From 3221a6d123d7f6e30220d7f86081927deeb23f22 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Fri, 9 Jan 2015 15:40:59 +0100 Subject: initial commit for mapping the configuration to JSON --- .../config/auth/ConfigurationToJSONConverter.java | 99 ++++++++++++++++++++++ id/server/moa-id-commons/pom.xml | 5 ++ 2 files changed, 104 insertions(+) create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java new file mode 100644 index 000000000..36063ca2c --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -0,0 +1,99 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.List; + +import org.codehaus.jackson.JsonGenerationException; +import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility; +import org.codehaus.jackson.annotate.JsonMethod; +import org.codehaus.jackson.map.JsonMappingException; +import org.codehaus.jackson.map.ObjectMapper; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; + +public class ConfigurationToJSONConverter { + + AuthConfigurationProvider config; + + public static void main(String[] args) { + + try { + ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); + + List jsonResults = converter.convertConfigToJSONStrings(); + System.out.println(jsonResults); + + } catch (ConfigurationException e) { + e.printStackTrace(); + System.out.println("Problems reading the configuration file in: " + + System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME)); + System.exit(1); + } + } + + public ConfigurationToJSONConverter() throws ConfigurationException { + config = AuthConfigurationProvider.getInstance(); + } + + public void writeConfigToJSONFile(String jsonFileName) { + // get JSON + // prettyprint and write to file + + } + + public void writeConfigToJSONDB() throws ConfigurationException { + ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); + List jsonResults = converter.convertConfigToJSONStrings(); + // TODO: write to db + } + + public List convertConfigToJSONStrings() { + + List result = new ArrayList(); + ObjectMapper mapper = new ObjectMapper(); + mapper.setVisibility(JsonMethod.FIELD, Visibility.ANY); + + int numberOfCalledGetterMethods = 0; + try { + System.out.println("=== Start ==="); + // find all getter methods + for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class) + .getPropertyDescriptors()) { + if (pd.getReadMethod() != null && !"class".equals(pd.getName())) { + + try { + // get result of get method + Object tmp = pd.getReadMethod().invoke(config); + // result to JSON + String show = mapper.writeValueAsString(tmp); + System.out.println(show); + result.add(show); + numberOfCalledGetterMethods++; + } catch (JsonGenerationException | JsonMappingException e) { + e.printStackTrace(); + // System.out.println("Problems while writing JSON as String"); + // return new ArrayList(); + } + } + } + + // TODO: handle static methods + + } catch (IntrospectionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + System.out.println("Problems while using reflection to get all getter methods."); + } catch (IOException e) { + System.out.println("Problems while writing JSON as String"); + return new ArrayList(); + } + + System.out.println("=== END called:'" + numberOfCalledGetterMethods + "' getter-methods ==="); + return result; + } + +} diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 27beeaaf3..6d499f42a 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -123,6 +123,11 @@ mysql-connector-java ${mysql-connector.java} + + org.codehaus.jackson + jackson-mapper-asl + 1.9.13 + -- cgit v1.2.3 From db9fdd97ec65b050494a01891eab55b59c3f3ace Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 12 Jan 2015 10:13:16 +0100 Subject: switch to Jackson Version 2.5.0 --- id/server/idserverlib/pom.xml | 11 +++++++++++ id/server/moa-id-commons/pom.xml | 5 ----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index 9465b56d1..f0c845928 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -424,6 +424,17 @@ + + + com.fasterxml.jackson.core + jackson-core + + + + com.fasterxml.jackson.core + jackson-databind + + javax.servlet javax.servlet-api diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 6d499f42a..27beeaaf3 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -123,11 +123,6 @@ mysql-connector-java ${mysql-connector.java} - - org.codehaus.jackson - jackson-mapper-asl - 1.9.13 - -- cgit v1.2.3 From 2673abd52ca07e5932cf98b55667f44505100f1c Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 12 Jan 2015 11:23:54 +0100 Subject: add previously auto-generated java source files used for configuration --- .../config/AbstractSimpleIdentificationType.java | 161 +++ .../db/dao/config/AttributeProviderPlugin.java | 254 +++++ .../db/dao/config/AuthComponentGeneral.java | 80 ++ .../id/commons/db/dao/config/AuthComponentOA.java | 735 +++++++++++++ .../commons/db/dao/config/AuthComponentType.java | 650 ++++++++++++ .../dao/config/BKUSelectionCustomizationType.java | 743 ++++++++++++++ .../id/commons/db/dao/config/BKUSelectionType.java | 58 ++ .../moa/id/commons/db/dao/config/BKUURLS.java | 256 +++++ .../id/commons/db/dao/config/BPKDecryption.java | 293 ++++++ .../id/commons/db/dao/config/BPKEncryption.java | 252 +++++ .../moa/id/commons/db/dao/config/BasicAuth.java | 214 ++++ .../moa/id/commons/db/dao/config/CPEPS.java | 418 ++++++++ .../db/dao/config/CPEPSAttributeValueItem.java | 93 ++ .../id/commons/db/dao/config/ChainingModeType.java | 58 ++ .../id/commons/db/dao/config/ChainingModes.java | 242 +++++ .../id/commons/db/dao/config/ClientKeyStore.java | 206 ++++ .../id/commons/db/dao/config/Configuration.java | 364 +++++++ .../config/ConnectionParameterClientAuthType.java | 143 +++ .../config/ConnectionParameterServerAuthType.java | 214 ++++ .../moa/id/commons/db/dao/config/Contact.java | 484 +++++++++ .../id/commons/db/dao/config/ContactMailItem.java | 93 ++ .../id/commons/db/dao/config/ContactPhoneItem.java | 93 ++ .../moa/id/commons/db/dao/config/DefaultBKUs.java | 256 +++++ .../commons/db/dao/config/DefaultTrustProfile.java | 164 +++ .../commons/db/dao/config/EncBPKInformation.java | 257 +++++ .../commons/db/dao/config/ForeignIdentities.java | 216 ++++ .../db/dao/config/GeneralConfiguration.java | 365 +++++++ .../db/dao/config/GenericConfiguration.java | 216 ++++ .../moa/id/commons/db/dao/config/Header.java | 212 ++++ .../moa/id/commons/db/dao/config/HeaderAuth.java | 185 ++++ .../db/dao/config/IdentificationNumber.java | 210 ++++ .../commons/db/dao/config/IdentityLinkSigners.java | 209 ++++ .../IdentityLinkSignersX509SubjectNameItem.java | 93 ++ .../commons/db/dao/config/InputProcessorType.java | 206 ++++ .../db/dao/config/InterfederationGatewayType.java | 208 ++++ .../db/dao/config/InterfederationIDPType.java | 402 ++++++++ .../moa/id/commons/db/dao/config/KeyName.java | 206 ++++ .../moa/id/commons/db/dao/config/KeyStore.java | 208 ++++ .../id/commons/db/dao/config/LegacyAllowed.java | 209 ++++ .../dao/config/LegacyAllowedProtocolNameItem.java | 93 ++ .../moa/id/commons/db/dao/config/LoginType.java | 58 ++ .../id/commons/db/dao/config/MOAAuthDataType.java | 82 ++ .../commons/db/dao/config/MOAIDConfiguration.java | 664 ++++++++++++ .../commons/db/dao/config/MOAKeyBoxSelector.java | 58 ++ .../moa/id/commons/db/dao/config/MOASP.java | 281 +++++ .../moa/id/commons/db/dao/config/Mandates.java | 254 +++++ .../db/dao/config/MandatesProfileNameItem.java | 93 ++ .../moa/id/commons/db/dao/config/OAOAUTH20.java | 254 +++++ .../moa/id/commons/db/dao/config/OAPVP2.java | 274 +++++ .../moa/id/commons/db/dao/config/OASAML1.java | 580 +++++++++++ .../moa/id/commons/db/dao/config/OASSO.java | 260 +++++ .../moa/id/commons/db/dao/config/OASTORK.java | 495 +++++++++ .../id/commons/db/dao/config/OAStorkAttribute.java | 213 ++++ .../moa/id/commons/db/dao/config/OAuth.java | 168 +++ .../id/commons/db/dao/config/ObjectFactory.java | 757 ++++++++++++++ .../commons/db/dao/config/OnlineApplication.java | 509 +++++++++ .../db/dao/config/OnlineApplicationType.java | 565 ++++++++++ .../id/commons/db/dao/config/OnlineMandates.java | 168 +++ .../moa/id/commons/db/dao/config/Organization.java | 254 +++++ .../moa/id/commons/db/dao/config/PVP2.java | 385 +++++++ .../moa/id/commons/db/dao/config/ParamAuth.java | 185 ++++ .../moa/id/commons/db/dao/config/Parameter.java | 212 ++++ .../db/dao/config/PartyRepresentationType.java | 331 ++++++ .../db/dao/config/PartyRepresentativeType.java | 457 +++++++++ .../moa/id/commons/db/dao/config/Protocols.java | 361 +++++++ .../moa/id/commons/db/dao/config/SAML1.java | 216 ++++ .../db/dao/config/SAMLSigningParameter.java | 216 ++++ .../commons/db/dao/config/SLRequestTemplates.java | 256 +++++ .../moa/id/commons/db/dao/config/SSO.java | 341 +++++++ .../moa/id/commons/db/dao/config/STORK.java | 342 +++++++ .../moa/id/commons/db/dao/config/Schema.java | 205 ++++ .../commons/db/dao/config/SchemaLocationType.java | 195 ++++ .../id/commons/db/dao/config/SecurityLayer.java | 183 ++++ .../dao/config/SignatureCreationParameterType.java | 218 ++++ .../config/SignatureVerificationParameterType.java | 168 +++ .../id/commons/db/dao/config/StorkAttribute.java | 213 ++++ .../moa/id/commons/db/dao/config/TemplateType.java | 165 +++ .../id/commons/db/dao/config/TemplatesType.java | 367 +++++++ .../id/commons/db/dao/config/TestCredentials.java | 260 +++++ .../config/TestCredentialsCredentialOIDItem.java | 93 ++ .../moa/id/commons/db/dao/config/TimeOuts.java | 253 +++++ .../commons/db/dao/config/TransformsInfoType.java | 215 ++++ .../moa/id/commons/db/dao/config/TrustAnchor.java | 131 +++ .../moa/id/commons/db/dao/config/UserDatabase.java | 1077 ++++++++++++++++++++ .../id/commons/db/dao/config/VerifyAuthBlock.java | 254 +++++ ...AuthBlockVerifyTransformsInfoProfileIDItem.java | 93 ++ .../commons/db/dao/config/VerifyIdentityLink.java | 164 +++ .../commons/db/dao/config/VerifyInfoboxesType.java | 181 ++++ .../db/dao/config/X509IssuerSerialType.java | 213 ++++ .../moa/id/commons/db/dao/config/package-info.java | 9 + 90 files changed, 23965 insertions(+) create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java new file mode 100644 index 000000000..0d1380def --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java @@ -0,0 +1,161 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for AbstractSimpleIdentificationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AbstractSimpleIdentificationType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AbstractSimpleIdentificationType", propOrder = { + "value" +}) +@Entity(name = "AbstractSimpleIdentificationType") +@Table(name = "ABSTRACTSIMPLEIDENTIFICATION_0") +@Inheritance(strategy = InheritanceType.JOINED) +public class AbstractSimpleIdentificationType + implements Serializable, Equals, HashCode +{ + + @XmlValue + protected String value; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof AbstractSimpleIdentificationType)) { + return false; + } + if (this == object) { + return true; + } + final AbstractSimpleIdentificationType that = ((AbstractSimpleIdentificationType) object); + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java new file mode 100644 index 000000000..5fe3065fb --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java @@ -0,0 +1,254 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for AttributeProviderPlugin complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AttributeProviderPlugin">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="url" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="attributes" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AttributeProviderPlugin", propOrder = { + "name", + "url", + "attributes" +}) +@Entity(name = "AttributeProviderPlugin") +@Table(name = "ATTRIBUTEPROVIDERPLUGIN") +@Inheritance(strategy = InheritanceType.JOINED) +public class AttributeProviderPlugin + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected String name; + @XmlElement(required = true) + @XmlSchemaType(name = "anyURI") + protected String url; + @XmlElement(required = true) + protected String attributes; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_", length = 255) + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "URL") + public String getUrl() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUrl(String value) { + this.url = value; + } + + /** + * Gets the value of the attributes property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ATTRIBUTES_", length = 255) + public String getAttributes() { + return attributes; + } + + /** + * Sets the value of the attributes property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAttributes(String value) { + this.attributes = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof AttributeProviderPlugin)) { + return false; + } + if (this == object) { + return true; + } + final AttributeProviderPlugin that = ((AttributeProviderPlugin) object); + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + { + String lhsUrl; + lhsUrl = this.getUrl(); + String rhsUrl; + rhsUrl = that.getUrl(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsUrl), LocatorUtils.property(thatLocator, "url", rhsUrl), lhsUrl, rhsUrl)) { + return false; + } + } + { + String lhsAttributes; + lhsAttributes = this.getAttributes(); + String rhsAttributes; + rhsAttributes = that.getAttributes(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "attributes", lhsAttributes), LocatorUtils.property(thatLocator, "attributes", rhsAttributes), lhsAttributes, rhsAttributes)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + { + String theUrl; + theUrl = this.getUrl(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theUrl), currentHashCode, theUrl); + } + { + String theAttributes; + theAttributes = this.getAttributes(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributes", theAttributes), currentHashCode, theAttributes); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java new file mode 100644 index 000000000..4112d91d5 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}AuthComponentType">
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@Entity(name = "AuthComponentGeneral") +@Table(name = "AUTHCOMPONENTGENERAL") +public class AuthComponentGeneral + extends AuthComponentType + implements Serializable, Equals, HashCode +{ + + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof AuthComponentGeneral)) { + return false; + } + if (this == object) { + return true; + } + if (!super.equals(thisLocator, thatLocator, object, strategy)) { + return false; + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = super.hashCode(locator, strategy); + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java new file mode 100644 index 000000000..c576f8169 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java @@ -0,0 +1,735 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="BKUURLS">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber" minOccurs="0"/>
+ *         <element name="Templates" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TemplatesType" minOccurs="0"/>
+ *         <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="Mandates" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Profiles" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   <element name="ProfileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="testCredentials" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="credentialOID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *                 <attribute name="enableTestCredentials" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_STORK" minOccurs="0"/>
+ *         <element name="OA_SSO" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="UseSSO" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *                   <element name="AuthDataFrame" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *                   <element name="SingleLogOutURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_SAML1" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_PVP2" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_OAUTH20" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}EncBPKInformation" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "bkuurls", + "identificationNumber", + "templates", + "transformsInfo", + "mandates", + "testCredentials", + "oastork", + "oasso", + "oasaml1", + "oapvp2", + "oaoauth20", + "encBPKInformation" +}) +@Entity(name = "AuthComponentOA") +@Table(name = "AUTHCOMPONENTOA") +@Inheritance(strategy = InheritanceType.JOINED) +public class AuthComponentOA + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "BKUURLS", required = true) + protected BKUURLS bkuurls; + @XmlElement(name = "IdentificationNumber") + protected IdentificationNumber identificationNumber; + @XmlElement(name = "Templates") + protected TemplatesType templates; + @XmlElement(name = "TransformsInfo") + protected List transformsInfo; + @XmlElement(name = "Mandates") + protected Mandates mandates; + protected TestCredentials testCredentials; + @XmlElement(name = "OA_STORK") + protected OASTORK oastork; + @XmlElement(name = "OA_SSO") + protected OASSO oasso; + @XmlElement(name = "OA_SAML1") + protected OASAML1 oasaml1; + @XmlElement(name = "OA_PVP2") + protected OAPVP2 oapvp2; + @XmlElement(name = "OA_OAUTH20") + protected OAOAUTH20 oaoauth20; + @XmlElement(name = "EncBPKInformation") + protected EncBPKInformation encBPKInformation; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the bkuurls property. + * + * @return + * possible object is + * {@link BKUURLS } + * + */ + @ManyToOne(targetEntity = BKUURLS.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "BKUURLS_AUTHCOMPONENTOA_HJID") + public BKUURLS getBKUURLS() { + return bkuurls; + } + + /** + * Sets the value of the bkuurls property. + * + * @param value + * allowed object is + * {@link BKUURLS } + * + */ + public void setBKUURLS(BKUURLS value) { + this.bkuurls = value; + } + + /** + * Gets the value of the identificationNumber property. + * + * @return + * possible object is + * {@link IdentificationNumber } + * + */ + @ManyToOne(targetEntity = IdentificationNumber.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "IDENTIFICATIONNUMBER_AUTHCOM_0") + public IdentificationNumber getIdentificationNumber() { + return identificationNumber; + } + + /** + * Sets the value of the identificationNumber property. + * + * @param value + * allowed object is + * {@link IdentificationNumber } + * + */ + public void setIdentificationNumber(IdentificationNumber value) { + this.identificationNumber = value; + } + + /** + * Gets the value of the templates property. + * + * @return + * possible object is + * {@link TemplatesType } + * + */ + @ManyToOne(targetEntity = TemplatesType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TEMPLATES_AUTHCOMPONENTOA_HJ_0") + public TemplatesType getTemplates() { + return templates; + } + + /** + * Sets the value of the templates property. + * + * @param value + * allowed object is + * {@link TemplatesType } + * + */ + public void setTemplates(TemplatesType value) { + this.templates = value; + } + + /** + * Gets the value of the transformsInfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the transformsInfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTransformsInfo().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TransformsInfoType } + * + * + */ + @OneToMany(targetEntity = TransformsInfoType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TRANSFORMSINFO_AUTHCOMPONENT_0") + public List getTransformsInfo() { + if (transformsInfo == null) { + transformsInfo = new ArrayList(); + } + return this.transformsInfo; + } + + /** + * + * + */ + public void setTransformsInfo(List transformsInfo) { + this.transformsInfo = transformsInfo; + } + + /** + * Gets the value of the mandates property. + * + * @return + * possible object is + * {@link Mandates } + * + */ + @ManyToOne(targetEntity = Mandates.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "MANDATES_AUTHCOMPONENTOA_HJID") + public Mandates getMandates() { + return mandates; + } + + /** + * Sets the value of the mandates property. + * + * @param value + * allowed object is + * {@link Mandates } + * + */ + public void setMandates(Mandates value) { + this.mandates = value; + } + + /** + * Gets the value of the testCredentials property. + * + * @return + * possible object is + * {@link TestCredentials } + * + */ + @ManyToOne(targetEntity = TestCredentials.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TESTCREDENTIALS_AUTHCOMPONEN_0") + public TestCredentials getTestCredentials() { + return testCredentials; + } + + /** + * Sets the value of the testCredentials property. + * + * @param value + * allowed object is + * {@link TestCredentials } + * + */ + public void setTestCredentials(TestCredentials value) { + this.testCredentials = value; + } + + /** + * Gets the value of the oastork property. + * + * @return + * possible object is + * {@link OASTORK } + * + */ + @ManyToOne(targetEntity = OASTORK.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OASTORK_AUTHCOMPONENTOA_HJID") + public OASTORK getOASTORK() { + return oastork; + } + + /** + * Sets the value of the oastork property. + * + * @param value + * allowed object is + * {@link OASTORK } + * + */ + public void setOASTORK(OASTORK value) { + this.oastork = value; + } + + /** + * Gets the value of the oasso property. + * + * @return + * possible object is + * {@link OASSO } + * + */ + @ManyToOne(targetEntity = OASSO.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OASSO_AUTHCOMPONENTOA_HJID") + public OASSO getOASSO() { + return oasso; + } + + /** + * Sets the value of the oasso property. + * + * @param value + * allowed object is + * {@link OASSO } + * + */ + public void setOASSO(OASSO value) { + this.oasso = value; + } + + /** + * Gets the value of the oasaml1 property. + * + * @return + * possible object is + * {@link OASAML1 } + * + */ + @ManyToOne(targetEntity = OASAML1 .class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OASAML1_AUTHCOMPONENTOA_HJID") + public OASAML1 getOASAML1() { + return oasaml1; + } + + /** + * Sets the value of the oasaml1 property. + * + * @param value + * allowed object is + * {@link OASAML1 } + * + */ + public void setOASAML1(OASAML1 value) { + this.oasaml1 = value; + } + + /** + * Gets the value of the oapvp2 property. + * + * @return + * possible object is + * {@link OAPVP2 } + * + */ + @ManyToOne(targetEntity = OAPVP2 .class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OAPVP2_AUTHCOMPONENTOA_HJID") + public OAPVP2 getOAPVP2() { + return oapvp2; + } + + /** + * Sets the value of the oapvp2 property. + * + * @param value + * allowed object is + * {@link OAPVP2 } + * + */ + public void setOAPVP2(OAPVP2 value) { + this.oapvp2 = value; + } + + /** + * Gets the value of the oaoauth20 property. + * + * @return + * possible object is + * {@link OAOAUTH20 } + * + */ + @ManyToOne(targetEntity = OAOAUTH20 .class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OAOAUTH20_AUTHCOMPONENTOA_HJ_0") + public OAOAUTH20 getOAOAUTH20() { + return oaoauth20; + } + + /** + * Sets the value of the oaoauth20 property. + * + * @param value + * allowed object is + * {@link OAOAUTH20 } + * + */ + public void setOAOAUTH20(OAOAUTH20 value) { + this.oaoauth20 = value; + } + + /** + * Gets the value of the encBPKInformation property. + * + * @return + * possible object is + * {@link EncBPKInformation } + * + */ + @ManyToOne(targetEntity = EncBPKInformation.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ENCBPKINFORMATION_AUTHCOMPON_0") + public EncBPKInformation getEncBPKInformation() { + return encBPKInformation; + } + + /** + * Sets the value of the encBPKInformation property. + * + * @param value + * allowed object is + * {@link EncBPKInformation } + * + */ + public void setEncBPKInformation(EncBPKInformation value) { + this.encBPKInformation = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof AuthComponentOA)) { + return false; + } + if (this == object) { + return true; + } + final AuthComponentOA that = ((AuthComponentOA) object); + { + BKUURLS lhsBKUURLS; + lhsBKUURLS = this.getBKUURLS(); + BKUURLS rhsBKUURLS; + rhsBKUURLS = that.getBKUURLS(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "bkuurls", lhsBKUURLS), LocatorUtils.property(thatLocator, "bkuurls", rhsBKUURLS), lhsBKUURLS, rhsBKUURLS)) { + return false; + } + } + { + IdentificationNumber lhsIdentificationNumber; + lhsIdentificationNumber = this.getIdentificationNumber(); + IdentificationNumber rhsIdentificationNumber; + rhsIdentificationNumber = that.getIdentificationNumber(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "identificationNumber", lhsIdentificationNumber), LocatorUtils.property(thatLocator, "identificationNumber", rhsIdentificationNumber), lhsIdentificationNumber, rhsIdentificationNumber)) { + return false; + } + } + { + TemplatesType lhsTemplates; + lhsTemplates = this.getTemplates(); + TemplatesType rhsTemplates; + rhsTemplates = that.getTemplates(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "templates", lhsTemplates), LocatorUtils.property(thatLocator, "templates", rhsTemplates), lhsTemplates, rhsTemplates)) { + return false; + } + } + { + List lhsTransformsInfo; + lhsTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); + List rhsTransformsInfo; + rhsTransformsInfo = (((that.transformsInfo!= null)&&(!that.transformsInfo.isEmpty()))?that.getTransformsInfo():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "transformsInfo", lhsTransformsInfo), LocatorUtils.property(thatLocator, "transformsInfo", rhsTransformsInfo), lhsTransformsInfo, rhsTransformsInfo)) { + return false; + } + } + { + Mandates lhsMandates; + lhsMandates = this.getMandates(); + Mandates rhsMandates; + rhsMandates = that.getMandates(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mandates", lhsMandates), LocatorUtils.property(thatLocator, "mandates", rhsMandates), lhsMandates, rhsMandates)) { + return false; + } + } + { + TestCredentials lhsTestCredentials; + lhsTestCredentials = this.getTestCredentials(); + TestCredentials rhsTestCredentials; + rhsTestCredentials = that.getTestCredentials(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "testCredentials", lhsTestCredentials), LocatorUtils.property(thatLocator, "testCredentials", rhsTestCredentials), lhsTestCredentials, rhsTestCredentials)) { + return false; + } + } + { + OASTORK lhsOASTORK; + lhsOASTORK = this.getOASTORK(); + OASTORK rhsOASTORK; + rhsOASTORK = that.getOASTORK(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oastork", lhsOASTORK), LocatorUtils.property(thatLocator, "oastork", rhsOASTORK), lhsOASTORK, rhsOASTORK)) { + return false; + } + } + { + OASSO lhsOASSO; + lhsOASSO = this.getOASSO(); + OASSO rhsOASSO; + rhsOASSO = that.getOASSO(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oasso", lhsOASSO), LocatorUtils.property(thatLocator, "oasso", rhsOASSO), lhsOASSO, rhsOASSO)) { + return false; + } + } + { + OASAML1 lhsOASAML1; + lhsOASAML1 = this.getOASAML1(); + OASAML1 rhsOASAML1; + rhsOASAML1 = that.getOASAML1(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oasaml1", lhsOASAML1), LocatorUtils.property(thatLocator, "oasaml1", rhsOASAML1), lhsOASAML1, rhsOASAML1)) { + return false; + } + } + { + OAPVP2 lhsOAPVP2; + lhsOAPVP2 = this.getOAPVP2(); + OAPVP2 rhsOAPVP2; + rhsOAPVP2 = that.getOAPVP2(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oapvp2", lhsOAPVP2), LocatorUtils.property(thatLocator, "oapvp2", rhsOAPVP2), lhsOAPVP2, rhsOAPVP2)) { + return false; + } + } + { + OAOAUTH20 lhsOAOAUTH20; + lhsOAOAUTH20 = this.getOAOAUTH20(); + OAOAUTH20 rhsOAOAUTH20; + rhsOAOAUTH20 = that.getOAOAUTH20(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oaoauth20", lhsOAOAUTH20), LocatorUtils.property(thatLocator, "oaoauth20", rhsOAOAUTH20), lhsOAOAUTH20, rhsOAOAUTH20)) { + return false; + } + } + { + EncBPKInformation lhsEncBPKInformation; + lhsEncBPKInformation = this.getEncBPKInformation(); + EncBPKInformation rhsEncBPKInformation; + rhsEncBPKInformation = that.getEncBPKInformation(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "encBPKInformation", lhsEncBPKInformation), LocatorUtils.property(thatLocator, "encBPKInformation", rhsEncBPKInformation), lhsEncBPKInformation, rhsEncBPKInformation)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + BKUURLS theBKUURLS; + theBKUURLS = this.getBKUURLS(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bkuurls", theBKUURLS), currentHashCode, theBKUURLS); + } + { + IdentificationNumber theIdentificationNumber; + theIdentificationNumber = this.getIdentificationNumber(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identificationNumber", theIdentificationNumber), currentHashCode, theIdentificationNumber); + } + { + TemplatesType theTemplates; + theTemplates = this.getTemplates(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "templates", theTemplates), currentHashCode, theTemplates); + } + { + List theTransformsInfo; + theTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transformsInfo", theTransformsInfo), currentHashCode, theTransformsInfo); + } + { + Mandates theMandates; + theMandates = this.getMandates(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandates", theMandates), currentHashCode, theMandates); + } + { + TestCredentials theTestCredentials; + theTestCredentials = this.getTestCredentials(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "testCredentials", theTestCredentials), currentHashCode, theTestCredentials); + } + { + OASTORK theOASTORK; + theOASTORK = this.getOASTORK(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oastork", theOASTORK), currentHashCode, theOASTORK); + } + { + OASSO theOASSO; + theOASSO = this.getOASSO(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oasso", theOASSO), currentHashCode, theOASSO); + } + { + OASAML1 theOASAML1; + theOASAML1 = this.getOASAML1(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oasaml1", theOASAML1), currentHashCode, theOASAML1); + } + { + OAPVP2 theOAPVP2; + theOAPVP2 = this.getOAPVP2(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oapvp2", theOAPVP2), currentHashCode, theOAPVP2); + } + { + OAOAUTH20 theOAOAUTH20; + theOAOAUTH20 = this.getOAOAUTH20(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oaoauth20", theOAOAUTH20), currentHashCode, theOAOAUTH20); + } + { + EncBPKInformation theEncBPKInformation; + theEncBPKInformation = this.getEncBPKInformation(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "encBPKInformation", theEncBPKInformation), currentHashCode, theEncBPKInformation); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java new file mode 100644 index 000000000..e5bcd572d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java @@ -0,0 +1,650 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for AuthComponentType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AuthComponentType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}GeneralConfiguration"/>
+ *         <element name="Protocols">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="SAML1" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="SourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                           </sequence>
+ *                           <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="PVP2" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="PublicURLPrefix" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                             <element name="IssuerName" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                             <element name="Organization">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                                       <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                                       <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Contact" maxOccurs="unbounded"/>
+ *                           </sequence>
+ *                           <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="OAuth" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="LegacyAllowed">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="ProtocolName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="SSO">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <choice>
+ *                   <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber"/>
+ *                 </choice>
+ *                 <attribute name="PublicURL" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="SpecialText" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="SecurityLayer">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="MOA-SP">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
+ *                   <element name="VerifyIdentityLink">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="VerifyAuthBlock">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *                             <element name="VerifyTransformsInfoProfileID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="IdentityLinkSigners" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="X509SubjectName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="ForeignIdentities" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}STORK" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="OnlineMandates" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "AuthComponentType", propOrder = { + "generalConfiguration", + "protocols", + "sso", + "securityLayer", + "moasp", + "identityLinkSigners", + "foreignIdentities", + "onlineMandates" +}) +@XmlSeeAlso({ + AuthComponentGeneral.class +}) +@Entity(name = "AuthComponentType") +@Table(name = "AUTHCOMPONENTTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class AuthComponentType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "GeneralConfiguration", required = true) + protected GeneralConfiguration generalConfiguration; + @XmlElement(name = "Protocols", required = true) + protected Protocols protocols; + @XmlElement(name = "SSO", required = true) + protected SSO sso; + @XmlElement(name = "SecurityLayer", required = true) + protected SecurityLayer securityLayer; + @XmlElement(name = "MOA-SP", required = true) + protected MOASP moasp; + @XmlElement(name = "IdentityLinkSigners") + protected IdentityLinkSigners identityLinkSigners; + @XmlElement(name = "ForeignIdentities") + protected ForeignIdentities foreignIdentities; + @XmlElement(name = "OnlineMandates") + protected OnlineMandates onlineMandates; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the generalConfiguration property. + * + * @return + * possible object is + * {@link GeneralConfiguration } + * + */ + @ManyToOne(targetEntity = GeneralConfiguration.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "GENERALCONFIGURATION_AUTHCOM_0") + public GeneralConfiguration getGeneralConfiguration() { + return generalConfiguration; + } + + /** + * Sets the value of the generalConfiguration property. + * + * @param value + * allowed object is + * {@link GeneralConfiguration } + * + */ + public void setGeneralConfiguration(GeneralConfiguration value) { + this.generalConfiguration = value; + } + + /** + * Gets the value of the protocols property. + * + * @return + * possible object is + * {@link Protocols } + * + */ + @ManyToOne(targetEntity = Protocols.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PROTOCOLS_AUTHCOMPONENTTYPE__0") + public Protocols getProtocols() { + return protocols; + } + + /** + * Sets the value of the protocols property. + * + * @param value + * allowed object is + * {@link Protocols } + * + */ + public void setProtocols(Protocols value) { + this.protocols = value; + } + + /** + * Gets the value of the sso property. + * + * @return + * possible object is + * {@link SSO } + * + */ + @ManyToOne(targetEntity = SSO.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SSO_AUTHCOMPONENTTYPE_HJID") + public SSO getSSO() { + return sso; + } + + /** + * Sets the value of the sso property. + * + * @param value + * allowed object is + * {@link SSO } + * + */ + public void setSSO(SSO value) { + this.sso = value; + } + + /** + * Gets the value of the securityLayer property. + * + * @return + * possible object is + * {@link SecurityLayer } + * + */ + @ManyToOne(targetEntity = SecurityLayer.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SECURITYLAYER_AUTHCOMPONENTT_0") + public SecurityLayer getSecurityLayer() { + return securityLayer; + } + + /** + * Sets the value of the securityLayer property. + * + * @param value + * allowed object is + * {@link SecurityLayer } + * + */ + public void setSecurityLayer(SecurityLayer value) { + this.securityLayer = value; + } + + /** + * Gets the value of the moasp property. + * + * @return + * possible object is + * {@link MOASP } + * + */ + @ManyToOne(targetEntity = MOASP.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "MOASP_AUTHCOMPONENTTYPE_HJID") + public MOASP getMOASP() { + return moasp; + } + + /** + * Sets the value of the moasp property. + * + * @param value + * allowed object is + * {@link MOASP } + * + */ + public void setMOASP(MOASP value) { + this.moasp = value; + } + + /** + * Gets the value of the identityLinkSigners property. + * + * @return + * possible object is + * {@link IdentityLinkSigners } + * + */ + @ManyToOne(targetEntity = IdentityLinkSigners.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "IDENTITYLINKSIGNERS_AUTHCOMP_0") + public IdentityLinkSigners getIdentityLinkSigners() { + return identityLinkSigners; + } + + /** + * Sets the value of the identityLinkSigners property. + * + * @param value + * allowed object is + * {@link IdentityLinkSigners } + * + */ + public void setIdentityLinkSigners(IdentityLinkSigners value) { + this.identityLinkSigners = value; + } + + /** + * Gets the value of the foreignIdentities property. + * + * @return + * possible object is + * {@link ForeignIdentities } + * + */ + @ManyToOne(targetEntity = ForeignIdentities.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "FOREIGNIDENTITIES_AUTHCOMPON_0") + public ForeignIdentities getForeignIdentities() { + return foreignIdentities; + } + + /** + * Sets the value of the foreignIdentities property. + * + * @param value + * allowed object is + * {@link ForeignIdentities } + * + */ + public void setForeignIdentities(ForeignIdentities value) { + this.foreignIdentities = value; + } + + /** + * Gets the value of the onlineMandates property. + * + * @return + * possible object is + * {@link OnlineMandates } + * + */ + @ManyToOne(targetEntity = OnlineMandates.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ONLINEMANDATES_AUTHCOMPONENT_0") + public OnlineMandates getOnlineMandates() { + return onlineMandates; + } + + /** + * Sets the value of the onlineMandates property. + * + * @param value + * allowed object is + * {@link OnlineMandates } + * + */ + public void setOnlineMandates(OnlineMandates value) { + this.onlineMandates = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof AuthComponentType)) { + return false; + } + if (this == object) { + return true; + } + final AuthComponentType that = ((AuthComponentType) object); + { + GeneralConfiguration lhsGeneralConfiguration; + lhsGeneralConfiguration = this.getGeneralConfiguration(); + GeneralConfiguration rhsGeneralConfiguration; + rhsGeneralConfiguration = that.getGeneralConfiguration(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "generalConfiguration", lhsGeneralConfiguration), LocatorUtils.property(thatLocator, "generalConfiguration", rhsGeneralConfiguration), lhsGeneralConfiguration, rhsGeneralConfiguration)) { + return false; + } + } + { + Protocols lhsProtocols; + lhsProtocols = this.getProtocols(); + Protocols rhsProtocols; + rhsProtocols = that.getProtocols(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "protocols", lhsProtocols), LocatorUtils.property(thatLocator, "protocols", rhsProtocols), lhsProtocols, rhsProtocols)) { + return false; + } + } + { + SSO lhsSSO; + lhsSSO = this.getSSO(); + SSO rhsSSO; + rhsSSO = that.getSSO(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "sso", lhsSSO), LocatorUtils.property(thatLocator, "sso", rhsSSO), lhsSSO, rhsSSO)) { + return false; + } + } + { + SecurityLayer lhsSecurityLayer; + lhsSecurityLayer = this.getSecurityLayer(); + SecurityLayer rhsSecurityLayer; + rhsSecurityLayer = that.getSecurityLayer(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "securityLayer", lhsSecurityLayer), LocatorUtils.property(thatLocator, "securityLayer", rhsSecurityLayer), lhsSecurityLayer, rhsSecurityLayer)) { + return false; + } + } + { + MOASP lhsMOASP; + lhsMOASP = this.getMOASP(); + MOASP rhsMOASP; + rhsMOASP = that.getMOASP(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "moasp", lhsMOASP), LocatorUtils.property(thatLocator, "moasp", rhsMOASP), lhsMOASP, rhsMOASP)) { + return false; + } + } + { + IdentityLinkSigners lhsIdentityLinkSigners; + lhsIdentityLinkSigners = this.getIdentityLinkSigners(); + IdentityLinkSigners rhsIdentityLinkSigners; + rhsIdentityLinkSigners = that.getIdentityLinkSigners(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "identityLinkSigners", lhsIdentityLinkSigners), LocatorUtils.property(thatLocator, "identityLinkSigners", rhsIdentityLinkSigners), lhsIdentityLinkSigners, rhsIdentityLinkSigners)) { + return false; + } + } + { + ForeignIdentities lhsForeignIdentities; + lhsForeignIdentities = this.getForeignIdentities(); + ForeignIdentities rhsForeignIdentities; + rhsForeignIdentities = that.getForeignIdentities(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "foreignIdentities", lhsForeignIdentities), LocatorUtils.property(thatLocator, "foreignIdentities", rhsForeignIdentities), lhsForeignIdentities, rhsForeignIdentities)) { + return false; + } + } + { + OnlineMandates lhsOnlineMandates; + lhsOnlineMandates = this.getOnlineMandates(); + OnlineMandates rhsOnlineMandates; + rhsOnlineMandates = that.getOnlineMandates(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineMandates", lhsOnlineMandates), LocatorUtils.property(thatLocator, "onlineMandates", rhsOnlineMandates), lhsOnlineMandates, rhsOnlineMandates)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + GeneralConfiguration theGeneralConfiguration; + theGeneralConfiguration = this.getGeneralConfiguration(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "generalConfiguration", theGeneralConfiguration), currentHashCode, theGeneralConfiguration); + } + { + Protocols theProtocols; + theProtocols = this.getProtocols(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protocols", theProtocols), currentHashCode, theProtocols); + } + { + SSO theSSO; + theSSO = this.getSSO(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sso", theSSO), currentHashCode, theSSO); + } + { + SecurityLayer theSecurityLayer; + theSecurityLayer = this.getSecurityLayer(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "securityLayer", theSecurityLayer), currentHashCode, theSecurityLayer); + } + { + MOASP theMOASP; + theMOASP = this.getMOASP(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "moasp", theMOASP), currentHashCode, theMOASP); + } + { + IdentityLinkSigners theIdentityLinkSigners; + theIdentityLinkSigners = this.getIdentityLinkSigners(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identityLinkSigners", theIdentityLinkSigners), currentHashCode, theIdentityLinkSigners); + } + { + ForeignIdentities theForeignIdentities; + theForeignIdentities = this.getForeignIdentities(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "foreignIdentities", theForeignIdentities), currentHashCode, theForeignIdentities); + } + { + OnlineMandates theOnlineMandates; + theOnlineMandates = this.getOnlineMandates(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineMandates", theOnlineMandates), currentHashCode, theOnlineMandates); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java new file mode 100644 index 000000000..3c119a5bf --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java @@ -0,0 +1,743 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for BKUSelectionCustomizationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="BKUSelectionCustomizationType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="FontType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="BackGroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="FrontColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="HeaderBackGroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="HeaderFrontColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="HeaderText" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ButtonBackGroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ButtonBackGroundColorFocus" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="ButtonFontColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="AppletRedirectTarget" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="AppletHeight" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="AppletWidth" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="MandateLoginButton" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="OnlyMandateLoginAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "BKUSelectionCustomizationType", propOrder = { + "fontType", + "backGroundColor", + "frontColor", + "headerBackGroundColor", + "headerFrontColor", + "headerText", + "buttonBackGroundColor", + "buttonBackGroundColorFocus", + "buttonFontColor", + "appletRedirectTarget", + "appletHeight", + "appletWidth", + "mandateLoginButton", + "onlyMandateLoginAllowed" +}) +@Entity(name = "BKUSelectionCustomizationType") +@Table(name = "BKUSELECTIONCUSTOMIZATIONTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class BKUSelectionCustomizationType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "FontType") + protected String fontType; + @XmlElement(name = "BackGroundColor") + protected String backGroundColor; + @XmlElement(name = "FrontColor") + protected String frontColor; + @XmlElement(name = "HeaderBackGroundColor") + protected String headerBackGroundColor; + @XmlElement(name = "HeaderFrontColor") + protected String headerFrontColor; + @XmlElement(name = "HeaderText") + protected String headerText; + @XmlElement(name = "ButtonBackGroundColor") + protected String buttonBackGroundColor; + @XmlElement(name = "ButtonBackGroundColorFocus") + protected String buttonBackGroundColorFocus; + @XmlElement(name = "ButtonFontColor") + protected String buttonFontColor; + @XmlElement(name = "AppletRedirectTarget") + protected String appletRedirectTarget; + @XmlElement(name = "AppletHeight") + protected String appletHeight; + @XmlElement(name = "AppletWidth") + protected String appletWidth; + @XmlElement(name = "MandateLoginButton", type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean mandateLoginButton; + @XmlElement(name = "OnlyMandateLoginAllowed", type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean onlyMandateLoginAllowed; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the fontType property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FONTTYPE", length = 255) + public String getFontType() { + return fontType; + } + + /** + * Sets the value of the fontType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFontType(String value) { + this.fontType = value; + } + + /** + * Gets the value of the backGroundColor property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "BACKGROUNDCOLOR", length = 255) + public String getBackGroundColor() { + return backGroundColor; + } + + /** + * Sets the value of the backGroundColor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBackGroundColor(String value) { + this.backGroundColor = value; + } + + /** + * Gets the value of the frontColor property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FRONTCOLOR", length = 255) + public String getFrontColor() { + return frontColor; + } + + /** + * Sets the value of the frontColor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFrontColor(String value) { + this.frontColor = value; + } + + /** + * Gets the value of the headerBackGroundColor property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "HEADERBACKGROUNDCOLOR", length = 255) + public String getHeaderBackGroundColor() { + return headerBackGroundColor; + } + + /** + * Sets the value of the headerBackGroundColor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHeaderBackGroundColor(String value) { + this.headerBackGroundColor = value; + } + + /** + * Gets the value of the headerFrontColor property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "HEADERFRONTCOLOR", length = 255) + public String getHeaderFrontColor() { + return headerFrontColor; + } + + /** + * Sets the value of the headerFrontColor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHeaderFrontColor(String value) { + this.headerFrontColor = value; + } + + /** + * Gets the value of the headerText property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "HEADERTEXT", length = 255) + public String getHeaderText() { + return headerText; + } + + /** + * Sets the value of the headerText property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHeaderText(String value) { + this.headerText = value; + } + + /** + * Gets the value of the buttonBackGroundColor property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "BUTTONBACKGROUNDCOLOR", length = 255) + public String getButtonBackGroundColor() { + return buttonBackGroundColor; + } + + /** + * Sets the value of the buttonBackGroundColor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setButtonBackGroundColor(String value) { + this.buttonBackGroundColor = value; + } + + /** + * Gets the value of the buttonBackGroundColorFocus property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "BUTTONBACKGROUNDCOLORFOCUS", length = 255) + public String getButtonBackGroundColorFocus() { + return buttonBackGroundColorFocus; + } + + /** + * Sets the value of the buttonBackGroundColorFocus property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setButtonBackGroundColorFocus(String value) { + this.buttonBackGroundColorFocus = value; + } + + /** + * Gets the value of the buttonFontColor property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "BUTTONFONTCOLOR", length = 255) + public String getButtonFontColor() { + return buttonFontColor; + } + + /** + * Sets the value of the buttonFontColor property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setButtonFontColor(String value) { + this.buttonFontColor = value; + } + + /** + * Gets the value of the appletRedirectTarget property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "APPLETREDIRECTTARGET", length = 255) + public String getAppletRedirectTarget() { + return appletRedirectTarget; + } + + /** + * Sets the value of the appletRedirectTarget property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAppletRedirectTarget(String value) { + this.appletRedirectTarget = value; + } + + /** + * Gets the value of the appletHeight property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "APPLETHEIGHT", length = 255) + public String getAppletHeight() { + return appletHeight; + } + + /** + * Sets the value of the appletHeight property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAppletHeight(String value) { + this.appletHeight = value; + } + + /** + * Gets the value of the appletWidth property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "APPLETWIDTH", length = 255) + public String getAppletWidth() { + return appletWidth; + } + + /** + * Sets the value of the appletWidth property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAppletWidth(String value) { + this.appletWidth = value; + } + + /** + * Gets the value of the mandateLoginButton property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "MANDATELOGINBUTTON") + public Boolean isMandateLoginButton() { + return mandateLoginButton; + } + + /** + * Sets the value of the mandateLoginButton property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMandateLoginButton(Boolean value) { + this.mandateLoginButton = value; + } + + /** + * Gets the value of the onlyMandateLoginAllowed property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ONLYMANDATELOGINALLOWED") + public Boolean isOnlyMandateLoginAllowed() { + return onlyMandateLoginAllowed; + } + + /** + * Sets the value of the onlyMandateLoginAllowed property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOnlyMandateLoginAllowed(Boolean value) { + this.onlyMandateLoginAllowed = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof BKUSelectionCustomizationType)) { + return false; + } + if (this == object) { + return true; + } + final BKUSelectionCustomizationType that = ((BKUSelectionCustomizationType) object); + { + String lhsFontType; + lhsFontType = this.getFontType(); + String rhsFontType; + rhsFontType = that.getFontType(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "fontType", lhsFontType), LocatorUtils.property(thatLocator, "fontType", rhsFontType), lhsFontType, rhsFontType)) { + return false; + } + } + { + String lhsBackGroundColor; + lhsBackGroundColor = this.getBackGroundColor(); + String rhsBackGroundColor; + rhsBackGroundColor = that.getBackGroundColor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "backGroundColor", lhsBackGroundColor), LocatorUtils.property(thatLocator, "backGroundColor", rhsBackGroundColor), lhsBackGroundColor, rhsBackGroundColor)) { + return false; + } + } + { + String lhsFrontColor; + lhsFrontColor = this.getFrontColor(); + String rhsFrontColor; + rhsFrontColor = that.getFrontColor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "frontColor", lhsFrontColor), LocatorUtils.property(thatLocator, "frontColor", rhsFrontColor), lhsFrontColor, rhsFrontColor)) { + return false; + } + } + { + String lhsHeaderBackGroundColor; + lhsHeaderBackGroundColor = this.getHeaderBackGroundColor(); + String rhsHeaderBackGroundColor; + rhsHeaderBackGroundColor = that.getHeaderBackGroundColor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "headerBackGroundColor", lhsHeaderBackGroundColor), LocatorUtils.property(thatLocator, "headerBackGroundColor", rhsHeaderBackGroundColor), lhsHeaderBackGroundColor, rhsHeaderBackGroundColor)) { + return false; + } + } + { + String lhsHeaderFrontColor; + lhsHeaderFrontColor = this.getHeaderFrontColor(); + String rhsHeaderFrontColor; + rhsHeaderFrontColor = that.getHeaderFrontColor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "headerFrontColor", lhsHeaderFrontColor), LocatorUtils.property(thatLocator, "headerFrontColor", rhsHeaderFrontColor), lhsHeaderFrontColor, rhsHeaderFrontColor)) { + return false; + } + } + { + String lhsHeaderText; + lhsHeaderText = this.getHeaderText(); + String rhsHeaderText; + rhsHeaderText = that.getHeaderText(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "headerText", lhsHeaderText), LocatorUtils.property(thatLocator, "headerText", rhsHeaderText), lhsHeaderText, rhsHeaderText)) { + return false; + } + } + { + String lhsButtonBackGroundColor; + lhsButtonBackGroundColor = this.getButtonBackGroundColor(); + String rhsButtonBackGroundColor; + rhsButtonBackGroundColor = that.getButtonBackGroundColor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "buttonBackGroundColor", lhsButtonBackGroundColor), LocatorUtils.property(thatLocator, "buttonBackGroundColor", rhsButtonBackGroundColor), lhsButtonBackGroundColor, rhsButtonBackGroundColor)) { + return false; + } + } + { + String lhsButtonBackGroundColorFocus; + lhsButtonBackGroundColorFocus = this.getButtonBackGroundColorFocus(); + String rhsButtonBackGroundColorFocus; + rhsButtonBackGroundColorFocus = that.getButtonBackGroundColorFocus(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "buttonBackGroundColorFocus", lhsButtonBackGroundColorFocus), LocatorUtils.property(thatLocator, "buttonBackGroundColorFocus", rhsButtonBackGroundColorFocus), lhsButtonBackGroundColorFocus, rhsButtonBackGroundColorFocus)) { + return false; + } + } + { + String lhsButtonFontColor; + lhsButtonFontColor = this.getButtonFontColor(); + String rhsButtonFontColor; + rhsButtonFontColor = that.getButtonFontColor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "buttonFontColor", lhsButtonFontColor), LocatorUtils.property(thatLocator, "buttonFontColor", rhsButtonFontColor), lhsButtonFontColor, rhsButtonFontColor)) { + return false; + } + } + { + String lhsAppletRedirectTarget; + lhsAppletRedirectTarget = this.getAppletRedirectTarget(); + String rhsAppletRedirectTarget; + rhsAppletRedirectTarget = that.getAppletRedirectTarget(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "appletRedirectTarget", lhsAppletRedirectTarget), LocatorUtils.property(thatLocator, "appletRedirectTarget", rhsAppletRedirectTarget), lhsAppletRedirectTarget, rhsAppletRedirectTarget)) { + return false; + } + } + { + String lhsAppletHeight; + lhsAppletHeight = this.getAppletHeight(); + String rhsAppletHeight; + rhsAppletHeight = that.getAppletHeight(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "appletHeight", lhsAppletHeight), LocatorUtils.property(thatLocator, "appletHeight", rhsAppletHeight), lhsAppletHeight, rhsAppletHeight)) { + return false; + } + } + { + String lhsAppletWidth; + lhsAppletWidth = this.getAppletWidth(); + String rhsAppletWidth; + rhsAppletWidth = that.getAppletWidth(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "appletWidth", lhsAppletWidth), LocatorUtils.property(thatLocator, "appletWidth", rhsAppletWidth), lhsAppletWidth, rhsAppletWidth)) { + return false; + } + } + { + Boolean lhsMandateLoginButton; + lhsMandateLoginButton = this.isMandateLoginButton(); + Boolean rhsMandateLoginButton; + rhsMandateLoginButton = that.isMandateLoginButton(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mandateLoginButton", lhsMandateLoginButton), LocatorUtils.property(thatLocator, "mandateLoginButton", rhsMandateLoginButton), lhsMandateLoginButton, rhsMandateLoginButton)) { + return false; + } + } + { + Boolean lhsOnlyMandateLoginAllowed; + lhsOnlyMandateLoginAllowed = this.isOnlyMandateLoginAllowed(); + Boolean rhsOnlyMandateLoginAllowed; + rhsOnlyMandateLoginAllowed = that.isOnlyMandateLoginAllowed(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlyMandateLoginAllowed", lhsOnlyMandateLoginAllowed), LocatorUtils.property(thatLocator, "onlyMandateLoginAllowed", rhsOnlyMandateLoginAllowed), lhsOnlyMandateLoginAllowed, rhsOnlyMandateLoginAllowed)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theFontType; + theFontType = this.getFontType(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "fontType", theFontType), currentHashCode, theFontType); + } + { + String theBackGroundColor; + theBackGroundColor = this.getBackGroundColor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "backGroundColor", theBackGroundColor), currentHashCode, theBackGroundColor); + } + { + String theFrontColor; + theFrontColor = this.getFrontColor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "frontColor", theFrontColor), currentHashCode, theFrontColor); + } + { + String theHeaderBackGroundColor; + theHeaderBackGroundColor = this.getHeaderBackGroundColor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerBackGroundColor", theHeaderBackGroundColor), currentHashCode, theHeaderBackGroundColor); + } + { + String theHeaderFrontColor; + theHeaderFrontColor = this.getHeaderFrontColor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerFrontColor", theHeaderFrontColor), currentHashCode, theHeaderFrontColor); + } + { + String theHeaderText; + theHeaderText = this.getHeaderText(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerText", theHeaderText), currentHashCode, theHeaderText); + } + { + String theButtonBackGroundColor; + theButtonBackGroundColor = this.getButtonBackGroundColor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "buttonBackGroundColor", theButtonBackGroundColor), currentHashCode, theButtonBackGroundColor); + } + { + String theButtonBackGroundColorFocus; + theButtonBackGroundColorFocus = this.getButtonBackGroundColorFocus(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "buttonBackGroundColorFocus", theButtonBackGroundColorFocus), currentHashCode, theButtonBackGroundColorFocus); + } + { + String theButtonFontColor; + theButtonFontColor = this.getButtonFontColor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "buttonFontColor", theButtonFontColor), currentHashCode, theButtonFontColor); + } + { + String theAppletRedirectTarget; + theAppletRedirectTarget = this.getAppletRedirectTarget(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "appletRedirectTarget", theAppletRedirectTarget), currentHashCode, theAppletRedirectTarget); + } + { + String theAppletHeight; + theAppletHeight = this.getAppletHeight(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "appletHeight", theAppletHeight), currentHashCode, theAppletHeight); + } + { + String theAppletWidth; + theAppletWidth = this.getAppletWidth(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "appletWidth", theAppletWidth), currentHashCode, theAppletWidth); + } + { + Boolean theMandateLoginButton; + theMandateLoginButton = this.isMandateLoginButton(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandateLoginButton", theMandateLoginButton), currentHashCode, theMandateLoginButton); + } + { + Boolean theOnlyMandateLoginAllowed; + theOnlyMandateLoginAllowed = this.isOnlyMandateLoginAllowed(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlyMandateLoginAllowed", theOnlyMandateLoginAllowed), currentHashCode, theOnlyMandateLoginAllowed); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java new file mode 100644 index 000000000..90ce82d9b --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for BKUSelectionType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="BKUSelectionType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="HTMLComplete"/>
+ *     <enumeration value="HTMLSelect"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "BKUSelectionType") +@XmlEnum +public enum BKUSelectionType { + + @XmlEnumValue("HTMLComplete") + HTML_COMPLETE("HTMLComplete"), + @XmlEnumValue("HTMLSelect") + HTML_SELECT("HTMLSelect"); + private final String value; + + BKUSelectionType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static BKUSelectionType fromValue(String v) { + for (BKUSelectionType c: BKUSelectionType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java new file mode 100644 index 000000000..8f75fedfe --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java @@ -0,0 +1,256 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "onlineBKU", + "handyBKU", + "localBKU" +}) +@Entity(name = "BKUURLS") +@Table(name = "BKUURLS") +@Inheritance(strategy = InheritanceType.JOINED) +public class BKUURLS + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "OnlineBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String onlineBKU; + @XmlElement(name = "HandyBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String handyBKU; + @XmlElement(name = "LocalBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String localBKU; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the onlineBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ONLINEBKU") + public String getOnlineBKU() { + return onlineBKU; + } + + /** + * Sets the value of the onlineBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOnlineBKU(String value) { + this.onlineBKU = value; + } + + /** + * Gets the value of the handyBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "HANDYBKU") + public String getHandyBKU() { + return handyBKU; + } + + /** + * Sets the value of the handyBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHandyBKU(String value) { + this.handyBKU = value; + } + + /** + * Gets the value of the localBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "LOCALBKU") + public String getLocalBKU() { + return localBKU; + } + + /** + * Sets the value of the localBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocalBKU(String value) { + this.localBKU = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof BKUURLS)) { + return false; + } + if (this == object) { + return true; + } + final BKUURLS that = ((BKUURLS) object); + { + String lhsOnlineBKU; + lhsOnlineBKU = this.getOnlineBKU(); + String rhsOnlineBKU; + rhsOnlineBKU = that.getOnlineBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineBKU", lhsOnlineBKU), LocatorUtils.property(thatLocator, "onlineBKU", rhsOnlineBKU), lhsOnlineBKU, rhsOnlineBKU)) { + return false; + } + } + { + String lhsHandyBKU; + lhsHandyBKU = this.getHandyBKU(); + String rhsHandyBKU; + rhsHandyBKU = that.getHandyBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "handyBKU", lhsHandyBKU), LocatorUtils.property(thatLocator, "handyBKU", rhsHandyBKU), lhsHandyBKU, rhsHandyBKU)) { + return false; + } + } + { + String lhsLocalBKU; + lhsLocalBKU = this.getLocalBKU(); + String rhsLocalBKU; + rhsLocalBKU = that.getLocalBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "localBKU", lhsLocalBKU), LocatorUtils.property(thatLocator, "localBKU", rhsLocalBKU), lhsLocalBKU, rhsLocalBKU)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theOnlineBKU; + theOnlineBKU = this.getOnlineBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineBKU", theOnlineBKU), currentHashCode, theOnlineBKU); + } + { + String theHandyBKU; + theHandyBKU = this.getHandyBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handyBKU", theHandyBKU), currentHashCode, theHandyBKU); + } + { + String theLocalBKU; + theLocalBKU = this.getLocalBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "localBKU", theLocalBKU), currentHashCode, theLocalBKU); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java new file mode 100644 index 000000000..f3fb0ecf0 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java @@ -0,0 +1,293 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Lob; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="keyInformation" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *         <element name="iv" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *         <element name="keyStoreFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="keyAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "keyInformation", + "iv", + "keyStoreFileName", + "keyAlias" +}) +@Entity(name = "BPKDecryption") +@Table(name = "BPKDECRYPTION") +@Inheritance(strategy = InheritanceType.JOINED) +public class BPKDecryption + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected byte[] keyInformation; + @XmlElement(required = true) + protected byte[] iv; + protected String keyStoreFileName; + protected String keyAlias; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the keyInformation property. + * + * @return + * possible object is + * byte[] + */ + @Basic + @Column(name = "KEYINFORMATION") + @Lob + public byte[] getKeyInformation() { + return keyInformation; + } + + /** + * Sets the value of the keyInformation property. + * + * @param value + * allowed object is + * byte[] + */ + public void setKeyInformation(byte[] value) { + this.keyInformation = value; + } + + /** + * Gets the value of the iv property. + * + * @return + * possible object is + * byte[] + */ + @Basic + @Column(name = "IV") + @Lob + public byte[] getIv() { + return iv; + } + + /** + * Sets the value of the iv property. + * + * @param value + * allowed object is + * byte[] + */ + public void setIv(byte[] value) { + this.iv = value; + } + + /** + * Gets the value of the keyStoreFileName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "KEYSTOREFILENAME", length = 255) + public String getKeyStoreFileName() { + return keyStoreFileName; + } + + /** + * Sets the value of the keyStoreFileName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKeyStoreFileName(String value) { + this.keyStoreFileName = value; + } + + /** + * Gets the value of the keyAlias property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "KEYALIAS", length = 255) + public String getKeyAlias() { + return keyAlias; + } + + /** + * Sets the value of the keyAlias property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKeyAlias(String value) { + this.keyAlias = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof BPKDecryption)) { + return false; + } + if (this == object) { + return true; + } + final BPKDecryption that = ((BPKDecryption) object); + { + byte[] lhsKeyInformation; + lhsKeyInformation = this.getKeyInformation(); + byte[] rhsKeyInformation; + rhsKeyInformation = that.getKeyInformation(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "keyInformation", lhsKeyInformation), LocatorUtils.property(thatLocator, "keyInformation", rhsKeyInformation), lhsKeyInformation, rhsKeyInformation)) { + return false; + } + } + { + byte[] lhsIv; + lhsIv = this.getIv(); + byte[] rhsIv; + rhsIv = that.getIv(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "iv", lhsIv), LocatorUtils.property(thatLocator, "iv", rhsIv), lhsIv, rhsIv)) { + return false; + } + } + { + String lhsKeyStoreFileName; + lhsKeyStoreFileName = this.getKeyStoreFileName(); + String rhsKeyStoreFileName; + rhsKeyStoreFileName = that.getKeyStoreFileName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "keyStoreFileName", lhsKeyStoreFileName), LocatorUtils.property(thatLocator, "keyStoreFileName", rhsKeyStoreFileName), lhsKeyStoreFileName, rhsKeyStoreFileName)) { + return false; + } + } + { + String lhsKeyAlias; + lhsKeyAlias = this.getKeyAlias(); + String rhsKeyAlias; + rhsKeyAlias = that.getKeyAlias(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "keyAlias", lhsKeyAlias), LocatorUtils.property(thatLocator, "keyAlias", rhsKeyAlias), lhsKeyAlias, rhsKeyAlias)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + byte[] theKeyInformation; + theKeyInformation = this.getKeyInformation(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyInformation", theKeyInformation), currentHashCode, theKeyInformation); + } + { + byte[] theIv; + theIv = this.getIv(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "iv", theIv), currentHashCode, theIv); + } + { + String theKeyStoreFileName; + theKeyStoreFileName = this.getKeyStoreFileName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyStoreFileName", theKeyStoreFileName), currentHashCode, theKeyStoreFileName); + } + { + String theKeyAlias; + theKeyAlias = this.getKeyAlias(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyAlias", theKeyAlias), currentHashCode, theKeyAlias); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java new file mode 100644 index 000000000..207ede902 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java @@ -0,0 +1,252 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Lob; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="publicKey" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *         <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="vkz" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "publicKey", + "target", + "vkz" +}) +@Entity(name = "BPKEncryption") +@Table(name = "BPKENCRYPTION") +@Inheritance(strategy = InheritanceType.JOINED) +public class BPKEncryption + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected byte[] publicKey; + @XmlElement(required = true) + protected String target; + @XmlElement(required = true) + protected String vkz; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the publicKey property. + * + * @return + * possible object is + * byte[] + */ + @Basic + @Column(name = "PUBLICKEY") + @Lob + public byte[] getPublicKey() { + return publicKey; + } + + /** + * Sets the value of the publicKey property. + * + * @param value + * allowed object is + * byte[] + */ + public void setPublicKey(byte[] value) { + this.publicKey = value; + } + + /** + * Gets the value of the target property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TARGET", length = 255) + public String getTarget() { + return target; + } + + /** + * Sets the value of the target property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTarget(String value) { + this.target = value; + } + + /** + * Gets the value of the vkz property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VKZ", length = 255) + public String getVkz() { + return vkz; + } + + /** + * Sets the value of the vkz property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVkz(String value) { + this.vkz = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof BPKEncryption)) { + return false; + } + if (this == object) { + return true; + } + final BPKEncryption that = ((BPKEncryption) object); + { + byte[] lhsPublicKey; + lhsPublicKey = this.getPublicKey(); + byte[] rhsPublicKey; + rhsPublicKey = that.getPublicKey(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "publicKey", lhsPublicKey), LocatorUtils.property(thatLocator, "publicKey", rhsPublicKey), lhsPublicKey, rhsPublicKey)) { + return false; + } + } + { + String lhsTarget; + lhsTarget = this.getTarget(); + String rhsTarget; + rhsTarget = that.getTarget(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { + return false; + } + } + { + String lhsVkz; + lhsVkz = this.getVkz(); + String rhsVkz; + rhsVkz = that.getVkz(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "vkz", lhsVkz), LocatorUtils.property(thatLocator, "vkz", rhsVkz), lhsVkz, rhsVkz)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + byte[] thePublicKey; + thePublicKey = this.getPublicKey(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicKey", thePublicKey), currentHashCode, thePublicKey); + } + { + String theTarget; + theTarget = this.getTarget(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); + } + { + String theVkz; + theVkz = this.getVkz(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "vkz", theVkz), currentHashCode, theVkz); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java new file mode 100644 index 000000000..65fcaa886 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java @@ -0,0 +1,214 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="UserID" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType"/>
+ *         <element name="Password" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "userID", + "password" +}) +@XmlRootElement(name = "BasicAuth") +@Entity(name = "BasicAuth") +@Table(name = "BASICAUTH") +@Inheritance(strategy = InheritanceType.JOINED) +public class BasicAuth + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "UserID", required = true) + protected MOAAuthDataType userID; + @XmlElement(name = "Password", required = true) + protected MOAAuthDataType password; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the userID property. + * + * @return + * possible object is + * {@link MOAAuthDataType } + * + */ + @Basic + @Column(name = "USERID", length = 255) + @Enumerated(EnumType.STRING) + public MOAAuthDataType getUserID() { + return userID; + } + + /** + * Sets the value of the userID property. + * + * @param value + * allowed object is + * {@link MOAAuthDataType } + * + */ + public void setUserID(MOAAuthDataType value) { + this.userID = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link MOAAuthDataType } + * + */ + @Basic + @Column(name = "PASSWORD_", length = 255) + @Enumerated(EnumType.STRING) + public MOAAuthDataType getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link MOAAuthDataType } + * + */ + public void setPassword(MOAAuthDataType value) { + this.password = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof BasicAuth)) { + return false; + } + if (this == object) { + return true; + } + final BasicAuth that = ((BasicAuth) object); + { + MOAAuthDataType lhsUserID; + lhsUserID = this.getUserID(); + MOAAuthDataType rhsUserID; + rhsUserID = that.getUserID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "userID", lhsUserID), LocatorUtils.property(thatLocator, "userID", rhsUserID), lhsUserID, rhsUserID)) { + return false; + } + } + { + MOAAuthDataType lhsPassword; + lhsPassword = this.getPassword(); + MOAAuthDataType rhsPassword; + rhsPassword = that.getPassword(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + MOAAuthDataType theUserID; + theUserID = this.getUserID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userID", theUserID), currentHashCode, theUserID); + } + { + MOAAuthDataType thePassword; + thePassword = this.getPassword(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java new file mode 100644 index 000000000..21476ced2 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java @@ -0,0 +1,418 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="AttributeValue" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_STORK" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="countryCode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}CountryCodeType" />
+ *       <attribute name="URL" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="supportsXMLSignature" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "attributeValue", + "oastork" +}) +@XmlRootElement(name = "C-PEPS") +@Entity(name = "CPEPS") +@Table(name = "CPEPS") +@Inheritance(strategy = InheritanceType.JOINED) +public class CPEPS + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "AttributeValue") + protected List attributeValue; + @XmlElement(name = "OA_STORK") + protected List oastork; + @XmlAttribute(name = "countryCode", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String countryCode; + @XmlAttribute(name = "URL", required = true) + @XmlSchemaType(name = "anyURI") + protected String url; + @XmlAttribute(name = "supportsXMLSignature") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean supportsXMLSignature; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List attributeValueItems; + + /** + * Gets the value of the attributeValue property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributeValue property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributeValue().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getAttributeValue() { + if (attributeValue == null) { + attributeValue = new ArrayList(); + } + return this.attributeValue; + } + + /** + * + * + */ + public void setAttributeValue(List attributeValue) { + this.attributeValue = attributeValue; + } + + /** + * Gets the value of the oastork property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the oastork property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getOASTORK().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link OASTORK } + * + * + */ + @ManyToMany(targetEntity = OASTORK.class, cascade = { + CascadeType.ALL + }) + @JoinTable(name = "OA_CPEPS", joinColumns = { + @JoinColumn(name = "aid", referencedColumnName = "hjid") + }, inverseJoinColumns = { + @JoinColumn(name = "bid", referencedColumnName = "hjid") + }) + public List getOASTORK() { + if (oastork == null) { + oastork = new ArrayList(); + } + return this.oastork; + } + + /** + * + * + */ + public void setOASTORK(List oastork) { + this.oastork = oastork; + } + + /** + * Gets the value of the countryCode property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "COUNTRYCODE", length = 255) + public String getCountryCode() { + return countryCode; + } + + /** + * Sets the value of the countryCode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCountryCode(String value) { + this.countryCode = value; + } + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "URL") + public String getURL() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setURL(String value) { + this.url = value; + } + + /** + * Gets the value of the supportsXMLSignature property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SUPPORTSXMLSIGNATURE") + public boolean isSupportsXMLSignature() { + if (supportsXMLSignature == null) { + return new ZeroOneBooleanAdapter().unmarshal("true"); + } else { + return supportsXMLSignature; + } + } + + /** + * Sets the value of the supportsXMLSignature property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSupportsXMLSignature(Boolean value) { + this.supportsXMLSignature = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = CPEPSAttributeValueItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ATTRIBUTEVALUEITEMS_CPEPS_HJ_0") + public List getAttributeValueItems() { + if (this.attributeValueItems == null) { + this.attributeValueItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.attributeValue)) { + this.attributeValue = ItemUtils.wrap(this.attributeValue, this.attributeValueItems, CPEPSAttributeValueItem.class); + } + return this.attributeValueItems; + } + + public void setAttributeValueItems(List value) { + this.attributeValue = null; + this.attributeValueItems = null; + this.attributeValueItems = value; + if (this.attributeValueItems == null) { + this.attributeValueItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.attributeValue)) { + this.attributeValue = ItemUtils.wrap(this.attributeValue, this.attributeValueItems, CPEPSAttributeValueItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof CPEPS)) { + return false; + } + if (this == object) { + return true; + } + final CPEPS that = ((CPEPS) object); + { + List lhsAttributeValue; + lhsAttributeValue = (((this.attributeValue!= null)&&(!this.attributeValue.isEmpty()))?this.getAttributeValue():null); + List rhsAttributeValue; + rhsAttributeValue = (((that.attributeValue!= null)&&(!that.attributeValue.isEmpty()))?that.getAttributeValue():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeValue", lhsAttributeValue), LocatorUtils.property(thatLocator, "attributeValue", rhsAttributeValue), lhsAttributeValue, rhsAttributeValue)) { + return false; + } + } + { + List lhsOASTORK; + lhsOASTORK = (((this.oastork!= null)&&(!this.oastork.isEmpty()))?this.getOASTORK():null); + List rhsOASTORK; + rhsOASTORK = (((that.oastork!= null)&&(!that.oastork.isEmpty()))?that.getOASTORK():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oastork", lhsOASTORK), LocatorUtils.property(thatLocator, "oastork", rhsOASTORK), lhsOASTORK, rhsOASTORK)) { + return false; + } + } + { + String lhsCountryCode; + lhsCountryCode = this.getCountryCode(); + String rhsCountryCode; + rhsCountryCode = that.getCountryCode(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "countryCode", lhsCountryCode), LocatorUtils.property(thatLocator, "countryCode", rhsCountryCode), lhsCountryCode, rhsCountryCode)) { + return false; + } + } + { + String lhsURL; + lhsURL = this.getURL(); + String rhsURL; + rhsURL = that.getURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { + return false; + } + } + { + boolean lhsSupportsXMLSignature; + lhsSupportsXMLSignature = ((this.supportsXMLSignature!= null)?this.isSupportsXMLSignature():false); + boolean rhsSupportsXMLSignature; + rhsSupportsXMLSignature = ((that.supportsXMLSignature!= null)?that.isSupportsXMLSignature():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "supportsXMLSignature", lhsSupportsXMLSignature), LocatorUtils.property(thatLocator, "supportsXMLSignature", rhsSupportsXMLSignature), lhsSupportsXMLSignature, rhsSupportsXMLSignature)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theAttributeValue; + theAttributeValue = (((this.attributeValue!= null)&&(!this.attributeValue.isEmpty()))?this.getAttributeValue():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeValue", theAttributeValue), currentHashCode, theAttributeValue); + } + { + List theOASTORK; + theOASTORK = (((this.oastork!= null)&&(!this.oastork.isEmpty()))?this.getOASTORK():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oastork", theOASTORK), currentHashCode, theOASTORK); + } + { + String theCountryCode; + theCountryCode = this.getCountryCode(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "countryCode", theCountryCode), currentHashCode, theCountryCode); + } + { + String theURL; + theURL = this.getURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); + } + { + boolean theSupportsXMLSignature; + theSupportsXMLSignature = ((this.supportsXMLSignature!= null)?this.isSupportsXMLSignature():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "supportsXMLSignature", theSupportsXMLSignature), currentHashCode, theSupportsXMLSignature); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java new file mode 100644 index 000000000..0b26ca5a3 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "CPEPSAttributeValueItem") +@Table(name = "CPEPSATTRIBUTEVALUEITEM") +@Inheritance(strategy = InheritanceType.JOINED) +public class CPEPSAttributeValueItem + implements Serializable, Item +{ + + @XmlElement(name = "AttributeValue", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java new file mode 100644 index 000000000..2dd3091e3 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ChainingModeType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="ChainingModeType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="chaining"/>
+ *     <enumeration value="pkix"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "ChainingModeType") +@XmlEnum +public enum ChainingModeType { + + @XmlEnumValue("chaining") + CHAINING("chaining"), + @XmlEnumValue("pkix") + PKIX("pkix"); + private final String value; + + ChainingModeType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static ChainingModeType fromValue(String v) { + for (ChainingModeType c: ChainingModeType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java new file mode 100644 index 000000000..317fe51c5 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java @@ -0,0 +1,242 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <element name="TrustAnchor">
+ *           <complexType>
+ *             <complexContent>
+ *               <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}X509IssuerSerialType">
+ *                 <attribute name="mode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" />
+ *               </extension>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="systemDefaultMode" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" default="pkix" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "trustAnchor" +}) +@Entity(name = "ChainingModes") +@Table(name = "CHAININGMODES") +@Inheritance(strategy = InheritanceType.JOINED) +public class ChainingModes + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TrustAnchor") + protected List trustAnchor; + @XmlAttribute(name = "systemDefaultMode") + protected ChainingModeType systemDefaultMode; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the trustAnchor property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the trustAnchor property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTrustAnchor().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TrustAnchor } + * + * + */ + @OneToMany(targetEntity = TrustAnchor.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TRUSTANCHOR_CHAININGMODES_HJ_0") + public List getTrustAnchor() { + if (trustAnchor == null) { + trustAnchor = new ArrayList(); + } + return this.trustAnchor; + } + + /** + * + * + */ + public void setTrustAnchor(List trustAnchor) { + this.trustAnchor = trustAnchor; + } + + /** + * Gets the value of the systemDefaultMode property. + * + * @return + * possible object is + * {@link ChainingModeType } + * + */ + @Basic + @Column(name = "SYSTEMDEFAULTMODE", length = 255) + @Enumerated(EnumType.STRING) + public ChainingModeType getSystemDefaultMode() { + if (systemDefaultMode == null) { + return ChainingModeType.PKIX; + } else { + return systemDefaultMode; + } + } + + /** + * Sets the value of the systemDefaultMode property. + * + * @param value + * allowed object is + * {@link ChainingModeType } + * + */ + public void setSystemDefaultMode(ChainingModeType value) { + this.systemDefaultMode = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof ChainingModes)) { + return false; + } + if (this == object) { + return true; + } + final ChainingModes that = ((ChainingModes) object); + { + List lhsTrustAnchor; + lhsTrustAnchor = (((this.trustAnchor!= null)&&(!this.trustAnchor.isEmpty()))?this.getTrustAnchor():null); + List rhsTrustAnchor; + rhsTrustAnchor = (((that.trustAnchor!= null)&&(!that.trustAnchor.isEmpty()))?that.getTrustAnchor():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustAnchor", lhsTrustAnchor), LocatorUtils.property(thatLocator, "trustAnchor", rhsTrustAnchor), lhsTrustAnchor, rhsTrustAnchor)) { + return false; + } + } + { + ChainingModeType lhsSystemDefaultMode; + lhsSystemDefaultMode = this.getSystemDefaultMode(); + ChainingModeType rhsSystemDefaultMode; + rhsSystemDefaultMode = that.getSystemDefaultMode(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "systemDefaultMode", lhsSystemDefaultMode), LocatorUtils.property(thatLocator, "systemDefaultMode", rhsSystemDefaultMode), lhsSystemDefaultMode, rhsSystemDefaultMode)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theTrustAnchor; + theTrustAnchor = (((this.trustAnchor!= null)&&(!this.trustAnchor.isEmpty()))?this.getTrustAnchor():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustAnchor", theTrustAnchor), currentHashCode, theTrustAnchor); + } + { + ChainingModeType theSystemDefaultMode; + theSystemDefaultMode = this.getSystemDefaultMode(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "systemDefaultMode", theSystemDefaultMode), currentHashCode, theSystemDefaultMode); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java new file mode 100644 index 000000000..3db58699a --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java @@ -0,0 +1,206 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "value" +}) +@Entity(name = "ClientKeyStore") +@Table(name = "CLIENTKEYSTORE") +@Inheritance(strategy = InheritanceType.JOINED) +public class ClientKeyStore + implements Serializable, Equals, HashCode +{ + + @XmlValue + @XmlSchemaType(name = "anyURI") + protected String value; + @XmlAttribute(name = "password") + protected String password; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_") + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PASSWORD_", length = 255) + public String getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPassword(String value) { + this.password = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof ClientKeyStore)) { + return false; + } + if (this == object) { + return true; + } + final ClientKeyStore that = ((ClientKeyStore) object); + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + { + String lhsPassword; + lhsPassword = this.getPassword(); + String rhsPassword; + rhsPassword = that.getPassword(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + { + String thePassword; + thePassword = this.getPassword(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java new file mode 100644 index 000000000..364af076a --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java @@ -0,0 +1,364 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="LoginType" type="{http://www.buergerkarte.at/namespaces/moaconfig#}LoginType"/>
+ *         <element name="Binding" minOccurs="0">
+ *           <simpleType>
+ *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *               <enumeration value="full"/>
+ *               <enumeration value="userName"/>
+ *               <enumeration value="none"/>
+ *             </restriction>
+ *           </simpleType>
+ *         </element>
+ *         <choice>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}ParamAuth"/>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}BasicAuth"/>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}HeaderAuth"/>
+ *         </choice>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "loginType", + "binding", + "paramAuth", + "basicAuth", + "headerAuth" +}) +@XmlRootElement(name = "Configuration") +@Entity(name = "Configuration") +@Table(name = "CONFIGURATION") +@Inheritance(strategy = InheritanceType.JOINED) +public class Configuration + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "LoginType", required = true, defaultValue = "stateful") + protected LoginType loginType; + @XmlElement(name = "Binding") + protected String binding; + @XmlElement(name = "ParamAuth") + protected ParamAuth paramAuth; + @XmlElement(name = "BasicAuth") + protected BasicAuth basicAuth; + @XmlElement(name = "HeaderAuth") + protected HeaderAuth headerAuth; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the loginType property. + * + * @return + * possible object is + * {@link LoginType } + * + */ + @Basic + @Column(name = "LOGINTYPE", length = 255) + @Enumerated(EnumType.STRING) + public LoginType getLoginType() { + return loginType; + } + + /** + * Sets the value of the loginType property. + * + * @param value + * allowed object is + * {@link LoginType } + * + */ + public void setLoginType(LoginType value) { + this.loginType = value; + } + + /** + * Gets the value of the binding property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "BINDING") + public String getBinding() { + return binding; + } + + /** + * Sets the value of the binding property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBinding(String value) { + this.binding = value; + } + + /** + * Gets the value of the paramAuth property. + * + * @return + * possible object is + * {@link ParamAuth } + * + */ + @ManyToOne(targetEntity = ParamAuth.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PARAMAUTH_CONFIGURATION_HJID") + public ParamAuth getParamAuth() { + return paramAuth; + } + + /** + * Sets the value of the paramAuth property. + * + * @param value + * allowed object is + * {@link ParamAuth } + * + */ + public void setParamAuth(ParamAuth value) { + this.paramAuth = value; + } + + /** + * Gets the value of the basicAuth property. + * + * @return + * possible object is + * {@link BasicAuth } + * + */ + @ManyToOne(targetEntity = BasicAuth.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "BASICAUTH_CONFIGURATION_HJID") + public BasicAuth getBasicAuth() { + return basicAuth; + } + + /** + * Sets the value of the basicAuth property. + * + * @param value + * allowed object is + * {@link BasicAuth } + * + */ + public void setBasicAuth(BasicAuth value) { + this.basicAuth = value; + } + + /** + * Gets the value of the headerAuth property. + * + * @return + * possible object is + * {@link HeaderAuth } + * + */ + @ManyToOne(targetEntity = HeaderAuth.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "HEADERAUTH_CONFIGURATION_HJID") + public HeaderAuth getHeaderAuth() { + return headerAuth; + } + + /** + * Sets the value of the headerAuth property. + * + * @param value + * allowed object is + * {@link HeaderAuth } + * + */ + public void setHeaderAuth(HeaderAuth value) { + this.headerAuth = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Configuration)) { + return false; + } + if (this == object) { + return true; + } + final Configuration that = ((Configuration) object); + { + LoginType lhsLoginType; + lhsLoginType = this.getLoginType(); + LoginType rhsLoginType; + rhsLoginType = that.getLoginType(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "loginType", lhsLoginType), LocatorUtils.property(thatLocator, "loginType", rhsLoginType), lhsLoginType, rhsLoginType)) { + return false; + } + } + { + String lhsBinding; + lhsBinding = this.getBinding(); + String rhsBinding; + rhsBinding = that.getBinding(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "binding", lhsBinding), LocatorUtils.property(thatLocator, "binding", rhsBinding), lhsBinding, rhsBinding)) { + return false; + } + } + { + ParamAuth lhsParamAuth; + lhsParamAuth = this.getParamAuth(); + ParamAuth rhsParamAuth; + rhsParamAuth = that.getParamAuth(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "paramAuth", lhsParamAuth), LocatorUtils.property(thatLocator, "paramAuth", rhsParamAuth), lhsParamAuth, rhsParamAuth)) { + return false; + } + } + { + BasicAuth lhsBasicAuth; + lhsBasicAuth = this.getBasicAuth(); + BasicAuth rhsBasicAuth; + rhsBasicAuth = that.getBasicAuth(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "basicAuth", lhsBasicAuth), LocatorUtils.property(thatLocator, "basicAuth", rhsBasicAuth), lhsBasicAuth, rhsBasicAuth)) { + return false; + } + } + { + HeaderAuth lhsHeaderAuth; + lhsHeaderAuth = this.getHeaderAuth(); + HeaderAuth rhsHeaderAuth; + rhsHeaderAuth = that.getHeaderAuth(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "headerAuth", lhsHeaderAuth), LocatorUtils.property(thatLocator, "headerAuth", rhsHeaderAuth), lhsHeaderAuth, rhsHeaderAuth)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + LoginType theLoginType; + theLoginType = this.getLoginType(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "loginType", theLoginType), currentHashCode, theLoginType); + } + { + String theBinding; + theBinding = this.getBinding(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "binding", theBinding), currentHashCode, theBinding); + } + { + ParamAuth theParamAuth; + theParamAuth = this.getParamAuth(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "paramAuth", theParamAuth), currentHashCode, theParamAuth); + } + { + BasicAuth theBasicAuth; + theBasicAuth = this.getBasicAuth(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "basicAuth", theBasicAuth), currentHashCode, theBasicAuth); + } + { + HeaderAuth theHeaderAuth; + theHeaderAuth = this.getHeaderAuth(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerAuth", theHeaderAuth), currentHashCode, theHeaderAuth); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java new file mode 100644 index 000000000..129508f35 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java @@ -0,0 +1,143 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for ConnectionParameterClientAuthType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ConnectionParameterClientAuthType">
+ *   <complexContent>
+ *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterServerAuthType">
+ *       <sequence>
+ *         <element name="ClientKeyStore" minOccurs="0">
+ *           <complexType>
+ *             <simpleContent>
+ *               <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *                 <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </extension>
+ *             </simpleContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ConnectionParameterClientAuthType", propOrder = { + "clientKeyStore" +}) +@Entity(name = "ConnectionParameterClientAuthType") +@Table(name = "CONNECTIONPARAMETERCLIENTAUT_0") +public class ConnectionParameterClientAuthType + extends ConnectionParameterServerAuthType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "ClientKeyStore") + protected ClientKeyStore clientKeyStore; + + /** + * Gets the value of the clientKeyStore property. + * + * @return + * possible object is + * {@link ClientKeyStore } + * + */ + @ManyToOne(targetEntity = ClientKeyStore.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CLIENTKEYSTORE_CONNECTIONPAR_0") + public ClientKeyStore getClientKeyStore() { + return clientKeyStore; + } + + /** + * Sets the value of the clientKeyStore property. + * + * @param value + * allowed object is + * {@link ClientKeyStore } + * + */ + public void setClientKeyStore(ClientKeyStore value) { + this.clientKeyStore = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof ConnectionParameterClientAuthType)) { + return false; + } + if (this == object) { + return true; + } + if (!super.equals(thisLocator, thatLocator, object, strategy)) { + return false; + } + final ConnectionParameterClientAuthType that = ((ConnectionParameterClientAuthType) object); + { + ClientKeyStore lhsClientKeyStore; + lhsClientKeyStore = this.getClientKeyStore(); + ClientKeyStore rhsClientKeyStore; + rhsClientKeyStore = that.getClientKeyStore(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "clientKeyStore", lhsClientKeyStore), LocatorUtils.property(thatLocator, "clientKeyStore", rhsClientKeyStore), lhsClientKeyStore, rhsClientKeyStore)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = super.hashCode(locator, strategy); + { + ClientKeyStore theClientKeyStore; + theClientKeyStore = this.getClientKeyStore(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "clientKeyStore", theClientKeyStore), currentHashCode, theClientKeyStore); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java new file mode 100644 index 000000000..4c6ab5917 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java @@ -0,0 +1,214 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for ConnectionParameterServerAuthType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ConnectionParameterServerAuthType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="AcceptedServerCertificates" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="URL" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ConnectionParameterServerAuthType", propOrder = { + "acceptedServerCertificates" +}) +@XmlSeeAlso({ + ConnectionParameterClientAuthType.class +}) +@Entity(name = "ConnectionParameterServerAuthType") +@Table(name = "CONNECTIONPARAMETERSERVERAUT_0") +@Inheritance(strategy = InheritanceType.JOINED) +public class ConnectionParameterServerAuthType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "AcceptedServerCertificates") + @XmlSchemaType(name = "anyURI") + protected String acceptedServerCertificates; + @XmlAttribute(name = "URL", required = true) + @XmlSchemaType(name = "anyURI") + protected String url; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the acceptedServerCertificates property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ACCEPTEDSERVERCERTIFICATES") + public String getAcceptedServerCertificates() { + return acceptedServerCertificates; + } + + /** + * Sets the value of the acceptedServerCertificates property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAcceptedServerCertificates(String value) { + this.acceptedServerCertificates = value; + } + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "URL") + public String getURL() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setURL(String value) { + this.url = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof ConnectionParameterServerAuthType)) { + return false; + } + if (this == object) { + return true; + } + final ConnectionParameterServerAuthType that = ((ConnectionParameterServerAuthType) object); + { + String lhsAcceptedServerCertificates; + lhsAcceptedServerCertificates = this.getAcceptedServerCertificates(); + String rhsAcceptedServerCertificates; + rhsAcceptedServerCertificates = that.getAcceptedServerCertificates(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "acceptedServerCertificates", lhsAcceptedServerCertificates), LocatorUtils.property(thatLocator, "acceptedServerCertificates", rhsAcceptedServerCertificates), lhsAcceptedServerCertificates, rhsAcceptedServerCertificates)) { + return false; + } + } + { + String lhsURL; + lhsURL = this.getURL(); + String rhsURL; + rhsURL = that.getURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theAcceptedServerCertificates; + theAcceptedServerCertificates = this.getAcceptedServerCertificates(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "acceptedServerCertificates", theAcceptedServerCertificates), currentHashCode, theAcceptedServerCertificates); + } + { + String theURL; + theURL = this.getURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java new file mode 100644 index 000000000..e600930aa --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java @@ -0,0 +1,484 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="SurName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="GivenName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Mail" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *         <element name="Type">
+ *           <simpleType>
+ *             <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *               <enumeration value="technical"/>
+ *               <enumeration value="support"/>
+ *               <enumeration value="administrative"/>
+ *               <enumeration value="billing"/>
+ *               <enumeration value="other"/>
+ *             </restriction>
+ *           </simpleType>
+ *         </element>
+ *         <element name="Company" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "surName", + "givenName", + "mail", + "type", + "company", + "phone" +}) +@XmlRootElement(name = "Contact") +@Entity(name = "Contact") +@Table(name = "CONTACT") +@Inheritance(strategy = InheritanceType.JOINED) +public class Contact + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "SurName", required = true) + protected String surName; + @XmlElement(name = "GivenName", required = true) + protected String givenName; + @XmlElement(name = "Mail", required = true) + protected List mail; + @XmlElement(name = "Type", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String type; + @XmlElement(name = "Company", required = true) + protected String company; + @XmlElement(name = "Phone", required = true) + protected List phone; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List mailItems; + protected transient List phoneItems; + + /** + * Gets the value of the surName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SURNAME", length = 255) + public String getSurName() { + return surName; + } + + /** + * Sets the value of the surName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSurName(String value) { + this.surName = value; + } + + /** + * Gets the value of the givenName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "GIVENNAME", length = 255) + public String getGivenName() { + return givenName; + } + + /** + * Sets the value of the givenName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGivenName(String value) { + this.givenName = value; + } + + /** + * Gets the value of the mail property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the mail property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getMail().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getMail() { + if (mail == null) { + mail = new ArrayList(); + } + return this.mail; + } + + /** + * + * + */ + public void setMail(List mail) { + this.mail = mail; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TYPE_") + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the company property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "COMPANY", length = 255) + public String getCompany() { + return company; + } + + /** + * Sets the value of the company property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCompany(String value) { + this.company = value; + } + + /** + * Gets the value of the phone property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the phone property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPhone().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getPhone() { + if (phone == null) { + phone = new ArrayList(); + } + return this.phone; + } + + /** + * + * + */ + public void setPhone(List phone) { + this.phone = phone; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = ContactMailItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "MAILITEMS_CONTACT_HJID") + public List getMailItems() { + if (this.mailItems == null) { + this.mailItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.mail)) { + this.mail = ItemUtils.wrap(this.mail, this.mailItems, ContactMailItem.class); + } + return this.mailItems; + } + + public void setMailItems(List value) { + this.mail = null; + this.mailItems = null; + this.mailItems = value; + if (this.mailItems == null) { + this.mailItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.mail)) { + this.mail = ItemUtils.wrap(this.mail, this.mailItems, ContactMailItem.class); + } + } + + @OneToMany(targetEntity = ContactPhoneItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PHONEITEMS_CONTACT_HJID") + public List getPhoneItems() { + if (this.phoneItems == null) { + this.phoneItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.phone)) { + this.phone = ItemUtils.wrap(this.phone, this.phoneItems, ContactPhoneItem.class); + } + return this.phoneItems; + } + + public void setPhoneItems(List value) { + this.phone = null; + this.phoneItems = null; + this.phoneItems = value; + if (this.phoneItems == null) { + this.phoneItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.phone)) { + this.phone = ItemUtils.wrap(this.phone, this.phoneItems, ContactPhoneItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Contact)) { + return false; + } + if (this == object) { + return true; + } + final Contact that = ((Contact) object); + { + String lhsSurName; + lhsSurName = this.getSurName(); + String rhsSurName; + rhsSurName = that.getSurName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "surName", lhsSurName), LocatorUtils.property(thatLocator, "surName", rhsSurName), lhsSurName, rhsSurName)) { + return false; + } + } + { + String lhsGivenName; + lhsGivenName = this.getGivenName(); + String rhsGivenName; + rhsGivenName = that.getGivenName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "givenName", lhsGivenName), LocatorUtils.property(thatLocator, "givenName", rhsGivenName), lhsGivenName, rhsGivenName)) { + return false; + } + } + { + List lhsMail; + lhsMail = (((this.mail!= null)&&(!this.mail.isEmpty()))?this.getMail():null); + List rhsMail; + rhsMail = (((that.mail!= null)&&(!that.mail.isEmpty()))?that.getMail():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mail", lhsMail), LocatorUtils.property(thatLocator, "mail", rhsMail), lhsMail, rhsMail)) { + return false; + } + } + { + String lhsType; + lhsType = this.getType(); + String rhsType; + rhsType = that.getType(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { + return false; + } + } + { + String lhsCompany; + lhsCompany = this.getCompany(); + String rhsCompany; + rhsCompany = that.getCompany(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "company", lhsCompany), LocatorUtils.property(thatLocator, "company", rhsCompany), lhsCompany, rhsCompany)) { + return false; + } + } + { + List lhsPhone; + lhsPhone = (((this.phone!= null)&&(!this.phone.isEmpty()))?this.getPhone():null); + List rhsPhone; + rhsPhone = (((that.phone!= null)&&(!that.phone.isEmpty()))?that.getPhone():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "phone", lhsPhone), LocatorUtils.property(thatLocator, "phone", rhsPhone), lhsPhone, rhsPhone)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theSurName; + theSurName = this.getSurName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "surName", theSurName), currentHashCode, theSurName); + } + { + String theGivenName; + theGivenName = this.getGivenName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "givenName", theGivenName), currentHashCode, theGivenName); + } + { + List theMail; + theMail = (((this.mail!= null)&&(!this.mail.isEmpty()))?this.getMail():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mail", theMail), currentHashCode, theMail); + } + { + String theType; + theType = this.getType(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); + } + { + String theCompany; + theCompany = this.getCompany(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "company", theCompany), currentHashCode, theCompany); + } + { + List thePhone; + thePhone = (((this.phone!= null)&&(!this.phone.isEmpty()))?this.getPhone():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "phone", thePhone), currentHashCode, thePhone); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java new file mode 100644 index 000000000..67bde993f --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "ContactMailItem") +@Table(name = "CONTACTMAILITEM") +@Inheritance(strategy = InheritanceType.JOINED) +public class ContactMailItem + implements Serializable, Item +{ + + @XmlElement(name = "Mail", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java new file mode 100644 index 000000000..55b433c2b --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "ContactPhoneItem") +@Table(name = "CONTACTPHONEITEM") +@Inheritance(strategy = InheritanceType.JOINED) +public class ContactPhoneItem + implements Serializable, Item +{ + + @XmlElement(name = "Phone", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java new file mode 100644 index 000000000..c31742a9a --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java @@ -0,0 +1,256 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
+ *         <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "onlineBKU", + "handyBKU", + "localBKU" +}) +@Entity(name = "DefaultBKUs") +@Table(name = "DEFAULTBKUS") +@Inheritance(strategy = InheritanceType.JOINED) +public class DefaultBKUs + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "OnlineBKU") + @XmlSchemaType(name = "anyURI") + protected String onlineBKU; + @XmlElement(name = "HandyBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String handyBKU; + @XmlElement(name = "LocalBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String localBKU; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the onlineBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ONLINEBKU") + public String getOnlineBKU() { + return onlineBKU; + } + + /** + * Sets the value of the onlineBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOnlineBKU(String value) { + this.onlineBKU = value; + } + + /** + * Gets the value of the handyBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "HANDYBKU") + public String getHandyBKU() { + return handyBKU; + } + + /** + * Sets the value of the handyBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHandyBKU(String value) { + this.handyBKU = value; + } + + /** + * Gets the value of the localBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "LOCALBKU") + public String getLocalBKU() { + return localBKU; + } + + /** + * Sets the value of the localBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocalBKU(String value) { + this.localBKU = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof DefaultBKUs)) { + return false; + } + if (this == object) { + return true; + } + final DefaultBKUs that = ((DefaultBKUs) object); + { + String lhsOnlineBKU; + lhsOnlineBKU = this.getOnlineBKU(); + String rhsOnlineBKU; + rhsOnlineBKU = that.getOnlineBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineBKU", lhsOnlineBKU), LocatorUtils.property(thatLocator, "onlineBKU", rhsOnlineBKU), lhsOnlineBKU, rhsOnlineBKU)) { + return false; + } + } + { + String lhsHandyBKU; + lhsHandyBKU = this.getHandyBKU(); + String rhsHandyBKU; + rhsHandyBKU = that.getHandyBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "handyBKU", lhsHandyBKU), LocatorUtils.property(thatLocator, "handyBKU", rhsHandyBKU), lhsHandyBKU, rhsHandyBKU)) { + return false; + } + } + { + String lhsLocalBKU; + lhsLocalBKU = this.getLocalBKU(); + String rhsLocalBKU; + rhsLocalBKU = that.getLocalBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "localBKU", lhsLocalBKU), LocatorUtils.property(thatLocator, "localBKU", rhsLocalBKU), lhsLocalBKU, rhsLocalBKU)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theOnlineBKU; + theOnlineBKU = this.getOnlineBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineBKU", theOnlineBKU), currentHashCode, theOnlineBKU); + } + { + String theHandyBKU; + theHandyBKU = this.getHandyBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handyBKU", theHandyBKU), currentHashCode, theHandyBKU); + } + { + String theLocalBKU; + theLocalBKU = this.getLocalBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "localBKU", theLocalBKU), currentHashCode, theLocalBKU); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java new file mode 100644 index 000000000..5161c7fe9 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java @@ -0,0 +1,164 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "trustProfileID" +}) +@Entity(name = "DefaultTrustProfile") +@Table(name = "DEFAULTTRUSTPROFILE") +@Inheritance(strategy = InheritanceType.JOINED) +public class DefaultTrustProfile + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TrustProfileID", required = true) + protected String trustProfileID; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the trustProfileID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TRUSTPROFILEID", length = 255) + public String getTrustProfileID() { + return trustProfileID; + } + + /** + * Sets the value of the trustProfileID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrustProfileID(String value) { + this.trustProfileID = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof DefaultTrustProfile)) { + return false; + } + if (this == object) { + return true; + } + final DefaultTrustProfile that = ((DefaultTrustProfile) object); + { + String lhsTrustProfileID; + lhsTrustProfileID = this.getTrustProfileID(); + String rhsTrustProfileID; + rhsTrustProfileID = that.getTrustProfileID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theTrustProfileID; + theTrustProfileID = this.getTrustProfileID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java new file mode 100644 index 000000000..b1639e1b0 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java @@ -0,0 +1,257 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="bPKDecryption" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="keyInformation" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *                   <element name="iv" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *                   <element name="keyStoreFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                   <element name="keyAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="bPKEncryption" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="publicKey" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *                   <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   <element name="vkz" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "bpkDecryption", + "bpkEncryption" +}) +@XmlRootElement(name = "EncBPKInformation") +@Entity(name = "EncBPKInformation") +@Table(name = "ENCBPKINFORMATION") +@Inheritance(strategy = InheritanceType.JOINED) +public class EncBPKInformation + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "bPKDecryption") + protected BPKDecryption bpkDecryption; + @XmlElement(name = "bPKEncryption") + protected List bpkEncryption; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the bpkDecryption property. + * + * @return + * possible object is + * {@link BPKDecryption } + * + */ + @ManyToOne(targetEntity = BPKDecryption.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "BPKDECRYPTION_ENCBPKINFORMAT_0") + public BPKDecryption getBPKDecryption() { + return bpkDecryption; + } + + /** + * Sets the value of the bpkDecryption property. + * + * @param value + * allowed object is + * {@link BPKDecryption } + * + */ + public void setBPKDecryption(BPKDecryption value) { + this.bpkDecryption = value; + } + + /** + * Gets the value of the bpkEncryption property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the bpkEncryption property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getBPKEncryption().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link BPKEncryption } + * + * + */ + @OneToMany(targetEntity = BPKEncryption.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "BPKENCRYPTION_ENCBPKINFORMAT_0") + public List getBPKEncryption() { + if (bpkEncryption == null) { + bpkEncryption = new ArrayList(); + } + return this.bpkEncryption; + } + + /** + * + * + */ + public void setBPKEncryption(List bpkEncryption) { + this.bpkEncryption = bpkEncryption; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof EncBPKInformation)) { + return false; + } + if (this == object) { + return true; + } + final EncBPKInformation that = ((EncBPKInformation) object); + { + BPKDecryption lhsBPKDecryption; + lhsBPKDecryption = this.getBPKDecryption(); + BPKDecryption rhsBPKDecryption; + rhsBPKDecryption = that.getBPKDecryption(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "bpkDecryption", lhsBPKDecryption), LocatorUtils.property(thatLocator, "bpkDecryption", rhsBPKDecryption), lhsBPKDecryption, rhsBPKDecryption)) { + return false; + } + } + { + List lhsBPKEncryption; + lhsBPKEncryption = (((this.bpkEncryption!= null)&&(!this.bpkEncryption.isEmpty()))?this.getBPKEncryption():null); + List rhsBPKEncryption; + rhsBPKEncryption = (((that.bpkEncryption!= null)&&(!that.bpkEncryption.isEmpty()))?that.getBPKEncryption():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "bpkEncryption", lhsBPKEncryption), LocatorUtils.property(thatLocator, "bpkEncryption", rhsBPKEncryption), lhsBPKEncryption, rhsBPKEncryption)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + BPKDecryption theBPKDecryption; + theBPKDecryption = this.getBPKDecryption(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bpkDecryption", theBPKDecryption), currentHashCode, theBPKDecryption); + } + { + List theBPKEncryption; + theBPKEncryption = (((this.bpkEncryption!= null)&&(!this.bpkEncryption.isEmpty()))?this.getBPKEncryption():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bpkEncryption", theBPKEncryption), currentHashCode, theBPKEncryption); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java new file mode 100644 index 000000000..8ada16935 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java @@ -0,0 +1,216 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}STORK" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "connectionParameter", + "stork" +}) +@Entity(name = "ForeignIdentities") +@Table(name = "FOREIGNIDENTITIES") +@Inheritance(strategy = InheritanceType.JOINED) +public class ForeignIdentities + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "ConnectionParameter", required = true) + protected ConnectionParameterClientAuthType connectionParameter; + @XmlElement(name = "STORK") + protected STORK stork; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the connectionParameter property. + * + * @return + * possible object is + * {@link ConnectionParameterClientAuthType } + * + */ + @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CONNECTIONPARAMETER_FOREIGNI_0") + public ConnectionParameterClientAuthType getConnectionParameter() { + return connectionParameter; + } + + /** + * Sets the value of the connectionParameter property. + * + * @param value + * allowed object is + * {@link ConnectionParameterClientAuthType } + * + */ + public void setConnectionParameter(ConnectionParameterClientAuthType value) { + this.connectionParameter = value; + } + + /** + * Verbindungsparameter zu den Country-PEPS + * (C-PEPS) + * + * + * @return + * possible object is + * {@link STORK } + * + */ + @ManyToOne(targetEntity = STORK.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "STORK_FOREIGNIDENTITIES_HJID") + public STORK getSTORK() { + return stork; + } + + /** + * Sets the value of the stork property. + * + * @param value + * allowed object is + * {@link STORK } + * + */ + public void setSTORK(STORK value) { + this.stork = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof ForeignIdentities)) { + return false; + } + if (this == object) { + return true; + } + final ForeignIdentities that = ((ForeignIdentities) object); + { + ConnectionParameterClientAuthType lhsConnectionParameter; + lhsConnectionParameter = this.getConnectionParameter(); + ConnectionParameterClientAuthType rhsConnectionParameter; + rhsConnectionParameter = that.getConnectionParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { + return false; + } + } + { + STORK lhsSTORK; + lhsSTORK = this.getSTORK(); + STORK rhsSTORK; + rhsSTORK = that.getSTORK(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "stork", lhsSTORK), LocatorUtils.property(thatLocator, "stork", rhsSTORK), lhsSTORK, rhsSTORK)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + ConnectionParameterClientAuthType theConnectionParameter; + theConnectionParameter = this.getConnectionParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); + } + { + STORK theSTORK; + theSTORK = this.getSTORK(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "stork", theSTORK), currentHashCode, theSTORK); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java new file mode 100644 index 000000000..843b1bec7 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java @@ -0,0 +1,365 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="TimeOuts">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Assertion" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *                   <element name="MOASessionCreated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *                   <element name="MOASessionUpdated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="AlternativeSourceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="CertStoreDirectory" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="TrustManagerRevocationChecking" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="PublicURLPreFix" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "timeOuts", + "alternativeSourceID", + "certStoreDirectory", + "trustManagerRevocationChecking", + "publicURLPreFix" +}) +@XmlRootElement(name = "GeneralConfiguration") +@Entity(name = "GeneralConfiguration") +@Table(name = "GENERALCONFIGURATION") +@Inheritance(strategy = InheritanceType.JOINED) +public class GeneralConfiguration + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TimeOuts", required = true) + protected TimeOuts timeOuts; + @XmlElement(name = "AlternativeSourceID", required = true) + protected String alternativeSourceID; + @XmlElement(name = "CertStoreDirectory", required = true) + @XmlSchemaType(name = "anyURI") + protected String certStoreDirectory; + @XmlElement(name = "TrustManagerRevocationChecking", required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean trustManagerRevocationChecking; + @XmlElement(name = "PublicURLPreFix", required = true) + protected String publicURLPreFix; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the timeOuts property. + * + * @return + * possible object is + * {@link TimeOuts } + * + */ + @ManyToOne(targetEntity = TimeOuts.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TIMEOUTS_GENERALCONFIGURATIO_0") + public TimeOuts getTimeOuts() { + return timeOuts; + } + + /** + * Sets the value of the timeOuts property. + * + * @param value + * allowed object is + * {@link TimeOuts } + * + */ + public void setTimeOuts(TimeOuts value) { + this.timeOuts = value; + } + + /** + * Gets the value of the alternativeSourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ALTERNATIVESOURCEID", length = 255) + public String getAlternativeSourceID() { + return alternativeSourceID; + } + + /** + * Sets the value of the alternativeSourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAlternativeSourceID(String value) { + this.alternativeSourceID = value; + } + + /** + * Gets the value of the certStoreDirectory property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "CERTSTOREDIRECTORY") + public String getCertStoreDirectory() { + return certStoreDirectory; + } + + /** + * Sets the value of the certStoreDirectory property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCertStoreDirectory(String value) { + this.certStoreDirectory = value; + } + + /** + * Gets the value of the trustManagerRevocationChecking property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TRUSTMANAGERREVOCATIONCHECKI_0") + public Boolean isTrustManagerRevocationChecking() { + return trustManagerRevocationChecking; + } + + /** + * Sets the value of the trustManagerRevocationChecking property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrustManagerRevocationChecking(Boolean value) { + this.trustManagerRevocationChecking = value; + } + + /** + * Gets the value of the publicURLPreFix property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PUBLICURLPREFIX", length = 255) + public String getPublicURLPreFix() { + return publicURLPreFix; + } + + /** + * Sets the value of the publicURLPreFix property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPublicURLPreFix(String value) { + this.publicURLPreFix = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof GeneralConfiguration)) { + return false; + } + if (this == object) { + return true; + } + final GeneralConfiguration that = ((GeneralConfiguration) object); + { + TimeOuts lhsTimeOuts; + lhsTimeOuts = this.getTimeOuts(); + TimeOuts rhsTimeOuts; + rhsTimeOuts = that.getTimeOuts(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "timeOuts", lhsTimeOuts), LocatorUtils.property(thatLocator, "timeOuts", rhsTimeOuts), lhsTimeOuts, rhsTimeOuts)) { + return false; + } + } + { + String lhsAlternativeSourceID; + lhsAlternativeSourceID = this.getAlternativeSourceID(); + String rhsAlternativeSourceID; + rhsAlternativeSourceID = that.getAlternativeSourceID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "alternativeSourceID", lhsAlternativeSourceID), LocatorUtils.property(thatLocator, "alternativeSourceID", rhsAlternativeSourceID), lhsAlternativeSourceID, rhsAlternativeSourceID)) { + return false; + } + } + { + String lhsCertStoreDirectory; + lhsCertStoreDirectory = this.getCertStoreDirectory(); + String rhsCertStoreDirectory; + rhsCertStoreDirectory = that.getCertStoreDirectory(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "certStoreDirectory", lhsCertStoreDirectory), LocatorUtils.property(thatLocator, "certStoreDirectory", rhsCertStoreDirectory), lhsCertStoreDirectory, rhsCertStoreDirectory)) { + return false; + } + } + { + Boolean lhsTrustManagerRevocationChecking; + lhsTrustManagerRevocationChecking = this.isTrustManagerRevocationChecking(); + Boolean rhsTrustManagerRevocationChecking; + rhsTrustManagerRevocationChecking = that.isTrustManagerRevocationChecking(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustManagerRevocationChecking", lhsTrustManagerRevocationChecking), LocatorUtils.property(thatLocator, "trustManagerRevocationChecking", rhsTrustManagerRevocationChecking), lhsTrustManagerRevocationChecking, rhsTrustManagerRevocationChecking)) { + return false; + } + } + { + String lhsPublicURLPreFix; + lhsPublicURLPreFix = this.getPublicURLPreFix(); + String rhsPublicURLPreFix; + rhsPublicURLPreFix = that.getPublicURLPreFix(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURLPreFix", lhsPublicURLPreFix), LocatorUtils.property(thatLocator, "publicURLPreFix", rhsPublicURLPreFix), lhsPublicURLPreFix, rhsPublicURLPreFix)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + TimeOuts theTimeOuts; + theTimeOuts = this.getTimeOuts(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timeOuts", theTimeOuts), currentHashCode, theTimeOuts); + } + { + String theAlternativeSourceID; + theAlternativeSourceID = this.getAlternativeSourceID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alternativeSourceID", theAlternativeSourceID), currentHashCode, theAlternativeSourceID); + } + { + String theCertStoreDirectory; + theCertStoreDirectory = this.getCertStoreDirectory(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "certStoreDirectory", theCertStoreDirectory), currentHashCode, theCertStoreDirectory); + } + { + Boolean theTrustManagerRevocationChecking; + theTrustManagerRevocationChecking = this.isTrustManagerRevocationChecking(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustManagerRevocationChecking", theTrustManagerRevocationChecking), currentHashCode, theTrustManagerRevocationChecking); + } + { + String thePublicURLPreFix; + thePublicURLPreFix = this.getPublicURLPreFix(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURLPreFix", thePublicURLPreFix), currentHashCode, thePublicURLPreFix); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java new file mode 100644 index 000000000..031a5ff82 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java @@ -0,0 +1,216 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="name" use="required">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *             <enumeration value="DirectoryCertStoreParameters.RootDir"/>
+ *             <enumeration value="AuthenticationSession.TimeOut"/>
+ *             <enumeration value="AuthenticationData.TimeOut"/>
+ *             <enumeration value="TrustManager.RevocationChecking"/>
+ *             <enumeration value="FrontendServlets.EnableHTTPConnection"/>
+ *             <enumeration value="FrontendServlets.DataURLPrefix"/>
+ *             <enumeration value="AuthenticationServer.KeepAssertion"/>
+ *             <enumeration value="AuthenticationServer.WriteAssertionToFile"/>
+ *             <enumeration value="AuthenticationServer.SourceID"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@Entity(name = "GenericConfiguration") +@Table(name = "GENERICCONFIGURATION") +@Inheritance(strategy = InheritanceType.JOINED) +public class GenericConfiguration + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "value", required = true) + protected String value; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_") + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof GenericConfiguration)) { + return false; + } + if (this == object) { + return true; + } + final GenericConfiguration that = ((GenericConfiguration) object); + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java new file mode 100644 index 000000000..7cd1bdf36 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java @@ -0,0 +1,212 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}token" />
+ *       <attribute name="Value" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "Header") +@Entity(name = "Header") +@Table(name = "HEADER") +@Inheritance(strategy = InheritanceType.JOINED) +public class Header + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "Name", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String name; + @XmlAttribute(name = "Value", required = true) + protected MOAAuthDataType value; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_", length = 255) + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link MOAAuthDataType } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + @Enumerated(EnumType.STRING) + public MOAAuthDataType getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link MOAAuthDataType } + * + */ + public void setValue(MOAAuthDataType value) { + this.value = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Header)) { + return false; + } + if (this == object) { + return true; + } + final Header that = ((Header) object); + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + { + MOAAuthDataType lhsValue; + lhsValue = this.getValue(); + MOAAuthDataType rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + { + MOAAuthDataType theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java new file mode 100644 index 000000000..baf367238 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java @@ -0,0 +1,185 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Header" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "header" +}) +@XmlRootElement(name = "HeaderAuth") +@Entity(name = "HeaderAuth") +@Table(name = "HEADERAUTH") +@Inheritance(strategy = InheritanceType.JOINED) +public class HeaderAuth + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Header", required = true) + protected List
header; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the header property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the header property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getHeader().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Header } + * + * + */ + @OneToMany(targetEntity = Header.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "HEADER_HEADERAUTH_HJID") + public List

getHeader() { + if (header == null) { + header = new ArrayList
(); + } + return this.header; + } + + /** + * + * + */ + public void setHeader(List
header) { + this.header = header; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof HeaderAuth)) { + return false; + } + if (this == object) { + return true; + } + final HeaderAuth that = ((HeaderAuth) object); + { + List
lhsHeader; + lhsHeader = (((this.header!= null)&&(!this.header.isEmpty()))?this.getHeader():null); + List
rhsHeader; + rhsHeader = (((that.header!= null)&&(!that.header.isEmpty()))?that.getHeader():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "header", lhsHeader), LocatorUtils.property(thatLocator, "header", rhsHeader), lhsHeader, rhsHeader)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List
theHeader; + theHeader = (((this.header!= null)&&(!this.header.isEmpty()))?this.getHeader():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "header", theHeader), currentHashCode, theHeader); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java new file mode 100644 index 000000000..c87f01c60 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java @@ -0,0 +1,210 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="Value" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "type", + "value" +}) +@XmlRootElement(name = "IdentificationNumber") +@Entity(name = "IdentificationNumber") +@Table(name = "IDENTIFICATIONNUMBER") +@Inheritance(strategy = InheritanceType.JOINED) +public class IdentificationNumber + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Type", required = true) + protected String type; + @XmlElement(name = "Value", required = true) + protected String value; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TYPE_", length = 255) + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof IdentificationNumber)) { + return false; + } + if (this == object) { + return true; + } + final IdentificationNumber that = ((IdentificationNumber) object); + { + String lhsType; + lhsType = this.getType(); + String rhsType; + rhsType = that.getType(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { + return false; + } + } + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theType; + theType = this.getType(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); + } + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java new file mode 100644 index 000000000..c4c9d2ec0 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java @@ -0,0 +1,209 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="X509SubjectName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "x509SubjectName" +}) +@Entity(name = "IdentityLinkSigners") +@Table(name = "IDENTITYLINKSIGNERS") +@Inheritance(strategy = InheritanceType.JOINED) +public class IdentityLinkSigners + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "X509SubjectName", required = true) + protected List x509SubjectName; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List x509SubjectNameItems; + + /** + * Gets the value of the x509SubjectName property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the x509SubjectName property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getX509SubjectName().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getX509SubjectName() { + if (x509SubjectName == null) { + x509SubjectName = new ArrayList(); + } + return this.x509SubjectName; + } + + /** + * + * + */ + public void setX509SubjectName(List x509SubjectName) { + this.x509SubjectName = x509SubjectName; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = IdentityLinkSignersX509SubjectNameItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "X509SUBJECTNAMEITEMS_IDENTIT_0") + public List getX509SubjectNameItems() { + if (this.x509SubjectNameItems == null) { + this.x509SubjectNameItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.x509SubjectName)) { + this.x509SubjectName = ItemUtils.wrap(this.x509SubjectName, this.x509SubjectNameItems, IdentityLinkSignersX509SubjectNameItem.class); + } + return this.x509SubjectNameItems; + } + + public void setX509SubjectNameItems(List value) { + this.x509SubjectName = null; + this.x509SubjectNameItems = null; + this.x509SubjectNameItems = value; + if (this.x509SubjectNameItems == null) { + this.x509SubjectNameItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.x509SubjectName)) { + this.x509SubjectName = ItemUtils.wrap(this.x509SubjectName, this.x509SubjectNameItems, IdentityLinkSignersX509SubjectNameItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof IdentityLinkSigners)) { + return false; + } + if (this == object) { + return true; + } + final IdentityLinkSigners that = ((IdentityLinkSigners) object); + { + List lhsX509SubjectName; + lhsX509SubjectName = (((this.x509SubjectName!= null)&&(!this.x509SubjectName.isEmpty()))?this.getX509SubjectName():null); + List rhsX509SubjectName; + rhsX509SubjectName = (((that.x509SubjectName!= null)&&(!that.x509SubjectName.isEmpty()))?that.getX509SubjectName():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "x509SubjectName", lhsX509SubjectName), LocatorUtils.property(thatLocator, "x509SubjectName", rhsX509SubjectName), lhsX509SubjectName, rhsX509SubjectName)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theX509SubjectName; + theX509SubjectName = (((this.x509SubjectName!= null)&&(!this.x509SubjectName.isEmpty()))?this.getX509SubjectName():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "x509SubjectName", theX509SubjectName), currentHashCode, theX509SubjectName); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java new file mode 100644 index 000000000..04841e54c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "IdentityLinkSignersX509SubjectNameItem") +@Table(name = "IDENTITYLINKSIGNERSX509SUBJE_0") +@Inheritance(strategy = InheritanceType.JOINED) +public class IdentityLinkSignersX509SubjectNameItem + implements Serializable, Item +{ + + @XmlElement(name = "X509SubjectName", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java new file mode 100644 index 000000000..4995d51dd --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java @@ -0,0 +1,206 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for InputProcessorType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="InputProcessorType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attribute name="template" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "InputProcessorType", propOrder = { + "value" +}) +@Entity(name = "InputProcessorType") +@Table(name = "INPUTPROCESSORTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class InputProcessorType + implements Serializable, Equals, HashCode +{ + + @XmlValue + protected String value; + @XmlAttribute(name = "template") + @XmlSchemaType(name = "anyURI") + protected String template; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the template property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TEMPLATE_") + public String getTemplate() { + return template; + } + + /** + * Sets the value of the template property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTemplate(String value) { + this.template = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof InputProcessorType)) { + return false; + } + if (this == object) { + return true; + } + final InputProcessorType that = ((InputProcessorType) object); + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + { + String lhsTemplate; + lhsTemplate = this.getTemplate(); + String rhsTemplate; + rhsTemplate = that.getTemplate(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "template", lhsTemplate), LocatorUtils.property(thatLocator, "template", rhsTemplate), lhsTemplate, rhsTemplate)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + { + String theTemplate; + theTemplate = this.getTemplate(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "template", theTemplate), currentHashCode, theTemplate); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java new file mode 100644 index 000000000..ec299b933 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java @@ -0,0 +1,208 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for InterfederationGatewayType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="InterfederationGatewayType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="forwardIDPIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="forwardProtocolIdentifer" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "InterfederationGatewayType", propOrder = { + "forwardIDPIdentifier", + "forwardProtocolIdentifer" +}) +@Entity(name = "InterfederationGatewayType") +@Table(name = "INTERFEDERATIONGATEWAYTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class InterfederationGatewayType + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected String forwardIDPIdentifier; + @XmlElement(required = true) + protected String forwardProtocolIdentifer; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the forwardIDPIdentifier property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FORWARDIDPIDENTIFIER", length = 255) + public String getForwardIDPIdentifier() { + return forwardIDPIdentifier; + } + + /** + * Sets the value of the forwardIDPIdentifier property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setForwardIDPIdentifier(String value) { + this.forwardIDPIdentifier = value; + } + + /** + * Gets the value of the forwardProtocolIdentifer property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FORWARDPROTOCOLIDENTIFER", length = 255) + public String getForwardProtocolIdentifer() { + return forwardProtocolIdentifer; + } + + /** + * Sets the value of the forwardProtocolIdentifer property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setForwardProtocolIdentifer(String value) { + this.forwardProtocolIdentifer = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof InterfederationGatewayType)) { + return false; + } + if (this == object) { + return true; + } + final InterfederationGatewayType that = ((InterfederationGatewayType) object); + { + String lhsForwardIDPIdentifier; + lhsForwardIDPIdentifier = this.getForwardIDPIdentifier(); + String rhsForwardIDPIdentifier; + rhsForwardIDPIdentifier = that.getForwardIDPIdentifier(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "forwardIDPIdentifier", lhsForwardIDPIdentifier), LocatorUtils.property(thatLocator, "forwardIDPIdentifier", rhsForwardIDPIdentifier), lhsForwardIDPIdentifier, rhsForwardIDPIdentifier)) { + return false; + } + } + { + String lhsForwardProtocolIdentifer; + lhsForwardProtocolIdentifer = this.getForwardProtocolIdentifer(); + String rhsForwardProtocolIdentifer; + rhsForwardProtocolIdentifer = that.getForwardProtocolIdentifer(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "forwardProtocolIdentifer", lhsForwardProtocolIdentifer), LocatorUtils.property(thatLocator, "forwardProtocolIdentifer", rhsForwardProtocolIdentifer), lhsForwardProtocolIdentifer, rhsForwardProtocolIdentifer)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theForwardIDPIdentifier; + theForwardIDPIdentifier = this.getForwardIDPIdentifier(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "forwardIDPIdentifier", theForwardIDPIdentifier), currentHashCode, theForwardIDPIdentifier); + } + { + String theForwardProtocolIdentifer; + theForwardProtocolIdentifer = this.getForwardProtocolIdentifer(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "forwardProtocolIdentifer", theForwardProtocolIdentifer), currentHashCode, theForwardProtocolIdentifer); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java new file mode 100644 index 000000000..282360082 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java @@ -0,0 +1,402 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for InterfederationIDPType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="InterfederationIDPType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="attributeQueryURL" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="storeSSOSession" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="performPassivRequest" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="performLocalAuthenticationOnError" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *       <attribute name="inboundSSO" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *       <attribute name="outboundSSO" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "InterfederationIDPType", propOrder = { + "attributeQueryURL", + "storeSSOSession", + "performPassivRequest", + "performLocalAuthenticationOnError" +}) +@Entity(name = "InterfederationIDPType") +@Table(name = "INTERFEDERATIONIDPTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class InterfederationIDPType + implements Serializable, Equals, HashCode +{ + + protected String attributeQueryURL; + @XmlElement(required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean storeSSOSession; + @XmlElement(required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean performPassivRequest; + @XmlElement(required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean performLocalAuthenticationOnError; + @XmlAttribute(name = "inboundSSO") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean inboundSSO; + @XmlAttribute(name = "outboundSSO") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean outboundSSO; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the attributeQueryURL property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ATTRIBUTEQUERYURL", length = 255) + public String getAttributeQueryURL() { + return attributeQueryURL; + } + + /** + * Sets the value of the attributeQueryURL property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAttributeQueryURL(String value) { + this.attributeQueryURL = value; + } + + /** + * Gets the value of the storeSSOSession property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "STORESSOSESSION") + public Boolean isStoreSSOSession() { + return storeSSOSession; + } + + /** + * Sets the value of the storeSSOSession property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStoreSSOSession(Boolean value) { + this.storeSSOSession = value; + } + + /** + * Gets the value of the performPassivRequest property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PERFORMPASSIVREQUEST") + public Boolean isPerformPassivRequest() { + return performPassivRequest; + } + + /** + * Sets the value of the performPassivRequest property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPerformPassivRequest(Boolean value) { + this.performPassivRequest = value; + } + + /** + * Gets the value of the performLocalAuthenticationOnError property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PERFORMLOCALAUTHENTICATIONON_0") + public Boolean isPerformLocalAuthenticationOnError() { + return performLocalAuthenticationOnError; + } + + /** + * Sets the value of the performLocalAuthenticationOnError property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPerformLocalAuthenticationOnError(Boolean value) { + this.performLocalAuthenticationOnError = value; + } + + /** + * Gets the value of the inboundSSO property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "INBOUNDSSO") + public boolean isInboundSSO() { + if (inboundSSO == null) { + return new ZeroOneBooleanAdapter().unmarshal("true"); + } else { + return inboundSSO; + } + } + + /** + * Sets the value of the inboundSSO property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInboundSSO(Boolean value) { + this.inboundSSO = value; + } + + /** + * Gets the value of the outboundSSO property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "OUTBOUNDSSO") + public boolean isOutboundSSO() { + if (outboundSSO == null) { + return new ZeroOneBooleanAdapter().unmarshal("true"); + } else { + return outboundSSO; + } + } + + /** + * Sets the value of the outboundSSO property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOutboundSSO(Boolean value) { + this.outboundSSO = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof InterfederationIDPType)) { + return false; + } + if (this == object) { + return true; + } + final InterfederationIDPType that = ((InterfederationIDPType) object); + { + String lhsAttributeQueryURL; + lhsAttributeQueryURL = this.getAttributeQueryURL(); + String rhsAttributeQueryURL; + rhsAttributeQueryURL = that.getAttributeQueryURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeQueryURL", lhsAttributeQueryURL), LocatorUtils.property(thatLocator, "attributeQueryURL", rhsAttributeQueryURL), lhsAttributeQueryURL, rhsAttributeQueryURL)) { + return false; + } + } + { + Boolean lhsStoreSSOSession; + lhsStoreSSOSession = this.isStoreSSOSession(); + Boolean rhsStoreSSOSession; + rhsStoreSSOSession = that.isStoreSSOSession(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "storeSSOSession", lhsStoreSSOSession), LocatorUtils.property(thatLocator, "storeSSOSession", rhsStoreSSOSession), lhsStoreSSOSession, rhsStoreSSOSession)) { + return false; + } + } + { + Boolean lhsPerformPassivRequest; + lhsPerformPassivRequest = this.isPerformPassivRequest(); + Boolean rhsPerformPassivRequest; + rhsPerformPassivRequest = that.isPerformPassivRequest(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "performPassivRequest", lhsPerformPassivRequest), LocatorUtils.property(thatLocator, "performPassivRequest", rhsPerformPassivRequest), lhsPerformPassivRequest, rhsPerformPassivRequest)) { + return false; + } + } + { + Boolean lhsPerformLocalAuthenticationOnError; + lhsPerformLocalAuthenticationOnError = this.isPerformLocalAuthenticationOnError(); + Boolean rhsPerformLocalAuthenticationOnError; + rhsPerformLocalAuthenticationOnError = that.isPerformLocalAuthenticationOnError(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "performLocalAuthenticationOnError", lhsPerformLocalAuthenticationOnError), LocatorUtils.property(thatLocator, "performLocalAuthenticationOnError", rhsPerformLocalAuthenticationOnError), lhsPerformLocalAuthenticationOnError, rhsPerformLocalAuthenticationOnError)) { + return false; + } + } + { + boolean lhsInboundSSO; + lhsInboundSSO = ((this.inboundSSO!= null)?this.isInboundSSO():false); + boolean rhsInboundSSO; + rhsInboundSSO = ((that.inboundSSO!= null)?that.isInboundSSO():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "inboundSSO", lhsInboundSSO), LocatorUtils.property(thatLocator, "inboundSSO", rhsInboundSSO), lhsInboundSSO, rhsInboundSSO)) { + return false; + } + } + { + boolean lhsOutboundSSO; + lhsOutboundSSO = ((this.outboundSSO!= null)?this.isOutboundSSO():false); + boolean rhsOutboundSSO; + rhsOutboundSSO = ((that.outboundSSO!= null)?that.isOutboundSSO():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "outboundSSO", lhsOutboundSSO), LocatorUtils.property(thatLocator, "outboundSSO", rhsOutboundSSO), lhsOutboundSSO, rhsOutboundSSO)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theAttributeQueryURL; + theAttributeQueryURL = this.getAttributeQueryURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeQueryURL", theAttributeQueryURL), currentHashCode, theAttributeQueryURL); + } + { + Boolean theStoreSSOSession; + theStoreSSOSession = this.isStoreSSOSession(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storeSSOSession", theStoreSSOSession), currentHashCode, theStoreSSOSession); + } + { + Boolean thePerformPassivRequest; + thePerformPassivRequest = this.isPerformPassivRequest(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "performPassivRequest", thePerformPassivRequest), currentHashCode, thePerformPassivRequest); + } + { + Boolean thePerformLocalAuthenticationOnError; + thePerformLocalAuthenticationOnError = this.isPerformLocalAuthenticationOnError(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "performLocalAuthenticationOnError", thePerformLocalAuthenticationOnError), currentHashCode, thePerformLocalAuthenticationOnError); + } + { + boolean theInboundSSO; + theInboundSSO = ((this.inboundSSO!= null)?this.isInboundSSO():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "inboundSSO", theInboundSSO), currentHashCode, theInboundSSO); + } + { + boolean theOutboundSSO; + theOutboundSSO = ((this.outboundSSO!= null)?this.isOutboundSSO():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "outboundSSO", theOutboundSSO), currentHashCode, theOutboundSSO); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java new file mode 100644 index 000000000..52c186536 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java @@ -0,0 +1,206 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
+ *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "value" +}) +@XmlRootElement(name = "KeyName") +@Entity(name = "KeyName") +@Table(name = "KEYNAME") +@Inheritance(strategy = InheritanceType.JOINED) +public class KeyName + implements Serializable, Equals, HashCode +{ + + @XmlValue + protected String value; + @XmlAttribute(name = "password") + protected String password; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PASSWORD_", length = 255) + public String getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPassword(String value) { + this.password = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof KeyName)) { + return false; + } + if (this == object) { + return true; + } + final KeyName that = ((KeyName) object); + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + { + String lhsPassword; + lhsPassword = this.getPassword(); + String rhsPassword; + rhsPassword = that.getPassword(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + { + String thePassword; + thePassword = this.getPassword(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java new file mode 100644 index 000000000..04701955d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java @@ -0,0 +1,208 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
+ *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "value" +}) +@XmlRootElement(name = "KeyStore") +@Entity(name = "KeyStore") +@Table(name = "KEYSTORE") +@Inheritance(strategy = InheritanceType.JOINED) +public class KeyStore + implements Serializable, Equals, HashCode +{ + + @XmlValue + @XmlSchemaType(name = "anyURI") + protected String value; + @XmlAttribute(name = "password") + protected String password; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VALUE_") + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PASSWORD_", length = 255) + public String getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPassword(String value) { + this.password = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof KeyStore)) { + return false; + } + if (this == object) { + return true; + } + final KeyStore that = ((KeyStore) object); + { + String lhsValue; + lhsValue = this.getValue(); + String rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + { + String lhsPassword; + lhsPassword = this.getPassword(); + String rhsPassword; + rhsPassword = that.getPassword(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + { + String thePassword; + thePassword = this.getPassword(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java new file mode 100644 index 000000000..dcb3d9059 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java @@ -0,0 +1,209 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ProtocolName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "protocolName" +}) +@Entity(name = "LegacyAllowed") +@Table(name = "LEGACYALLOWED") +@Inheritance(strategy = InheritanceType.JOINED) +public class LegacyAllowed + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "ProtocolName") + protected List protocolName; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List protocolNameItems; + + /** + * Gets the value of the protocolName property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the protocolName property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getProtocolName().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getProtocolName() { + if (protocolName == null) { + protocolName = new ArrayList(); + } + return this.protocolName; + } + + /** + * + * + */ + public void setProtocolName(List protocolName) { + this.protocolName = protocolName; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = LegacyAllowedProtocolNameItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PROTOCOLNAMEITEMS_LEGACYALLO_0") + public List getProtocolNameItems() { + if (this.protocolNameItems == null) { + this.protocolNameItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.protocolName)) { + this.protocolName = ItemUtils.wrap(this.protocolName, this.protocolNameItems, LegacyAllowedProtocolNameItem.class); + } + return this.protocolNameItems; + } + + public void setProtocolNameItems(List value) { + this.protocolName = null; + this.protocolNameItems = null; + this.protocolNameItems = value; + if (this.protocolNameItems == null) { + this.protocolNameItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.protocolName)) { + this.protocolName = ItemUtils.wrap(this.protocolName, this.protocolNameItems, LegacyAllowedProtocolNameItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof LegacyAllowed)) { + return false; + } + if (this == object) { + return true; + } + final LegacyAllowed that = ((LegacyAllowed) object); + { + List lhsProtocolName; + lhsProtocolName = (((this.protocolName!= null)&&(!this.protocolName.isEmpty()))?this.getProtocolName():null); + List rhsProtocolName; + rhsProtocolName = (((that.protocolName!= null)&&(!that.protocolName.isEmpty()))?that.getProtocolName():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "protocolName", lhsProtocolName), LocatorUtils.property(thatLocator, "protocolName", rhsProtocolName), lhsProtocolName, rhsProtocolName)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theProtocolName; + theProtocolName = (((this.protocolName!= null)&&(!this.protocolName.isEmpty()))?this.getProtocolName():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protocolName", theProtocolName), currentHashCode, theProtocolName); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java new file mode 100644 index 000000000..fe2fcd7fc --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "LegacyAllowedProtocolNameItem") +@Table(name = "LEGACYALLOWEDPROTOCOLNAMEITEM") +@Inheritance(strategy = InheritanceType.JOINED) +public class LegacyAllowedProtocolNameItem + implements Serializable, Item +{ + + @XmlElement(name = "ProtocolName", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java new file mode 100644 index 000000000..8dda6238c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for LoginType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="LoginType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="stateless"/>
+ *     <enumeration value="stateful"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "LoginType") +@XmlEnum +public enum LoginType { + + @XmlEnumValue("stateless") + STATELESS("stateless"), + @XmlEnumValue("stateful") + STATEFUL("stateful"); + private final String value; + + LoginType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static LoginType fromValue(String v) { + for (LoginType c: LoginType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java new file mode 100644 index 000000000..27631773d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java @@ -0,0 +1,82 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for MOAAuthDataType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="MOAAuthDataType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="MOAGivenName"/>
+ *     <enumeration value="MOAFamilyName"/>
+ *     <enumeration value="MOADateOfBirth"/>
+ *     <enumeration value="MOABPK"/>
+ *     <enumeration value="MOAWBPK"/>
+ *     <enumeration value="MOAPublicAuthority"/>
+ *     <enumeration value="MOABKZ"/>
+ *     <enumeration value="MOAQualifiedCertificate"/>
+ *     <enumeration value="MOAStammzahl"/>
+ *     <enumeration value="MOAIdentificationValueType"/>
+ *     <enumeration value="MOAIPAddress"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "MOAAuthDataType") +@XmlEnum +public enum MOAAuthDataType { + + @XmlEnumValue("MOAGivenName") + MOA_GIVEN_NAME("MOAGivenName"), + @XmlEnumValue("MOAFamilyName") + MOA_FAMILY_NAME("MOAFamilyName"), + @XmlEnumValue("MOADateOfBirth") + MOA_DATE_OF_BIRTH("MOADateOfBirth"), + MOABPK("MOABPK"), + MOAWBPK("MOAWBPK"), + @XmlEnumValue("MOAPublicAuthority") + MOA_PUBLIC_AUTHORITY("MOAPublicAuthority"), + MOABKZ("MOABKZ"), + @XmlEnumValue("MOAQualifiedCertificate") + MOA_QUALIFIED_CERTIFICATE("MOAQualifiedCertificate"), + @XmlEnumValue("MOAStammzahl") + MOA_STAMMZAHL("MOAStammzahl"), + @XmlEnumValue("MOAIdentificationValueType") + MOA_IDENTIFICATION_VALUE_TYPE("MOAIdentificationValueType"), + @XmlEnumValue("MOAIPAddress") + MOAIP_ADDRESS("MOAIPAddress"); + private final String value; + + MOAAuthDataType(String v) { + value = v; + } + + public String value() { + return value; + } + + public static MOAAuthDataType fromValue(String v) { + for (MOAAuthDataType c: MOAAuthDataType.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java new file mode 100644 index 000000000..5a23240a9 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java @@ -0,0 +1,664 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; +import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XMLGregorianCalendarAsDateTime; +import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XmlAdapterUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="AuthComponent_General" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}AuthComponentType">
+ *               </extension>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="OnlineApplication" type="{http://www.buergerkarte.at/namespaces/moaconfig#}OnlineApplication" maxOccurs="unbounded"/>
+ *         <element name="ChainingModes" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence maxOccurs="unbounded" minOccurs="0">
+ *                   <element name="TrustAnchor">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}X509IssuerSerialType">
+ *                           <attribute name="mode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" />
+ *                         </extension>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *                 <attribute name="systemDefaultMode" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" default="pkix" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="TrustedCACertificates" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
+ *         <element name="GenericConfiguration" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="name" use="required">
+ *                   <simpleType>
+ *                     <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *                       <enumeration value="DirectoryCertStoreParameters.RootDir"/>
+ *                       <enumeration value="AuthenticationSession.TimeOut"/>
+ *                       <enumeration value="AuthenticationData.TimeOut"/>
+ *                       <enumeration value="TrustManager.RevocationChecking"/>
+ *                       <enumeration value="FrontendServlets.EnableHTTPConnection"/>
+ *                       <enumeration value="FrontendServlets.DataURLPrefix"/>
+ *                       <enumeration value="AuthenticationServer.KeepAssertion"/>
+ *                       <enumeration value="AuthenticationServer.WriteAssertionToFile"/>
+ *                       <enumeration value="AuthenticationServer.SourceID"/>
+ *                     </restriction>
+ *                   </simpleType>
+ *                 </attribute>
+ *                 <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="DefaultBKUs">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
+ *                   <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="SLRequestTemplates">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+ *       <attribute name="pvp2refresh" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "authComponentGeneral", + "onlineApplication", + "chainingModes", + "trustedCACertificates", + "genericConfiguration", + "defaultBKUs", + "slRequestTemplates" +}) +@XmlRootElement(name = "MOA-IDConfiguration") +@Entity(name = "MOAIDConfiguration") +@Table(name = "MOAIDCONFIGURATION") +@Inheritance(strategy = InheritanceType.JOINED) +public class MOAIDConfiguration + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "AuthComponent_General") + protected AuthComponentGeneral authComponentGeneral; + @XmlElement(name = "OnlineApplication", required = true) + protected List onlineApplication; + @XmlElement(name = "ChainingModes") + protected ChainingModes chainingModes; + @XmlElement(name = "TrustedCACertificates") + @XmlSchemaType(name = "anyURI") + protected String trustedCACertificates; + @XmlElement(name = "GenericConfiguration") + protected List genericConfiguration; + @XmlElement(name = "DefaultBKUs", required = true) + protected DefaultBKUs defaultBKUs; + @XmlElement(name = "SLRequestTemplates", required = true) + protected SLRequestTemplates slRequestTemplates; + @XmlAttribute(name = "timestamp") + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar timestamp; + @XmlAttribute(name = "pvp2refresh") + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar pvp2Refresh; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the authComponentGeneral property. + * + * @return + * possible object is + * {@link AuthComponentGeneral } + * + */ + @ManyToOne(targetEntity = AuthComponentGeneral.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "AUTHCOMPONENTGENERAL_MOAIDCO_0") + public AuthComponentGeneral getAuthComponentGeneral() { + return authComponentGeneral; + } + + /** + * Sets the value of the authComponentGeneral property. + * + * @param value + * allowed object is + * {@link AuthComponentGeneral } + * + */ + public void setAuthComponentGeneral(AuthComponentGeneral value) { + this.authComponentGeneral = value; + } + + /** + * Gets the value of the onlineApplication property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the onlineApplication property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getOnlineApplication().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link OnlineApplication } + * + * + */ + @OneToMany(targetEntity = OnlineApplication.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ONLINEAPPLICATION_MOAIDCONFI_0") + public List getOnlineApplication() { + if (onlineApplication == null) { + onlineApplication = new ArrayList(); + } + return this.onlineApplication; + } + + /** + * + * + */ + public void setOnlineApplication(List onlineApplication) { + this.onlineApplication = onlineApplication; + } + + /** + * Gets the value of the chainingModes property. + * + * @return + * possible object is + * {@link ChainingModes } + * + */ + @ManyToOne(targetEntity = ChainingModes.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CHAININGMODES_MOAIDCONFIGURA_0") + public ChainingModes getChainingModes() { + return chainingModes; + } + + /** + * Sets the value of the chainingModes property. + * + * @param value + * allowed object is + * {@link ChainingModes } + * + */ + public void setChainingModes(ChainingModes value) { + this.chainingModes = value; + } + + /** + * Gets the value of the trustedCACertificates property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TRUSTEDCACERTIFICATES") + public String getTrustedCACertificates() { + return trustedCACertificates; + } + + /** + * Sets the value of the trustedCACertificates property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrustedCACertificates(String value) { + this.trustedCACertificates = value; + } + + /** + * Gets the value of the genericConfiguration property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the genericConfiguration property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getGenericConfiguration().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link GenericConfiguration } + * + * + */ + @OneToMany(targetEntity = GenericConfiguration.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "GENERICCONFIGURATION_MOAIDCO_0") + public List getGenericConfiguration() { + if (genericConfiguration == null) { + genericConfiguration = new ArrayList(); + } + return this.genericConfiguration; + } + + /** + * + * + */ + public void setGenericConfiguration(List genericConfiguration) { + this.genericConfiguration = genericConfiguration; + } + + /** + * Gets the value of the defaultBKUs property. + * + * @return + * possible object is + * {@link DefaultBKUs } + * + */ + @ManyToOne(targetEntity = DefaultBKUs.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "DEFAULTBKUS_MOAIDCONFIGURATI_0") + public DefaultBKUs getDefaultBKUs() { + return defaultBKUs; + } + + /** + * Sets the value of the defaultBKUs property. + * + * @param value + * allowed object is + * {@link DefaultBKUs } + * + */ + public void setDefaultBKUs(DefaultBKUs value) { + this.defaultBKUs = value; + } + + /** + * Gets the value of the slRequestTemplates property. + * + * @return + * possible object is + * {@link SLRequestTemplates } + * + */ + @ManyToOne(targetEntity = SLRequestTemplates.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SLREQUESTTEMPLATES_MOAIDCONF_0") + public SLRequestTemplates getSLRequestTemplates() { + return slRequestTemplates; + } + + /** + * Sets the value of the slRequestTemplates property. + * + * @param value + * allowed object is + * {@link SLRequestTemplates } + * + */ + public void setSLRequestTemplates(SLRequestTemplates value) { + this.slRequestTemplates = value; + } + + /** + * Gets the value of the timestamp property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + @Transient + public XMLGregorianCalendar getTimestamp() { + return timestamp; + } + + /** + * Sets the value of the timestamp property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setTimestamp(XMLGregorianCalendar value) { + this.timestamp = value; + } + + /** + * Gets the value of the pvp2Refresh property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + @Transient + public XMLGregorianCalendar getPvp2Refresh() { + return pvp2Refresh; + } + + /** + * Sets the value of the pvp2Refresh property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setPvp2Refresh(XMLGregorianCalendar value) { + this.pvp2Refresh = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @Basic + @Column(name = "TIMESTAMPITEM") + @Temporal(TemporalType.TIMESTAMP) + public Date getTimestampItem() { + return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getTimestamp()); + } + + public void setTimestampItem(Date target) { + setTimestamp(XmlAdapterUtils.marshall(XMLGregorianCalendarAsDateTime.class, target)); + } + + @Basic + @Column(name = "PVP2REFRESHITEM") + @Temporal(TemporalType.TIMESTAMP) + public Date getPvp2RefreshItem() { + return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getPvp2Refresh()); + } + + public void setPvp2RefreshItem(Date target) { + setPvp2Refresh(XmlAdapterUtils.marshall(XMLGregorianCalendarAsDateTime.class, target)); + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof MOAIDConfiguration)) { + return false; + } + if (this == object) { + return true; + } + final MOAIDConfiguration that = ((MOAIDConfiguration) object); + { + AuthComponentGeneral lhsAuthComponentGeneral; + lhsAuthComponentGeneral = this.getAuthComponentGeneral(); + AuthComponentGeneral rhsAuthComponentGeneral; + rhsAuthComponentGeneral = that.getAuthComponentGeneral(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "authComponentGeneral", lhsAuthComponentGeneral), LocatorUtils.property(thatLocator, "authComponentGeneral", rhsAuthComponentGeneral), lhsAuthComponentGeneral, rhsAuthComponentGeneral)) { + return false; + } + } + { + List lhsOnlineApplication; + lhsOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); + List rhsOnlineApplication; + rhsOnlineApplication = (((that.onlineApplication!= null)&&(!that.onlineApplication.isEmpty()))?that.getOnlineApplication():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineApplication", lhsOnlineApplication), LocatorUtils.property(thatLocator, "onlineApplication", rhsOnlineApplication), lhsOnlineApplication, rhsOnlineApplication)) { + return false; + } + } + { + ChainingModes lhsChainingModes; + lhsChainingModes = this.getChainingModes(); + ChainingModes rhsChainingModes; + rhsChainingModes = that.getChainingModes(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "chainingModes", lhsChainingModes), LocatorUtils.property(thatLocator, "chainingModes", rhsChainingModes), lhsChainingModes, rhsChainingModes)) { + return false; + } + } + { + String lhsTrustedCACertificates; + lhsTrustedCACertificates = this.getTrustedCACertificates(); + String rhsTrustedCACertificates; + rhsTrustedCACertificates = that.getTrustedCACertificates(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustedCACertificates", lhsTrustedCACertificates), LocatorUtils.property(thatLocator, "trustedCACertificates", rhsTrustedCACertificates), lhsTrustedCACertificates, rhsTrustedCACertificates)) { + return false; + } + } + { + List lhsGenericConfiguration; + lhsGenericConfiguration = (((this.genericConfiguration!= null)&&(!this.genericConfiguration.isEmpty()))?this.getGenericConfiguration():null); + List rhsGenericConfiguration; + rhsGenericConfiguration = (((that.genericConfiguration!= null)&&(!that.genericConfiguration.isEmpty()))?that.getGenericConfiguration():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "genericConfiguration", lhsGenericConfiguration), LocatorUtils.property(thatLocator, "genericConfiguration", rhsGenericConfiguration), lhsGenericConfiguration, rhsGenericConfiguration)) { + return false; + } + } + { + DefaultBKUs lhsDefaultBKUs; + lhsDefaultBKUs = this.getDefaultBKUs(); + DefaultBKUs rhsDefaultBKUs; + rhsDefaultBKUs = that.getDefaultBKUs(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "defaultBKUs", lhsDefaultBKUs), LocatorUtils.property(thatLocator, "defaultBKUs", rhsDefaultBKUs), lhsDefaultBKUs, rhsDefaultBKUs)) { + return false; + } + } + { + SLRequestTemplates lhsSLRequestTemplates; + lhsSLRequestTemplates = this.getSLRequestTemplates(); + SLRequestTemplates rhsSLRequestTemplates; + rhsSLRequestTemplates = that.getSLRequestTemplates(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "slRequestTemplates", lhsSLRequestTemplates), LocatorUtils.property(thatLocator, "slRequestTemplates", rhsSLRequestTemplates), lhsSLRequestTemplates, rhsSLRequestTemplates)) { + return false; + } + } + { + XMLGregorianCalendar lhsTimestamp; + lhsTimestamp = this.getTimestamp(); + XMLGregorianCalendar rhsTimestamp; + rhsTimestamp = that.getTimestamp(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "timestamp", lhsTimestamp), LocatorUtils.property(thatLocator, "timestamp", rhsTimestamp), lhsTimestamp, rhsTimestamp)) { + return false; + } + } + { + XMLGregorianCalendar lhsPvp2Refresh; + lhsPvp2Refresh = this.getPvp2Refresh(); + XMLGregorianCalendar rhsPvp2Refresh; + rhsPvp2Refresh = that.getPvp2Refresh(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "pvp2Refresh", lhsPvp2Refresh), LocatorUtils.property(thatLocator, "pvp2Refresh", rhsPvp2Refresh), lhsPvp2Refresh, rhsPvp2Refresh)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + AuthComponentGeneral theAuthComponentGeneral; + theAuthComponentGeneral = this.getAuthComponentGeneral(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "authComponentGeneral", theAuthComponentGeneral), currentHashCode, theAuthComponentGeneral); + } + { + List theOnlineApplication; + theOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineApplication", theOnlineApplication), currentHashCode, theOnlineApplication); + } + { + ChainingModes theChainingModes; + theChainingModes = this.getChainingModes(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "chainingModes", theChainingModes), currentHashCode, theChainingModes); + } + { + String theTrustedCACertificates; + theTrustedCACertificates = this.getTrustedCACertificates(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustedCACertificates", theTrustedCACertificates), currentHashCode, theTrustedCACertificates); + } + { + List theGenericConfiguration; + theGenericConfiguration = (((this.genericConfiguration!= null)&&(!this.genericConfiguration.isEmpty()))?this.getGenericConfiguration():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "genericConfiguration", theGenericConfiguration), currentHashCode, theGenericConfiguration); + } + { + DefaultBKUs theDefaultBKUs; + theDefaultBKUs = this.getDefaultBKUs(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "defaultBKUs", theDefaultBKUs), currentHashCode, theDefaultBKUs); + } + { + SLRequestTemplates theSLRequestTemplates; + theSLRequestTemplates = this.getSLRequestTemplates(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "slRequestTemplates", theSLRequestTemplates), currentHashCode, theSLRequestTemplates); + } + { + XMLGregorianCalendar theTimestamp; + theTimestamp = this.getTimestamp(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timestamp", theTimestamp), currentHashCode, theTimestamp); + } + { + XMLGregorianCalendar thePvp2Refresh; + thePvp2Refresh = this.getPvp2Refresh(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "pvp2Refresh", thePvp2Refresh), currentHashCode, thePvp2Refresh); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java new file mode 100644 index 000000000..f418ef719 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java @@ -0,0 +1,58 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for MOAKeyBoxSelector. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="MOAKeyBoxSelector">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="SecureSignatureKeypair"/>
+ *     <enumeration value="CertifiedKeypair"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "MOAKeyBoxSelector") +@XmlEnum +public enum MOAKeyBoxSelector { + + @XmlEnumValue("SecureSignatureKeypair") + SECURE_SIGNATURE_KEYPAIR("SecureSignatureKeypair"), + @XmlEnumValue("CertifiedKeypair") + CERTIFIED_KEYPAIR("CertifiedKeypair"); + private final String value; + + MOAKeyBoxSelector(String v) { + value = v; + } + + public String value() { + return value; + } + + public static MOAKeyBoxSelector fromValue(String v) { + for (MOAKeyBoxSelector c: MOAKeyBoxSelector.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java new file mode 100644 index 000000000..d93b38a26 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java @@ -0,0 +1,281 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
+ *         <element name="VerifyIdentityLink">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="VerifyAuthBlock">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *                   <element name="VerifyTransformsInfoProfileID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "connectionParameter", + "verifyIdentityLink", + "verifyAuthBlock" +}) +@Entity(name = "MOASP") +@Table(name = "MOASP") +@Inheritance(strategy = InheritanceType.JOINED) +public class MOASP + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "ConnectionParameter") + protected ConnectionParameterClientAuthType connectionParameter; + @XmlElement(name = "VerifyIdentityLink", required = true) + protected VerifyIdentityLink verifyIdentityLink; + @XmlElement(name = "VerifyAuthBlock", required = true) + protected VerifyAuthBlock verifyAuthBlock; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the connectionParameter property. + * + * @return + * possible object is + * {@link ConnectionParameterClientAuthType } + * + */ + @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CONNECTIONPARAMETER_MOASP_HJ_0") + public ConnectionParameterClientAuthType getConnectionParameter() { + return connectionParameter; + } + + /** + * Sets the value of the connectionParameter property. + * + * @param value + * allowed object is + * {@link ConnectionParameterClientAuthType } + * + */ + public void setConnectionParameter(ConnectionParameterClientAuthType value) { + this.connectionParameter = value; + } + + /** + * Gets the value of the verifyIdentityLink property. + * + * @return + * possible object is + * {@link VerifyIdentityLink } + * + */ + @ManyToOne(targetEntity = VerifyIdentityLink.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "VERIFYIDENTITYLINK_MOASP_HJID") + public VerifyIdentityLink getVerifyIdentityLink() { + return verifyIdentityLink; + } + + /** + * Sets the value of the verifyIdentityLink property. + * + * @param value + * allowed object is + * {@link VerifyIdentityLink } + * + */ + public void setVerifyIdentityLink(VerifyIdentityLink value) { + this.verifyIdentityLink = value; + } + + /** + * Gets the value of the verifyAuthBlock property. + * + * @return + * possible object is + * {@link VerifyAuthBlock } + * + */ + @ManyToOne(targetEntity = VerifyAuthBlock.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "VERIFYAUTHBLOCK_MOASP_HJID") + public VerifyAuthBlock getVerifyAuthBlock() { + return verifyAuthBlock; + } + + /** + * Sets the value of the verifyAuthBlock property. + * + * @param value + * allowed object is + * {@link VerifyAuthBlock } + * + */ + public void setVerifyAuthBlock(VerifyAuthBlock value) { + this.verifyAuthBlock = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof MOASP)) { + return false; + } + if (this == object) { + return true; + } + final MOASP that = ((MOASP) object); + { + ConnectionParameterClientAuthType lhsConnectionParameter; + lhsConnectionParameter = this.getConnectionParameter(); + ConnectionParameterClientAuthType rhsConnectionParameter; + rhsConnectionParameter = that.getConnectionParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { + return false; + } + } + { + VerifyIdentityLink lhsVerifyIdentityLink; + lhsVerifyIdentityLink = this.getVerifyIdentityLink(); + VerifyIdentityLink rhsVerifyIdentityLink; + rhsVerifyIdentityLink = that.getVerifyIdentityLink(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "verifyIdentityLink", lhsVerifyIdentityLink), LocatorUtils.property(thatLocator, "verifyIdentityLink", rhsVerifyIdentityLink), lhsVerifyIdentityLink, rhsVerifyIdentityLink)) { + return false; + } + } + { + VerifyAuthBlock lhsVerifyAuthBlock; + lhsVerifyAuthBlock = this.getVerifyAuthBlock(); + VerifyAuthBlock rhsVerifyAuthBlock; + rhsVerifyAuthBlock = that.getVerifyAuthBlock(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "verifyAuthBlock", lhsVerifyAuthBlock), LocatorUtils.property(thatLocator, "verifyAuthBlock", rhsVerifyAuthBlock), lhsVerifyAuthBlock, rhsVerifyAuthBlock)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + ConnectionParameterClientAuthType theConnectionParameter; + theConnectionParameter = this.getConnectionParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); + } + { + VerifyIdentityLink theVerifyIdentityLink; + theVerifyIdentityLink = this.getVerifyIdentityLink(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "verifyIdentityLink", theVerifyIdentityLink), currentHashCode, theVerifyIdentityLink); + } + { + VerifyAuthBlock theVerifyAuthBlock; + theVerifyAuthBlock = this.getVerifyAuthBlock(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "verifyAuthBlock", theVerifyAuthBlock), currentHashCode, theVerifyAuthBlock); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java new file mode 100644 index 000000000..9c91d3c5c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java @@ -0,0 +1,254 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Profiles" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="ProfileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "profiles", + "profileName" +}) +@Entity(name = "Mandates") +@Table(name = "MANDATES") +@Inheritance(strategy = InheritanceType.JOINED) +public class Mandates + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Profiles", required = true) + protected String profiles; + @XmlElement(name = "ProfileName") + protected List profileName; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List profileNameItems; + + /** + * Gets the value of the profiles property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROFILES", length = 255) + public String getProfiles() { + return profiles; + } + + /** + * Sets the value of the profiles property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProfiles(String value) { + this.profiles = value; + } + + /** + * Gets the value of the profileName property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the profileName property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getProfileName().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getProfileName() { + if (profileName == null) { + profileName = new ArrayList(); + } + return this.profileName; + } + + /** + * + * + */ + public void setProfileName(List profileName) { + this.profileName = profileName; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = MandatesProfileNameItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PROFILENAMEITEMS_MANDATES_HJ_0") + public List getProfileNameItems() { + if (this.profileNameItems == null) { + this.profileNameItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.profileName)) { + this.profileName = ItemUtils.wrap(this.profileName, this.profileNameItems, MandatesProfileNameItem.class); + } + return this.profileNameItems; + } + + public void setProfileNameItems(List value) { + this.profileName = null; + this.profileNameItems = null; + this.profileNameItems = value; + if (this.profileNameItems == null) { + this.profileNameItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.profileName)) { + this.profileName = ItemUtils.wrap(this.profileName, this.profileNameItems, MandatesProfileNameItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Mandates)) { + return false; + } + if (this == object) { + return true; + } + final Mandates that = ((Mandates) object); + { + String lhsProfiles; + lhsProfiles = this.getProfiles(); + String rhsProfiles; + rhsProfiles = that.getProfiles(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "profiles", lhsProfiles), LocatorUtils.property(thatLocator, "profiles", rhsProfiles), lhsProfiles, rhsProfiles)) { + return false; + } + } + { + List lhsProfileName; + lhsProfileName = (((this.profileName!= null)&&(!this.profileName.isEmpty()))?this.getProfileName():null); + List rhsProfileName; + rhsProfileName = (((that.profileName!= null)&&(!that.profileName.isEmpty()))?that.getProfileName():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "profileName", lhsProfileName), LocatorUtils.property(thatLocator, "profileName", rhsProfileName), lhsProfileName, rhsProfileName)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theProfiles; + theProfiles = this.getProfiles(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "profiles", theProfiles), currentHashCode, theProfiles); + } + { + List theProfileName; + theProfileName = (((this.profileName!= null)&&(!this.profileName.isEmpty()))?this.getProfileName():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "profileName", theProfileName), currentHashCode, theProfileName); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java new file mode 100644 index 000000000..b9dc096aa --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "MandatesProfileNameItem") +@Table(name = "MANDATESPROFILENAMEITEM") +@Inheritance(strategy = InheritanceType.JOINED) +public class MandatesProfileNameItem + implements Serializable, Item +{ + + @XmlElement(name = "ProfileName", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java new file mode 100644 index 000000000..790cf660f --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java @@ -0,0 +1,254 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="oAuthClientId" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="oAuthClientSecret" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="oAuthRedirectUri" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "oAuthClientId", + "oAuthClientSecret", + "oAuthRedirectUri" +}) +@XmlRootElement(name = "OA_OAUTH20") +@Entity(name = "OAOAUTH20") +@Table(name = "OAOAUTH20") +@Inheritance(strategy = InheritanceType.JOINED) +public class OAOAUTH20 + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected String oAuthClientId; + @XmlElement(required = true) + protected String oAuthClientSecret; + @XmlElement(required = true) + protected String oAuthRedirectUri; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the oAuthClientId property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "OAUTHCLIENTID", length = 255) + public String getOAuthClientId() { + return oAuthClientId; + } + + /** + * Sets the value of the oAuthClientId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOAuthClientId(String value) { + this.oAuthClientId = value; + } + + /** + * Gets the value of the oAuthClientSecret property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "OAUTHCLIENTSECRET", length = 255) + public String getOAuthClientSecret() { + return oAuthClientSecret; + } + + /** + * Sets the value of the oAuthClientSecret property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOAuthClientSecret(String value) { + this.oAuthClientSecret = value; + } + + /** + * Gets the value of the oAuthRedirectUri property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "OAUTHREDIRECTURI", length = 255) + public String getOAuthRedirectUri() { + return oAuthRedirectUri; + } + + /** + * Sets the value of the oAuthRedirectUri property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOAuthRedirectUri(String value) { + this.oAuthRedirectUri = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OAOAUTH20)) { + return false; + } + if (this == object) { + return true; + } + final OAOAUTH20 that = ((OAOAUTH20) object); + { + String lhsOAuthClientId; + lhsOAuthClientId = this.getOAuthClientId(); + String rhsOAuthClientId; + rhsOAuthClientId = that.getOAuthClientId(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuthClientId", lhsOAuthClientId), LocatorUtils.property(thatLocator, "oAuthClientId", rhsOAuthClientId), lhsOAuthClientId, rhsOAuthClientId)) { + return false; + } + } + { + String lhsOAuthClientSecret; + lhsOAuthClientSecret = this.getOAuthClientSecret(); + String rhsOAuthClientSecret; + rhsOAuthClientSecret = that.getOAuthClientSecret(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuthClientSecret", lhsOAuthClientSecret), LocatorUtils.property(thatLocator, "oAuthClientSecret", rhsOAuthClientSecret), lhsOAuthClientSecret, rhsOAuthClientSecret)) { + return false; + } + } + { + String lhsOAuthRedirectUri; + lhsOAuthRedirectUri = this.getOAuthRedirectUri(); + String rhsOAuthRedirectUri; + rhsOAuthRedirectUri = that.getOAuthRedirectUri(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuthRedirectUri", lhsOAuthRedirectUri), LocatorUtils.property(thatLocator, "oAuthRedirectUri", rhsOAuthRedirectUri), lhsOAuthRedirectUri, rhsOAuthRedirectUri)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theOAuthClientId; + theOAuthClientId = this.getOAuthClientId(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuthClientId", theOAuthClientId), currentHashCode, theOAuthClientId); + } + { + String theOAuthClientSecret; + theOAuthClientSecret = this.getOAuthClientSecret(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuthClientSecret", theOAuthClientSecret), currentHashCode, theOAuthClientSecret); + } + { + String theOAuthRedirectUri; + theOAuthRedirectUri = this.getOAuthRedirectUri(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuthRedirectUri", theOAuthRedirectUri), currentHashCode, theOAuthRedirectUri); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java new file mode 100644 index 000000000..2183021dc --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java @@ -0,0 +1,274 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.Date; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Lob; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; +import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XMLGregorianCalendarAsDateTime; +import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XmlAdapterUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="metadataURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="certificate" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *         <element name="updateRequired" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "metadataURL", + "certificate", + "updateRequired" +}) +@XmlRootElement(name = "OA_PVP2") +@Entity(name = "OAPVP2") +@Table(name = "OAPVP2") +@Inheritance(strategy = InheritanceType.JOINED) +public class OAPVP2 + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + @XmlSchemaType(name = "anyURI") + protected String metadataURL; + @XmlElement(required = true) + protected byte[] certificate; + @XmlElement(required = true) + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar updateRequired; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the metadataURL property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "METADATAURL") + public String getMetadataURL() { + return metadataURL; + } + + /** + * Sets the value of the metadataURL property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMetadataURL(String value) { + this.metadataURL = value; + } + + /** + * Gets the value of the certificate property. + * + * @return + * possible object is + * byte[] + */ + @Basic + @Column(name = "CERTIFICATE") + @Lob + public byte[] getCertificate() { + return certificate; + } + + /** + * Sets the value of the certificate property. + * + * @param value + * allowed object is + * byte[] + */ + public void setCertificate(byte[] value) { + this.certificate = value; + } + + /** + * Gets the value of the updateRequired property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + @Transient + public XMLGregorianCalendar getUpdateRequired() { + return updateRequired; + } + + /** + * Sets the value of the updateRequired property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setUpdateRequired(XMLGregorianCalendar value) { + this.updateRequired = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @Basic + @Column(name = "UPDATEREQUIREDITEM") + @Temporal(TemporalType.TIMESTAMP) + public Date getUpdateRequiredItem() { + return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getUpdateRequired()); + } + + public void setUpdateRequiredItem(Date target) { + setUpdateRequired(XmlAdapterUtils.marshall(XMLGregorianCalendarAsDateTime.class, target)); + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OAPVP2)) { + return false; + } + if (this == object) { + return true; + } + final OAPVP2 that = ((OAPVP2) object); + { + String lhsMetadataURL; + lhsMetadataURL = this.getMetadataURL(); + String rhsMetadataURL; + rhsMetadataURL = that.getMetadataURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "metadataURL", lhsMetadataURL), LocatorUtils.property(thatLocator, "metadataURL", rhsMetadataURL), lhsMetadataURL, rhsMetadataURL)) { + return false; + } + } + { + byte[] lhsCertificate; + lhsCertificate = this.getCertificate(); + byte[] rhsCertificate; + rhsCertificate = that.getCertificate(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "certificate", lhsCertificate), LocatorUtils.property(thatLocator, "certificate", rhsCertificate), lhsCertificate, rhsCertificate)) { + return false; + } + } + { + XMLGregorianCalendar lhsUpdateRequired; + lhsUpdateRequired = this.getUpdateRequired(); + XMLGregorianCalendar rhsUpdateRequired; + rhsUpdateRequired = that.getUpdateRequired(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "updateRequired", lhsUpdateRequired), LocatorUtils.property(thatLocator, "updateRequired", rhsUpdateRequired), lhsUpdateRequired, rhsUpdateRequired)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theMetadataURL; + theMetadataURL = this.getMetadataURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "metadataURL", theMetadataURL), currentHashCode, theMetadataURL); + } + { + byte[] theCertificate; + theCertificate = this.getCertificate(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "certificate", theCertificate), currentHashCode, theCertificate); + } + { + XMLGregorianCalendar theUpdateRequired; + theUpdateRequired = this.getUpdateRequired(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "updateRequired", theUpdateRequired), currentHashCode, theUpdateRequired); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java new file mode 100644 index 000000000..b6fcbecbe --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java @@ -0,0 +1,580 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.math.BigInteger; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="provideStammzahl" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="provideAUTHBlock" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="provideIdentityLink" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="provideCertificate" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="provideFullMandatorData" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="useCondition" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="conditionLength" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
+ *         <element name="sourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="provideAllErrors" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "isActive", + "provideStammzahl", + "provideAUTHBlock", + "provideIdentityLink", + "provideCertificate", + "provideFullMandatorData", + "useCondition", + "conditionLength", + "sourceID", + "provideAllErrors" +}) +@XmlRootElement(name = "OA_SAML1") +@Entity(name = "OASAML1") +@Table(name = "OASAML1") +@Inheritance(strategy = InheritanceType.JOINED) +public class OASAML1 + implements Serializable, Equals, HashCode +{ + + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isActive; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean provideStammzahl; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean provideAUTHBlock; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean provideIdentityLink; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean provideCertificate; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean provideFullMandatorData; + @XmlElement(type = String.class) + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean useCondition; + protected BigInteger conditionLength; + protected String sourceID; + @XmlElement(type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean provideAllErrors; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISACTIVE") + public Boolean isIsActive() { + return isActive; + } + + /** + * Sets the value of the isActive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsActive(Boolean value) { + this.isActive = value; + } + + /** + * Gets the value of the provideStammzahl property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROVIDESTAMMZAHL") + public Boolean isProvideStammzahl() { + return provideStammzahl; + } + + /** + * Sets the value of the provideStammzahl property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProvideStammzahl(Boolean value) { + this.provideStammzahl = value; + } + + /** + * Gets the value of the provideAUTHBlock property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROVIDEAUTHBLOCK") + public Boolean isProvideAUTHBlock() { + return provideAUTHBlock; + } + + /** + * Sets the value of the provideAUTHBlock property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProvideAUTHBlock(Boolean value) { + this.provideAUTHBlock = value; + } + + /** + * Gets the value of the provideIdentityLink property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROVIDEIDENTITYLINK") + public Boolean isProvideIdentityLink() { + return provideIdentityLink; + } + + /** + * Sets the value of the provideIdentityLink property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProvideIdentityLink(Boolean value) { + this.provideIdentityLink = value; + } + + /** + * Gets the value of the provideCertificate property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROVIDECERTIFICATE") + public Boolean isProvideCertificate() { + return provideCertificate; + } + + /** + * Sets the value of the provideCertificate property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProvideCertificate(Boolean value) { + this.provideCertificate = value; + } + + /** + * Gets the value of the provideFullMandatorData property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROVIDEFULLMANDATORDATA") + public Boolean isProvideFullMandatorData() { + return provideFullMandatorData; + } + + /** + * Sets the value of the provideFullMandatorData property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProvideFullMandatorData(Boolean value) { + this.provideFullMandatorData = value; + } + + /** + * Gets the value of the useCondition property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "USECONDITION") + public Boolean isUseCondition() { + return useCondition; + } + + /** + * Sets the value of the useCondition property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUseCondition(Boolean value) { + this.useCondition = value; + } + + /** + * Gets the value of the conditionLength property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + @Basic + @Column(name = "CONDITIONLENGTH", precision = 20, scale = 0) + public BigInteger getConditionLength() { + return conditionLength; + } + + /** + * Sets the value of the conditionLength property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setConditionLength(BigInteger value) { + this.conditionLength = value; + } + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SOURCEID", length = 255) + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = value; + } + + /** + * Gets the value of the provideAllErrors property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PROVIDEALLERRORS") + public Boolean isProvideAllErrors() { + return provideAllErrors; + } + + /** + * Sets the value of the provideAllErrors property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProvideAllErrors(Boolean value) { + this.provideAllErrors = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OASAML1)) { + return false; + } + if (this == object) { + return true; + } + final OASAML1 that = ((OASAML1) object); + { + Boolean lhsIsActive; + lhsIsActive = this.isIsActive(); + Boolean rhsIsActive; + rhsIsActive = that.isIsActive(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { + return false; + } + } + { + Boolean lhsProvideStammzahl; + lhsProvideStammzahl = this.isProvideStammzahl(); + Boolean rhsProvideStammzahl; + rhsProvideStammzahl = that.isProvideStammzahl(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "provideStammzahl", lhsProvideStammzahl), LocatorUtils.property(thatLocator, "provideStammzahl", rhsProvideStammzahl), lhsProvideStammzahl, rhsProvideStammzahl)) { + return false; + } + } + { + Boolean lhsProvideAUTHBlock; + lhsProvideAUTHBlock = this.isProvideAUTHBlock(); + Boolean rhsProvideAUTHBlock; + rhsProvideAUTHBlock = that.isProvideAUTHBlock(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "provideAUTHBlock", lhsProvideAUTHBlock), LocatorUtils.property(thatLocator, "provideAUTHBlock", rhsProvideAUTHBlock), lhsProvideAUTHBlock, rhsProvideAUTHBlock)) { + return false; + } + } + { + Boolean lhsProvideIdentityLink; + lhsProvideIdentityLink = this.isProvideIdentityLink(); + Boolean rhsProvideIdentityLink; + rhsProvideIdentityLink = that.isProvideIdentityLink(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "provideIdentityLink", lhsProvideIdentityLink), LocatorUtils.property(thatLocator, "provideIdentityLink", rhsProvideIdentityLink), lhsProvideIdentityLink, rhsProvideIdentityLink)) { + return false; + } + } + { + Boolean lhsProvideCertificate; + lhsProvideCertificate = this.isProvideCertificate(); + Boolean rhsProvideCertificate; + rhsProvideCertificate = that.isProvideCertificate(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "provideCertificate", lhsProvideCertificate), LocatorUtils.property(thatLocator, "provideCertificate", rhsProvideCertificate), lhsProvideCertificate, rhsProvideCertificate)) { + return false; + } + } + { + Boolean lhsProvideFullMandatorData; + lhsProvideFullMandatorData = this.isProvideFullMandatorData(); + Boolean rhsProvideFullMandatorData; + rhsProvideFullMandatorData = that.isProvideFullMandatorData(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "provideFullMandatorData", lhsProvideFullMandatorData), LocatorUtils.property(thatLocator, "provideFullMandatorData", rhsProvideFullMandatorData), lhsProvideFullMandatorData, rhsProvideFullMandatorData)) { + return false; + } + } + { + Boolean lhsUseCondition; + lhsUseCondition = this.isUseCondition(); + Boolean rhsUseCondition; + rhsUseCondition = that.isUseCondition(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "useCondition", lhsUseCondition), LocatorUtils.property(thatLocator, "useCondition", rhsUseCondition), lhsUseCondition, rhsUseCondition)) { + return false; + } + } + { + BigInteger lhsConditionLength; + lhsConditionLength = this.getConditionLength(); + BigInteger rhsConditionLength; + rhsConditionLength = that.getConditionLength(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "conditionLength", lhsConditionLength), LocatorUtils.property(thatLocator, "conditionLength", rhsConditionLength), lhsConditionLength, rhsConditionLength)) { + return false; + } + } + { + String lhsSourceID; + lhsSourceID = this.getSourceID(); + String rhsSourceID; + rhsSourceID = that.getSourceID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceID", lhsSourceID), LocatorUtils.property(thatLocator, "sourceID", rhsSourceID), lhsSourceID, rhsSourceID)) { + return false; + } + } + { + Boolean lhsProvideAllErrors; + lhsProvideAllErrors = this.isProvideAllErrors(); + Boolean rhsProvideAllErrors; + rhsProvideAllErrors = that.isProvideAllErrors(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "provideAllErrors", lhsProvideAllErrors), LocatorUtils.property(thatLocator, "provideAllErrors", rhsProvideAllErrors), lhsProvideAllErrors, rhsProvideAllErrors)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + Boolean theIsActive; + theIsActive = this.isIsActive(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); + } + { + Boolean theProvideStammzahl; + theProvideStammzahl = this.isProvideStammzahl(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideStammzahl", theProvideStammzahl), currentHashCode, theProvideStammzahl); + } + { + Boolean theProvideAUTHBlock; + theProvideAUTHBlock = this.isProvideAUTHBlock(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideAUTHBlock", theProvideAUTHBlock), currentHashCode, theProvideAUTHBlock); + } + { + Boolean theProvideIdentityLink; + theProvideIdentityLink = this.isProvideIdentityLink(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideIdentityLink", theProvideIdentityLink), currentHashCode, theProvideIdentityLink); + } + { + Boolean theProvideCertificate; + theProvideCertificate = this.isProvideCertificate(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideCertificate", theProvideCertificate), currentHashCode, theProvideCertificate); + } + { + Boolean theProvideFullMandatorData; + theProvideFullMandatorData = this.isProvideFullMandatorData(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideFullMandatorData", theProvideFullMandatorData), currentHashCode, theProvideFullMandatorData); + } + { + Boolean theUseCondition; + theUseCondition = this.isUseCondition(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "useCondition", theUseCondition), currentHashCode, theUseCondition); + } + { + BigInteger theConditionLength; + theConditionLength = this.getConditionLength(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "conditionLength", theConditionLength), currentHashCode, theConditionLength); + } + { + String theSourceID; + theSourceID = this.getSourceID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceID", theSourceID), currentHashCode, theSourceID); + } + { + Boolean theProvideAllErrors; + theProvideAllErrors = this.isProvideAllErrors(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideAllErrors", theProvideAllErrors), currentHashCode, theProvideAllErrors); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java new file mode 100644 index 000000000..a41c3ac0f --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java @@ -0,0 +1,260 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="UseSSO" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="AuthDataFrame" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="SingleLogOutURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "useSSO", + "authDataFrame", + "singleLogOutURL" +}) +@Entity(name = "OASSO") +@Table(name = "OASSO") +@Inheritance(strategy = InheritanceType.JOINED) +public class OASSO + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "UseSSO", required = true, type = String.class) + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean useSSO; + @XmlElement(name = "AuthDataFrame", required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean authDataFrame; + @XmlElement(name = "SingleLogOutURL", required = true) + @XmlSchemaType(name = "anyURI") + protected String singleLogOutURL; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the useSSO property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "USESSO") + public Boolean isUseSSO() { + return useSSO; + } + + /** + * Sets the value of the useSSO property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUseSSO(Boolean value) { + this.useSSO = value; + } + + /** + * Gets the value of the authDataFrame property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "AUTHDATAFRAME") + public Boolean isAuthDataFrame() { + return authDataFrame; + } + + /** + * Sets the value of the authDataFrame property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAuthDataFrame(Boolean value) { + this.authDataFrame = value; + } + + /** + * Gets the value of the singleLogOutURL property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SINGLELOGOUTURL") + public String getSingleLogOutURL() { + return singleLogOutURL; + } + + /** + * Sets the value of the singleLogOutURL property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSingleLogOutURL(String value) { + this.singleLogOutURL = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OASSO)) { + return false; + } + if (this == object) { + return true; + } + final OASSO that = ((OASSO) object); + { + Boolean lhsUseSSO; + lhsUseSSO = this.isUseSSO(); + Boolean rhsUseSSO; + rhsUseSSO = that.isUseSSO(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "useSSO", lhsUseSSO), LocatorUtils.property(thatLocator, "useSSO", rhsUseSSO), lhsUseSSO, rhsUseSSO)) { + return false; + } + } + { + Boolean lhsAuthDataFrame; + lhsAuthDataFrame = this.isAuthDataFrame(); + Boolean rhsAuthDataFrame; + rhsAuthDataFrame = that.isAuthDataFrame(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "authDataFrame", lhsAuthDataFrame), LocatorUtils.property(thatLocator, "authDataFrame", rhsAuthDataFrame), lhsAuthDataFrame, rhsAuthDataFrame)) { + return false; + } + } + { + String lhsSingleLogOutURL; + lhsSingleLogOutURL = this.getSingleLogOutURL(); + String rhsSingleLogOutURL; + rhsSingleLogOutURL = that.getSingleLogOutURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "singleLogOutURL", lhsSingleLogOutURL), LocatorUtils.property(thatLocator, "singleLogOutURL", rhsSingleLogOutURL), lhsSingleLogOutURL, rhsSingleLogOutURL)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + Boolean theUseSSO; + theUseSSO = this.isUseSSO(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "useSSO", theUseSSO), currentHashCode, theUseSSO); + } + { + Boolean theAuthDataFrame; + theAuthDataFrame = this.isAuthDataFrame(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "authDataFrame", theAuthDataFrame), currentHashCode, theAuthDataFrame); + } + { + String theSingleLogOutURL; + theSingleLogOutURL = this.getSingleLogOutURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "singleLogOutURL", theSingleLogOutURL), currentHashCode, theSingleLogOutURL); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java new file mode 100644 index 000000000..9d4f5d699 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java @@ -0,0 +1,495 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="StorkLogonEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Qaa" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OAAttributes" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="VidpEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}AttributeProviders" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="requireConsent" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}C-PEPS" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "storkLogonEnabled", + "qaa", + "oaAttributes", + "vidpEnabled", + "attributeProviders", + "requireConsent", + "cpeps" +}) +@XmlRootElement(name = "OA_STORK") +@Entity(name = "OASTORK") +@Table(name = "OASTORK") +@Inheritance(strategy = InheritanceType.JOINED) +public class OASTORK + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "StorkLogonEnabled", required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean storkLogonEnabled; + @XmlElement(name = "Qaa") + protected Integer qaa; + @XmlElement(name = "OAAttributes") + protected List oaAttributes; + @XmlElement(name = "VidpEnabled", required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean vidpEnabled; + @XmlElement(name = "AttributeProviders") + protected List attributeProviders; + @XmlElement(required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean requireConsent; + @XmlElement(name = "C-PEPS", required = true) + protected List cpeps; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the storkLogonEnabled property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "STORKLOGONENABLED") + public Boolean isStorkLogonEnabled() { + return storkLogonEnabled; + } + + /** + * Sets the value of the storkLogonEnabled property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStorkLogonEnabled(Boolean value) { + this.storkLogonEnabled = value; + } + + /** + * Gets the value of the qaa property. + * + * @return + * possible object is + * {@link Integer } + * + */ + @Basic + @Column(name = "QAA", precision = 20, scale = 0) + public Integer getQaa() { + return qaa; + } + + /** + * Sets the value of the qaa property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setQaa(Integer value) { + this.qaa = value; + } + + /** + * Gets the value of the oaAttributes property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the oaAttributes property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getOAAttributes().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link OAStorkAttribute } + * + * + */ + @OneToMany(targetEntity = OAStorkAttribute.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OAATTRIBUTES_OASTORK_HJID") + public List getOAAttributes() { + if (oaAttributes == null) { + oaAttributes = new ArrayList(); + } + return this.oaAttributes; + } + + /** + * + * + */ + public void setOAAttributes(List oaAttributes) { + this.oaAttributes = oaAttributes; + } + + /** + * Gets the value of the vidpEnabled property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "VIDPENABLED") + public Boolean isVidpEnabled() { + return vidpEnabled; + } + + /** + * Sets the value of the vidpEnabled property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVidpEnabled(Boolean value) { + this.vidpEnabled = value; + } + + /** + * Gets the value of the attributeProviders property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributeProviders property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributeProviders().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link AttributeProviderPlugin } + * + * + */ + @OneToMany(targetEntity = AttributeProviderPlugin.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ATTRIBUTEPROVIDERS_OASTORK_H_0") + public List getAttributeProviders() { + if (attributeProviders == null) { + attributeProviders = new ArrayList(); + } + return this.attributeProviders; + } + + /** + * + * + */ + public void setAttributeProviders(List attributeProviders) { + this.attributeProviders = attributeProviders; + } + + /** + * Gets the value of the requireConsent property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "REQUIRECONSENT") + public Boolean isRequireConsent() { + return requireConsent; + } + + /** + * Sets the value of the requireConsent property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRequireConsent(Boolean value) { + this.requireConsent = value; + } + + /** + * Gets the value of the cpeps property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the cpeps property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCPEPS().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CPEPS } + * + * + */ + @ManyToMany(targetEntity = CPEPS.class, cascade = { + CascadeType.ALL + }) + @JoinTable(name = "OASTORK_CPEPS_CPEPS", joinColumns = { + @JoinColumn(name = "PARENT_OASTORK_HJID") + }, inverseJoinColumns = { + @JoinColumn(name = "CHILD_CPEPS_HJID") + }) + public List getCPEPS() { + if (cpeps == null) { + cpeps = new ArrayList(); + } + return this.cpeps; + } + + /** + * + * + */ + public void setCPEPS(List cpeps) { + this.cpeps = cpeps; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OASTORK)) { + return false; + } + if (this == object) { + return true; + } + final OASTORK that = ((OASTORK) object); + { + Boolean lhsStorkLogonEnabled; + lhsStorkLogonEnabled = this.isStorkLogonEnabled(); + Boolean rhsStorkLogonEnabled; + rhsStorkLogonEnabled = that.isStorkLogonEnabled(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "storkLogonEnabled", lhsStorkLogonEnabled), LocatorUtils.property(thatLocator, "storkLogonEnabled", rhsStorkLogonEnabled), lhsStorkLogonEnabled, rhsStorkLogonEnabled)) { + return false; + } + } + { + Integer lhsQaa; + lhsQaa = this.getQaa(); + Integer rhsQaa; + rhsQaa = that.getQaa(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "qaa", lhsQaa), LocatorUtils.property(thatLocator, "qaa", rhsQaa), lhsQaa, rhsQaa)) { + return false; + } + } + { + List lhsOAAttributes; + lhsOAAttributes = (((this.oaAttributes!= null)&&(!this.oaAttributes.isEmpty()))?this.getOAAttributes():null); + List rhsOAAttributes; + rhsOAAttributes = (((that.oaAttributes!= null)&&(!that.oaAttributes.isEmpty()))?that.getOAAttributes():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oaAttributes", lhsOAAttributes), LocatorUtils.property(thatLocator, "oaAttributes", rhsOAAttributes), lhsOAAttributes, rhsOAAttributes)) { + return false; + } + } + { + Boolean lhsVidpEnabled; + lhsVidpEnabled = this.isVidpEnabled(); + Boolean rhsVidpEnabled; + rhsVidpEnabled = that.isVidpEnabled(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "vidpEnabled", lhsVidpEnabled), LocatorUtils.property(thatLocator, "vidpEnabled", rhsVidpEnabled), lhsVidpEnabled, rhsVidpEnabled)) { + return false; + } + } + { + List lhsAttributeProviders; + lhsAttributeProviders = (((this.attributeProviders!= null)&&(!this.attributeProviders.isEmpty()))?this.getAttributeProviders():null); + List rhsAttributeProviders; + rhsAttributeProviders = (((that.attributeProviders!= null)&&(!that.attributeProviders.isEmpty()))?that.getAttributeProviders():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeProviders", lhsAttributeProviders), LocatorUtils.property(thatLocator, "attributeProviders", rhsAttributeProviders), lhsAttributeProviders, rhsAttributeProviders)) { + return false; + } + } + { + Boolean lhsRequireConsent; + lhsRequireConsent = this.isRequireConsent(); + Boolean rhsRequireConsent; + rhsRequireConsent = that.isRequireConsent(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "requireConsent", lhsRequireConsent), LocatorUtils.property(thatLocator, "requireConsent", rhsRequireConsent), lhsRequireConsent, rhsRequireConsent)) { + return false; + } + } + { + List lhsCPEPS; + lhsCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); + List rhsCPEPS; + rhsCPEPS = (((that.cpeps!= null)&&(!that.cpeps.isEmpty()))?that.getCPEPS():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "cpeps", lhsCPEPS), LocatorUtils.property(thatLocator, "cpeps", rhsCPEPS), lhsCPEPS, rhsCPEPS)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + Boolean theStorkLogonEnabled; + theStorkLogonEnabled = this.isStorkLogonEnabled(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storkLogonEnabled", theStorkLogonEnabled), currentHashCode, theStorkLogonEnabled); + } + { + Integer theQaa; + theQaa = this.getQaa(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "qaa", theQaa), currentHashCode, theQaa); + } + { + List theOAAttributes; + theOAAttributes = (((this.oaAttributes!= null)&&(!this.oaAttributes.isEmpty()))?this.getOAAttributes():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oaAttributes", theOAAttributes), currentHashCode, theOAAttributes); + } + { + Boolean theVidpEnabled; + theVidpEnabled = this.isVidpEnabled(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "vidpEnabled", theVidpEnabled), currentHashCode, theVidpEnabled); + } + { + List theAttributeProviders; + theAttributeProviders = (((this.attributeProviders!= null)&&(!this.attributeProviders.isEmpty()))?this.getAttributeProviders():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeProviders", theAttributeProviders), currentHashCode, theAttributeProviders); + } + { + Boolean theRequireConsent; + theRequireConsent = this.isRequireConsent(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "requireConsent", theRequireConsent), currentHashCode, theRequireConsent); + } + { + List theCPEPS; + theCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "cpeps", theCPEPS), currentHashCode, theCPEPS); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java new file mode 100644 index 000000000..1226afdf9 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java @@ -0,0 +1,213 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for OAStorkAttribute complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="OAStorkAttribute">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="mandatory" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "OAStorkAttribute", propOrder = { + "mandatory", + "name" +}) +@Entity(name = "OAStorkAttribute") +@Table(name = "OASTORKATTRIBUTE") +@Inheritance(strategy = InheritanceType.JOINED) +public class OAStorkAttribute + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true, type = String.class) + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean mandatory; + @XmlElement(required = true) + protected String name; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the mandatory property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "MANDATORY") + public Boolean isMandatory() { + return mandatory; + } + + /** + * Sets the value of the mandatory property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMandatory(Boolean value) { + this.mandatory = value; + } + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_", length = 255) + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OAStorkAttribute)) { + return false; + } + if (this == object) { + return true; + } + final OAStorkAttribute that = ((OAStorkAttribute) object); + { + Boolean lhsMandatory; + lhsMandatory = this.isMandatory(); + Boolean rhsMandatory; + rhsMandatory = that.isMandatory(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mandatory", lhsMandatory), LocatorUtils.property(thatLocator, "mandatory", rhsMandatory), lhsMandatory, rhsMandatory)) { + return false; + } + } + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + Boolean theMandatory; + theMandatory = this.isMandatory(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandatory", theMandatory), currentHashCode, theMandatory); + } + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java new file mode 100644 index 000000000..b8f10ff52 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java @@ -0,0 +1,168 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@Entity(name = "OAuth") +@Table(name = "OAUTH") +@Inheritance(strategy = InheritanceType.JOINED) +public class OAuth + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "isActive") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isActive; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISACTIVE") + public boolean isIsActive() { + if (isActive == null) { + return new ZeroOneBooleanAdapter().unmarshal("true"); + } else { + return isActive; + } + } + + /** + * Sets the value of the isActive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsActive(Boolean value) { + this.isActive = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OAuth)) { + return false; + } + if (this == object) { + return true; + } + final OAuth that = ((OAuth) object); + { + boolean lhsIsActive; + lhsIsActive = ((this.isActive!= null)?this.isIsActive():false); + boolean rhsIsActive; + rhsIsActive = ((that.isActive!= null)?that.isIsActive():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + boolean theIsActive; + theIsActive = ((this.isActive!= null)?this.isIsActive():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java new file mode 100644 index 000000000..aec99bb3a --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java @@ -0,0 +1,757 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.namespace.QName; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the at.gv.egovernment.moa.id.commons.db.dao.config package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _EnableInfoboxValidator_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "EnableInfoboxValidator"); + private final static QName _AlwaysShowForm_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AlwaysShowForm"); + private final static QName _AbstractSimpleIdentification_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AbstractSimpleIdentification"); + private final static QName _QualityAuthenticationAssuranceLevel_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "QualityAuthenticationAssuranceLevel"); + private final static QName _Attributes_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "Attributes"); + private final static QName _AttributeProviders_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AttributeProviders"); + private final static QName _OAAttributes_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "OAAttributes"); + private final static QName _AttributeValue_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AttributeValue"); + private final static QName _CompatibilityMode_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "CompatibilityMode"); + private final static QName _TrustProfileID_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "TrustProfileID"); + private final static QName _Qaa_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "Qaa"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.gv.egovernment.moa.id.commons.db.dao.config + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link StorkAttribute } + * + */ + public StorkAttribute createStorkAttribute() { + return new StorkAttribute(); + } + + /** + * Create an instance of {@link CPEPS } + * + */ + public CPEPS createCPEPS() { + return new CPEPS(); + } + + /** + * Create an instance of {@link OASTORK } + * + */ + public OASTORK createOASTORK() { + return new OASTORK(); + } + + /** + * Create an instance of {@link OAStorkAttribute } + * + */ + public OAStorkAttribute createOAStorkAttribute() { + return new OAStorkAttribute(); + } + + /** + * Create an instance of {@link AttributeProviderPlugin } + * + */ + public AttributeProviderPlugin createAttributeProviderPlugin() { + return new AttributeProviderPlugin(); + } + + /** + * Create an instance of {@link OAPVP2 } + * + */ + public OAPVP2 createOAPVP2() { + return new OAPVP2(); + } + + /** + * Create an instance of {@link Header } + * + */ + public Header createHeader() { + return new Header(); + } + + /** + * Create an instance of {@link Parameter } + * + */ + public Parameter createParameter() { + return new Parameter(); + } + + /** + * Create an instance of {@link EncBPKInformation } + * + */ + public EncBPKInformation createEncBPKInformation() { + return new EncBPKInformation(); + } + + /** + * Create an instance of {@link BPKDecryption } + * + */ + public BPKDecryption createBPKDecryption() { + return new BPKDecryption(); + } + + /** + * Create an instance of {@link BPKEncryption } + * + */ + public BPKEncryption createBPKEncryption() { + return new BPKEncryption(); + } + + /** + * Create an instance of {@link MOAIDConfiguration } + * + */ + public MOAIDConfiguration createMOAIDConfiguration() { + return new MOAIDConfiguration(); + } + + /** + * Create an instance of {@link AuthComponentGeneral } + * + */ + public AuthComponentGeneral createAuthComponentGeneral() { + return new AuthComponentGeneral(); + } + + /** + * Create an instance of {@link OnlineApplication } + * + */ + public OnlineApplication createOnlineApplication() { + return new OnlineApplication(); + } + + /** + * Create an instance of {@link ChainingModes } + * + */ + public ChainingModes createChainingModes() { + return new ChainingModes(); + } + + /** + * Create an instance of {@link GenericConfiguration } + * + */ + public GenericConfiguration createGenericConfiguration() { + return new GenericConfiguration(); + } + + /** + * Create an instance of {@link DefaultBKUs } + * + */ + public DefaultBKUs createDefaultBKUs() { + return new DefaultBKUs(); + } + + /** + * Create an instance of {@link SLRequestTemplates } + * + */ + public SLRequestTemplates createSLRequestTemplates() { + return new SLRequestTemplates(); + } + + /** + * Create an instance of {@link GeneralConfiguration } + * + */ + public GeneralConfiguration createGeneralConfiguration() { + return new GeneralConfiguration(); + } + + /** + * Create an instance of {@link TimeOuts } + * + */ + public TimeOuts createTimeOuts() { + return new TimeOuts(); + } + + /** + * Create an instance of {@link Contact } + * + */ + public Contact createContact() { + return new Contact(); + } + + /** + * Create an instance of {@link ParamAuth } + * + */ + public ParamAuth createParamAuth() { + return new ParamAuth(); + } + + /** + * Create an instance of {@link Configuration } + * + */ + public Configuration createConfiguration() { + return new Configuration(); + } + + /** + * Create an instance of {@link BasicAuth } + * + */ + public BasicAuth createBasicAuth() { + return new BasicAuth(); + } + + /** + * Create an instance of {@link HeaderAuth } + * + */ + public HeaderAuth createHeaderAuth() { + return new HeaderAuth(); + } + + /** + * Create an instance of {@link OAOAUTH20 } + * + */ + public OAOAUTH20 createOAOAUTH20() { + return new OAOAUTH20(); + } + + /** + * Create an instance of {@link SAMLSigningParameter } + * + */ + public SAMLSigningParameter createSAMLSigningParameter() { + return new SAMLSigningParameter(); + } + + /** + * Create an instance of {@link SignatureCreationParameterType } + * + */ + public SignatureCreationParameterType createSignatureCreationParameterType() { + return new SignatureCreationParameterType(); + } + + /** + * Create an instance of {@link SignatureVerificationParameterType } + * + */ + public SignatureVerificationParameterType createSignatureVerificationParameterType() { + return new SignatureVerificationParameterType(); + } + + /** + * Create an instance of {@link OASAML1 } + * + */ + public OASAML1 createOASAML1() { + return new OASAML1(); + } + + /** + * Create an instance of {@link IdentificationNumber } + * + */ + public IdentificationNumber createIdentificationNumber() { + return new IdentificationNumber(); + } + + /** + * Create an instance of {@link KeyStore } + * + */ + public KeyStore createKeyStore() { + return new KeyStore(); + } + + /** + * Create an instance of {@link STORK } + * + */ + public STORK createSTORK() { + return new STORK(); + } + + /** + * Create an instance of {@link KeyName } + * + */ + public KeyName createKeyName() { + return new KeyName(); + } + + /** + * Create an instance of {@link X509IssuerSerialType } + * + */ + public X509IssuerSerialType createX509IssuerSerialType() { + return new X509IssuerSerialType(); + } + + /** + * Create an instance of {@link TemplateType } + * + */ + public TemplateType createTemplateType() { + return new TemplateType(); + } + + /** + * Create an instance of {@link ConnectionParameterClientAuthType } + * + */ + public ConnectionParameterClientAuthType createConnectionParameterClientAuthType() { + return new ConnectionParameterClientAuthType(); + } + + /** + * Create an instance of {@link BKUSelectionCustomizationType } + * + */ + public BKUSelectionCustomizationType createBKUSelectionCustomizationType() { + return new BKUSelectionCustomizationType(); + } + + /** + * Create an instance of {@link PartyRepresentativeType } + * + */ + public PartyRepresentativeType createPartyRepresentativeType() { + return new PartyRepresentativeType(); + } + + /** + * Create an instance of {@link AuthComponentType } + * + */ + public AuthComponentType createAuthComponentType() { + return new AuthComponentType(); + } + + /** + * Create an instance of {@link TemplatesType } + * + */ + public TemplatesType createTemplatesType() { + return new TemplatesType(); + } + + /** + * Create an instance of {@link OnlineApplicationType } + * + */ + public OnlineApplicationType createOnlineApplicationType() { + return new OnlineApplicationType(); + } + + /** + * Create an instance of {@link TransformsInfoType } + * + */ + public TransformsInfoType createTransformsInfoType() { + return new TransformsInfoType(); + } + + /** + * Create an instance of {@link InterfederationIDPType } + * + */ + public InterfederationIDPType createInterfederationIDPType() { + return new InterfederationIDPType(); + } + + /** + * Create an instance of {@link VerifyInfoboxesType } + * + */ + public VerifyInfoboxesType createVerifyInfoboxesType() { + return new VerifyInfoboxesType(); + } + + /** + * Create an instance of {@link AbstractSimpleIdentificationType } + * + */ + public AbstractSimpleIdentificationType createAbstractSimpleIdentificationType() { + return new AbstractSimpleIdentificationType(); + } + + /** + * Create an instance of {@link SchemaLocationType } + * + */ + public SchemaLocationType createSchemaLocationType() { + return new SchemaLocationType(); + } + + /** + * Create an instance of {@link ConnectionParameterServerAuthType } + * + */ + public ConnectionParameterServerAuthType createConnectionParameterServerAuthType() { + return new ConnectionParameterServerAuthType(); + } + + /** + * Create an instance of {@link PartyRepresentationType } + * + */ + public PartyRepresentationType createPartyRepresentationType() { + return new PartyRepresentationType(); + } + + /** + * Create an instance of {@link UserDatabase } + * + */ + public UserDatabase createUserDatabase() { + return new UserDatabase(); + } + + /** + * Create an instance of {@link InputProcessorType } + * + */ + public InputProcessorType createInputProcessorType() { + return new InputProcessorType(); + } + + /** + * Create an instance of {@link InterfederationGatewayType } + * + */ + public InterfederationGatewayType createInterfederationGatewayType() { + return new InterfederationGatewayType(); + } + + /** + * Create an instance of {@link Schema } + * + */ + public Schema createSchema() { + return new Schema(); + } + + /** + * Create an instance of {@link DefaultTrustProfile } + * + */ + public DefaultTrustProfile createDefaultTrustProfile() { + return new DefaultTrustProfile(); + } + + /** + * Create an instance of {@link AuthComponentOA } + * + */ + public AuthComponentOA createAuthComponentOA() { + return new AuthComponentOA(); + } + + /** + * Create an instance of {@link BKUURLS } + * + */ + public BKUURLS createBKUURLS() { + return new BKUURLS(); + } + + /** + * Create an instance of {@link Mandates } + * + */ + public Mandates createMandates() { + return new Mandates(); + } + + /** + * Create an instance of {@link TestCredentials } + * + */ + public TestCredentials createTestCredentials() { + return new TestCredentials(); + } + + /** + * Create an instance of {@link OASSO } + * + */ + public OASSO createOASSO() { + return new OASSO(); + } + + /** + * Create an instance of {@link Protocols } + * + */ + public Protocols createProtocols() { + return new Protocols(); + } + + /** + * Create an instance of {@link SSO } + * + */ + public SSO createSSO() { + return new SSO(); + } + + /** + * Create an instance of {@link SecurityLayer } + * + */ + public SecurityLayer createSecurityLayer() { + return new SecurityLayer(); + } + + /** + * Create an instance of {@link MOASP } + * + */ + public MOASP createMOASP() { + return new MOASP(); + } + + /** + * Create an instance of {@link IdentityLinkSigners } + * + */ + public IdentityLinkSigners createIdentityLinkSigners() { + return new IdentityLinkSigners(); + } + + /** + * Create an instance of {@link ForeignIdentities } + * + */ + public ForeignIdentities createForeignIdentities() { + return new ForeignIdentities(); + } + + /** + * Create an instance of {@link OnlineMandates } + * + */ + public OnlineMandates createOnlineMandates() { + return new OnlineMandates(); + } + + /** + * Create an instance of {@link VerifyIdentityLink } + * + */ + public VerifyIdentityLink createVerifyIdentityLink() { + return new VerifyIdentityLink(); + } + + /** + * Create an instance of {@link VerifyAuthBlock } + * + */ + public VerifyAuthBlock createVerifyAuthBlock() { + return new VerifyAuthBlock(); + } + + /** + * Create an instance of {@link SAML1 } + * + */ + public SAML1 createSAML1() { + return new SAML1(); + } + + /** + * Create an instance of {@link PVP2 } + * + */ + public PVP2 createPVP2() { + return new PVP2(); + } + + /** + * Create an instance of {@link OAuth } + * + */ + public OAuth createOAuth() { + return new OAuth(); + } + + /** + * Create an instance of {@link LegacyAllowed } + * + */ + public LegacyAllowed createLegacyAllowed() { + return new LegacyAllowed(); + } + + /** + * Create an instance of {@link Organization } + * + */ + public Organization createOrganization() { + return new Organization(); + } + + /** + * Create an instance of {@link ClientKeyStore } + * + */ + public ClientKeyStore createClientKeyStore() { + return new ClientKeyStore(); + } + + /** + * Create an instance of {@link TrustAnchor } + * + */ + public TrustAnchor createTrustAnchor() { + return new TrustAnchor(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "EnableInfoboxValidator", defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + public JAXBElement createEnableInfoboxValidator(Boolean value) { + return new JAXBElement(_EnableInfoboxValidator_QNAME, Boolean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AlwaysShowForm", defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + public JAXBElement createAlwaysShowForm(Boolean value) { + return new JAXBElement(_AlwaysShowForm_QNAME, Boolean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AttributeProviderPlugin }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AbstractSimpleIdentification") + public JAXBElement createAbstractSimpleIdentification(AttributeProviderPlugin value) { + return new JAXBElement(_AbstractSimpleIdentification_QNAME, AttributeProviderPlugin.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "QualityAuthenticationAssuranceLevel") + public JAXBElement createQualityAuthenticationAssuranceLevel(Integer value) { + return new JAXBElement(_QualityAuthenticationAssuranceLevel_QNAME, Integer.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link StorkAttribute }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "Attributes") + public JAXBElement createAttributes(StorkAttribute value) { + return new JAXBElement(_Attributes_QNAME, StorkAttribute.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AttributeProviderPlugin }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AttributeProviders") + public JAXBElement createAttributeProviders(AttributeProviderPlugin value) { + return new JAXBElement(_AttributeProviders_QNAME, AttributeProviderPlugin.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link OAStorkAttribute }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "OAAttributes") + public JAXBElement createOAAttributes(OAStorkAttribute value) { + return new JAXBElement(_OAAttributes_QNAME, OAStorkAttribute.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AttributeValue") + public JAXBElement createAttributeValue(Object value) { + return new JAXBElement(_AttributeValue_QNAME, Object.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "CompatibilityMode", defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + public JAXBElement createCompatibilityMode(Boolean value) { + return new JAXBElement(_CompatibilityMode_QNAME, Boolean.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "TrustProfileID") + public JAXBElement createTrustProfileID(String value) { + return new JAXBElement(_TrustProfileID_QNAME, String.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "Qaa") + public JAXBElement createQaa(Integer value) { + return new JAXBElement(_Qaa_QNAME, Integer.class, null, value); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java new file mode 100644 index 000000000..b71428782 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java @@ -0,0 +1,509 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for OnlineApplication complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="OnlineApplication">
+ *   <complexContent>
+ *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}OnlineApplicationType">
+ *       <attribute name="publicURLPrefix" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="keyBoxIdentifier" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAKeyBoxSelector" default="SecureSignatureKeypair" />
+ *       <attribute name="type" default="publicService">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *             <enumeration value="businessService"/>
+ *             <enumeration value="publicService"/>
+ *             <enumeration value="storkService"/>
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="calculateHPI" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="friendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="target" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="targetFriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="storkSPTargetCountry" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="removeBPKFromAuthBlock" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "OnlineApplication") +@Entity(name = "OnlineApplication") +@Table(name = "ONLINEAPPLICATION") +public class OnlineApplication + extends OnlineApplicationType + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "publicURLPrefix", required = true) + @XmlSchemaType(name = "anyURI") + protected String publicURLPrefix; + @XmlAttribute(name = "keyBoxIdentifier") + protected MOAKeyBoxSelector keyBoxIdentifier; + @XmlAttribute(name = "type") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String type; + @XmlAttribute(name = "calculateHPI") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean calculateHPI; + @XmlAttribute(name = "friendlyName") + protected String friendlyName; + @XmlAttribute(name = "target") + protected String target; + @XmlAttribute(name = "targetFriendlyName") + protected String targetFriendlyName; + @XmlAttribute(name = "storkSPTargetCountry") + protected String storkSPTargetCountry; + @XmlAttribute(name = "removeBPKFromAuthBlock") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean removeBPKFromAuthBlock; + + /** + * Gets the value of the publicURLPrefix property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PUBLICURLPREFIX") + public String getPublicURLPrefix() { + return publicURLPrefix; + } + + /** + * Sets the value of the publicURLPrefix property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPublicURLPrefix(String value) { + this.publicURLPrefix = value; + } + + /** + * Gets the value of the keyBoxIdentifier property. + * + * @return + * possible object is + * {@link MOAKeyBoxSelector } + * + */ + @Basic + @Column(name = "KEYBOXIDENTIFIER", length = 255) + @Enumerated(EnumType.STRING) + public MOAKeyBoxSelector getKeyBoxIdentifier() { + if (keyBoxIdentifier == null) { + return MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR; + } else { + return keyBoxIdentifier; + } + } + + /** + * Sets the value of the keyBoxIdentifier property. + * + * @param value + * allowed object is + * {@link MOAKeyBoxSelector } + * + */ + public void setKeyBoxIdentifier(MOAKeyBoxSelector value) { + this.keyBoxIdentifier = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TYPE_") + public String getType() { + if (type == null) { + return "publicService"; + } else { + return type; + } + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the calculateHPI property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "CALCULATEHPI") + public boolean isCalculateHPI() { + if (calculateHPI == null) { + return new ZeroOneBooleanAdapter().unmarshal("false"); + } else { + return calculateHPI; + } + } + + /** + * Sets the value of the calculateHPI property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCalculateHPI(Boolean value) { + this.calculateHPI = value; + } + + /** + * Gets the value of the friendlyName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FRIENDLYNAME", length = 255) + public String getFriendlyName() { + return friendlyName; + } + + /** + * Sets the value of the friendlyName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFriendlyName(String value) { + this.friendlyName = value; + } + + /** + * Gets the value of the target property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TARGET", length = 255) + public String getTarget() { + return target; + } + + /** + * Sets the value of the target property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTarget(String value) { + this.target = value; + } + + /** + * Gets the value of the targetFriendlyName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TARGETFRIENDLYNAME", length = 255) + public String getTargetFriendlyName() { + return targetFriendlyName; + } + + /** + * Sets the value of the targetFriendlyName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTargetFriendlyName(String value) { + this.targetFriendlyName = value; + } + + /** + * Gets the value of the storkSPTargetCountry property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "STORKSPTARGETCOUNTRY", length = 255) + public String getStorkSPTargetCountry() { + return storkSPTargetCountry; + } + + /** + * Sets the value of the storkSPTargetCountry property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStorkSPTargetCountry(String value) { + this.storkSPTargetCountry = value; + } + + /** + * Gets the value of the removeBPKFromAuthBlock property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "REMOVEBPKFROMAUTHBLOCK") + public boolean isRemoveBPKFromAuthBlock() { + if (removeBPKFromAuthBlock == null) { + return new ZeroOneBooleanAdapter().unmarshal("false"); + } else { + return removeBPKFromAuthBlock; + } + } + + /** + * Sets the value of the removeBPKFromAuthBlock property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRemoveBPKFromAuthBlock(Boolean value) { + this.removeBPKFromAuthBlock = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OnlineApplication)) { + return false; + } + if (this == object) { + return true; + } + if (!super.equals(thisLocator, thatLocator, object, strategy)) { + return false; + } + final OnlineApplication that = ((OnlineApplication) object); + { + String lhsPublicURLPrefix; + lhsPublicURLPrefix = this.getPublicURLPrefix(); + String rhsPublicURLPrefix; + rhsPublicURLPrefix = that.getPublicURLPrefix(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURLPrefix", lhsPublicURLPrefix), LocatorUtils.property(thatLocator, "publicURLPrefix", rhsPublicURLPrefix), lhsPublicURLPrefix, rhsPublicURLPrefix)) { + return false; + } + } + { + MOAKeyBoxSelector lhsKeyBoxIdentifier; + lhsKeyBoxIdentifier = this.getKeyBoxIdentifier(); + MOAKeyBoxSelector rhsKeyBoxIdentifier; + rhsKeyBoxIdentifier = that.getKeyBoxIdentifier(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "keyBoxIdentifier", lhsKeyBoxIdentifier), LocatorUtils.property(thatLocator, "keyBoxIdentifier", rhsKeyBoxIdentifier), lhsKeyBoxIdentifier, rhsKeyBoxIdentifier)) { + return false; + } + } + { + String lhsType; + lhsType = this.getType(); + String rhsType; + rhsType = that.getType(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { + return false; + } + } + { + boolean lhsCalculateHPI; + lhsCalculateHPI = ((this.calculateHPI!= null)?this.isCalculateHPI():false); + boolean rhsCalculateHPI; + rhsCalculateHPI = ((that.calculateHPI!= null)?that.isCalculateHPI():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "calculateHPI", lhsCalculateHPI), LocatorUtils.property(thatLocator, "calculateHPI", rhsCalculateHPI), lhsCalculateHPI, rhsCalculateHPI)) { + return false; + } + } + { + String lhsFriendlyName; + lhsFriendlyName = this.getFriendlyName(); + String rhsFriendlyName; + rhsFriendlyName = that.getFriendlyName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "friendlyName", lhsFriendlyName), LocatorUtils.property(thatLocator, "friendlyName", rhsFriendlyName), lhsFriendlyName, rhsFriendlyName)) { + return false; + } + } + { + String lhsTarget; + lhsTarget = this.getTarget(); + String rhsTarget; + rhsTarget = that.getTarget(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { + return false; + } + } + { + String lhsTargetFriendlyName; + lhsTargetFriendlyName = this.getTargetFriendlyName(); + String rhsTargetFriendlyName; + rhsTargetFriendlyName = that.getTargetFriendlyName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "targetFriendlyName", lhsTargetFriendlyName), LocatorUtils.property(thatLocator, "targetFriendlyName", rhsTargetFriendlyName), lhsTargetFriendlyName, rhsTargetFriendlyName)) { + return false; + } + } + { + String lhsStorkSPTargetCountry; + lhsStorkSPTargetCountry = this.getStorkSPTargetCountry(); + String rhsStorkSPTargetCountry; + rhsStorkSPTargetCountry = that.getStorkSPTargetCountry(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "storkSPTargetCountry", lhsStorkSPTargetCountry), LocatorUtils.property(thatLocator, "storkSPTargetCountry", rhsStorkSPTargetCountry), lhsStorkSPTargetCountry, rhsStorkSPTargetCountry)) { + return false; + } + } + { + boolean lhsRemoveBPKFromAuthBlock; + lhsRemoveBPKFromAuthBlock = ((this.removeBPKFromAuthBlock!= null)?this.isRemoveBPKFromAuthBlock():false); + boolean rhsRemoveBPKFromAuthBlock; + rhsRemoveBPKFromAuthBlock = ((that.removeBPKFromAuthBlock!= null)?that.isRemoveBPKFromAuthBlock():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "removeBPKFromAuthBlock", lhsRemoveBPKFromAuthBlock), LocatorUtils.property(thatLocator, "removeBPKFromAuthBlock", rhsRemoveBPKFromAuthBlock), lhsRemoveBPKFromAuthBlock, rhsRemoveBPKFromAuthBlock)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = super.hashCode(locator, strategy); + { + String thePublicURLPrefix; + thePublicURLPrefix = this.getPublicURLPrefix(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURLPrefix", thePublicURLPrefix), currentHashCode, thePublicURLPrefix); + } + { + MOAKeyBoxSelector theKeyBoxIdentifier; + theKeyBoxIdentifier = this.getKeyBoxIdentifier(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyBoxIdentifier", theKeyBoxIdentifier), currentHashCode, theKeyBoxIdentifier); + } + { + String theType; + theType = this.getType(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); + } + { + boolean theCalculateHPI; + theCalculateHPI = ((this.calculateHPI!= null)?this.isCalculateHPI():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "calculateHPI", theCalculateHPI), currentHashCode, theCalculateHPI); + } + { + String theFriendlyName; + theFriendlyName = this.getFriendlyName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "friendlyName", theFriendlyName), currentHashCode, theFriendlyName); + } + { + String theTarget; + theTarget = this.getTarget(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); + } + { + String theTargetFriendlyName; + theTargetFriendlyName = this.getTargetFriendlyName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "targetFriendlyName", theTargetFriendlyName), currentHashCode, theTargetFriendlyName); + } + { + String theStorkSPTargetCountry; + theStorkSPTargetCountry = this.getStorkSPTargetCountry(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storkSPTargetCountry", theStorkSPTargetCountry), currentHashCode, theStorkSPTargetCountry); + } + { + boolean theRemoveBPKFromAuthBlock; + theRemoveBPKFromAuthBlock = ((this.removeBPKFromAuthBlock!= null)?this.isRemoveBPKFromAuthBlock():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "removeBPKFromAuthBlock", theRemoveBPKFromAuthBlock), currentHashCode, theRemoveBPKFromAuthBlock); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java new file mode 100644 index 000000000..413d790e5 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java @@ -0,0 +1,565 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for OnlineApplicationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="OnlineApplicationType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="isNew" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="isAdminRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="isInterfederationIDP" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="InterfederationIDP" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InterfederationIDPType" minOccurs="0"/>
+ *         <element name="isInterfederationGateway" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="InterfederationGateway" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InterfederationGatewayType" minOccurs="0"/>
+ *         <element name="AuthComponent_OA" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="BKUURLS">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                             <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                             <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber" minOccurs="0"/>
+ *                   <element name="Templates" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TemplatesType" minOccurs="0"/>
+ *                   <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded" minOccurs="0"/>
+ *                   <element name="Mandates" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Profiles" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                             <element name="ProfileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="testCredentials" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="credentialOID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                           </sequence>
+ *                           <attribute name="enableTestCredentials" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_STORK" minOccurs="0"/>
+ *                   <element name="OA_SSO" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="UseSSO" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *                             <element name="AuthDataFrame" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *                             <element name="SingleLogOutURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_SAML1" minOccurs="0"/>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_PVP2" minOccurs="0"/>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_OAUTH20" minOccurs="0"/>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}EncBPKInformation" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "OnlineApplicationType", propOrder = { + "isNew", + "isActive", + "isAdminRequired", + "isInterfederationIDP", + "interfederationIDP", + "isInterfederationGateway", + "interfederationGateway", + "authComponentOA" +}) +@XmlSeeAlso({ + OnlineApplication.class +}) +@Entity(name = "OnlineApplicationType") +@Table(name = "ONLINEAPPLICATIONTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class OnlineApplicationType + implements Serializable, Equals, HashCode +{ + + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isNew; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isActive; + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isAdminRequired; + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isInterfederationIDP; + @XmlElement(name = "InterfederationIDP") + protected InterfederationIDPType interfederationIDP; + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isInterfederationGateway; + @XmlElement(name = "InterfederationGateway") + protected InterfederationGatewayType interfederationGateway; + @XmlElement(name = "AuthComponent_OA") + protected AuthComponentOA authComponentOA; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the isNew property. + * + * @return + * possible object is + * {@link String } + * + */ + @Transient + public Boolean isIsNew() { + return isNew; + } + + /** + * Sets the value of the isNew property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsNew(Boolean value) { + this.isNew = value; + } + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISACTIVE") + public Boolean isIsActive() { + return isActive; + } + + /** + * Sets the value of the isActive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsActive(Boolean value) { + this.isActive = value; + } + + /** + * Gets the value of the isAdminRequired property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISADMINREQUIRED") + public Boolean isIsAdminRequired() { + return isAdminRequired; + } + + /** + * Sets the value of the isAdminRequired property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsAdminRequired(Boolean value) { + this.isAdminRequired = value; + } + + /** + * Gets the value of the isInterfederationIDP property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISINTERFEDERATIONIDP") + public Boolean isIsInterfederationIDP() { + return isInterfederationIDP; + } + + /** + * Sets the value of the isInterfederationIDP property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsInterfederationIDP(Boolean value) { + this.isInterfederationIDP = value; + } + + /** + * Gets the value of the interfederationIDP property. + * + * @return + * possible object is + * {@link InterfederationIDPType } + * + */ + @ManyToOne(targetEntity = InterfederationIDPType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "INTERFEDERATIONIDP_ONLINEAPP_0") + public InterfederationIDPType getInterfederationIDP() { + return interfederationIDP; + } + + /** + * Sets the value of the interfederationIDP property. + * + * @param value + * allowed object is + * {@link InterfederationIDPType } + * + */ + public void setInterfederationIDP(InterfederationIDPType value) { + this.interfederationIDP = value; + } + + /** + * Gets the value of the isInterfederationGateway property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISINTERFEDERATIONGATEWAY") + public Boolean isIsInterfederationGateway() { + return isInterfederationGateway; + } + + /** + * Sets the value of the isInterfederationGateway property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsInterfederationGateway(Boolean value) { + this.isInterfederationGateway = value; + } + + /** + * Gets the value of the interfederationGateway property. + * + * @return + * possible object is + * {@link InterfederationGatewayType } + * + */ + @ManyToOne(targetEntity = InterfederationGatewayType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "INTERFEDERATIONGATEWAY_ONLIN_0") + public InterfederationGatewayType getInterfederationGateway() { + return interfederationGateway; + } + + /** + * Sets the value of the interfederationGateway property. + * + * @param value + * allowed object is + * {@link InterfederationGatewayType } + * + */ + public void setInterfederationGateway(InterfederationGatewayType value) { + this.interfederationGateway = value; + } + + /** + * Gets the value of the authComponentOA property. + * + * @return + * possible object is + * {@link AuthComponentOA } + * + */ + @ManyToOne(targetEntity = AuthComponentOA.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "AUTHCOMPONENTOA_ONLINEAPPLIC_0") + public AuthComponentOA getAuthComponentOA() { + return authComponentOA; + } + + /** + * Sets the value of the authComponentOA property. + * + * @param value + * allowed object is + * {@link AuthComponentOA } + * + */ + public void setAuthComponentOA(AuthComponentOA value) { + this.authComponentOA = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OnlineApplicationType)) { + return false; + } + if (this == object) { + return true; + } + final OnlineApplicationType that = ((OnlineApplicationType) object); + { + Boolean lhsIsNew; + lhsIsNew = this.isIsNew(); + Boolean rhsIsNew; + rhsIsNew = that.isIsNew(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isNew", lhsIsNew), LocatorUtils.property(thatLocator, "isNew", rhsIsNew), lhsIsNew, rhsIsNew)) { + return false; + } + } + { + Boolean lhsIsActive; + lhsIsActive = this.isIsActive(); + Boolean rhsIsActive; + rhsIsActive = that.isIsActive(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { + return false; + } + } + { + Boolean lhsIsAdminRequired; + lhsIsAdminRequired = this.isIsAdminRequired(); + Boolean rhsIsAdminRequired; + rhsIsAdminRequired = that.isIsAdminRequired(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isAdminRequired", lhsIsAdminRequired), LocatorUtils.property(thatLocator, "isAdminRequired", rhsIsAdminRequired), lhsIsAdminRequired, rhsIsAdminRequired)) { + return false; + } + } + { + Boolean lhsIsInterfederationIDP; + lhsIsInterfederationIDP = this.isIsInterfederationIDP(); + Boolean rhsIsInterfederationIDP; + rhsIsInterfederationIDP = that.isIsInterfederationIDP(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isInterfederationIDP", lhsIsInterfederationIDP), LocatorUtils.property(thatLocator, "isInterfederationIDP", rhsIsInterfederationIDP), lhsIsInterfederationIDP, rhsIsInterfederationIDP)) { + return false; + } + } + { + InterfederationIDPType lhsInterfederationIDP; + lhsInterfederationIDP = this.getInterfederationIDP(); + InterfederationIDPType rhsInterfederationIDP; + rhsInterfederationIDP = that.getInterfederationIDP(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "interfederationIDP", lhsInterfederationIDP), LocatorUtils.property(thatLocator, "interfederationIDP", rhsInterfederationIDP), lhsInterfederationIDP, rhsInterfederationIDP)) { + return false; + } + } + { + Boolean lhsIsInterfederationGateway; + lhsIsInterfederationGateway = this.isIsInterfederationGateway(); + Boolean rhsIsInterfederationGateway; + rhsIsInterfederationGateway = that.isIsInterfederationGateway(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isInterfederationGateway", lhsIsInterfederationGateway), LocatorUtils.property(thatLocator, "isInterfederationGateway", rhsIsInterfederationGateway), lhsIsInterfederationGateway, rhsIsInterfederationGateway)) { + return false; + } + } + { + InterfederationGatewayType lhsInterfederationGateway; + lhsInterfederationGateway = this.getInterfederationGateway(); + InterfederationGatewayType rhsInterfederationGateway; + rhsInterfederationGateway = that.getInterfederationGateway(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "interfederationGateway", lhsInterfederationGateway), LocatorUtils.property(thatLocator, "interfederationGateway", rhsInterfederationGateway), lhsInterfederationGateway, rhsInterfederationGateway)) { + return false; + } + } + { + AuthComponentOA lhsAuthComponentOA; + lhsAuthComponentOA = this.getAuthComponentOA(); + AuthComponentOA rhsAuthComponentOA; + rhsAuthComponentOA = that.getAuthComponentOA(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "authComponentOA", lhsAuthComponentOA), LocatorUtils.property(thatLocator, "authComponentOA", rhsAuthComponentOA), lhsAuthComponentOA, rhsAuthComponentOA)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + Boolean theIsNew; + theIsNew = this.isIsNew(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isNew", theIsNew), currentHashCode, theIsNew); + } + { + Boolean theIsActive; + theIsActive = this.isIsActive(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); + } + { + Boolean theIsAdminRequired; + theIsAdminRequired = this.isIsAdminRequired(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAdminRequired", theIsAdminRequired), currentHashCode, theIsAdminRequired); + } + { + Boolean theIsInterfederationIDP; + theIsInterfederationIDP = this.isIsInterfederationIDP(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isInterfederationIDP", theIsInterfederationIDP), currentHashCode, theIsInterfederationIDP); + } + { + InterfederationIDPType theInterfederationIDP; + theInterfederationIDP = this.getInterfederationIDP(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "interfederationIDP", theInterfederationIDP), currentHashCode, theInterfederationIDP); + } + { + Boolean theIsInterfederationGateway; + theIsInterfederationGateway = this.isIsInterfederationGateway(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isInterfederationGateway", theIsInterfederationGateway), currentHashCode, theIsInterfederationGateway); + } + { + InterfederationGatewayType theInterfederationGateway; + theInterfederationGateway = this.getInterfederationGateway(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "interfederationGateway", theInterfederationGateway), currentHashCode, theInterfederationGateway); + } + { + AuthComponentOA theAuthComponentOA; + theAuthComponentOA = this.getAuthComponentOA(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "authComponentOA", theAuthComponentOA), currentHashCode, theAuthComponentOA); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java new file mode 100644 index 000000000..18b400d73 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java @@ -0,0 +1,168 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "connectionParameter" +}) +@Entity(name = "OnlineMandates") +@Table(name = "ONLINEMANDATES") +@Inheritance(strategy = InheritanceType.JOINED) +public class OnlineMandates + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "ConnectionParameter", required = true) + protected ConnectionParameterClientAuthType connectionParameter; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the connectionParameter property. + * + * @return + * possible object is + * {@link ConnectionParameterClientAuthType } + * + */ + @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CONNECTIONPARAMETER_ONLINEMA_0") + public ConnectionParameterClientAuthType getConnectionParameter() { + return connectionParameter; + } + + /** + * Sets the value of the connectionParameter property. + * + * @param value + * allowed object is + * {@link ConnectionParameterClientAuthType } + * + */ + public void setConnectionParameter(ConnectionParameterClientAuthType value) { + this.connectionParameter = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof OnlineMandates)) { + return false; + } + if (this == object) { + return true; + } + final OnlineMandates that = ((OnlineMandates) object); + { + ConnectionParameterClientAuthType lhsConnectionParameter; + lhsConnectionParameter = this.getConnectionParameter(); + ConnectionParameterClientAuthType rhsConnectionParameter; + rhsConnectionParameter = that.getConnectionParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + ConnectionParameterClientAuthType theConnectionParameter; + theConnectionParameter = this.getConnectionParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java new file mode 100644 index 000000000..fe2ff6933 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java @@ -0,0 +1,254 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "name", + "displayName", + "url" +}) +@Entity(name = "Organization") +@Table(name = "ORGANIZATION") +@Inheritance(strategy = InheritanceType.JOINED) +public class Organization + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Name", required = true) + protected String name; + @XmlElement(name = "DisplayName", required = true) + protected String displayName; + @XmlElement(name = "URL", required = true) + @XmlSchemaType(name = "anyURI") + protected String url; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_", length = 255) + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the displayName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "DISPLAYNAME", length = 255) + public String getDisplayName() { + return displayName; + } + + /** + * Sets the value of the displayName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDisplayName(String value) { + this.displayName = value; + } + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "URL") + public String getURL() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setURL(String value) { + this.url = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Organization)) { + return false; + } + if (this == object) { + return true; + } + final Organization that = ((Organization) object); + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + { + String lhsDisplayName; + lhsDisplayName = this.getDisplayName(); + String rhsDisplayName; + rhsDisplayName = that.getDisplayName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "displayName", lhsDisplayName), LocatorUtils.property(thatLocator, "displayName", rhsDisplayName), lhsDisplayName, rhsDisplayName)) { + return false; + } + } + { + String lhsURL; + lhsURL = this.getURL(); + String rhsURL; + rhsURL = that.getURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + { + String theDisplayName; + theDisplayName = this.getDisplayName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "displayName", theDisplayName), currentHashCode, theDisplayName); + } + { + String theURL; + theURL = this.getURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java new file mode 100644 index 000000000..2cd4bdd0d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java @@ -0,0 +1,385 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="PublicURLPrefix" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="IssuerName" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="Organization">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                   <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Contact" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "publicURLPrefix", + "issuerName", + "organization", + "contact" +}) +@Entity(name = "PVP2") +@Table(name = "PVP2") +@Inheritance(strategy = InheritanceType.JOINED) +public class PVP2 + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "PublicURLPrefix", required = true) + @XmlSchemaType(name = "anyURI") + protected String publicURLPrefix; + @XmlElement(name = "IssuerName", required = true) + @XmlSchemaType(name = "anyURI") + protected String issuerName; + @XmlElement(name = "Organization", required = true) + protected Organization organization; + @XmlElement(name = "Contact", required = true) + protected List contact; + @XmlAttribute(name = "isActive") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isActive; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the publicURLPrefix property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PUBLICURLPREFIX") + public String getPublicURLPrefix() { + return publicURLPrefix; + } + + /** + * Sets the value of the publicURLPrefix property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPublicURLPrefix(String value) { + this.publicURLPrefix = value; + } + + /** + * Gets the value of the issuerName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISSUERNAME") + public String getIssuerName() { + return issuerName; + } + + /** + * Sets the value of the issuerName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIssuerName(String value) { + this.issuerName = value; + } + + /** + * Gets the value of the organization property. + * + * @return + * possible object is + * {@link Organization } + * + */ + @ManyToOne(targetEntity = Organization.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ORGANIZATION_PVP2_HJID") + public Organization getOrganization() { + return organization; + } + + /** + * Sets the value of the organization property. + * + * @param value + * allowed object is + * {@link Organization } + * + */ + public void setOrganization(Organization value) { + this.organization = value; + } + + /** + * Gets the value of the contact property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the contact property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getContact().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Contact } + * + * + */ + @OneToMany(targetEntity = Contact.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CONTACT_PVP2_HJID") + public List getContact() { + if (contact == null) { + contact = new ArrayList(); + } + return this.contact; + } + + /** + * + * + */ + public void setContact(List contact) { + this.contact = contact; + } + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISACTIVE") + public boolean isIsActive() { + if (isActive == null) { + return new ZeroOneBooleanAdapter().unmarshal("true"); + } else { + return isActive; + } + } + + /** + * Sets the value of the isActive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsActive(Boolean value) { + this.isActive = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof PVP2)) { + return false; + } + if (this == object) { + return true; + } + final PVP2 that = ((PVP2) object); + { + String lhsPublicURLPrefix; + lhsPublicURLPrefix = this.getPublicURLPrefix(); + String rhsPublicURLPrefix; + rhsPublicURLPrefix = that.getPublicURLPrefix(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURLPrefix", lhsPublicURLPrefix), LocatorUtils.property(thatLocator, "publicURLPrefix", rhsPublicURLPrefix), lhsPublicURLPrefix, rhsPublicURLPrefix)) { + return false; + } + } + { + String lhsIssuerName; + lhsIssuerName = this.getIssuerName(); + String rhsIssuerName; + rhsIssuerName = that.getIssuerName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "issuerName", lhsIssuerName), LocatorUtils.property(thatLocator, "issuerName", rhsIssuerName), lhsIssuerName, rhsIssuerName)) { + return false; + } + } + { + Organization lhsOrganization; + lhsOrganization = this.getOrganization(); + Organization rhsOrganization; + rhsOrganization = that.getOrganization(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "organization", lhsOrganization), LocatorUtils.property(thatLocator, "organization", rhsOrganization), lhsOrganization, rhsOrganization)) { + return false; + } + } + { + List lhsContact; + lhsContact = (((this.contact!= null)&&(!this.contact.isEmpty()))?this.getContact():null); + List rhsContact; + rhsContact = (((that.contact!= null)&&(!that.contact.isEmpty()))?that.getContact():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "contact", lhsContact), LocatorUtils.property(thatLocator, "contact", rhsContact), lhsContact, rhsContact)) { + return false; + } + } + { + boolean lhsIsActive; + lhsIsActive = ((this.isActive!= null)?this.isIsActive():false); + boolean rhsIsActive; + rhsIsActive = ((that.isActive!= null)?that.isIsActive():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String thePublicURLPrefix; + thePublicURLPrefix = this.getPublicURLPrefix(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURLPrefix", thePublicURLPrefix), currentHashCode, thePublicURLPrefix); + } + { + String theIssuerName; + theIssuerName = this.getIssuerName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "issuerName", theIssuerName), currentHashCode, theIssuerName); + } + { + Organization theOrganization; + theOrganization = this.getOrganization(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "organization", theOrganization), currentHashCode, theOrganization); + } + { + List theContact; + theContact = (((this.contact!= null)&&(!this.contact.isEmpty()))?this.getContact():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "contact", theContact), currentHashCode, theContact); + } + { + boolean theIsActive; + theIsActive = ((this.isActive!= null)?this.isIsActive():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java new file mode 100644 index 000000000..19504c804 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java @@ -0,0 +1,185 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Parameter" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "parameter" +}) +@XmlRootElement(name = "ParamAuth") +@Entity(name = "ParamAuth") +@Table(name = "PARAMAUTH") +@Inheritance(strategy = InheritanceType.JOINED) +public class ParamAuth + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Parameter", required = true) + protected List parameter; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the parameter property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the parameter property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getParameter().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Parameter } + * + * + */ + @OneToMany(targetEntity = Parameter.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PARAMETER__PARAMAUTH_HJID") + public List getParameter() { + if (parameter == null) { + parameter = new ArrayList(); + } + return this.parameter; + } + + /** + * + * + */ + public void setParameter(List parameter) { + this.parameter = parameter; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof ParamAuth)) { + return false; + } + if (this == object) { + return true; + } + final ParamAuth that = ((ParamAuth) object); + { + List lhsParameter; + lhsParameter = (((this.parameter!= null)&&(!this.parameter.isEmpty()))?this.getParameter():null); + List rhsParameter; + rhsParameter = (((that.parameter!= null)&&(!that.parameter.isEmpty()))?that.getParameter():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "parameter", lhsParameter), LocatorUtils.property(thatLocator, "parameter", rhsParameter), lhsParameter, rhsParameter)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theParameter; + theParameter = (((this.parameter!= null)&&(!this.parameter.isEmpty()))?this.getParameter():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parameter", theParameter), currentHashCode, theParameter); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java new file mode 100644 index 000000000..b4231d975 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java @@ -0,0 +1,212 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}token" />
+ *       <attribute name="Value" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@XmlRootElement(name = "Parameter") +@Entity(name = "Parameter") +@Table(name = "PARAMETER_") +@Inheritance(strategy = InheritanceType.JOINED) +public class Parameter + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "Name", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String name; + @XmlAttribute(name = "Value", required = true) + protected MOAAuthDataType value; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_", length = 255) + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link MOAAuthDataType } + * + */ + @Basic + @Column(name = "VALUE_", length = 255) + @Enumerated(EnumType.STRING) + public MOAAuthDataType getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link MOAAuthDataType } + * + */ + public void setValue(MOAAuthDataType value) { + this.value = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Parameter)) { + return false; + } + if (this == object) { + return true; + } + final Parameter that = ((Parameter) object); + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + { + MOAAuthDataType lhsValue; + lhsValue = this.getValue(); + MOAAuthDataType rhsValue; + rhsValue = that.getValue(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + { + MOAAuthDataType theValue; + theValue = this.getValue(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java new file mode 100644 index 000000000..8ce43675a --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java @@ -0,0 +1,331 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for PartyRepresentationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PartyRepresentationType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="InputProcessor" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InputProcessorType" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}AlwaysShowForm" minOccurs="0"/>
+ *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
+ *         <element name="PartyRepresentative" type="{http://www.buergerkarte.at/namespaces/moaconfig#}PartyRepresentativeType" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PartyRepresentationType", propOrder = { + "inputProcessor", + "alwaysShowForm", + "connectionParameter", + "partyRepresentative" +}) +@Entity(name = "PartyRepresentationType") +@Table(name = "PARTYREPRESENTATIONTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class PartyRepresentationType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "InputProcessor") + protected InputProcessorType inputProcessor; + @XmlElement(name = "AlwaysShowForm", type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + protected Boolean alwaysShowForm; + @XmlElement(name = "ConnectionParameter") + protected ConnectionParameterClientAuthType connectionParameter; + @XmlElement(name = "PartyRepresentative") + protected List partyRepresentative; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the inputProcessor property. + * + * @return + * possible object is + * {@link InputProcessorType } + * + */ + @ManyToOne(targetEntity = InputProcessorType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "INPUTPROCESSOR_PARTYREPRESEN_1") + public InputProcessorType getInputProcessor() { + return inputProcessor; + } + + /** + * Sets the value of the inputProcessor property. + * + * @param value + * allowed object is + * {@link InputProcessorType } + * + */ + public void setInputProcessor(InputProcessorType value) { + this.inputProcessor = value; + } + + /** + * Default Wert fuer Formularanzeige. Soll nicht nur + * bei leerer oder standardisierter Vollmacht mit unvollstaendigen + * Daten, sondern beispielsweise zu Kontrollzwecken das + * Eingabeformular zur vervollstaendigung der Vertretenendaten immer + * angezeigt werden, wenn ein Einschreiten durch berufliche + * Parteienvertretung geschieht so kann dies mittels dieses Schalters + * veranlasst werden + * + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ALWAYSSHOWFORM") + public Boolean isAlwaysShowForm() { + return alwaysShowForm; + } + + /** + * Sets the value of the alwaysShowForm property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAlwaysShowForm(Boolean value) { + this.alwaysShowForm = value; + } + + /** + * Gets the value of the connectionParameter property. + * + * @return + * possible object is + * {@link ConnectionParameterClientAuthType } + * + */ + @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CONNECTIONPARAMETER_PARTYREP_1") + public ConnectionParameterClientAuthType getConnectionParameter() { + return connectionParameter; + } + + /** + * Sets the value of the connectionParameter property. + * + * @param value + * allowed object is + * {@link ConnectionParameterClientAuthType } + * + */ + public void setConnectionParameter(ConnectionParameterClientAuthType value) { + this.connectionParameter = value; + } + + /** + * Gets the value of the partyRepresentative property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the partyRepresentative property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPartyRepresentative().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PartyRepresentativeType } + * + * + */ + @OneToMany(targetEntity = PartyRepresentativeType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PARTYREPRESENTATIVE_PARTYREP_0") + public List getPartyRepresentative() { + if (partyRepresentative == null) { + partyRepresentative = new ArrayList(); + } + return this.partyRepresentative; + } + + /** + * + * + */ + public void setPartyRepresentative(List partyRepresentative) { + this.partyRepresentative = partyRepresentative; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof PartyRepresentationType)) { + return false; + } + if (this == object) { + return true; + } + final PartyRepresentationType that = ((PartyRepresentationType) object); + { + InputProcessorType lhsInputProcessor; + lhsInputProcessor = this.getInputProcessor(); + InputProcessorType rhsInputProcessor; + rhsInputProcessor = that.getInputProcessor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "inputProcessor", lhsInputProcessor), LocatorUtils.property(thatLocator, "inputProcessor", rhsInputProcessor), lhsInputProcessor, rhsInputProcessor)) { + return false; + } + } + { + Boolean lhsAlwaysShowForm; + lhsAlwaysShowForm = this.isAlwaysShowForm(); + Boolean rhsAlwaysShowForm; + rhsAlwaysShowForm = that.isAlwaysShowForm(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "alwaysShowForm", lhsAlwaysShowForm), LocatorUtils.property(thatLocator, "alwaysShowForm", rhsAlwaysShowForm), lhsAlwaysShowForm, rhsAlwaysShowForm)) { + return false; + } + } + { + ConnectionParameterClientAuthType lhsConnectionParameter; + lhsConnectionParameter = this.getConnectionParameter(); + ConnectionParameterClientAuthType rhsConnectionParameter; + rhsConnectionParameter = that.getConnectionParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { + return false; + } + } + { + List lhsPartyRepresentative; + lhsPartyRepresentative = (((this.partyRepresentative!= null)&&(!this.partyRepresentative.isEmpty()))?this.getPartyRepresentative():null); + List rhsPartyRepresentative; + rhsPartyRepresentative = (((that.partyRepresentative!= null)&&(!that.partyRepresentative.isEmpty()))?that.getPartyRepresentative():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "partyRepresentative", lhsPartyRepresentative), LocatorUtils.property(thatLocator, "partyRepresentative", rhsPartyRepresentative), lhsPartyRepresentative, rhsPartyRepresentative)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + InputProcessorType theInputProcessor; + theInputProcessor = this.getInputProcessor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "inputProcessor", theInputProcessor), currentHashCode, theInputProcessor); + } + { + Boolean theAlwaysShowForm; + theAlwaysShowForm = this.isAlwaysShowForm(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alwaysShowForm", theAlwaysShowForm), currentHashCode, theAlwaysShowForm); + } + { + ConnectionParameterClientAuthType theConnectionParameter; + theConnectionParameter = this.getConnectionParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); + } + { + List thePartyRepresentative; + thePartyRepresentative = (((this.partyRepresentative!= null)&&(!this.partyRepresentative.isEmpty()))?this.getPartyRepresentative():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "partyRepresentative", thePartyRepresentative), currentHashCode, thePartyRepresentative); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java new file mode 100644 index 000000000..ea6e957ec --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java @@ -0,0 +1,457 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for PartyRepresentativeType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PartyRepresentativeType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="InputProcessor" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InputProcessorType" minOccurs="0"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}AlwaysShowForm" minOccurs="0"/>
+ *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="oid" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ *       <attribute name="representPhysicalParty" default="false">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}boolean">
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="representCorporateParty" default="false">
+ *         <simpleType>
+ *           <restriction base="{http://www.w3.org/2001/XMLSchema}boolean">
+ *           </restriction>
+ *         </simpleType>
+ *       </attribute>
+ *       <attribute name="representationText" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PartyRepresentativeType", propOrder = { + "inputProcessor", + "alwaysShowForm", + "connectionParameter" +}) +@Entity(name = "PartyRepresentativeType") +@Table(name = "PARTYREPRESENTATIVETYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class PartyRepresentativeType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "InputProcessor") + protected InputProcessorType inputProcessor; + @XmlElement(name = "AlwaysShowForm", type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + protected Boolean alwaysShowForm; + @XmlElement(name = "ConnectionParameter") + protected ConnectionParameterClientAuthType connectionParameter; + @XmlAttribute(name = "oid", required = true) + @XmlSchemaType(name = "anySimpleType") + protected String oid; + @XmlAttribute(name = "representPhysicalParty") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + protected Boolean representPhysicalParty; + @XmlAttribute(name = "representCorporateParty") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + protected Boolean representCorporateParty; + @XmlAttribute(name = "representationText") + @XmlSchemaType(name = "anySimpleType") + protected String representationText; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the inputProcessor property. + * + * @return + * possible object is + * {@link InputProcessorType } + * + */ + @ManyToOne(targetEntity = InputProcessorType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "INPUTPROCESSOR_PARTYREPRESEN_0") + public InputProcessorType getInputProcessor() { + return inputProcessor; + } + + /** + * Sets the value of the inputProcessor property. + * + * @param value + * allowed object is + * {@link InputProcessorType } + * + */ + public void setInputProcessor(InputProcessorType value) { + this.inputProcessor = value; + } + + /** + * Gets the value of the alwaysShowForm property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ALWAYSSHOWFORM") + public Boolean isAlwaysShowForm() { + return alwaysShowForm; + } + + /** + * Sets the value of the alwaysShowForm property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAlwaysShowForm(Boolean value) { + this.alwaysShowForm = value; + } + + /** + * Gets the value of the connectionParameter property. + * + * @return + * possible object is + * {@link ConnectionParameterClientAuthType } + * + */ + @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CONNECTIONPARAMETER_PARTYREP_0") + public ConnectionParameterClientAuthType getConnectionParameter() { + return connectionParameter; + } + + /** + * Sets the value of the connectionParameter property. + * + * @param value + * allowed object is + * {@link ConnectionParameterClientAuthType } + * + */ + public void setConnectionParameter(ConnectionParameterClientAuthType value) { + this.connectionParameter = value; + } + + /** + * Gets the value of the oid property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "OID_") + public String getOid() { + return oid; + } + + /** + * Sets the value of the oid property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOid(String value) { + this.oid = value; + } + + /** + * Gets the value of the representPhysicalParty property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "REPRESENTPHYSICALPARTY") + public boolean isRepresentPhysicalParty() { + if (representPhysicalParty == null) { + return new ZeroOneBooleanAdapter().unmarshal("false"); + } else { + return representPhysicalParty; + } + } + + /** + * Sets the value of the representPhysicalParty property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRepresentPhysicalParty(Boolean value) { + this.representPhysicalParty = value; + } + + /** + * Gets the value of the representCorporateParty property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "REPRESENTCORPORATEPARTY") + public boolean isRepresentCorporateParty() { + if (representCorporateParty == null) { + return new ZeroOneBooleanAdapter().unmarshal("false"); + } else { + return representCorporateParty; + } + } + + /** + * Sets the value of the representCorporateParty property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRepresentCorporateParty(Boolean value) { + this.representCorporateParty = value; + } + + /** + * Gets the value of the representationText property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "REPRESENTATIONTEXT") + public String getRepresentationText() { + return representationText; + } + + /** + * Sets the value of the representationText property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setRepresentationText(String value) { + this.representationText = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof PartyRepresentativeType)) { + return false; + } + if (this == object) { + return true; + } + final PartyRepresentativeType that = ((PartyRepresentativeType) object); + { + InputProcessorType lhsInputProcessor; + lhsInputProcessor = this.getInputProcessor(); + InputProcessorType rhsInputProcessor; + rhsInputProcessor = that.getInputProcessor(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "inputProcessor", lhsInputProcessor), LocatorUtils.property(thatLocator, "inputProcessor", rhsInputProcessor), lhsInputProcessor, rhsInputProcessor)) { + return false; + } + } + { + Boolean lhsAlwaysShowForm; + lhsAlwaysShowForm = this.isAlwaysShowForm(); + Boolean rhsAlwaysShowForm; + rhsAlwaysShowForm = that.isAlwaysShowForm(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "alwaysShowForm", lhsAlwaysShowForm), LocatorUtils.property(thatLocator, "alwaysShowForm", rhsAlwaysShowForm), lhsAlwaysShowForm, rhsAlwaysShowForm)) { + return false; + } + } + { + ConnectionParameterClientAuthType lhsConnectionParameter; + lhsConnectionParameter = this.getConnectionParameter(); + ConnectionParameterClientAuthType rhsConnectionParameter; + rhsConnectionParameter = that.getConnectionParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { + return false; + } + } + { + String lhsOid; + lhsOid = this.getOid(); + String rhsOid; + rhsOid = that.getOid(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oid", lhsOid), LocatorUtils.property(thatLocator, "oid", rhsOid), lhsOid, rhsOid)) { + return false; + } + } + { + boolean lhsRepresentPhysicalParty; + lhsRepresentPhysicalParty = ((this.representPhysicalParty!= null)?this.isRepresentPhysicalParty():false); + boolean rhsRepresentPhysicalParty; + rhsRepresentPhysicalParty = ((that.representPhysicalParty!= null)?that.isRepresentPhysicalParty():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "representPhysicalParty", lhsRepresentPhysicalParty), LocatorUtils.property(thatLocator, "representPhysicalParty", rhsRepresentPhysicalParty), lhsRepresentPhysicalParty, rhsRepresentPhysicalParty)) { + return false; + } + } + { + boolean lhsRepresentCorporateParty; + lhsRepresentCorporateParty = ((this.representCorporateParty!= null)?this.isRepresentCorporateParty():false); + boolean rhsRepresentCorporateParty; + rhsRepresentCorporateParty = ((that.representCorporateParty!= null)?that.isRepresentCorporateParty():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "representCorporateParty", lhsRepresentCorporateParty), LocatorUtils.property(thatLocator, "representCorporateParty", rhsRepresentCorporateParty), lhsRepresentCorporateParty, rhsRepresentCorporateParty)) { + return false; + } + } + { + String lhsRepresentationText; + lhsRepresentationText = this.getRepresentationText(); + String rhsRepresentationText; + rhsRepresentationText = that.getRepresentationText(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "representationText", lhsRepresentationText), LocatorUtils.property(thatLocator, "representationText", rhsRepresentationText), lhsRepresentationText, rhsRepresentationText)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + InputProcessorType theInputProcessor; + theInputProcessor = this.getInputProcessor(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "inputProcessor", theInputProcessor), currentHashCode, theInputProcessor); + } + { + Boolean theAlwaysShowForm; + theAlwaysShowForm = this.isAlwaysShowForm(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alwaysShowForm", theAlwaysShowForm), currentHashCode, theAlwaysShowForm); + } + { + ConnectionParameterClientAuthType theConnectionParameter; + theConnectionParameter = this.getConnectionParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); + } + { + String theOid; + theOid = this.getOid(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oid", theOid), currentHashCode, theOid); + } + { + boolean theRepresentPhysicalParty; + theRepresentPhysicalParty = ((this.representPhysicalParty!= null)?this.isRepresentPhysicalParty():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "representPhysicalParty", theRepresentPhysicalParty), currentHashCode, theRepresentPhysicalParty); + } + { + boolean theRepresentCorporateParty; + theRepresentCorporateParty = ((this.representCorporateParty!= null)?this.isRepresentCorporateParty():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "representCorporateParty", theRepresentCorporateParty), currentHashCode, theRepresentCorporateParty); + } + { + String theRepresentationText; + theRepresentationText = this.getRepresentationText(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "representationText", theRepresentationText), currentHashCode, theRepresentationText); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java new file mode 100644 index 000000000..2158b1953 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java @@ -0,0 +1,361 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="SAML1" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="SourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                 </sequence>
+ *                 <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="PVP2" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="PublicURLPrefix" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="IssuerName" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                   <element name="Organization">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                             <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *                             <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *                           </sequence>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Contact" maxOccurs="unbounded"/>
+ *                 </sequence>
+ *                 <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="OAuth" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="LegacyAllowed">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="ProtocolName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "saml1", + "pvp2", + "oAuth", + "legacyAllowed" +}) +@Entity(name = "Protocols") +@Table(name = "PROTOCOLS") +@Inheritance(strategy = InheritanceType.JOINED) +public class Protocols + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "SAML1") + protected SAML1 saml1; + @XmlElement(name = "PVP2") + protected PVP2 pvp2; + @XmlElement(name = "OAuth") + protected OAuth oAuth; + @XmlElement(name = "LegacyAllowed", required = true) + protected LegacyAllowed legacyAllowed; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the saml1 property. + * + * @return + * possible object is + * {@link SAML1 } + * + */ + @ManyToOne(targetEntity = SAML1 .class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SAML1_PROTOCOLS_HJID") + public SAML1 getSAML1() { + return saml1; + } + + /** + * Sets the value of the saml1 property. + * + * @param value + * allowed object is + * {@link SAML1 } + * + */ + public void setSAML1(SAML1 value) { + this.saml1 = value; + } + + /** + * Gets the value of the pvp2 property. + * + * @return + * possible object is + * {@link PVP2 } + * + */ + @ManyToOne(targetEntity = PVP2 .class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "PVP2_PROTOCOLS_HJID") + public PVP2 getPVP2() { + return pvp2; + } + + /** + * Sets the value of the pvp2 property. + * + * @param value + * allowed object is + * {@link PVP2 } + * + */ + public void setPVP2(PVP2 value) { + this.pvp2 = value; + } + + /** + * Gets the value of the oAuth property. + * + * @return + * possible object is + * {@link OAuth } + * + */ + @ManyToOne(targetEntity = OAuth.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "OAUTH_PROTOCOLS_HJID") + public OAuth getOAuth() { + return oAuth; + } + + /** + * Sets the value of the oAuth property. + * + * @param value + * allowed object is + * {@link OAuth } + * + */ + public void setOAuth(OAuth value) { + this.oAuth = value; + } + + /** + * Gets the value of the legacyAllowed property. + * + * @return + * possible object is + * {@link LegacyAllowed } + * + */ + @ManyToOne(targetEntity = LegacyAllowed.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "LEGACYALLOWED_PROTOCOLS_HJID") + public LegacyAllowed getLegacyAllowed() { + return legacyAllowed; + } + + /** + * Sets the value of the legacyAllowed property. + * + * @param value + * allowed object is + * {@link LegacyAllowed } + * + */ + public void setLegacyAllowed(LegacyAllowed value) { + this.legacyAllowed = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Protocols)) { + return false; + } + if (this == object) { + return true; + } + final Protocols that = ((Protocols) object); + { + SAML1 lhsSAML1; + lhsSAML1 = this.getSAML1(); + SAML1 rhsSAML1; + rhsSAML1 = that.getSAML1(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "saml1", lhsSAML1), LocatorUtils.property(thatLocator, "saml1", rhsSAML1), lhsSAML1, rhsSAML1)) { + return false; + } + } + { + PVP2 lhsPVP2; + lhsPVP2 = this.getPVP2(); + PVP2 rhsPVP2; + rhsPVP2 = that.getPVP2(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "pvp2", lhsPVP2), LocatorUtils.property(thatLocator, "pvp2", rhsPVP2), lhsPVP2, rhsPVP2)) { + return false; + } + } + { + OAuth lhsOAuth; + lhsOAuth = this.getOAuth(); + OAuth rhsOAuth; + rhsOAuth = that.getOAuth(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuth", lhsOAuth), LocatorUtils.property(thatLocator, "oAuth", rhsOAuth), lhsOAuth, rhsOAuth)) { + return false; + } + } + { + LegacyAllowed lhsLegacyAllowed; + lhsLegacyAllowed = this.getLegacyAllowed(); + LegacyAllowed rhsLegacyAllowed; + rhsLegacyAllowed = that.getLegacyAllowed(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "legacyAllowed", lhsLegacyAllowed), LocatorUtils.property(thatLocator, "legacyAllowed", rhsLegacyAllowed), lhsLegacyAllowed, rhsLegacyAllowed)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + SAML1 theSAML1; + theSAML1 = this.getSAML1(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "saml1", theSAML1), currentHashCode, theSAML1); + } + { + PVP2 thePVP2; + thePVP2 = this.getPVP2(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "pvp2", thePVP2), currentHashCode, thePVP2); + } + { + OAuth theOAuth; + theOAuth = this.getOAuth(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuth", theOAuth), currentHashCode, theOAuth); + } + { + LegacyAllowed theLegacyAllowed; + theLegacyAllowed = this.getLegacyAllowed(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "legacyAllowed", theLegacyAllowed), currentHashCode, theLegacyAllowed); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java new file mode 100644 index 000000000..516c27e91 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java @@ -0,0 +1,216 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="SourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "sourceID" +}) +@Entity(name = "SAML1") +@Table(name = "SAML1") +@Inheritance(strategy = InheritanceType.JOINED) +public class SAML1 + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "SourceID") + protected String sourceID; + @XmlAttribute(name = "isActive") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isActive; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SOURCEID", length = 255) + public String getSourceID() { + return sourceID; + } + + /** + * Sets the value of the sourceID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSourceID(String value) { + this.sourceID = value; + } + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISACTIVE") + public boolean isIsActive() { + if (isActive == null) { + return new ZeroOneBooleanAdapter().unmarshal("false"); + } else { + return isActive; + } + } + + /** + * Sets the value of the isActive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsActive(Boolean value) { + this.isActive = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SAML1)) { + return false; + } + if (this == object) { + return true; + } + final SAML1 that = ((SAML1) object); + { + String lhsSourceID; + lhsSourceID = this.getSourceID(); + String rhsSourceID; + rhsSourceID = that.getSourceID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceID", lhsSourceID), LocatorUtils.property(thatLocator, "sourceID", rhsSourceID), lhsSourceID, rhsSourceID)) { + return false; + } + } + { + boolean lhsIsActive; + lhsIsActive = ((this.isActive!= null)?this.isIsActive():false); + boolean rhsIsActive; + rhsIsActive = ((that.isActive!= null)?that.isIsActive():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theSourceID; + theSourceID = this.getSourceID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceID", theSourceID), currentHashCode, theSourceID); + } + { + boolean theIsActive; + theIsActive = ((this.isActive!= null)?this.isIsActive():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java new file mode 100644 index 000000000..685aa6299 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java @@ -0,0 +1,216 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="SignatureCreationParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}SignatureCreationParameterType"/>
+ *         <element name="SignatureVerificationParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}SignatureVerificationParameterType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "signatureCreationParameter", + "signatureVerificationParameter" +}) +@XmlRootElement(name = "SAMLSigningParameter") +@Entity(name = "SAMLSigningParameter") +@Table(name = "SAMLSIGNINGPARAMETER") +@Inheritance(strategy = InheritanceType.JOINED) +public class SAMLSigningParameter + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "SignatureCreationParameter", required = true) + protected SignatureCreationParameterType signatureCreationParameter; + @XmlElement(name = "SignatureVerificationParameter", required = true) + protected SignatureVerificationParameterType signatureVerificationParameter; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the signatureCreationParameter property. + * + * @return + * possible object is + * {@link SignatureCreationParameterType } + * + */ + @ManyToOne(targetEntity = SignatureCreationParameterType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SIGNATURECREATIONPARAMETER_S_0") + public SignatureCreationParameterType getSignatureCreationParameter() { + return signatureCreationParameter; + } + + /** + * Sets the value of the signatureCreationParameter property. + * + * @param value + * allowed object is + * {@link SignatureCreationParameterType } + * + */ + public void setSignatureCreationParameter(SignatureCreationParameterType value) { + this.signatureCreationParameter = value; + } + + /** + * Gets the value of the signatureVerificationParameter property. + * + * @return + * possible object is + * {@link SignatureVerificationParameterType } + * + */ + @ManyToOne(targetEntity = SignatureVerificationParameterType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SIGNATUREVERIFICATIONPARAMET_1") + public SignatureVerificationParameterType getSignatureVerificationParameter() { + return signatureVerificationParameter; + } + + /** + * Sets the value of the signatureVerificationParameter property. + * + * @param value + * allowed object is + * {@link SignatureVerificationParameterType } + * + */ + public void setSignatureVerificationParameter(SignatureVerificationParameterType value) { + this.signatureVerificationParameter = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SAMLSigningParameter)) { + return false; + } + if (this == object) { + return true; + } + final SAMLSigningParameter that = ((SAMLSigningParameter) object); + { + SignatureCreationParameterType lhsSignatureCreationParameter; + lhsSignatureCreationParameter = this.getSignatureCreationParameter(); + SignatureCreationParameterType rhsSignatureCreationParameter; + rhsSignatureCreationParameter = that.getSignatureCreationParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "signatureCreationParameter", lhsSignatureCreationParameter), LocatorUtils.property(thatLocator, "signatureCreationParameter", rhsSignatureCreationParameter), lhsSignatureCreationParameter, rhsSignatureCreationParameter)) { + return false; + } + } + { + SignatureVerificationParameterType lhsSignatureVerificationParameter; + lhsSignatureVerificationParameter = this.getSignatureVerificationParameter(); + SignatureVerificationParameterType rhsSignatureVerificationParameter; + rhsSignatureVerificationParameter = that.getSignatureVerificationParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "signatureVerificationParameter", lhsSignatureVerificationParameter), LocatorUtils.property(thatLocator, "signatureVerificationParameter", rhsSignatureVerificationParameter), lhsSignatureVerificationParameter, rhsSignatureVerificationParameter)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + SignatureCreationParameterType theSignatureCreationParameter; + theSignatureCreationParameter = this.getSignatureCreationParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "signatureCreationParameter", theSignatureCreationParameter), currentHashCode, theSignatureCreationParameter); + } + { + SignatureVerificationParameterType theSignatureVerificationParameter; + theSignatureVerificationParameter = this.getSignatureVerificationParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "signatureVerificationParameter", theSignatureVerificationParameter), currentHashCode, theSignatureVerificationParameter); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java new file mode 100644 index 000000000..a10e7941e --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java @@ -0,0 +1,256 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "onlineBKU", + "handyBKU", + "localBKU" +}) +@Entity(name = "SLRequestTemplates") +@Table(name = "SLREQUESTTEMPLATES") +@Inheritance(strategy = InheritanceType.JOINED) +public class SLRequestTemplates + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "OnlineBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String onlineBKU; + @XmlElement(name = "HandyBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String handyBKU; + @XmlElement(name = "LocalBKU", required = true) + @XmlSchemaType(name = "anyURI") + protected String localBKU; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the onlineBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ONLINEBKU") + public String getOnlineBKU() { + return onlineBKU; + } + + /** + * Sets the value of the onlineBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOnlineBKU(String value) { + this.onlineBKU = value; + } + + /** + * Gets the value of the handyBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "HANDYBKU") + public String getHandyBKU() { + return handyBKU; + } + + /** + * Sets the value of the handyBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setHandyBKU(String value) { + this.handyBKU = value; + } + + /** + * Gets the value of the localBKU property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "LOCALBKU") + public String getLocalBKU() { + return localBKU; + } + + /** + * Sets the value of the localBKU property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocalBKU(String value) { + this.localBKU = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SLRequestTemplates)) { + return false; + } + if (this == object) { + return true; + } + final SLRequestTemplates that = ((SLRequestTemplates) object); + { + String lhsOnlineBKU; + lhsOnlineBKU = this.getOnlineBKU(); + String rhsOnlineBKU; + rhsOnlineBKU = that.getOnlineBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineBKU", lhsOnlineBKU), LocatorUtils.property(thatLocator, "onlineBKU", rhsOnlineBKU), lhsOnlineBKU, rhsOnlineBKU)) { + return false; + } + } + { + String lhsHandyBKU; + lhsHandyBKU = this.getHandyBKU(); + String rhsHandyBKU; + rhsHandyBKU = that.getHandyBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "handyBKU", lhsHandyBKU), LocatorUtils.property(thatLocator, "handyBKU", rhsHandyBKU), lhsHandyBKU, rhsHandyBKU)) { + return false; + } + } + { + String lhsLocalBKU; + lhsLocalBKU = this.getLocalBKU(); + String rhsLocalBKU; + rhsLocalBKU = that.getLocalBKU(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "localBKU", lhsLocalBKU), LocatorUtils.property(thatLocator, "localBKU", rhsLocalBKU), lhsLocalBKU, rhsLocalBKU)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theOnlineBKU; + theOnlineBKU = this.getOnlineBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineBKU", theOnlineBKU), currentHashCode, theOnlineBKU); + } + { + String theHandyBKU; + theHandyBKU = this.getHandyBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handyBKU", theHandyBKU), currentHashCode, theHandyBKU); + } + { + String theLocalBKU; + theLocalBKU = this.getLocalBKU(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "localBKU", theLocalBKU), currentHashCode, theLocalBKU); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java new file mode 100644 index 000000000..2321ee884 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java @@ -0,0 +1,341 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber"/>
+ *       </choice>
+ *       <attribute name="PublicURL" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="SpecialText" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "target", + "identificationNumber" +}) +@Entity(name = "SSO") +@Table(name = "SSO") +@Inheritance(strategy = InheritanceType.JOINED) +public class SSO + implements Serializable, Equals, HashCode +{ + + protected String target; + @XmlElement(name = "IdentificationNumber") + protected IdentificationNumber identificationNumber; + @XmlAttribute(name = "PublicURL") + protected String publicURL; + @XmlAttribute(name = "FriendlyName") + protected String friendlyName; + @XmlAttribute(name = "SpecialText") + protected String specialText; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the target property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TARGET", length = 255) + public String getTarget() { + return target; + } + + /** + * Sets the value of the target property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTarget(String value) { + this.target = value; + } + + /** + * Gets the value of the identificationNumber property. + * + * @return + * possible object is + * {@link IdentificationNumber } + * + */ + @ManyToOne(targetEntity = IdentificationNumber.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "IDENTIFICATIONNUMBER_SSO_HJID") + public IdentificationNumber getIdentificationNumber() { + return identificationNumber; + } + + /** + * Sets the value of the identificationNumber property. + * + * @param value + * allowed object is + * {@link IdentificationNumber } + * + */ + public void setIdentificationNumber(IdentificationNumber value) { + this.identificationNumber = value; + } + + /** + * Gets the value of the publicURL property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PUBLICURL", length = 255) + public String getPublicURL() { + return publicURL; + } + + /** + * Sets the value of the publicURL property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPublicURL(String value) { + this.publicURL = value; + } + + /** + * Gets the value of the friendlyName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FRIENDLYNAME", length = 255) + public String getFriendlyName() { + return friendlyName; + } + + /** + * Sets the value of the friendlyName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFriendlyName(String value) { + this.friendlyName = value; + } + + /** + * Gets the value of the specialText property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SPECIALTEXT", length = 255) + public String getSpecialText() { + return specialText; + } + + /** + * Sets the value of the specialText property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSpecialText(String value) { + this.specialText = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SSO)) { + return false; + } + if (this == object) { + return true; + } + final SSO that = ((SSO) object); + { + String lhsTarget; + lhsTarget = this.getTarget(); + String rhsTarget; + rhsTarget = that.getTarget(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { + return false; + } + } + { + IdentificationNumber lhsIdentificationNumber; + lhsIdentificationNumber = this.getIdentificationNumber(); + IdentificationNumber rhsIdentificationNumber; + rhsIdentificationNumber = that.getIdentificationNumber(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "identificationNumber", lhsIdentificationNumber), LocatorUtils.property(thatLocator, "identificationNumber", rhsIdentificationNumber), lhsIdentificationNumber, rhsIdentificationNumber)) { + return false; + } + } + { + String lhsPublicURL; + lhsPublicURL = this.getPublicURL(); + String rhsPublicURL; + rhsPublicURL = that.getPublicURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURL", lhsPublicURL), LocatorUtils.property(thatLocator, "publicURL", rhsPublicURL), lhsPublicURL, rhsPublicURL)) { + return false; + } + } + { + String lhsFriendlyName; + lhsFriendlyName = this.getFriendlyName(); + String rhsFriendlyName; + rhsFriendlyName = that.getFriendlyName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "friendlyName", lhsFriendlyName), LocatorUtils.property(thatLocator, "friendlyName", rhsFriendlyName), lhsFriendlyName, rhsFriendlyName)) { + return false; + } + } + { + String lhsSpecialText; + lhsSpecialText = this.getSpecialText(); + String rhsSpecialText; + rhsSpecialText = that.getSpecialText(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "specialText", lhsSpecialText), LocatorUtils.property(thatLocator, "specialText", rhsSpecialText), lhsSpecialText, rhsSpecialText)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theTarget; + theTarget = this.getTarget(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); + } + { + IdentificationNumber theIdentificationNumber; + theIdentificationNumber = this.getIdentificationNumber(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identificationNumber", theIdentificationNumber), currentHashCode, theIdentificationNumber); + } + { + String thePublicURL; + thePublicURL = this.getPublicURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURL", thePublicURL), currentHashCode, thePublicURL); + } + { + String theFriendlyName; + theFriendlyName = this.getFriendlyName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "friendlyName", theFriendlyName), currentHashCode, theFriendlyName); + } + { + String theSpecialText; + theSpecialText = this.getSpecialText(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "specialText", theSpecialText), currentHashCode, theSpecialText); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java new file mode 100644 index 000000000..42bedb94c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java @@ -0,0 +1,342 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <sequence>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}C-PEPS" maxOccurs="unbounded"/>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}SAMLSigningParameter"/>
+ *         </sequence>
+ *         <sequence>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}QualityAuthenticationAssuranceLevel" minOccurs="0"/>
+ *         </sequence>
+ *         <sequence>
+ *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Attributes" maxOccurs="unbounded" minOccurs="0"/>
+ *         </sequence>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "cpeps", + "samlSigningParameter", + "qualityAuthenticationAssuranceLevel", + "attributes" +}) +@XmlRootElement(name = "STORK") +@Entity(name = "STORK") +@Table(name = "STORK") +@Inheritance(strategy = InheritanceType.JOINED) +public class STORK + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "C-PEPS") + protected List cpeps; + @XmlElement(name = "SAMLSigningParameter") + protected SAMLSigningParameter samlSigningParameter; + @XmlElement(name = "QualityAuthenticationAssuranceLevel") + protected Integer qualityAuthenticationAssuranceLevel; + @XmlElement(name = "Attributes") + protected List attributes; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the cpeps property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the cpeps property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCPEPS().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CPEPS } + * + * + */ + @OneToMany(targetEntity = CPEPS.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CPEPS_STORK_HJID") + public List getCPEPS() { + if (cpeps == null) { + cpeps = new ArrayList(); + } + return this.cpeps; + } + + /** + * + * + */ + public void setCPEPS(List cpeps) { + this.cpeps = cpeps; + } + + /** + * Gets the value of the samlSigningParameter property. + * + * @return + * possible object is + * {@link SAMLSigningParameter } + * + */ + @ManyToOne(targetEntity = SAMLSigningParameter.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SAMLSIGNINGPARAMETER_STORK_H_0") + public SAMLSigningParameter getSAMLSigningParameter() { + return samlSigningParameter; + } + + /** + * Sets the value of the samlSigningParameter property. + * + * @param value + * allowed object is + * {@link SAMLSigningParameter } + * + */ + public void setSAMLSigningParameter(SAMLSigningParameter value) { + this.samlSigningParameter = value; + } + + /** + * Gets the value of the qualityAuthenticationAssuranceLevel property. + * + * @return + * possible object is + * {@link Integer } + * + */ + @Basic + @Column(name = "QUALITYAUTHENTICATIONASSURAN_0", precision = 20, scale = 0) + public Integer getQualityAuthenticationAssuranceLevel() { + return qualityAuthenticationAssuranceLevel; + } + + /** + * Sets the value of the qualityAuthenticationAssuranceLevel property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setQualityAuthenticationAssuranceLevel(Integer value) { + this.qualityAuthenticationAssuranceLevel = value; + } + + /** + * Gets the value of the attributes property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the attributes property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getAttributes().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link StorkAttribute } + * + * + */ + @OneToMany(targetEntity = StorkAttribute.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ATTRIBUTES__STORK_HJID") + public List getAttributes() { + if (attributes == null) { + attributes = new ArrayList(); + } + return this.attributes; + } + + /** + * + * + */ + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof STORK)) { + return false; + } + if (this == object) { + return true; + } + final STORK that = ((STORK) object); + { + List lhsCPEPS; + lhsCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); + List rhsCPEPS; + rhsCPEPS = (((that.cpeps!= null)&&(!that.cpeps.isEmpty()))?that.getCPEPS():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "cpeps", lhsCPEPS), LocatorUtils.property(thatLocator, "cpeps", rhsCPEPS), lhsCPEPS, rhsCPEPS)) { + return false; + } + } + { + SAMLSigningParameter lhsSAMLSigningParameter; + lhsSAMLSigningParameter = this.getSAMLSigningParameter(); + SAMLSigningParameter rhsSAMLSigningParameter; + rhsSAMLSigningParameter = that.getSAMLSigningParameter(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "samlSigningParameter", lhsSAMLSigningParameter), LocatorUtils.property(thatLocator, "samlSigningParameter", rhsSAMLSigningParameter), lhsSAMLSigningParameter, rhsSAMLSigningParameter)) { + return false; + } + } + { + Integer lhsQualityAuthenticationAssuranceLevel; + lhsQualityAuthenticationAssuranceLevel = this.getQualityAuthenticationAssuranceLevel(); + Integer rhsQualityAuthenticationAssuranceLevel; + rhsQualityAuthenticationAssuranceLevel = that.getQualityAuthenticationAssuranceLevel(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "qualityAuthenticationAssuranceLevel", lhsQualityAuthenticationAssuranceLevel), LocatorUtils.property(thatLocator, "qualityAuthenticationAssuranceLevel", rhsQualityAuthenticationAssuranceLevel), lhsQualityAuthenticationAssuranceLevel, rhsQualityAuthenticationAssuranceLevel)) { + return false; + } + } + { + List lhsAttributes; + lhsAttributes = (((this.attributes!= null)&&(!this.attributes.isEmpty()))?this.getAttributes():null); + List rhsAttributes; + rhsAttributes = (((that.attributes!= null)&&(!that.attributes.isEmpty()))?that.getAttributes():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "attributes", lhsAttributes), LocatorUtils.property(thatLocator, "attributes", rhsAttributes), lhsAttributes, rhsAttributes)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theCPEPS; + theCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "cpeps", theCPEPS), currentHashCode, theCPEPS); + } + { + SAMLSigningParameter theSAMLSigningParameter; + theSAMLSigningParameter = this.getSAMLSigningParameter(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "samlSigningParameter", theSAMLSigningParameter), currentHashCode, theSAMLSigningParameter); + } + { + Integer theQualityAuthenticationAssuranceLevel; + theQualityAuthenticationAssuranceLevel = this.getQualityAuthenticationAssuranceLevel(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "qualityAuthenticationAssuranceLevel", theQualityAuthenticationAssuranceLevel), currentHashCode, theQualityAuthenticationAssuranceLevel); + } + { + List theAttributes; + theAttributes = (((this.attributes!= null)&&(!this.attributes.isEmpty()))?this.getAttributes():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributes", theAttributes), currentHashCode, theAttributes); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java new file mode 100644 index 000000000..37fdc522d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java @@ -0,0 +1,205 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="schemaLocation" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@Entity(name = "Schema") +@Table(name = "SCHEMA_") +@Inheritance(strategy = InheritanceType.JOINED) +public class Schema + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "namespace", required = true) + @XmlSchemaType(name = "anyURI") + protected String namespace; + @XmlAttribute(name = "schemaLocation", required = true) + @XmlSchemaType(name = "anyURI") + protected String schemaLocation; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the namespace property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAMESPACE") + public String getNamespace() { + return namespace; + } + + /** + * Sets the value of the namespace property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setNamespace(String value) { + this.namespace = value; + } + + /** + * Gets the value of the schemaLocation property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "SCHEMALOCATION") + public String getSchemaLocation() { + return schemaLocation; + } + + /** + * Sets the value of the schemaLocation property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSchemaLocation(String value) { + this.schemaLocation = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof Schema)) { + return false; + } + if (this == object) { + return true; + } + final Schema that = ((Schema) object); + { + String lhsNamespace; + lhsNamespace = this.getNamespace(); + String rhsNamespace; + rhsNamespace = that.getNamespace(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "namespace", lhsNamespace), LocatorUtils.property(thatLocator, "namespace", rhsNamespace), lhsNamespace, rhsNamespace)) { + return false; + } + } + { + String lhsSchemaLocation; + lhsSchemaLocation = this.getSchemaLocation(); + String rhsSchemaLocation; + rhsSchemaLocation = that.getSchemaLocation(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "schemaLocation", lhsSchemaLocation), LocatorUtils.property(thatLocator, "schemaLocation", rhsSchemaLocation), lhsSchemaLocation, rhsSchemaLocation)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theNamespace; + theNamespace = this.getNamespace(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace); + } + { + String theSchemaLocation; + theSchemaLocation = this.getSchemaLocation(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "schemaLocation", theSchemaLocation), currentHashCode, theSchemaLocation); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java new file mode 100644 index 000000000..11a5a7bac --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java @@ -0,0 +1,195 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + * Spezifiziert die Lage von XML Schemas + * + * + *

Java class for SchemaLocationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SchemaLocationType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Schema" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *                 <attribute name="schemaLocation" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SchemaLocationType", propOrder = { + "schema" +}) +@Entity(name = "SchemaLocationType") +@Table(name = "SCHEMALOCATIONTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class SchemaLocationType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Schema", required = true) + protected List schema; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the schema property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the schema property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getSchema().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Schema } + * + * + */ + @OneToMany(targetEntity = Schema.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SCHEMA__SCHEMALOCATIONTYPE_H_0") + public List getSchema() { + if (schema == null) { + schema = new ArrayList(); + } + return this.schema; + } + + /** + * + * + */ + public void setSchema(List schema) { + this.schema = schema; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SchemaLocationType)) { + return false; + } + if (this == object) { + return true; + } + final SchemaLocationType that = ((SchemaLocationType) object); + { + List lhsSchema; + lhsSchema = (((this.schema!= null)&&(!this.schema.isEmpty()))?this.getSchema():null); + List rhsSchema; + rhsSchema = (((that.schema!= null)&&(!that.schema.isEmpty()))?that.getSchema():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "schema", lhsSchema), LocatorUtils.property(thatLocator, "schema", rhsSchema), lhsSchema, rhsSchema)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theSchema; + theSchema = (((this.schema!= null)&&(!this.schema.isEmpty()))?this.getSchema():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "schema", theSchema), currentHashCode, theSchema); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java new file mode 100644 index 000000000..13001493a --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java @@ -0,0 +1,183 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "transformsInfo" +}) +@Entity(name = "SecurityLayer") +@Table(name = "SECURITYLAYER") +@Inheritance(strategy = InheritanceType.JOINED) +public class SecurityLayer + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TransformsInfo", required = true) + protected List transformsInfo; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the transformsInfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the transformsInfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTransformsInfo().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TransformsInfoType } + * + * + */ + @OneToMany(targetEntity = TransformsInfoType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TRANSFORMSINFO_SECURITYLAYER_0") + public List getTransformsInfo() { + if (transformsInfo == null) { + transformsInfo = new ArrayList(); + } + return this.transformsInfo; + } + + /** + * + * + */ + public void setTransformsInfo(List transformsInfo) { + this.transformsInfo = transformsInfo; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SecurityLayer)) { + return false; + } + if (this == object) { + return true; + } + final SecurityLayer that = ((SecurityLayer) object); + { + List lhsTransformsInfo; + lhsTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); + List rhsTransformsInfo; + rhsTransformsInfo = (((that.transformsInfo!= null)&&(!that.transformsInfo.isEmpty()))?that.getTransformsInfo():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "transformsInfo", lhsTransformsInfo), LocatorUtils.property(thatLocator, "transformsInfo", rhsTransformsInfo), lhsTransformsInfo, rhsTransformsInfo)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theTransformsInfo; + theTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transformsInfo", theTransformsInfo), currentHashCode, theTransformsInfo); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java new file mode 100644 index 000000000..7d67f1784 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java @@ -0,0 +1,218 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + * Enthaelt Informationen zu einem KeyStore bzw. Key + * zur STORK SAML AuthnRequest Signaturerstellung + * + * + *

Java class for SignatureCreationParameterType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SignatureCreationParameterType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}KeyStore"/>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}KeyName"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignatureCreationParameterType", propOrder = { + "keyStore", + "keyName" +}) +@Entity(name = "SignatureCreationParameterType") +@Table(name = "SIGNATURECREATIONPARAMETERTY_0") +@Inheritance(strategy = InheritanceType.JOINED) +public class SignatureCreationParameterType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "KeyStore", required = true) + protected KeyStore keyStore; + @XmlElement(name = "KeyName", required = true) + protected KeyName keyName; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the keyStore property. + * + * @return + * possible object is + * {@link KeyStore } + * + */ + @ManyToOne(targetEntity = KeyStore.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "KEYSTORE_SIGNATURECREATIONPA_0") + public KeyStore getKeyStore() { + return keyStore; + } + + /** + * Sets the value of the keyStore property. + * + * @param value + * allowed object is + * {@link KeyStore } + * + */ + public void setKeyStore(KeyStore value) { + this.keyStore = value; + } + + /** + * Gets the value of the keyName property. + * + * @return + * possible object is + * {@link KeyName } + * + */ + @ManyToOne(targetEntity = KeyName.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "KEYNAME_SIGNATURECREATIONPAR_0") + public KeyName getKeyName() { + return keyName; + } + + /** + * Sets the value of the keyName property. + * + * @param value + * allowed object is + * {@link KeyName } + * + */ + public void setKeyName(KeyName value) { + this.keyName = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SignatureCreationParameterType)) { + return false; + } + if (this == object) { + return true; + } + final SignatureCreationParameterType that = ((SignatureCreationParameterType) object); + { + KeyStore lhsKeyStore; + lhsKeyStore = this.getKeyStore(); + KeyStore rhsKeyStore; + rhsKeyStore = that.getKeyStore(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "keyStore", lhsKeyStore), LocatorUtils.property(thatLocator, "keyStore", rhsKeyStore), lhsKeyStore, rhsKeyStore)) { + return false; + } + } + { + KeyName lhsKeyName; + lhsKeyName = this.getKeyName(); + KeyName rhsKeyName; + rhsKeyName = that.getKeyName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "keyName", lhsKeyName), LocatorUtils.property(thatLocator, "keyName", rhsKeyName), lhsKeyName, rhsKeyName)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + KeyStore theKeyStore; + theKeyStore = this.getKeyStore(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyStore", theKeyStore), currentHashCode, theKeyStore); + } + { + KeyName theKeyName; + theKeyName = this.getKeyName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyName", theKeyName), currentHashCode, theKeyName); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java new file mode 100644 index 000000000..9f72d4297 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java @@ -0,0 +1,168 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + * Enthaelt Informationen zur Verfikation von + * Signaturen einer STORK SAML Response + * + * + *

Java class for SignatureVerificationParameterType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SignatureVerificationParameterType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignatureVerificationParameterType", propOrder = { + "trustProfileID" +}) +@Entity(name = "SignatureVerificationParameterType") +@Table(name = "SIGNATUREVERIFICATIONPARAMET_2") +@Inheritance(strategy = InheritanceType.JOINED) +public class SignatureVerificationParameterType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TrustProfileID", required = true) + protected String trustProfileID; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the trustProfileID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TRUSTPROFILEID", length = 255) + public String getTrustProfileID() { + return trustProfileID; + } + + /** + * Sets the value of the trustProfileID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrustProfileID(String value) { + this.trustProfileID = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof SignatureVerificationParameterType)) { + return false; + } + if (this == object) { + return true; + } + final SignatureVerificationParameterType that = ((SignatureVerificationParameterType) object); + { + String lhsTrustProfileID; + lhsTrustProfileID = this.getTrustProfileID(); + String rhsTrustProfileID; + rhsTrustProfileID = that.getTrustProfileID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theTrustProfileID; + theTrustProfileID = this.getTrustProfileID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java new file mode 100644 index 000000000..ad24cadf6 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java @@ -0,0 +1,213 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for StorkAttribute complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="StorkAttribute">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="mandatory" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "StorkAttribute", propOrder = { + "name", + "mandatory" +}) +@Entity(name = "StorkAttribute") +@Table(name = "STORKATTRIBUTE") +@Inheritance(strategy = InheritanceType.JOINED) +public class StorkAttribute + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected String name; + @XmlElement(required = true, type = String.class) + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean mandatory; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "NAME_", length = 255) + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the mandatory property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "MANDATORY") + public Boolean isMandatory() { + return mandatory; + } + + /** + * Sets the value of the mandatory property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMandatory(Boolean value) { + this.mandatory = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof StorkAttribute)) { + return false; + } + if (this == object) { + return true; + } + final StorkAttribute that = ((StorkAttribute) object); + { + String lhsName; + lhsName = this.getName(); + String rhsName; + rhsName = that.getName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { + return false; + } + } + { + Boolean lhsMandatory; + lhsMandatory = this.isMandatory(); + Boolean rhsMandatory; + rhsMandatory = that.isMandatory(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mandatory", lhsMandatory), LocatorUtils.property(thatLocator, "mandatory", rhsMandatory), lhsMandatory, rhsMandatory)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theName; + theName = this.getName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); + } + { + Boolean theMandatory; + theMandatory = this.isMandatory(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandatory", theMandatory), currentHashCode, theMandatory); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java new file mode 100644 index 000000000..f3fb1e5d0 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java @@ -0,0 +1,165 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + * das Attribut URL spezifiziert die Lage des + * Templates + * + * + *

Java class for TemplateType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="TemplateType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="URL" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "TemplateType") +@Entity(name = "TemplateType") +@Table(name = "TEMPLATETYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class TemplateType + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "URL", required = true) + @XmlSchemaType(name = "anyURI") + protected String url; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the url property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "URL") + public String getURL() { + return url; + } + + /** + * Sets the value of the url property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setURL(String value) { + this.url = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof TemplateType)) { + return false; + } + if (this == object) { + return true; + } + final TemplateType that = ((TemplateType) object); + { + String lhsURL; + lhsURL = this.getURL(); + String rhsURL; + rhsURL = that.getURL(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theURL; + theURL = this.getURL(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java new file mode 100644 index 000000000..1dc94e718 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java @@ -0,0 +1,367 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for TemplatesType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="TemplatesType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Template" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TemplateType" maxOccurs="3" minOccurs="0"/>
+ *         <element name="AditionalAuthBlockText" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="BKUSelectionCustomization" type="{http://www.buergerkarte.at/namespaces/moaconfig#}BKUSelectionCustomizationType" minOccurs="0"/>
+ *         <element name="BKUSelectionTemplate" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" minOccurs="0"/>
+ *         <element name="SendAssertionTemplate" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "TemplatesType", propOrder = { + "template", + "aditionalAuthBlockText", + "bkuSelectionCustomization", + "bkuSelectionTemplate", + "sendAssertionTemplate" +}) +@Entity(name = "TemplatesType") +@Table(name = "TEMPLATESTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class TemplatesType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Template") + protected List template; + @XmlElement(name = "AditionalAuthBlockText") + protected String aditionalAuthBlockText; + @XmlElement(name = "BKUSelectionCustomization") + protected BKUSelectionCustomizationType bkuSelectionCustomization; + @XmlElement(name = "BKUSelectionTemplate") + protected TransformsInfoType bkuSelectionTemplate; + @XmlElement(name = "SendAssertionTemplate") + protected TransformsInfoType sendAssertionTemplate; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the template property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the template property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getTemplate().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TemplateType } + * + * + */ + @OneToMany(targetEntity = TemplateType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "TEMPLATE__TEMPLATESTYPE_HJID") + public List getTemplate() { + if (template == null) { + template = new ArrayList(); + } + return this.template; + } + + /** + * + * + */ + public void setTemplate(List template) { + this.template = template; + } + + /** + * Gets the value of the aditionalAuthBlockText property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ADITIONALAUTHBLOCKTEXT", length = 255) + public String getAditionalAuthBlockText() { + return aditionalAuthBlockText; + } + + /** + * Sets the value of the aditionalAuthBlockText property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAditionalAuthBlockText(String value) { + this.aditionalAuthBlockText = value; + } + + /** + * Gets the value of the bkuSelectionCustomization property. + * + * @return + * possible object is + * {@link BKUSelectionCustomizationType } + * + */ + @ManyToOne(targetEntity = BKUSelectionCustomizationType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "BKUSELECTIONCUSTOMIZATION_TE_0") + public BKUSelectionCustomizationType getBKUSelectionCustomization() { + return bkuSelectionCustomization; + } + + /** + * Sets the value of the bkuSelectionCustomization property. + * + * @param value + * allowed object is + * {@link BKUSelectionCustomizationType } + * + */ + public void setBKUSelectionCustomization(BKUSelectionCustomizationType value) { + this.bkuSelectionCustomization = value; + } + + /** + * Gets the value of the bkuSelectionTemplate property. + * + * @return + * possible object is + * {@link TransformsInfoType } + * + */ + @ManyToOne(targetEntity = TransformsInfoType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "BKUSELECTIONTEMPLATE_TEMPLAT_0") + public TransformsInfoType getBKUSelectionTemplate() { + return bkuSelectionTemplate; + } + + /** + * Sets the value of the bkuSelectionTemplate property. + * + * @param value + * allowed object is + * {@link TransformsInfoType } + * + */ + public void setBKUSelectionTemplate(TransformsInfoType value) { + this.bkuSelectionTemplate = value; + } + + /** + * Gets the value of the sendAssertionTemplate property. + * + * @return + * possible object is + * {@link TransformsInfoType } + * + */ + @ManyToOne(targetEntity = TransformsInfoType.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "SENDASSERTIONTEMPLATE_TEMPLA_0") + public TransformsInfoType getSendAssertionTemplate() { + return sendAssertionTemplate; + } + + /** + * Sets the value of the sendAssertionTemplate property. + * + * @param value + * allowed object is + * {@link TransformsInfoType } + * + */ + public void setSendAssertionTemplate(TransformsInfoType value) { + this.sendAssertionTemplate = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof TemplatesType)) { + return false; + } + if (this == object) { + return true; + } + final TemplatesType that = ((TemplatesType) object); + { + List lhsTemplate; + lhsTemplate = (((this.template!= null)&&(!this.template.isEmpty()))?this.getTemplate():null); + List rhsTemplate; + rhsTemplate = (((that.template!= null)&&(!that.template.isEmpty()))?that.getTemplate():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "template", lhsTemplate), LocatorUtils.property(thatLocator, "template", rhsTemplate), lhsTemplate, rhsTemplate)) { + return false; + } + } + { + String lhsAditionalAuthBlockText; + lhsAditionalAuthBlockText = this.getAditionalAuthBlockText(); + String rhsAditionalAuthBlockText; + rhsAditionalAuthBlockText = that.getAditionalAuthBlockText(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "aditionalAuthBlockText", lhsAditionalAuthBlockText), LocatorUtils.property(thatLocator, "aditionalAuthBlockText", rhsAditionalAuthBlockText), lhsAditionalAuthBlockText, rhsAditionalAuthBlockText)) { + return false; + } + } + { + BKUSelectionCustomizationType lhsBKUSelectionCustomization; + lhsBKUSelectionCustomization = this.getBKUSelectionCustomization(); + BKUSelectionCustomizationType rhsBKUSelectionCustomization; + rhsBKUSelectionCustomization = that.getBKUSelectionCustomization(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "bkuSelectionCustomization", lhsBKUSelectionCustomization), LocatorUtils.property(thatLocator, "bkuSelectionCustomization", rhsBKUSelectionCustomization), lhsBKUSelectionCustomization, rhsBKUSelectionCustomization)) { + return false; + } + } + { + TransformsInfoType lhsBKUSelectionTemplate; + lhsBKUSelectionTemplate = this.getBKUSelectionTemplate(); + TransformsInfoType rhsBKUSelectionTemplate; + rhsBKUSelectionTemplate = that.getBKUSelectionTemplate(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "bkuSelectionTemplate", lhsBKUSelectionTemplate), LocatorUtils.property(thatLocator, "bkuSelectionTemplate", rhsBKUSelectionTemplate), lhsBKUSelectionTemplate, rhsBKUSelectionTemplate)) { + return false; + } + } + { + TransformsInfoType lhsSendAssertionTemplate; + lhsSendAssertionTemplate = this.getSendAssertionTemplate(); + TransformsInfoType rhsSendAssertionTemplate; + rhsSendAssertionTemplate = that.getSendAssertionTemplate(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "sendAssertionTemplate", lhsSendAssertionTemplate), LocatorUtils.property(thatLocator, "sendAssertionTemplate", rhsSendAssertionTemplate), lhsSendAssertionTemplate, rhsSendAssertionTemplate)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theTemplate; + theTemplate = (((this.template!= null)&&(!this.template.isEmpty()))?this.getTemplate():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "template", theTemplate), currentHashCode, theTemplate); + } + { + String theAditionalAuthBlockText; + theAditionalAuthBlockText = this.getAditionalAuthBlockText(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "aditionalAuthBlockText", theAditionalAuthBlockText), currentHashCode, theAditionalAuthBlockText); + } + { + BKUSelectionCustomizationType theBKUSelectionCustomization; + theBKUSelectionCustomization = this.getBKUSelectionCustomization(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bkuSelectionCustomization", theBKUSelectionCustomization), currentHashCode, theBKUSelectionCustomization); + } + { + TransformsInfoType theBKUSelectionTemplate; + theBKUSelectionTemplate = this.getBKUSelectionTemplate(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bkuSelectionTemplate", theBKUSelectionTemplate), currentHashCode, theBKUSelectionTemplate); + } + { + TransformsInfoType theSendAssertionTemplate; + theSendAssertionTemplate = this.getSendAssertionTemplate(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sendAssertionTemplate", theSendAssertionTemplate), currentHashCode, theSendAssertionTemplate); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java new file mode 100644 index 000000000..fb061d2eb --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java @@ -0,0 +1,260 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="credentialOID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="enableTestCredentials" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "credentialOID" +}) +@Entity(name = "TestCredentials") +@Table(name = "TESTCREDENTIALS") +@Inheritance(strategy = InheritanceType.JOINED) +public class TestCredentials + implements Serializable, Equals, HashCode +{ + + protected List credentialOID; + @XmlAttribute(name = "enableTestCredentials") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean enableTestCredentials; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List credentialOIDItems; + + /** + * Gets the value of the credentialOID property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the credentialOID property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCredentialOID().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getCredentialOID() { + if (credentialOID == null) { + credentialOID = new ArrayList(); + } + return this.credentialOID; + } + + /** + * + * + */ + public void setCredentialOID(List credentialOID) { + this.credentialOID = credentialOID; + } + + /** + * Gets the value of the enableTestCredentials property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ENABLETESTCREDENTIALS") + public boolean isEnableTestCredentials() { + if (enableTestCredentials == null) { + return new ZeroOneBooleanAdapter().unmarshal("false"); + } else { + return enableTestCredentials; + } + } + + /** + * Sets the value of the enableTestCredentials property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEnableTestCredentials(Boolean value) { + this.enableTestCredentials = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = TestCredentialsCredentialOIDItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "CREDENTIALOIDITEMS_TESTCREDE_0") + public List getCredentialOIDItems() { + if (this.credentialOIDItems == null) { + this.credentialOIDItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.credentialOID)) { + this.credentialOID = ItemUtils.wrap(this.credentialOID, this.credentialOIDItems, TestCredentialsCredentialOIDItem.class); + } + return this.credentialOIDItems; + } + + public void setCredentialOIDItems(List value) { + this.credentialOID = null; + this.credentialOIDItems = null; + this.credentialOIDItems = value; + if (this.credentialOIDItems == null) { + this.credentialOIDItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.credentialOID)) { + this.credentialOID = ItemUtils.wrap(this.credentialOID, this.credentialOIDItems, TestCredentialsCredentialOIDItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof TestCredentials)) { + return false; + } + if (this == object) { + return true; + } + final TestCredentials that = ((TestCredentials) object); + { + List lhsCredentialOID; + lhsCredentialOID = (((this.credentialOID!= null)&&(!this.credentialOID.isEmpty()))?this.getCredentialOID():null); + List rhsCredentialOID; + rhsCredentialOID = (((that.credentialOID!= null)&&(!that.credentialOID.isEmpty()))?that.getCredentialOID():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "credentialOID", lhsCredentialOID), LocatorUtils.property(thatLocator, "credentialOID", rhsCredentialOID), lhsCredentialOID, rhsCredentialOID)) { + return false; + } + } + { + boolean lhsEnableTestCredentials; + lhsEnableTestCredentials = ((this.enableTestCredentials!= null)?this.isEnableTestCredentials():false); + boolean rhsEnableTestCredentials; + rhsEnableTestCredentials = ((that.enableTestCredentials!= null)?that.isEnableTestCredentials():false); + if (!strategy.equals(LocatorUtils.property(thisLocator, "enableTestCredentials", lhsEnableTestCredentials), LocatorUtils.property(thatLocator, "enableTestCredentials", rhsEnableTestCredentials), lhsEnableTestCredentials, rhsEnableTestCredentials)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + List theCredentialOID; + theCredentialOID = (((this.credentialOID!= null)&&(!this.credentialOID.isEmpty()))?this.getCredentialOID():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "credentialOID", theCredentialOID), currentHashCode, theCredentialOID); + } + { + boolean theEnableTestCredentials; + theEnableTestCredentials = ((this.enableTestCredentials!= null)?this.isEnableTestCredentials():false); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "enableTestCredentials", theEnableTestCredentials), currentHashCode, theEnableTestCredentials); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java new file mode 100644 index 000000000..92d92bda7 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "TestCredentialsCredentialOIDItem") +@Table(name = "TESTCREDENTIALSCREDENTIALOID_0") +@Inheritance(strategy = InheritanceType.JOINED) +public class TestCredentialsCredentialOIDItem + implements Serializable, Item +{ + + @XmlElement(name = "credentialOID", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java new file mode 100644 index 000000000..c33a2d500 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java @@ -0,0 +1,253 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.math.BigInteger; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Assertion" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *         <element name="MOASessionCreated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *         <element name="MOASessionUpdated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "assertion", + "moaSessionCreated", + "moaSessionUpdated" +}) +@Entity(name = "TimeOuts") +@Table(name = "TIMEOUTS") +@Inheritance(strategy = InheritanceType.JOINED) +public class TimeOuts + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "Assertion", required = true) + protected BigInteger assertion; + @XmlElement(name = "MOASessionCreated", required = true) + protected BigInteger moaSessionCreated; + @XmlElement(name = "MOASessionUpdated", required = true) + protected BigInteger moaSessionUpdated; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the assertion property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + @Basic + @Column(name = "ASSERTION_", precision = 20, scale = 0) + public BigInteger getAssertion() { + return assertion; + } + + /** + * Sets the value of the assertion property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setAssertion(BigInteger value) { + this.assertion = value; + } + + /** + * Gets the value of the moaSessionCreated property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + @Basic + @Column(name = "MOASESSIONCREATED", precision = 20, scale = 0) + public BigInteger getMOASessionCreated() { + return moaSessionCreated; + } + + /** + * Sets the value of the moaSessionCreated property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setMOASessionCreated(BigInteger value) { + this.moaSessionCreated = value; + } + + /** + * Gets the value of the moaSessionUpdated property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + @Basic + @Column(name = "MOASESSIONUPDATED", precision = 20, scale = 0) + public BigInteger getMOASessionUpdated() { + return moaSessionUpdated; + } + + /** + * Sets the value of the moaSessionUpdated property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setMOASessionUpdated(BigInteger value) { + this.moaSessionUpdated = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof TimeOuts)) { + return false; + } + if (this == object) { + return true; + } + final TimeOuts that = ((TimeOuts) object); + { + BigInteger lhsAssertion; + lhsAssertion = this.getAssertion(); + BigInteger rhsAssertion; + rhsAssertion = that.getAssertion(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "assertion", lhsAssertion), LocatorUtils.property(thatLocator, "assertion", rhsAssertion), lhsAssertion, rhsAssertion)) { + return false; + } + } + { + BigInteger lhsMOASessionCreated; + lhsMOASessionCreated = this.getMOASessionCreated(); + BigInteger rhsMOASessionCreated; + rhsMOASessionCreated = that.getMOASessionCreated(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "moaSessionCreated", lhsMOASessionCreated), LocatorUtils.property(thatLocator, "moaSessionCreated", rhsMOASessionCreated), lhsMOASessionCreated, rhsMOASessionCreated)) { + return false; + } + } + { + BigInteger lhsMOASessionUpdated; + lhsMOASessionUpdated = this.getMOASessionUpdated(); + BigInteger rhsMOASessionUpdated; + rhsMOASessionUpdated = that.getMOASessionUpdated(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "moaSessionUpdated", lhsMOASessionUpdated), LocatorUtils.property(thatLocator, "moaSessionUpdated", rhsMOASessionUpdated), lhsMOASessionUpdated, rhsMOASessionUpdated)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + BigInteger theAssertion; + theAssertion = this.getAssertion(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "assertion", theAssertion), currentHashCode, theAssertion); + } + { + BigInteger theMOASessionCreated; + theMOASessionCreated = this.getMOASessionCreated(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "moaSessionCreated", theMOASessionCreated), currentHashCode, theMOASessionCreated); + } + { + BigInteger theMOASessionUpdated; + theMOASessionUpdated = this.getMOASessionUpdated(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "moaSessionUpdated", theMOASessionUpdated), currentHashCode, theMOASessionUpdated); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java new file mode 100644 index 000000000..c1706a591 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java @@ -0,0 +1,215 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Lob; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + * das Attribut filename verweist auf eine Datei mit + * globalem Element TransformsInfo vom Typ sl10:TransformsInfo; diese + * TransformsInfo werden in den CreateXMLSignatureRequest fuer die + * Signatur des AUTH-Blocks inkludiert + * + * + *

Java class for TransformsInfoType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="TransformsInfoType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="transformation" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *       </sequence>
+ *       <attribute name="filename" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "TransformsInfoType", propOrder = { + "transformation" +}) +@Entity(name = "TransformsInfoType") +@Table(name = "TRANSFORMSINFOTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class TransformsInfoType + implements Serializable, Equals, HashCode +{ + + @XmlElement(required = true) + protected byte[] transformation; + @XmlAttribute(name = "filename", required = true) + @XmlSchemaType(name = "anyURI") + protected String filename; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the transformation property. + * + * @return + * possible object is + * byte[] + */ + @Basic + @Column(name = "TRANSFORMATION") + @Lob + public byte[] getTransformation() { + return transformation; + } + + /** + * Sets the value of the transformation property. + * + * @param value + * allowed object is + * byte[] + */ + public void setTransformation(byte[] value) { + this.transformation = value; + } + + /** + * Gets the value of the filename property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FILENAME") + public String getFilename() { + return filename; + } + + /** + * Sets the value of the filename property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFilename(String value) { + this.filename = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof TransformsInfoType)) { + return false; + } + if (this == object) { + return true; + } + final TransformsInfoType that = ((TransformsInfoType) object); + { + byte[] lhsTransformation; + lhsTransformation = this.getTransformation(); + byte[] rhsTransformation; + rhsTransformation = that.getTransformation(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "transformation", lhsTransformation), LocatorUtils.property(thatLocator, "transformation", rhsTransformation), lhsTransformation, rhsTransformation)) { + return false; + } + } + { + String lhsFilename; + lhsFilename = this.getFilename(); + String rhsFilename; + rhsFilename = that.getFilename(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "filename", lhsFilename), LocatorUtils.property(thatLocator, "filename", rhsFilename), lhsFilename, rhsFilename)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + byte[] theTransformation; + theTransformation = this.getTransformation(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transformation", theTransformation), currentHashCode, theTransformation); + } + { + String theFilename; + theFilename = this.getFilename(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "filename", theFilename), currentHashCode, theFilename); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java new file mode 100644 index 000000000..8bf36c415 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java @@ -0,0 +1,131 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}X509IssuerSerialType">
+ *       <attribute name="mode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" />
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +@Entity(name = "TrustAnchor") +@Table(name = "TRUSTANCHOR") +public class TrustAnchor + extends X509IssuerSerialType + implements Serializable, Equals, HashCode +{ + + @XmlAttribute(name = "mode", required = true) + protected ChainingModeType mode; + + /** + * Gets the value of the mode property. + * + * @return + * possible object is + * {@link ChainingModeType } + * + */ + @Basic + @Column(name = "MODE_", length = 255) + @Enumerated(EnumType.STRING) + public ChainingModeType getMode() { + return mode; + } + + /** + * Sets the value of the mode property. + * + * @param value + * allowed object is + * {@link ChainingModeType } + * + */ + public void setMode(ChainingModeType value) { + this.mode = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof TrustAnchor)) { + return false; + } + if (this == object) { + return true; + } + if (!super.equals(thisLocator, thatLocator, object, strategy)) { + return false; + } + final TrustAnchor that = ((TrustAnchor) object); + { + ChainingModeType lhsMode; + lhsMode = this.getMode(); + ChainingModeType rhsMode; + rhsMode = that.getMode(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mode", lhsMode), LocatorUtils.property(thatLocator, "mode", rhsMode), lhsMode, rhsMode)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = super.hashCode(locator, strategy); + { + ChainingModeType theMode; + theMode = this.getMode(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mode", theMode), currentHashCode, theMode); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java new file mode 100644 index 000000000..5e29131ad --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java @@ -0,0 +1,1077 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for UserDatabase complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="UserDatabase">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="bpk" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="familyname" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="givenname" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="institut" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="mail" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="phone" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="username" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="password" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="password_salt" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="userRequestTokken" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="isAdmin" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="isUsernamePasswordAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="isMandateUser" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="isMailAddressVerified" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="isAdminRequest" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="isPVP2Generated" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="lastLogin" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="OnlineApplication" type="{http://www.buergerkarte.at/namespaces/moaconfig#}OnlineApplication" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="onlyBusinessService" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="businessServiceType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "UserDatabase", propOrder = { + "bpk", + "familyname", + "givenname", + "institut", + "mail", + "phone", + "username", + "password", + "passwordSalt", + "userRequestTokken", + "isActive", + "isAdmin", + "isUsernamePasswordAllowed", + "isMandateUser", + "isMailAddressVerified", + "isAdminRequest", + "isPVP2Generated", + "lastLogin", + "onlineApplication", + "onlyBusinessService", + "businessServiceType" +}) +@Entity(name = "UserDatabase") +@Table(name = "USERDATABASE") +@Inheritance(strategy = InheritanceType.JOINED) +public class UserDatabase + implements Serializable, Equals, HashCode +{ + + protected String bpk; + protected String familyname; + protected String givenname; + @XmlElement(required = true) + protected String institut; + @XmlElement(required = true) + protected String mail; + @XmlElement(required = true) + protected String phone; + @XmlElement(required = true) + protected String username; + @XmlElement(required = true) + protected String password; + @XmlElement(name = "password_salt") + protected String passwordSalt; + protected String userRequestTokken; + @XmlElement(required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isActive; + @XmlElement(required = true, type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isAdmin; + @XmlElement(type = String.class, defaultValue = "true") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isUsernamePasswordAllowed; + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isMandateUser; + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isMailAddressVerified; + @XmlElement(type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isAdminRequest; + @XmlElement(type = String.class) + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean isPVP2Generated; + @XmlElement(required = true) + protected String lastLogin; + @XmlElement(name = "OnlineApplication") + protected List onlineApplication; + @XmlElement(required = true, type = String.class, defaultValue = "false") + @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) + @XmlSchemaType(name = "boolean") + protected Boolean onlyBusinessService; + protected String businessServiceType; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the bpk property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "BPK", length = 255) + public String getBpk() { + return bpk; + } + + /** + * Sets the value of the bpk property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBpk(String value) { + this.bpk = value; + } + + /** + * Gets the value of the familyname property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "FAMILYNAME", length = 255) + public String getFamilyname() { + return familyname; + } + + /** + * Sets the value of the familyname property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFamilyname(String value) { + this.familyname = value; + } + + /** + * Gets the value of the givenname property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "GIVENNAME", length = 255) + public String getGivenname() { + return givenname; + } + + /** + * Sets the value of the givenname property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setGivenname(String value) { + this.givenname = value; + } + + /** + * Gets the value of the institut property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "INSTITUT", length = 255) + public String getInstitut() { + return institut; + } + + /** + * Sets the value of the institut property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInstitut(String value) { + this.institut = value; + } + + /** + * Gets the value of the mail property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "MAIL", length = 255) + public String getMail() { + return mail; + } + + /** + * Sets the value of the mail property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMail(String value) { + this.mail = value; + } + + /** + * Gets the value of the phone property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PHONE", length = 255) + public String getPhone() { + return phone; + } + + /** + * Sets the value of the phone property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPhone(String value) { + this.phone = value; + } + + /** + * Gets the value of the username property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "USERNAME", length = 255) + public String getUsername() { + return username; + } + + /** + * Sets the value of the username property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUsername(String value) { + this.username = value; + } + + /** + * Gets the value of the password property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PASSWORD_", length = 255) + public String getPassword() { + return password; + } + + /** + * Sets the value of the password property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPassword(String value) { + this.password = value; + } + + /** + * Gets the value of the passwordSalt property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "PASSWORDSALT", length = 255) + public String getPasswordSalt() { + return passwordSalt; + } + + /** + * Sets the value of the passwordSalt property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPasswordSalt(String value) { + this.passwordSalt = value; + } + + /** + * Gets the value of the userRequestTokken property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "USERREQUESTTOKKEN", length = 255) + public String getUserRequestTokken() { + return userRequestTokken; + } + + /** + * Sets the value of the userRequestTokken property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUserRequestTokken(String value) { + this.userRequestTokken = value; + } + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISACTIVE") + public Boolean isIsActive() { + return isActive; + } + + /** + * Sets the value of the isActive property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsActive(Boolean value) { + this.isActive = value; + } + + /** + * Gets the value of the isAdmin property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISADMIN") + public Boolean isIsAdmin() { + return isAdmin; + } + + /** + * Sets the value of the isAdmin property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsAdmin(Boolean value) { + this.isAdmin = value; + } + + /** + * Gets the value of the isUsernamePasswordAllowed property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISUSERNAMEPASSWORDALLOWED") + public Boolean isIsUsernamePasswordAllowed() { + return isUsernamePasswordAllowed; + } + + /** + * Sets the value of the isUsernamePasswordAllowed property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsUsernamePasswordAllowed(Boolean value) { + this.isUsernamePasswordAllowed = value; + } + + /** + * Gets the value of the isMandateUser property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISMANDATEUSER") + public Boolean isIsMandateUser() { + return isMandateUser; + } + + /** + * Sets the value of the isMandateUser property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsMandateUser(Boolean value) { + this.isMandateUser = value; + } + + /** + * Gets the value of the isMailAddressVerified property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISMAILADDRESSVERIFIED") + public Boolean isIsMailAddressVerified() { + return isMailAddressVerified; + } + + /** + * Sets the value of the isMailAddressVerified property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsMailAddressVerified(Boolean value) { + this.isMailAddressVerified = value; + } + + /** + * Gets the value of the isAdminRequest property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISADMINREQUEST") + public Boolean isIsAdminRequest() { + return isAdminRequest; + } + + /** + * Sets the value of the isAdminRequest property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsAdminRequest(Boolean value) { + this.isAdminRequest = value; + } + + /** + * Gets the value of the isPVP2Generated property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ISPVP2GENERATED") + public Boolean isIsPVP2Generated() { + return isPVP2Generated; + } + + /** + * Sets the value of the isPVP2Generated property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIsPVP2Generated(Boolean value) { + this.isPVP2Generated = value; + } + + /** + * Gets the value of the lastLogin property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "LASTLOGIN", length = 255) + public String getLastLogin() { + return lastLogin; + } + + /** + * Sets the value of the lastLogin property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastLogin(String value) { + this.lastLogin = value; + } + + /** + * Gets the value of the onlineApplication property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the onlineApplication property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getOnlineApplication().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link OnlineApplication } + * + * + */ + @OneToMany(targetEntity = OnlineApplication.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "ONLINEAPPLICATION_USERDATABA_0") + public List getOnlineApplication() { + if (onlineApplication == null) { + onlineApplication = new ArrayList(); + } + return this.onlineApplication; + } + + /** + * + * + */ + public void setOnlineApplication(List onlineApplication) { + this.onlineApplication = onlineApplication; + } + + /** + * Gets the value of the onlyBusinessService property. + * + * @return + * possible object is + * {@link String } + * + */ + @Transient + public Boolean isOnlyBusinessService() { + return onlyBusinessService; + } + + /** + * Sets the value of the onlyBusinessService property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setOnlyBusinessService(Boolean value) { + this.onlyBusinessService = value; + } + + /** + * Gets the value of the businessServiceType property. + * + * @return + * possible object is + * {@link String } + * + */ + @Transient + public String getBusinessServiceType() { + return businessServiceType; + } + + /** + * Sets the value of the businessServiceType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setBusinessServiceType(String value) { + this.businessServiceType = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof UserDatabase)) { + return false; + } + if (this == object) { + return true; + } + final UserDatabase that = ((UserDatabase) object); + { + String lhsBpk; + lhsBpk = this.getBpk(); + String rhsBpk; + rhsBpk = that.getBpk(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "bpk", lhsBpk), LocatorUtils.property(thatLocator, "bpk", rhsBpk), lhsBpk, rhsBpk)) { + return false; + } + } + { + String lhsFamilyname; + lhsFamilyname = this.getFamilyname(); + String rhsFamilyname; + rhsFamilyname = that.getFamilyname(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "familyname", lhsFamilyname), LocatorUtils.property(thatLocator, "familyname", rhsFamilyname), lhsFamilyname, rhsFamilyname)) { + return false; + } + } + { + String lhsGivenname; + lhsGivenname = this.getGivenname(); + String rhsGivenname; + rhsGivenname = that.getGivenname(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "givenname", lhsGivenname), LocatorUtils.property(thatLocator, "givenname", rhsGivenname), lhsGivenname, rhsGivenname)) { + return false; + } + } + { + String lhsInstitut; + lhsInstitut = this.getInstitut(); + String rhsInstitut; + rhsInstitut = that.getInstitut(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "institut", lhsInstitut), LocatorUtils.property(thatLocator, "institut", rhsInstitut), lhsInstitut, rhsInstitut)) { + return false; + } + } + { + String lhsMail; + lhsMail = this.getMail(); + String rhsMail; + rhsMail = that.getMail(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "mail", lhsMail), LocatorUtils.property(thatLocator, "mail", rhsMail), lhsMail, rhsMail)) { + return false; + } + } + { + String lhsPhone; + lhsPhone = this.getPhone(); + String rhsPhone; + rhsPhone = that.getPhone(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "phone", lhsPhone), LocatorUtils.property(thatLocator, "phone", rhsPhone), lhsPhone, rhsPhone)) { + return false; + } + } + { + String lhsUsername; + lhsUsername = this.getUsername(); + String rhsUsername; + rhsUsername = that.getUsername(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "username", lhsUsername), LocatorUtils.property(thatLocator, "username", rhsUsername), lhsUsername, rhsUsername)) { + return false; + } + } + { + String lhsPassword; + lhsPassword = this.getPassword(); + String rhsPassword; + rhsPassword = that.getPassword(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { + return false; + } + } + { + String lhsPasswordSalt; + lhsPasswordSalt = this.getPasswordSalt(); + String rhsPasswordSalt; + rhsPasswordSalt = that.getPasswordSalt(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "passwordSalt", lhsPasswordSalt), LocatorUtils.property(thatLocator, "passwordSalt", rhsPasswordSalt), lhsPasswordSalt, rhsPasswordSalt)) { + return false; + } + } + { + String lhsUserRequestTokken; + lhsUserRequestTokken = this.getUserRequestTokken(); + String rhsUserRequestTokken; + rhsUserRequestTokken = that.getUserRequestTokken(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "userRequestTokken", lhsUserRequestTokken), LocatorUtils.property(thatLocator, "userRequestTokken", rhsUserRequestTokken), lhsUserRequestTokken, rhsUserRequestTokken)) { + return false; + } + } + { + Boolean lhsIsActive; + lhsIsActive = this.isIsActive(); + Boolean rhsIsActive; + rhsIsActive = that.isIsActive(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { + return false; + } + } + { + Boolean lhsIsAdmin; + lhsIsAdmin = this.isIsAdmin(); + Boolean rhsIsAdmin; + rhsIsAdmin = that.isIsAdmin(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isAdmin", lhsIsAdmin), LocatorUtils.property(thatLocator, "isAdmin", rhsIsAdmin), lhsIsAdmin, rhsIsAdmin)) { + return false; + } + } + { + Boolean lhsIsUsernamePasswordAllowed; + lhsIsUsernamePasswordAllowed = this.isIsUsernamePasswordAllowed(); + Boolean rhsIsUsernamePasswordAllowed; + rhsIsUsernamePasswordAllowed = that.isIsUsernamePasswordAllowed(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isUsernamePasswordAllowed", lhsIsUsernamePasswordAllowed), LocatorUtils.property(thatLocator, "isUsernamePasswordAllowed", rhsIsUsernamePasswordAllowed), lhsIsUsernamePasswordAllowed, rhsIsUsernamePasswordAllowed)) { + return false; + } + } + { + Boolean lhsIsMandateUser; + lhsIsMandateUser = this.isIsMandateUser(); + Boolean rhsIsMandateUser; + rhsIsMandateUser = that.isIsMandateUser(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isMandateUser", lhsIsMandateUser), LocatorUtils.property(thatLocator, "isMandateUser", rhsIsMandateUser), lhsIsMandateUser, rhsIsMandateUser)) { + return false; + } + } + { + Boolean lhsIsMailAddressVerified; + lhsIsMailAddressVerified = this.isIsMailAddressVerified(); + Boolean rhsIsMailAddressVerified; + rhsIsMailAddressVerified = that.isIsMailAddressVerified(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isMailAddressVerified", lhsIsMailAddressVerified), LocatorUtils.property(thatLocator, "isMailAddressVerified", rhsIsMailAddressVerified), lhsIsMailAddressVerified, rhsIsMailAddressVerified)) { + return false; + } + } + { + Boolean lhsIsAdminRequest; + lhsIsAdminRequest = this.isIsAdminRequest(); + Boolean rhsIsAdminRequest; + rhsIsAdminRequest = that.isIsAdminRequest(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isAdminRequest", lhsIsAdminRequest), LocatorUtils.property(thatLocator, "isAdminRequest", rhsIsAdminRequest), lhsIsAdminRequest, rhsIsAdminRequest)) { + return false; + } + } + { + Boolean lhsIsPVP2Generated; + lhsIsPVP2Generated = this.isIsPVP2Generated(); + Boolean rhsIsPVP2Generated; + rhsIsPVP2Generated = that.isIsPVP2Generated(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "isPVP2Generated", lhsIsPVP2Generated), LocatorUtils.property(thatLocator, "isPVP2Generated", rhsIsPVP2Generated), lhsIsPVP2Generated, rhsIsPVP2Generated)) { + return false; + } + } + { + String lhsLastLogin; + lhsLastLogin = this.getLastLogin(); + String rhsLastLogin; + rhsLastLogin = that.getLastLogin(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "lastLogin", lhsLastLogin), LocatorUtils.property(thatLocator, "lastLogin", rhsLastLogin), lhsLastLogin, rhsLastLogin)) { + return false; + } + } + { + List lhsOnlineApplication; + lhsOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); + List rhsOnlineApplication; + rhsOnlineApplication = (((that.onlineApplication!= null)&&(!that.onlineApplication.isEmpty()))?that.getOnlineApplication():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineApplication", lhsOnlineApplication), LocatorUtils.property(thatLocator, "onlineApplication", rhsOnlineApplication), lhsOnlineApplication, rhsOnlineApplication)) { + return false; + } + } + { + Boolean lhsOnlyBusinessService; + lhsOnlyBusinessService = this.isOnlyBusinessService(); + Boolean rhsOnlyBusinessService; + rhsOnlyBusinessService = that.isOnlyBusinessService(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "onlyBusinessService", lhsOnlyBusinessService), LocatorUtils.property(thatLocator, "onlyBusinessService", rhsOnlyBusinessService), lhsOnlyBusinessService, rhsOnlyBusinessService)) { + return false; + } + } + { + String lhsBusinessServiceType; + lhsBusinessServiceType = this.getBusinessServiceType(); + String rhsBusinessServiceType; + rhsBusinessServiceType = that.getBusinessServiceType(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "businessServiceType", lhsBusinessServiceType), LocatorUtils.property(thatLocator, "businessServiceType", rhsBusinessServiceType), lhsBusinessServiceType, rhsBusinessServiceType)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theBpk; + theBpk = this.getBpk(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bpk", theBpk), currentHashCode, theBpk); + } + { + String theFamilyname; + theFamilyname = this.getFamilyname(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "familyname", theFamilyname), currentHashCode, theFamilyname); + } + { + String theGivenname; + theGivenname = this.getGivenname(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "givenname", theGivenname), currentHashCode, theGivenname); + } + { + String theInstitut; + theInstitut = this.getInstitut(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "institut", theInstitut), currentHashCode, theInstitut); + } + { + String theMail; + theMail = this.getMail(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mail", theMail), currentHashCode, theMail); + } + { + String thePhone; + thePhone = this.getPhone(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "phone", thePhone), currentHashCode, thePhone); + } + { + String theUsername; + theUsername = this.getUsername(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "username", theUsername), currentHashCode, theUsername); + } + { + String thePassword; + thePassword = this.getPassword(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); + } + { + String thePasswordSalt; + thePasswordSalt = this.getPasswordSalt(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "passwordSalt", thePasswordSalt), currentHashCode, thePasswordSalt); + } + { + String theUserRequestTokken; + theUserRequestTokken = this.getUserRequestTokken(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userRequestTokken", theUserRequestTokken), currentHashCode, theUserRequestTokken); + } + { + Boolean theIsActive; + theIsActive = this.isIsActive(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); + } + { + Boolean theIsAdmin; + theIsAdmin = this.isIsAdmin(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAdmin", theIsAdmin), currentHashCode, theIsAdmin); + } + { + Boolean theIsUsernamePasswordAllowed; + theIsUsernamePasswordAllowed = this.isIsUsernamePasswordAllowed(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isUsernamePasswordAllowed", theIsUsernamePasswordAllowed), currentHashCode, theIsUsernamePasswordAllowed); + } + { + Boolean theIsMandateUser; + theIsMandateUser = this.isIsMandateUser(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isMandateUser", theIsMandateUser), currentHashCode, theIsMandateUser); + } + { + Boolean theIsMailAddressVerified; + theIsMailAddressVerified = this.isIsMailAddressVerified(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isMailAddressVerified", theIsMailAddressVerified), currentHashCode, theIsMailAddressVerified); + } + { + Boolean theIsAdminRequest; + theIsAdminRequest = this.isIsAdminRequest(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAdminRequest", theIsAdminRequest), currentHashCode, theIsAdminRequest); + } + { + Boolean theIsPVP2Generated; + theIsPVP2Generated = this.isIsPVP2Generated(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isPVP2Generated", theIsPVP2Generated), currentHashCode, theIsPVP2Generated); + } + { + String theLastLogin; + theLastLogin = this.getLastLogin(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lastLogin", theLastLogin), currentHashCode, theLastLogin); + } + { + List theOnlineApplication; + theOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineApplication", theOnlineApplication), currentHashCode, theOnlineApplication); + } + { + Boolean theOnlyBusinessService; + theOnlyBusinessService = this.isOnlyBusinessService(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlyBusinessService", theOnlyBusinessService), currentHashCode, theOnlyBusinessService); + } + { + String theBusinessServiceType; + theBusinessServiceType = this.getBusinessServiceType(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "businessServiceType", theBusinessServiceType), currentHashCode, theBusinessServiceType); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java new file mode 100644 index 000000000..ff1c8f97d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java @@ -0,0 +1,254 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.hyperjaxb3.item.ItemUtils; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *         <element name="VerifyTransformsInfoProfileID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "trustProfileID", + "verifyTransformsInfoProfileID" +}) +@Entity(name = "VerifyAuthBlock") +@Table(name = "VERIFYAUTHBLOCK") +@Inheritance(strategy = InheritanceType.JOINED) +public class VerifyAuthBlock + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TrustProfileID", required = true) + protected String trustProfileID; + @XmlElement(name = "VerifyTransformsInfoProfileID") + protected List verifyTransformsInfoProfileID; + @XmlAttribute(name = "Hjid") + protected Long hjid; + protected transient List verifyTransformsInfoProfileIDItems; + + /** + * Gets the value of the trustProfileID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TRUSTPROFILEID", length = 255) + public String getTrustProfileID() { + return trustProfileID; + } + + /** + * Sets the value of the trustProfileID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrustProfileID(String value) { + this.trustProfileID = value; + } + + /** + * Gets the value of the verifyTransformsInfoProfileID property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the verifyTransformsInfoProfileID property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getVerifyTransformsInfoProfileID().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + @Transient + public List getVerifyTransformsInfoProfileID() { + if (verifyTransformsInfoProfileID == null) { + verifyTransformsInfoProfileID = new ArrayList(); + } + return this.verifyTransformsInfoProfileID; + } + + /** + * + * + */ + public void setVerifyTransformsInfoProfileID(List verifyTransformsInfoProfileID) { + this.verifyTransformsInfoProfileID = verifyTransformsInfoProfileID; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + @OneToMany(targetEntity = VerifyAuthBlockVerifyTransformsInfoProfileIDItem.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "VERIFYTRANSFORMSINFOPROFILEI_1") + public List getVerifyTransformsInfoProfileIDItems() { + if (this.verifyTransformsInfoProfileIDItems == null) { + this.verifyTransformsInfoProfileIDItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.verifyTransformsInfoProfileID)) { + this.verifyTransformsInfoProfileID = ItemUtils.wrap(this.verifyTransformsInfoProfileID, this.verifyTransformsInfoProfileIDItems, VerifyAuthBlockVerifyTransformsInfoProfileIDItem.class); + } + return this.verifyTransformsInfoProfileIDItems; + } + + public void setVerifyTransformsInfoProfileIDItems(List value) { + this.verifyTransformsInfoProfileID = null; + this.verifyTransformsInfoProfileIDItems = null; + this.verifyTransformsInfoProfileIDItems = value; + if (this.verifyTransformsInfoProfileIDItems == null) { + this.verifyTransformsInfoProfileIDItems = new ArrayList(); + } + if (ItemUtils.shouldBeWrapped(this.verifyTransformsInfoProfileID)) { + this.verifyTransformsInfoProfileID = ItemUtils.wrap(this.verifyTransformsInfoProfileID, this.verifyTransformsInfoProfileIDItems, VerifyAuthBlockVerifyTransformsInfoProfileIDItem.class); + } + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof VerifyAuthBlock)) { + return false; + } + if (this == object) { + return true; + } + final VerifyAuthBlock that = ((VerifyAuthBlock) object); + { + String lhsTrustProfileID; + lhsTrustProfileID = this.getTrustProfileID(); + String rhsTrustProfileID; + rhsTrustProfileID = that.getTrustProfileID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { + return false; + } + } + { + List lhsVerifyTransformsInfoProfileID; + lhsVerifyTransformsInfoProfileID = (((this.verifyTransformsInfoProfileID!= null)&&(!this.verifyTransformsInfoProfileID.isEmpty()))?this.getVerifyTransformsInfoProfileID():null); + List rhsVerifyTransformsInfoProfileID; + rhsVerifyTransformsInfoProfileID = (((that.verifyTransformsInfoProfileID!= null)&&(!that.verifyTransformsInfoProfileID.isEmpty()))?that.getVerifyTransformsInfoProfileID():null); + if (!strategy.equals(LocatorUtils.property(thisLocator, "verifyTransformsInfoProfileID", lhsVerifyTransformsInfoProfileID), LocatorUtils.property(thatLocator, "verifyTransformsInfoProfileID", rhsVerifyTransformsInfoProfileID), lhsVerifyTransformsInfoProfileID, rhsVerifyTransformsInfoProfileID)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theTrustProfileID; + theTrustProfileID = this.getTrustProfileID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); + } + { + List theVerifyTransformsInfoProfileID; + theVerifyTransformsInfoProfileID = (((this.verifyTransformsInfoProfileID!= null)&&(!this.verifyTransformsInfoProfileID.isEmpty()))?this.getVerifyTransformsInfoProfileID():null); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "verifyTransformsInfoProfileID", theVerifyTransformsInfoProfileID), currentHashCode, theVerifyTransformsInfoProfileID); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java new file mode 100644 index 000000000..fef7c185b --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java @@ -0,0 +1,93 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import org.jvnet.hyperjaxb3.item.Item; + +@XmlAccessorType(XmlAccessType.FIELD) +@Entity(name = "VerifyAuthBlockVerifyTransformsInfoProfileIDItem") +@Table(name = "VERIFYAUTHBLOCKVERIFYTRANSFO_0") +@Inheritance(strategy = InheritanceType.JOINED) +public class VerifyAuthBlockVerifyTransformsInfoProfileIDItem + implements Serializable, Item +{ + + @XmlElement(name = "VerifyTransformsInfoProfileID", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") + protected String item; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the item property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "ITEM", length = 255) + public String getItem() { + return item; + } + + /** + * Sets the value of the item property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setItem(String value) { + this.item = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java new file mode 100644 index 000000000..3b6ee5fcd --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java @@ -0,0 +1,164 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "trustProfileID" +}) +@Entity(name = "VerifyIdentityLink") +@Table(name = "VERIFYIDENTITYLINK") +@Inheritance(strategy = InheritanceType.JOINED) +public class VerifyIdentityLink + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "TrustProfileID", required = true) + protected String trustProfileID; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the trustProfileID property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "TRUSTPROFILEID", length = 255) + public String getTrustProfileID() { + return trustProfileID; + } + + /** + * Sets the value of the trustProfileID property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setTrustProfileID(String value) { + this.trustProfileID = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof VerifyIdentityLink)) { + return false; + } + if (this == object) { + return true; + } + final VerifyIdentityLink that = ((VerifyIdentityLink) object); + { + String lhsTrustProfileID; + lhsTrustProfileID = this.getTrustProfileID(); + String rhsTrustProfileID; + rhsTrustProfileID = that.getTrustProfileID(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theTrustProfileID; + theTrustProfileID = this.getTrustProfileID(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java new file mode 100644 index 000000000..762b6f884 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java @@ -0,0 +1,181 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + * Verifikation zusaetzlicher Infoboxen + * + * + *

Java class for VerifyInfoboxesType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="VerifyInfoboxesType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="DefaultTrustProfile" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "VerifyInfoboxesType", propOrder = { + "defaultTrustProfile" +}) +@Entity(name = "VerifyInfoboxesType") +@Table(name = "VERIFYINFOBOXESTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class VerifyInfoboxesType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "DefaultTrustProfile") + protected DefaultTrustProfile defaultTrustProfile; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the defaultTrustProfile property. + * + * @return + * possible object is + * {@link DefaultTrustProfile } + * + */ + @ManyToOne(targetEntity = DefaultTrustProfile.class, cascade = { + CascadeType.ALL + }) + @JoinColumn(name = "DEFAULTTRUSTPROFILE_VERIFYIN_0") + public DefaultTrustProfile getDefaultTrustProfile() { + return defaultTrustProfile; + } + + /** + * Sets the value of the defaultTrustProfile property. + * + * @param value + * allowed object is + * {@link DefaultTrustProfile } + * + */ + public void setDefaultTrustProfile(DefaultTrustProfile value) { + this.defaultTrustProfile = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof VerifyInfoboxesType)) { + return false; + } + if (this == object) { + return true; + } + final VerifyInfoboxesType that = ((VerifyInfoboxesType) object); + { + DefaultTrustProfile lhsDefaultTrustProfile; + lhsDefaultTrustProfile = this.getDefaultTrustProfile(); + DefaultTrustProfile rhsDefaultTrustProfile; + rhsDefaultTrustProfile = that.getDefaultTrustProfile(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "defaultTrustProfile", lhsDefaultTrustProfile), LocatorUtils.property(thatLocator, "defaultTrustProfile", rhsDefaultTrustProfile), lhsDefaultTrustProfile, rhsDefaultTrustProfile)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + DefaultTrustProfile theDefaultTrustProfile; + theDefaultTrustProfile = this.getDefaultTrustProfile(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "defaultTrustProfile", theDefaultTrustProfile), currentHashCode, theDefaultTrustProfile); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java new file mode 100644 index 000000000..1195930e2 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java @@ -0,0 +1,213 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + + +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.io.Serializable; +import java.math.BigInteger; +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.Table; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import org.jvnet.jaxb2_commons.lang.Equals; +import org.jvnet.jaxb2_commons.lang.EqualsStrategy; +import org.jvnet.jaxb2_commons.lang.HashCode; +import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; +import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; +import org.jvnet.jaxb2_commons.locator.ObjectLocator; +import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; + + +/** + *

Java class for X509IssuerSerialType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="X509IssuerSerialType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="X509IssuerName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="X509SerialNumber" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "X509IssuerSerialType", propOrder = { + "x509IssuerName", + "x509SerialNumber" +}) +@XmlSeeAlso({ + TrustAnchor.class +}) +@Entity(name = "X509IssuerSerialType") +@Table(name = "X509ISSUERSERIALTYPE") +@Inheritance(strategy = InheritanceType.JOINED) +public class X509IssuerSerialType + implements Serializable, Equals, HashCode +{ + + @XmlElement(name = "X509IssuerName", required = true) + protected String x509IssuerName; + @XmlElement(name = "X509SerialNumber", required = true) + protected BigInteger x509SerialNumber; + @XmlAttribute(name = "Hjid") + protected Long hjid; + + /** + * Gets the value of the x509IssuerName property. + * + * @return + * possible object is + * {@link String } + * + */ + @Basic + @Column(name = "X509ISSUERNAME", length = 255) + public String getX509IssuerName() { + return x509IssuerName; + } + + /** + * Sets the value of the x509IssuerName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setX509IssuerName(String value) { + this.x509IssuerName = value; + } + + /** + * Gets the value of the x509SerialNumber property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + @Basic + @Column(name = "X509SERIALNUMBER", precision = 20, scale = 0) + public BigInteger getX509SerialNumber() { + return x509SerialNumber; + } + + /** + * Sets the value of the x509SerialNumber property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setX509SerialNumber(BigInteger value) { + this.x509SerialNumber = value; + } + + /** + * Gets the value of the hjid property. + * + * @return + * possible object is + * {@link Long } + * + */ + @Id + @Column(name = "HJID") + @GeneratedValue(strategy = GenerationType.AUTO) + public Long getHjid() { + return hjid; + } + + /** + * Sets the value of the hjid property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setHjid(Long value) { + this.hjid = value; + } + + public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { + if (!(object instanceof X509IssuerSerialType)) { + return false; + } + if (this == object) { + return true; + } + final X509IssuerSerialType that = ((X509IssuerSerialType) object); + { + String lhsX509IssuerName; + lhsX509IssuerName = this.getX509IssuerName(); + String rhsX509IssuerName; + rhsX509IssuerName = that.getX509IssuerName(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "x509IssuerName", lhsX509IssuerName), LocatorUtils.property(thatLocator, "x509IssuerName", rhsX509IssuerName), lhsX509IssuerName, rhsX509IssuerName)) { + return false; + } + } + { + BigInteger lhsX509SerialNumber; + lhsX509SerialNumber = this.getX509SerialNumber(); + BigInteger rhsX509SerialNumber; + rhsX509SerialNumber = that.getX509SerialNumber(); + if (!strategy.equals(LocatorUtils.property(thisLocator, "x509SerialNumber", lhsX509SerialNumber), LocatorUtils.property(thatLocator, "x509SerialNumber", rhsX509SerialNumber), lhsX509SerialNumber, rhsX509SerialNumber)) { + return false; + } + } + return true; + } + + public boolean equals(Object object) { + final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; + return equals(null, null, object, strategy); + } + + public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { + int currentHashCode = 1; + { + String theX509IssuerName; + theX509IssuerName = this.getX509IssuerName(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "x509IssuerName", theX509IssuerName), currentHashCode, theX509IssuerName); + } + { + BigInteger theX509SerialNumber; + theX509SerialNumber = this.getX509SerialNumber(); + currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "x509SerialNumber", theX509SerialNumber), currentHashCode, theX509SerialNumber); + } + return currentHashCode; + } + + public int hashCode() { + final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; + return this.hashCode(null, strategy); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java new file mode 100644 index 000000000..a1e54ed3c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java @@ -0,0 +1,9 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.01.09 at 09:01:43 AM CET +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package at.gv.egovernment.moa.id.commons.db.dao.config; -- cgit v1.2.3 From d1b7f7f87f0460f7c96359106a24a4a486d39b15 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 12 Jan 2015 11:51:55 +0100 Subject: disable generation of java source files used for configuration, to avoid name conflict --- id/server/moa-id-commons/pom.xml | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 27beeaaf3..670e855d5 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -171,7 +171,7 @@ - + @@ -204,26 +204,6 @@ - - org.jvnet.hyperjaxb3 - maven-hyperjaxb3-plugin - 0.5.6 - - - generate-sources - - generate - - - - - true - src/main/resources/config - src/main/resources/config - src/main/resources/config/persistence_template.xml - at.gv.egovernment.moa.id.commons.db.dao.config - - true maven-compiler-plugin -- cgit v1.2.3 From 4d16df7e7a3a893332248d20d032d23605eb091e Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Mon, 12 Jan 2015 16:32:43 +0100 Subject: add Jackson 2.5.0 annotations --- id/server/idserverlib/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index f0c845928..b224717c2 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -435,6 +435,12 @@ jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + javax.servlet javax.servlet-api -- cgit v1.2.3 From 3d8ea79b6167a2e4784beaafe5596cc78519e358 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 12 Jan 2015 17:39:59 +0100 Subject: fix hibernate setup --- id/server/moa-id-commons/pom.xml | 15 - .../src/main/resources/META-INF/persistence.xml | 15 + .../moa-id-commons/src/main/resources/bindings.xjb | 35 + .../src/main/resources/config/bindings.xjb | 35 - .../resources/config/hibernate_moasession.cfg.xml | 15 - .../resources/config/hibernate_statistic.cfg.xml | 11 - .../src/main/resources/config/moaid_config_2.0.xsd | 1057 -------------------- .../main/resources/config/persistence_template.xml | 17 - .../main/resources/hibernate_moasession.cfg.xml | 15 + .../src/main/resources/hibernate_statistic.cfg.xml | 11 + .../src/main/resources/moaid_config_2.0.xsd | 1057 ++++++++++++++++++++ .../src/main/resources/persistence_template.xml | 17 + 12 files changed, 1150 insertions(+), 1150 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml create mode 100644 id/server/moa-id-commons/src/main/resources/bindings.xjb delete mode 100644 id/server/moa-id-commons/src/main/resources/config/bindings.xjb delete mode 100644 id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml delete mode 100644 id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml delete mode 100644 id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd delete mode 100644 id/server/moa-id-commons/src/main/resources/config/persistence_template.xml create mode 100644 id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml create mode 100644 id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml create mode 100644 id/server/moa-id-commons/src/main/resources/moaid_config_2.0.xsd create mode 100644 id/server/moa-id-commons/src/main/resources/persistence_template.xml (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 670e855d5..b573263bc 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -128,21 +128,6 @@ install - - - src/main/resources/config - - **/*.java - - - - target/generated-sources/xjc - - **/*.java - - - - diff --git a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml new file mode 100644 index 000000000..e77d6c49e --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,15 @@ + + + + + org.hibernate.ejb.HibernatePersistence + com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/bindings.xjb b/id/server/moa-id-commons/src/main/resources/bindings.xjb new file mode 100644 index 000000000..21714849b --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/bindings.xjb @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb b/id/server/moa-id-commons/src/main/resources/config/bindings.xjb deleted file mode 100644 index 21714849b..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/bindings.xjb +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml b/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml deleted file mode 100644 index e40c8b8a9..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/hibernate_moasession.cfg.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml b/id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml deleted file mode 100644 index aa77a9c67..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/hibernate_statistic.cfg.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd deleted file mode 100644 index d4686bd5e..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ /dev/null @@ -1,1057 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - possibility to include common austrian primary - keys in human readable way, english translation not available - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter der - Authentisierungs-Komponente - - - - - - - - - - - enthält Parameter für die OA - - - - - - spezifiziert den Algorithmus ("pkix" oder - "chaining") für die Zertifikatspfadvalidierung - - - - - - - ein vom SystemDefaultMode abweichender - ChiningMode kann für jeden TrustAnchor gesetzt werden - - - - - - - - - - - - - - - - - verweist auf ein Verzeichnis, das - vertrauenswürdige CA (Zwischen-CA, Wurzel-CA) Zertifikate - enthält. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter für die Kommunikation mit dem - Security-Layer - - - - - - - - - - - enthaelt Konfiguratiosnparameter für die - Kommunikation mit dem MOA SP Modul - - - - - - - enthält Parameter für die SOAP-Verbindung von - der AUTH-Komponente zu MOA-SP; das Attribut URL enthält den - Endpunkt des Server; wird das Schema "https" verwendet müssen - die Kind-Elemente angegeben werden; wird das Schema "http" - verwendet dürfen keine Kind-Elemente angegeben werden; wird das - Element nicht verwendet dann wird MOA-SP über das API - aufgerufen - - - - - - enthält Parameter für die Überprüfung der - Personenbindung - - - - - - - - - - - enthält Parameter für die Überprüfung des - AUTH-Blocks - - - - - - - - - - - - - - - enthält Informationen über akzeptierte Signers - des IdentityLinks - - - - - - - akzeptierte Signer des IdentityLinks werden - per X509SubjectName (Kodierung nach RFC 2253) identifiziert - - - - - - - - - - - - Verbindungsparameter zum SZR-Gateway - (GetIdentityLink) - - - - - - Verbindungsparameter zu den Country-PEPS - (C-PEPS) - - - - - - - - - - - - Verbindungsparameter zum - Online-Vollmachten-Service - - - - - - - - - - - das Attribut filename verweist auf eine Datei mit - globalem Element TransformsInfo vom Typ sl10:TransformsInfo; diese - TransformsInfo werden in den CreateXMLSignatureRequest fuer die - Signatur des AUTH-Blocks inkludiert - - - - - - - - - - - - - - - - - - - das Attribut URL spezifiziert die Lage des - Templates - - - - - - - Verifikation zusaetzlicher Infoboxen - - - - - - Optionales DefaultTrustprofil für die - Überprüfung aller weiteren Infoboxen - - - - - - - - - - - - - Spezifiziert die Lage von XML Schemas - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - URL zu einem Verzeichnis, das akzeptierte - Server-Zertifikate der TLS-Verbindung enthält (keine - CA-Zertifikate) - - - - - - - - - - - - - URL zu einem KeyStore, der den privaten - Schlüssel, der für die TLS-Client-Authentisierung verwendet - wird, enthält - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Soll nicht nur bei leerer oder standardisierter - Vollmacht mit unvollständigen Daten, sondern beispielsweise zu - Kontrollzwecken das Eingabeformular immer angezeigt werden, wenn ein - Einschreiten durch berufliche Parteienvertretung geschieht so kann - dies mittels dieses Schalters veranlasst werden - - - - - - - - - - - - Das Attribut spezifiziert die Lage des - Templates, welches der InputProcessor zur Darstellung des - Eingabeformulars nutzen soll - - - - - - - - - - - Default InputProcessor. Konfiguration eines vom - Standardprozess abweichenden Verarbeitungsvorgangs bei der - beruflichen Parteienvertretung. Der Wert dieses Elements ist der - vollständige Klassenname des InputProzessors - - - - - - Default Wert fuer Formularanzeige. Soll nicht nur - bei leerer oder standardisierter Vollmacht mit unvollstaendigen - Daten, sondern beispielsweise zu Kontrollzwecken das - Eingabeformular zur vervollstaendigung der Vertretenendaten immer - angezeigt werden, wenn ein Einschreiten durch berufliche - Parteienvertretung geschieht so kann dies mittels dieses Schalters - veranlasst werden - - - - - - Default Verbindungsparameter zum SZR-Gateway - (für den EGIZ-Demonstrator im internen Netzwerk: - https://129.27.142.5:8443/szr-gateway/services/MandateCreation) - - - - - - Falls keine speziellen beruflichen - ParteienvertreterInnen definiert sind (Element kommt nicht vor), - werden ausschließlich standardisierte Vollmachten mit einer - MandateID="*" akzeptiert - - - - - - - - - - Konfiguration eines vom Standardprozess - abweichenden Verarbeitungsvorgangs bei der beruflichen - Parteienvertretung. Der Wert dieses Elements ist der vollständige - Klassenname des InputProzessors - - - - - - - Optionale Verbindungsparameter zu speziellem - (SZR-)Gateway - - - - - - - OID der Parteienvertretung lt. "Object Identifier - der öffentlichen Verwaltung" - Konvention, Empfehlung. Diese ID - muss mit der MandateID der übermittelten standardisierten Vollmacht - übereinstimmen. Eine Parteienvertretung für standardisierte - Vollmachten mit der MandateID "*" muss nicht definiert werden und - erlaubt eine allgemeine berufliche Parteienvertretung mit - Standardtexten. In anderen Fällen ist eine erlaubte OID mitttels - dieses Attributs zu definieren - - - - - - Legt fest, ob berufliche Parteienvertretung für - natürliche Personen erlaubt ist - - - - - - - - - Legt fest, ob berufliche Parteienvertretung für - juristische Personen erlaubt ist (welche z.B. ein Organwalter nicht - vertreten darf und dieser Wert aus diesem Grund dort false sein - muss) - - - - - - - - - Beschreibender Text, der an Stelle des - Standardtexts bei der Signatur der Anmeldedaten im Falle einer - vorliegenden beruflichen Parteienvertretung zur Signatur vorgelegt - wird - - - - - - - Enthaelt Informationen zu einem KeyStore bzw. Key - zur STORK SAML AuthnRequest Signaturerstellung - - - - - - - - - - Enthaelt Informationen zur Verfikation von - Signaturen einer STORK SAML Response - - - - - - - - - Enthält Informationen zur Erstellung und - Verifikation von STORK SAML Messages - - - - - - - - - - - - URL zu einem KeyStore, der den privaten Schlüssel - zum Erstellen einer Signatur enthält - - - - - - - - - - - - - Name zum Key eines KeyStores, der den privaten - Schlüssel zum Erstellen einer Signatur darstellt - - - - - - - - - - - - - - Enthält Informationen zu einem Citizen Country - PEPS (C-PEPS) - - - - - - - - - - - - - - - Contains STORK related information - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml b/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml deleted file mode 100644 index 25092ff58..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - diff --git a/id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml b/id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml new file mode 100644 index 000000000..e40c8b8a9 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/hibernate_moasession.cfg.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml b/id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml new file mode 100644 index 000000000..aa77a9c67 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/hibernate_statistic.cfg.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/resources/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/moaid_config_2.0.xsd new file mode 100644 index 000000000..d4686bd5e --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/moaid_config_2.0.xsd @@ -0,0 +1,1057 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + possibility to include common austrian primary + keys in human readable way, english translation not available + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter der + Authentisierungs-Komponente + + + + + + + + + + + enthält Parameter für die OA + + + + + + spezifiziert den Algorithmus ("pkix" oder + "chaining") für die Zertifikatspfadvalidierung + + + + + + + ein vom SystemDefaultMode abweichender + ChiningMode kann für jeden TrustAnchor gesetzt werden + + + + + + + + + + + + + + + + + verweist auf ein Verzeichnis, das + vertrauenswürdige CA (Zwischen-CA, Wurzel-CA) Zertifikate + enthält. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter für die Kommunikation mit dem + Security-Layer + + + + + + + + + + + enthaelt Konfiguratiosnparameter für die + Kommunikation mit dem MOA SP Modul + + + + + + + enthält Parameter für die SOAP-Verbindung von + der AUTH-Komponente zu MOA-SP; das Attribut URL enthält den + Endpunkt des Server; wird das Schema "https" verwendet müssen + die Kind-Elemente angegeben werden; wird das Schema "http" + verwendet dürfen keine Kind-Elemente angegeben werden; wird das + Element nicht verwendet dann wird MOA-SP über das API + aufgerufen + + + + + + enthält Parameter für die Überprüfung der + Personenbindung + + + + + + + + + + + enthält Parameter für die Überprüfung des + AUTH-Blocks + + + + + + + + + + + + + + + enthält Informationen über akzeptierte Signers + des IdentityLinks + + + + + + + akzeptierte Signer des IdentityLinks werden + per X509SubjectName (Kodierung nach RFC 2253) identifiziert + + + + + + + + + + + + Verbindungsparameter zum SZR-Gateway + (GetIdentityLink) + + + + + + Verbindungsparameter zu den Country-PEPS + (C-PEPS) + + + + + + + + + + + + Verbindungsparameter zum + Online-Vollmachten-Service + + + + + + + + + + + das Attribut filename verweist auf eine Datei mit + globalem Element TransformsInfo vom Typ sl10:TransformsInfo; diese + TransformsInfo werden in den CreateXMLSignatureRequest fuer die + Signatur des AUTH-Blocks inkludiert + + + + + + + + + + + + + + + + + + + das Attribut URL spezifiziert die Lage des + Templates + + + + + + + Verifikation zusaetzlicher Infoboxen + + + + + + Optionales DefaultTrustprofil für die + Überprüfung aller weiteren Infoboxen + + + + + + + + + + + + + Spezifiziert die Lage von XML Schemas + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter über die OA, die die + Authentisierungs-Komponente betreffen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + URL zu einem Verzeichnis, das akzeptierte + Server-Zertifikate der TLS-Verbindung enthält (keine + CA-Zertifikate) + + + + + + + + + + + + + URL zu einem KeyStore, der den privaten + Schlüssel, der für die TLS-Client-Authentisierung verwendet + wird, enthält + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Soll nicht nur bei leerer oder standardisierter + Vollmacht mit unvollständigen Daten, sondern beispielsweise zu + Kontrollzwecken das Eingabeformular immer angezeigt werden, wenn ein + Einschreiten durch berufliche Parteienvertretung geschieht so kann + dies mittels dieses Schalters veranlasst werden + + + + + + + + + + + + Das Attribut spezifiziert die Lage des + Templates, welches der InputProcessor zur Darstellung des + Eingabeformulars nutzen soll + + + + + + + + + + + Default InputProcessor. Konfiguration eines vom + Standardprozess abweichenden Verarbeitungsvorgangs bei der + beruflichen Parteienvertretung. Der Wert dieses Elements ist der + vollständige Klassenname des InputProzessors + + + + + + Default Wert fuer Formularanzeige. Soll nicht nur + bei leerer oder standardisierter Vollmacht mit unvollstaendigen + Daten, sondern beispielsweise zu Kontrollzwecken das + Eingabeformular zur vervollstaendigung der Vertretenendaten immer + angezeigt werden, wenn ein Einschreiten durch berufliche + Parteienvertretung geschieht so kann dies mittels dieses Schalters + veranlasst werden + + + + + + Default Verbindungsparameter zum SZR-Gateway + (für den EGIZ-Demonstrator im internen Netzwerk: + https://129.27.142.5:8443/szr-gateway/services/MandateCreation) + + + + + + Falls keine speziellen beruflichen + ParteienvertreterInnen definiert sind (Element kommt nicht vor), + werden ausschließlich standardisierte Vollmachten mit einer + MandateID="*" akzeptiert + + + + + + + + + + Konfiguration eines vom Standardprozess + abweichenden Verarbeitungsvorgangs bei der beruflichen + Parteienvertretung. Der Wert dieses Elements ist der vollständige + Klassenname des InputProzessors + + + + + + + Optionale Verbindungsparameter zu speziellem + (SZR-)Gateway + + + + + + + OID der Parteienvertretung lt. "Object Identifier + der öffentlichen Verwaltung" - Konvention, Empfehlung. Diese ID + muss mit der MandateID der übermittelten standardisierten Vollmacht + übereinstimmen. Eine Parteienvertretung für standardisierte + Vollmachten mit der MandateID "*" muss nicht definiert werden und + erlaubt eine allgemeine berufliche Parteienvertretung mit + Standardtexten. In anderen Fällen ist eine erlaubte OID mitttels + dieses Attributs zu definieren + + + + + + Legt fest, ob berufliche Parteienvertretung für + natürliche Personen erlaubt ist + + + + + + + + + Legt fest, ob berufliche Parteienvertretung für + juristische Personen erlaubt ist (welche z.B. ein Organwalter nicht + vertreten darf und dieser Wert aus diesem Grund dort false sein + muss) + + + + + + + + + Beschreibender Text, der an Stelle des + Standardtexts bei der Signatur der Anmeldedaten im Falle einer + vorliegenden beruflichen Parteienvertretung zur Signatur vorgelegt + wird + + + + + + + Enthaelt Informationen zu einem KeyStore bzw. Key + zur STORK SAML AuthnRequest Signaturerstellung + + + + + + + + + + Enthaelt Informationen zur Verfikation von + Signaturen einer STORK SAML Response + + + + + + + + + Enthält Informationen zur Erstellung und + Verifikation von STORK SAML Messages + + + + + + + + + + + + URL zu einem KeyStore, der den privaten Schlüssel + zum Erstellen einer Signatur enthält + + + + + + + + + + + + + Name zum Key eines KeyStores, der den privaten + Schlüssel zum Erstellen einer Signatur darstellt + + + + + + + + + + + + + + Enthält Informationen zu einem Citizen Country + PEPS (C-PEPS) + + + + + + + + + + + + + + + Contains STORK related information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/id/server/moa-id-commons/src/main/resources/persistence_template.xml b/id/server/moa-id-commons/src/main/resources/persistence_template.xml new file mode 100644 index 000000000..25092ff58 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/persistence_template.xml @@ -0,0 +1,17 @@ + + + + + + + + -- cgit v1.2.3 From 70721aa00fa8eea76e9b632e7f17dd4424d2ad4e Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Tue, 13 Jan 2015 09:22:39 +0100 Subject: use Jackson 2.5.0, write JSON to file, evaluate @JsonIgnore Annotation --- .../id/config/auth/AuthConfigurationProvider.java | 3 + .../config/auth/ConfigurationToJSONConverter.java | 67 ++++++++++++++-------- 2 files changed, 46 insertions(+), 24 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index d33a9ea92..0049813d3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -117,6 +117,8 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; import at.gv.util.config.EgovUtilPropertiesConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; + /** * A class providing access to the Auth Part of the MOA-ID configuration data. * @@ -1118,6 +1120,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { /** * @return the eGovUtilsConfig */ +@JsonIgnore public EgovUtilPropertiesConfiguration geteGovUtilsConfig() { return eGovUtilsConfig; } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 36063ca2c..2efb1e251 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -3,20 +3,25 @@ package at.gv.egovernment.moa.id.config.auth; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; +import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; +import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; -import org.codehaus.jackson.JsonGenerationException; -import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility; -import org.codehaus.jackson.annotate.JsonMethod; -import org.codehaus.jackson.map.JsonMappingException; -import org.codehaus.jackson.map.ObjectMapper; - import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + public class ConfigurationToJSONConverter { AuthConfigurationProvider config; @@ -25,8 +30,7 @@ public class ConfigurationToJSONConverter { try { ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - - List jsonResults = converter.convertConfigToJSONStrings(); + List jsonResults = converter.convertConfigToJSONStrings(true); System.out.println(jsonResults); } catch (ConfigurationException e) { @@ -41,44 +45,60 @@ public class ConfigurationToJSONConverter { config = AuthConfigurationProvider.getInstance(); } - public void writeConfigToJSONFile(String jsonFileName) { - // get JSON - // prettyprint and write to file + public void writeConfigToJSONFile(String jsonFileName, boolean isPrettyPrint) throws FileNotFoundException, + IOException, ConfigurationException { + File out = new File(jsonFileName); + try (PrintWriter outStream = new PrintWriter(out)) { + // get pretty printed JSON + ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); + List jsonResults = converter.convertConfigToJSONStrings(isPrettyPrint); + for (String json : jsonResults) { + outStream.println(json); + } + } } public void writeConfigToJSONDB() throws ConfigurationException { ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - List jsonResults = converter.convertConfigToJSONStrings(); + List jsonResults = converter.convertConfigToJSONStrings(false); + if(jsonResults.isEmpty()){ + System.out.println("WARN: writing EMPTY configuration to database"); + } // TODO: write to db } - public List convertConfigToJSONStrings() { + public List convertConfigToJSONStrings(boolean prettyPrint) { List result = new ArrayList(); ObjectMapper mapper = new ObjectMapper(); - mapper.setVisibility(JsonMethod.FIELD, Visibility.ANY); + mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); + mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); + mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); + + if (prettyPrint) { + mapper.enable(SerializationFeature.INDENT_OUTPUT); + } - int numberOfCalledGetterMethods = 0; try { - System.out.println("=== Start ==="); // find all getter methods for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class) .getPropertyDescriptors()) { - if (pd.getReadMethod() != null && !"class".equals(pd.getName())) { - + // check if correct methods, and not annotated with @JsonIgnore + if ((pd.getReadMethod() != null) + && (!"class".equals(pd.getName())) + && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { try { // get result of get method Object tmp = pd.getReadMethod().invoke(config); - // result to JSON + // convert result to JSON String show = mapper.writeValueAsString(tmp); + System.out.println("Method: " + pd.getDisplayName()); System.out.println(show); result.add(show); - numberOfCalledGetterMethods++; } catch (JsonGenerationException | JsonMappingException e) { - e.printStackTrace(); - // System.out.println("Problems while writing JSON as String"); - // return new ArrayList(); + System.out.println("Problems while writing JSON as String"); + return new ArrayList(); } } } @@ -92,7 +112,6 @@ public class ConfigurationToJSONConverter { return new ArrayList(); } - System.out.println("=== END called:'" + numberOfCalledGetterMethods + "' getter-methods ==="); return result; } -- cgit v1.2.3 From cb6daf2e54d72a4a0bdca0252d96191440cd5f52 Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Tue, 13 Jan 2015 10:23:25 +0100 Subject: move 'persistence' package from project 'moa-id-DTI' here --- id/server/moa-id-commons/pom.xml | 10 +++ .../id/conf/persistence/dal/ConfigProperty.java | 95 ++++++++++++++++++++++ .../id/conf/persistence/dal/ConfigPropertyDao.java | 45 ++++++++++ .../persistence/dal/ConfigPropertyDaoImpl.java | 88 ++++++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index b573263bc..c16c68a5f 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -123,6 +123,16 @@ mysql-connector-java ${mysql-connector.java} + + commons-cli + commons-cli + + + + org.springframework + spring-orm + + diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java new file mode 100644 index 000000000..7e4e217b0 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java @@ -0,0 +1,95 @@ +package com.datentechnik.moa.id.conf.persistence.dal; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.Table; + +/** + * Reflects a MOAID configuration entry. + * + */ +@Table(name = "moaid_configuration") +@Entity +public class ConfigProperty implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "propertyKey", unique = true) + private String key; + + @Lob + @Column(name = "propertyValue") + private String value; + + /** + * Returns the property's key. + * @return The key. + */ + public String getKey() { + return key; + } + + /** + * Sets the property's key. + * @param key The key + */ + public void setKey(String key) { + this.key = key; + } + + /** + * Returns the property's value (which might be {@code null}). + * @return The property's value (might be {@code null}). + */ + public String getValue() { + return value; + } + + /** + * Sets the property's value. + * @param value The value + */ + public void setValue(String value) { + this.value = value; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((key == null) ? 0 : key.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ConfigProperty other = (ConfigProperty) obj; + if (key == null) { + if (other.key != null) + return false; + } else if (!key.equals(other.key)) + return false; + return true; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("ConfigProperty [key="); + builder.append(key); + builder.append(", value="); + builder.append(value); + builder.append("]"); + return builder.toString(); + } +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java new file mode 100644 index 000000000..a11d23ce8 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java @@ -0,0 +1,45 @@ +package com.datentechnik.moa.id.conf.persistence.dal; + +import java.util.List; +import java.util.Set; + +/** + * DAO interface providing means for accessing MOAID configuration properties. + * + */ +public interface ConfigPropertyDao { + + /** + * Returns the {@link ConfigProperty} associated with {@code key} or {@code null} if the entry does not exist. + * + * @param key The configuration key. + * @return The configuration property value or {@code null}. + */ + public ConfigProperty getProperty(String key); + + /** + * Persists a given {@link ConfigProperty}. + * @param property The property to be persisted. + */ + public void saveProperty(ConfigProperty property); + + /** + * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. + * @return The list with the properties. + */ + public List getProperties(); + + /** + * Returns the value for the configuration property associated with {@code key} or {@code null} if the entry does not exist or its value is {@code null}. + * + * @param key The configuration key. + * @return The configuration property value or {@code null}. + */ + public String getPropertyValue(String key); + + /** + * Persists a {@link List} of {@linkplain ConfigProperty ConfigProperties}. + * @param properties The list containing all the properties to be persisted. + */ + public void saveProperties(Set properties); +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java new file mode 100644 index 000000000..e1e0a836c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java @@ -0,0 +1,88 @@ +package com.datentechnik.moa.id.conf.persistence.dal; + +import java.util.List; +import java.util.Set; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.transaction.annotation.Transactional; + +/** + * Database backed implementation of the DAO interface + * + */ + +@Transactional("transactionManager") +public class ConfigPropertyDaoImpl implements ConfigPropertyDao { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @PersistenceContext(unitName = "moaidconf") + private EntityManager em; + + @Override + public void saveProperty(ConfigProperty property) { + if (null == em) { + log.error("No EntityManager set!"); + return; + } + + if (em.find(ConfigProperty.class, property.getKey()) != null) { + log.trace("Property '{}' already exists!", property.toString()); + // TODO: think about merging + // em.merge(property); + } else { + log.debug("Storing '{}'.", property.toString()); + em.persist(property); + } + } + + @Override + public ConfigProperty getProperty(String key) { + log.debug("Looking for configuration property for key '{}'.", key); + ConfigProperty result = em.find(ConfigProperty.class, key); + if (result != null) { + log.debug("Found configuration property {}.", result); + } else { + log.debug("Unable to find configuration property for key '{}'.", key); + } + return result; + } + + @Override + public String getPropertyValue(String key) { + ConfigProperty property = getProperty(key); + if (property == null) { + return null; + } + return property.getValue(); + } + + @Override + public List getProperties() { + log.debug("Retrieving all properties from database."); + TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); + try { + List questionerVoterList = query.getResultList(); + return questionerVoterList; + } catch (NoResultException e) { + log.debug("No property found in database."); + return null; + } + } + + @Override + public void saveProperties(Set properties) { + log.debug("Storing {} properties to database.", properties.size()); + for (ConfigProperty cp : properties) { + saveProperty(cp); + } + em.flush(); + } + +} -- cgit v1.2.3 From 4882a375585451be88bee367a82f9e18a57ebfdf Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Tue, 13 Jan 2015 13:02:26 +0100 Subject: add configuration interface little cleanup in 'ConfigPropertyDaoImpl' --- .../moa/id/conf/persistence/Configuration.java | 48 ++++++++++++++++++++++ .../persistence/dal/ConfigPropertyDaoImpl.java | 11 +++-- 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java new file mode 100644 index 000000000..6ec43c583 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java @@ -0,0 +1,48 @@ +package com.datentechnik.moa.id.conf.persistence; + +import java.util.List; + +/** + * + */ +public interface Configuration { + + /** + * + * @param key + * @return + */ + Object get(String key); + + /** + * + * @param key + * @param clazz + * @return + */ + T get(String key, Class clazz); + + /** + * + * @param key + * @param value + */ + void set(String key, Object value); + + /** + * + * @param key + * @param clazz + * @param defaultValue + * @return + */ + T get(String key, Class clazz, Object defaultValue); + + /** + * + * @param key + * @param clazz + * @return + */ + List getList(String key, Class clazz); +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java index e1e0a836c..2b28cb245 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java @@ -34,7 +34,6 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { if (em.find(ConfigProperty.class, property.getKey()) != null) { log.trace("Property '{}' already exists!", property.toString()); - // TODO: think about merging // em.merge(property); } else { log.debug("Storing '{}'.", property.toString()); @@ -65,11 +64,17 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { @Override public List getProperties() { + + if (null == em) { + log.error("No EntityManager set!"); + return null; + } + log.debug("Retrieving all properties from database."); TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); try { - List questionerVoterList = query.getResultList(); - return questionerVoterList; + List propertiesList = query.getResultList(); + return propertiesList; } catch (NoResultException e) { log.debug("No property found in database."); return null; -- cgit v1.2.3 From ccb85bd3fcd268b4e3cece2d57c1a92374cbc59d Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Tue, 13 Jan 2015 14:41:43 +0100 Subject: add Json annotations to getter methods --- .../at/gv/egovernment/moa/id/config/ConfigurationProvider.java | 10 +++++++--- .../moa/id/config/auth/AuthConfigurationProvider.java | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java index 24def1e02..f24f4e646 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java @@ -46,13 +46,12 @@ package at.gv.egovernment.moa.id.config; -import java.math.BigInteger; -import java.security.Principal; -import java.security.cert.X509Certificate; import java.util.Map; import at.gv.egovernment.moa.id.data.IssuerAndSerial; +import com.fasterxml.jackson.annotation.JsonProperty; + /** * Base class for AuthConfigurationProvider and ProxyConfigurationProvider, * providing functions common to both of them. @@ -131,10 +130,12 @@ public class ConfigurationProvider { * * @return the directory */ + @JsonProperty("getRootConfigFileDir") public String getRootConfigFileDir() { return rootConfigFileDir; } + @JsonProperty("getDefaultChainingMode") public String getDefaultChainingMode() { return defaultChainingMode; } @@ -144,6 +145,7 @@ public class ConfigurationProvider { * Returns the trustedCACertificates. * @return String */ + @JsonProperty("getTrustedCACertificates") public String getTrustedCACertificates() { return trustedCACertificates; @@ -152,6 +154,7 @@ public class ConfigurationProvider { /** * @return the certstoreDirectory */ +@JsonProperty("getCertstoreDirectory") public String getCertstoreDirectory() { return certstoreDirectory; } @@ -159,6 +162,7 @@ public String getCertstoreDirectory() { /** * @return the trustmanagerrevoationchecking */ +@JsonProperty("isTrustmanagerrevoationchecking") public boolean isTrustmanagerrevoationchecking() { return trustmanagerrevoationchecking; } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index 0049813d3..5ccaa4f35 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -1054,6 +1054,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { return Arrays.asList(prop.replaceAll(" ", "").split(",")); } + @JsonProperty("isMonitoringActive") public boolean isMonitoringActive() { String prop = props.getProperty("configuration.monitoring.active", "false"); return Boolean.valueOf(prop); -- cgit v1.2.3 From 3ee292090346f27e7e23d4943b74ada281f20552 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Tue, 13 Jan 2015 14:43:57 +0100 Subject: add initial deserialization, small code restructuring --- .../config/auth/ConfigurationToJSONConverter.java | 118 ++++++++++++++++----- 1 file changed, 90 insertions(+), 28 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 2efb1e251..00a685b5e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -8,16 +8,19 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; +import java.util.Map; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.core.JsonGenerationException; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -30,8 +33,18 @@ public class ConfigurationToJSONConverter { try { ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - List jsonResults = converter.convertConfigToJSONStrings(true); - System.out.println(jsonResults); + Map jsonResults = converter.convertConfigToJSONStrings(true); + for (String name : jsonResults.keySet()) { + System.out.println("Method: " + name + " = "); + System.out.println(jsonResults.get(name)); + converter.convertJsonStringToObject(jsonResults.get(name)); + } + + System.out.println("Try conversion from Json to object"); + for (String name : jsonResults.keySet()) { + Object obj = converter.convertJsonStringToObject(jsonResults.get(name)); + System.out.println(obj); + } } catch (ConfigurationException e) { e.printStackTrace(); @@ -51,9 +64,10 @@ public class ConfigurationToJSONConverter { try (PrintWriter outStream = new PrintWriter(out)) { // get pretty printed JSON ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - List jsonResults = converter.convertConfigToJSONStrings(isPrettyPrint); - for (String json : jsonResults) { - outStream.println(json); + Map jsonResults = converter.convertConfigToJSONStrings(isPrettyPrint); + for (String name : jsonResults.keySet()) { + outStream.println(name); + outStream.println(jsonResults.get(name)); } } @@ -61,24 +75,17 @@ public class ConfigurationToJSONConverter { public void writeConfigToJSONDB() throws ConfigurationException { ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - List jsonResults = converter.convertConfigToJSONStrings(false); - if(jsonResults.isEmpty()){ + Map jsonResults = converter.convertConfigToJSONStrings(false); + if (jsonResults.isEmpty()) { System.out.println("WARN: writing EMPTY configuration to database"); } // TODO: write to db } - public List convertConfigToJSONStrings(boolean prettyPrint) { - - List result = new ArrayList(); - ObjectMapper mapper = new ObjectMapper(); - mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); - mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); - mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); + public Map convertConfigToJSONStrings(boolean prettyPrint) { - if (prettyPrint) { - mapper.enable(SerializationFeature.INDENT_OUTPUT); - } + Map result = new HashMap(); + JsonMapper mapper = new JsonMapper(prettyPrint); try { // find all getter methods @@ -89,30 +96,85 @@ public class ConfigurationToJSONConverter { && (!"class".equals(pd.getName())) && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { try { + JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); // get result of get method Object tmp = pd.getReadMethod().invoke(config); // convert result to JSON - String show = mapper.writeValueAsString(tmp); - System.out.println("Method: " + pd.getDisplayName()); - System.out.println(show); - result.add(show); + String json = mapper.serialize(tmp); + if (name != null) { + result.put(name.value(), json); + } else { + System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); + } + } catch (JsonGenerationException | JsonMappingException e) { - System.out.println("Problems while writing JSON as String"); - return new ArrayList(); + System.out.println("Problems while writing JSON as String"); + return new HashMap(); } } } - // TODO: handle static methods + // no static method handling needed } catch (IntrospectionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { System.out.println("Problems while using reflection to get all getter methods."); } catch (IOException e) { - System.out.println("Problems while writing JSON as String"); - return new ArrayList(); + System.out.println("Problems while writing JSON as string"); + return new HashMap(); } return result; } + public Object convertJsonStringToObject(String jsonString){ + JsonMapper mapper = new JsonMapper(); + Object result = null; + try { + result = mapper.deserialize(jsonString, null); + } catch (JsonParseException | JsonMappingException e) { + System.out.println("Problems parsing the JSON string"); + return null; + } catch (IOException e) { + System.out.println("Problems while reading JSON string"); + return null; + } + + return result; + } + + private class JsonMapper { + + private ObjectMapper mapper = new ObjectMapper(); + + public JsonMapper(){ + this(false); + } + + public JsonMapper(boolean prettyPrint) { + mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); + mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); + mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); + if (prettyPrint) { + mapper.enable(SerializationFeature.INDENT_OUTPUT); + } + } + + public String serialize(Object value) throws JsonProcessingException { + return mapper.writeValueAsString(value); + } + + public Object deserialize(String value, Class type) throws JsonParseException, JsonMappingException, + IOException { + + ObjectMapper mapper = new ObjectMapper(); + if (type != null) { + return mapper.readValue(value, type); + } else { + return mapper.readValue(value, Object.class); + } + + } + + } + } -- cgit v1.2.3 From c20d8f3da0b112864130031d39800e60289380d4 Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Tue, 13 Jan 2015 16:12:36 +0100 Subject: add raw configuration persistence functionality some problems: * all tables annotated via '@Table' are created in every database connected * loading of 'Configuration' via Spring isn't pretty at all --- .../config/auth/ConfigurationToJSONConverter.java | 228 ++++++++++----------- id/server/moa-id-commons/pom.xml | 25 +++ .../moa/id/conf/persistence/ConfigurationImpl.java | 162 +++++++++++++++ .../src/main/resources/META-INF/persistence.xml | 5 + .../src/main/resources/configuration.beans.xml | 53 +++++ 5 files changed, 357 insertions(+), 116 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java create mode 100644 id/server/moa-id-commons/src/main/resources/configuration.beans.xml (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 00a685b5e..321cb150c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -3,178 +3,174 @@ package at.gv.egovernment.moa.id.config.auth; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.datentechnik.moa.id.conf.persistence.Configuration; +import com.datentechnik.moa.id.conf.persistence.ConfigurationImpl; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; public class ConfigurationToJSONConverter { AuthConfigurationProvider config; + Configuration configuration; public static void main(String[] args) { try { ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - Map jsonResults = converter.convertConfigToJSONStrings(true); - for (String name : jsonResults.keySet()) { - System.out.println("Method: " + name + " = "); - System.out.println(jsonResults.get(name)); - converter.convertJsonStringToObject(jsonResults.get(name)); - } - - System.out.println("Try conversion from Json to object"); - for (String name : jsonResults.keySet()) { - Object obj = converter.convertJsonStringToObject(jsonResults.get(name)); - System.out.println(obj); - } + converter.writeConfigToJSONDB(); + System.out.println("====================================="); + System.out.println("====================================="); + converter.readConfigFromDB(); } catch (ConfigurationException e) { e.printStackTrace(); - System.out.println("Problems reading the configuration file in: " - + System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME)); + System.out.println("Problems reading the configuration file in: " + System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME)); System.exit(1); } + } public ConfigurationToJSONConverter() throws ConfigurationException { config = AuthConfigurationProvider.getInstance(); - } - public void writeConfigToJSONFile(String jsonFileName, boolean isPrettyPrint) throws FileNotFoundException, - IOException, ConfigurationException { - File out = new File(jsonFileName); - try (PrintWriter outStream = new PrintWriter(out)) { - // get pretty printed JSON - ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - Map jsonResults = converter.convertConfigToJSONStrings(isPrettyPrint); - for (String name : jsonResults.keySet()) { - outStream.println(name); - outStream.println(jsonResults.get(name)); - } - } + System.getProperties().setProperty("location", "file:" + "c:\\Users\\cwagner\\dev\\temp\\moaid_test_db.properties"); - } + ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); + configuration = (ConfigurationImpl) context.getBean(ConfigurationImpl.class); - public void writeConfigToJSONDB() throws ConfigurationException { - ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - Map jsonResults = converter.convertConfigToJSONStrings(false); - if (jsonResults.isEmpty()) { - System.out.println("WARN: writing EMPTY configuration to database"); - } - // TODO: write to db } - public Map convertConfigToJSONStrings(boolean prettyPrint) { - - Map result = new HashMap(); - JsonMapper mapper = new JsonMapper(prettyPrint); + // public void writeConfigToJSONFile(String jsonFileName, boolean isPrettyPrint) throws FileNotFoundException, + // IOException, ConfigurationException { + // File out = new File(jsonFileName); + // try (PrintWriter outStream = new PrintWriter(out)) { + // // get pretty printed JSON + // ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); + // Map jsonResults = converter.convertConfigToJSONStrings(isPrettyPrint); + // for (String name : jsonResults.keySet()) { + // outStream.println(name); + // outStream.println(jsonResults.get(name)); + // } + // } + // + // } + + public void writeConfigToJSONDB() { try { // find all getter methods - for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class) - .getPropertyDescriptors()) { + for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class).getPropertyDescriptors()) { // check if correct methods, and not annotated with @JsonIgnore - if ((pd.getReadMethod() != null) - && (!"class".equals(pd.getName())) - && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { + if ((pd.getReadMethod() != null) && (!"class".equals(pd.getName())) && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { + + JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); + // get result of get method + Object tmp; try { - JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); - // get result of get method - Object tmp = pd.getReadMethod().invoke(config); + tmp = pd.getReadMethod().invoke(config); + // convert result to JSON - String json = mapper.serialize(tmp); + if (name != null) { - result.put(name.value(), json); + + + configuration.set(name.value(), tmp); } else { System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); } - - } catch (JsonGenerationException | JsonMappingException e) { - System.out.println("Problems while writing JSON as String"); - return new HashMap(); + } catch (IllegalAccessException | InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } + } } // no static method handling needed - } catch (IntrospectionException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + } catch (IllegalArgumentException e) { System.out.println("Problems while using reflection to get all getter methods."); - } catch (IOException e) { - System.out.println("Problems while writing JSON as string"); - return new HashMap(); + } catch (IntrospectionException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - return result; } - public Object convertJsonStringToObject(String jsonString){ - JsonMapper mapper = new JsonMapper(); - Object result = null; + public void readConfigFromDB() { try { - result = mapper.deserialize(jsonString, null); - } catch (JsonParseException | JsonMappingException e) { - System.out.println("Problems parsing the JSON string"); - return null; - } catch (IOException e) { - System.out.println("Problems while reading JSON string"); - return null; - } - - return result; - } - - private class JsonMapper { - - private ObjectMapper mapper = new ObjectMapper(); - - public JsonMapper(){ - this(false); - } + // find all getter methods + for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class).getPropertyDescriptors()) { + // check if correct methods, and not annotated with @JsonIgnore + if ((pd.getReadMethod() != null) && (!"class".equals(pd.getName())) && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { + + JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); + // get result of get method + Object tmp; + if (name != null) { + + Object o = configuration.get(name.value()); + + System.out.println(">>> OBJECT: " + o ); + + } else { + System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); + } - public JsonMapper(boolean prettyPrint) { - mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); - mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); - mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); - if (prettyPrint) { - mapper.enable(SerializationFeature.INDENT_OUTPUT); + } } - } - - public String serialize(Object value) throws JsonProcessingException { - return mapper.writeValueAsString(value); - } - public Object deserialize(String value, Class type) throws JsonParseException, JsonMappingException, - IOException { - - ObjectMapper mapper = new ObjectMapper(); - if (type != null) { - return mapper.readValue(value, type); - } else { - return mapper.readValue(value, Object.class); - } + // no static method handling needed + } catch (IllegalArgumentException e) { + System.out.println("Problems while using reflection to get all getter methods."); + } catch (IntrospectionException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - - } + } + // ============================================================================= + // private class JsonMapper { + // + // private ObjectMapper mapper = new ObjectMapper(); + // + // public JsonMapper(){ + // this(false); + // } + // + // public JsonMapper(boolean prettyPrint) { + // mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); + // mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); + // mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); + // if (prettyPrint) { + // mapper.enable(SerializationFeature.INDENT_OUTPUT); + // } + // } + // + // public String serialize(Object value) throws JsonProcessingException { + // return mapper.writeValueAsString(value); + // } + // + // public Object deserialize(String value, Class type) throws JsonParseException, JsonMappingException, + // IOException { + // + // ObjectMapper mapper = new ObjectMapper(); + // if (type != null) { + // return mapper.readValue(value, type); + // } else { + // return mapper.readValue(value, Object.class); + // } + // + // } + // + // } } diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index c16c68a5f..85bd82dd4 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -123,6 +123,7 @@ mysql-connector-java ${mysql-connector.java} + commons-cli commons-cli @@ -133,6 +134,30 @@ spring-orm + + com.fasterxml.jackson.core + jackson-databind + + + + + cglib + cglib + 2.2.2 + + + + com.h2database + h2 + 1.4.178 + + + + commons-dbcp + commons-dbcp + 1.4 + + diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java new file mode 100644 index 000000000..da2c4b7e6 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java @@ -0,0 +1,162 @@ +package com.datentechnik.moa.id.conf.persistence; + +import java.io.IOException; +import java.util.List; + +import org.springframework.beans.factory.annotation.Required; +import org.springframework.stereotype.Component; + +import com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty; +import com.datentechnik.moa.id.conf.persistence.dal.ConfigPropertyDao; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +/** + * + * + */ +@Component +public class ConfigurationImpl implements Configuration { + + ConfigPropertyDao configPropertyDao; + private JsonMapper mapper = new JsonMapper(); + + /** + * Sets the {@link ConfigPropertyDao}. + * @param configPropertyDao the ConfigPropertyDao + */ + @Required + public void setConfigPropertyDao(ConfigPropertyDao configPropertyDao) { + this.configPropertyDao = configPropertyDao; + } + + @Override + public Object get(String key) { + // return null if key does not exist + + try { + return mapper.deserialize(getPropertyValue(key), null); + } catch (Exception e) { + return null; + } + } + + @Override + public T get(String key, Class clazz) { + // return null if key does not exist + ConfigProperty property = configPropertyDao.getProperty(key); + if (property != null && property.getValue() != null) { + try { + return clazz.cast(mapper.deserialize(property.getValue(), clazz)); + } catch (IOException e) { + return null; + } + } else { + return null; + } + } + + @Override + public void set(String key, Object value) { + + ConfigProperty keyValue = new ConfigProperty(); + keyValue.setKey(key); + try { + keyValue.setValue(mapper.serialize(value)); + // System.out.println(">> key - value: " + keyValue.getKey() + " - " + keyValue.getValue() + "\n"); + configPropertyDao.saveProperty(keyValue); + + } catch (JsonProcessingException e) { + // TODO do proper error handling + e.printStackTrace(); + } + + } + + @Override + public T get(String key, Class clazz, Object defaultValue) { + // TODO complete the method + T value = get(key, clazz); + if (value != null) { + return value; + } else { + return clazz.cast(defaultValue); + } + } + + @Override + public List getList(String key, Class clazz) { + // return empty list if key does not exist + // TODO Auto-generated method stub + + return null; + } + + private String getPropertyValue(String key) { + ConfigProperty property = configPropertyDao.getProperty(key); + return property.getValue(); + } + + /** + * + * + */ + private class JsonMapper { + + private ObjectMapper mapper = new ObjectMapper(); + + public JsonMapper() { + this(false); + } + + /** + * + * @param prettyPrint + */ + public JsonMapper(boolean prettyPrint) { + mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); + mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); + mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); + if (prettyPrint) { + mapper.enable(SerializationFeature.INDENT_OUTPUT); + } + } + + /** + * + * @param value + * @return + * @throws JsonProcessingException + */ + public String serialize(Object value) throws JsonProcessingException { + return mapper.writeValueAsString(value); + } + + /** + * + * @param value + * @param clazz + * @return + * @throws JsonParseException + * @throws JsonMappingException + * @throws IOException + */ + public Object deserialize(String value, Class clazz) throws JsonParseException, JsonMappingException, IOException { + + ObjectMapper mapper = new ObjectMapper(); + if (clazz != null) { + return mapper.readValue(value, clazz); + } else { + return mapper.readValue(value, Object.class); + } + + } + + }; + +} diff --git a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml index e77d6c49e..640c1504c 100644 --- a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml +++ b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml @@ -6,6 +6,11 @@ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> + org.hibernate.ejb.HibernatePersistence + com.datentechnik.moa.id.conf.persistence.dal.SOME_CLASS + + + org.hibernate.ejb.HibernatePersistence com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml new file mode 100644 index 000000000..762c55507 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 7d3a585005e9907b043770891206eb591e064ebe Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Tue, 13 Jan 2015 16:35:33 +0100 Subject: moved path to property file to runtime argument, small code cleanup --- .../config/auth/ConfigurationToJSONConverter.java | 100 ++++----------------- 1 file changed, 18 insertions(+), 82 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 321cb150c..b47ba0e27 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -18,13 +18,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class ConfigurationToJSONConverter { - AuthConfigurationProvider config; - Configuration configuration; + AuthConfigurationProvider configProvider; + Configuration configDataBase; public static void main(String[] args) { try { - ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); + ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(args[0]); converter.writeConfigToJSONDB(); System.out.println("====================================="); System.out.println("====================================="); @@ -38,31 +38,15 @@ public class ConfigurationToJSONConverter { } - public ConfigurationToJSONConverter() throws ConfigurationException { - config = AuthConfigurationProvider.getInstance(); - - System.getProperties().setProperty("location", "file:" + "c:\\Users\\cwagner\\dev\\temp\\moaid_test_db.properties"); + public ConfigurationToJSONConverter(String pathToDBConfigPropertiesFile) throws ConfigurationException { + configProvider = AuthConfigurationProvider.getInstance(); + System.getProperties().setProperty("location", "file:" + pathToDBConfigPropertiesFile); ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - configuration = (ConfigurationImpl) context.getBean(ConfigurationImpl.class); + configDataBase = (ConfigurationImpl) context.getBean(ConfigurationImpl.class); } - // public void writeConfigToJSONFile(String jsonFileName, boolean isPrettyPrint) throws FileNotFoundException, - // IOException, ConfigurationException { - // File out = new File(jsonFileName); - // try (PrintWriter outStream = new PrintWriter(out)) { - // // get pretty printed JSON - // ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(); - // Map jsonResults = converter.convertConfigToJSONStrings(isPrettyPrint); - // for (String name : jsonResults.keySet()) { - // outStream.println(name); - // outStream.println(jsonResults.get(name)); - // } - // } - // - // } - public void writeConfigToJSONDB() { try { @@ -75,14 +59,10 @@ public class ConfigurationToJSONConverter { // get result of get method Object tmp; try { - tmp = pd.getReadMethod().invoke(config); - + tmp = pd.getReadMethod().invoke(configProvider); // convert result to JSON - if (name != null) { - - - configuration.set(name.value(), tmp); + configDataBase.set(name.value(), tmp); } else { System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); } @@ -90,7 +70,6 @@ public class ConfigurationToJSONConverter { // TODO Auto-generated catch block e.printStackTrace(); } - } } @@ -99,8 +78,7 @@ public class ConfigurationToJSONConverter { } catch (IllegalArgumentException e) { System.out.println("Problems while using reflection to get all getter methods."); } catch (IntrospectionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + System.out.println("Problems while using reflection to get all getter methods."); } } @@ -108,69 +86,27 @@ public class ConfigurationToJSONConverter { public void readConfigFromDB() { try { // find all getter methods - for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class).getPropertyDescriptors()) { + for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class) + .getPropertyDescriptors()) { // check if correct methods, and not annotated with @JsonIgnore - if ((pd.getReadMethod() != null) && (!"class".equals(pd.getName())) && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { + if ((pd.getReadMethod() != null) + && (!"class".equals(pd.getName())) + && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); // get result of get method - Object tmp; if (name != null) { - - Object o = configuration.get(name.value()); - - System.out.println(">>> OBJECT: " + o ); - + System.out.println(">>> OBJECT: " + configDataBase.get(name.value())); } else { System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); } - } } - - // no static method handling needed - } catch (IllegalArgumentException e) { System.out.println("Problems while using reflection to get all getter methods."); } catch (IntrospectionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + System.out.println("Problems while using reflection to get all getter methods."); + } } - // ============================================================================= - // private class JsonMapper { - // - // private ObjectMapper mapper = new ObjectMapper(); - // - // public JsonMapper(){ - // this(false); - // } - // - // public JsonMapper(boolean prettyPrint) { - // mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); - // mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); - // mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); - // if (prettyPrint) { - // mapper.enable(SerializationFeature.INDENT_OUTPUT); - // } - // } - // - // public String serialize(Object value) throws JsonProcessingException { - // return mapper.writeValueAsString(value); - // } - // - // public Object deserialize(String value, Class type) throws JsonParseException, JsonMappingException, - // IOException { - // - // ObjectMapper mapper = new ObjectMapper(); - // if (type != null) { - // return mapper.readValue(value, type); - // } else { - // return mapper.readValue(value, Object.class); - // } - // - // } - // - // } } -- cgit v1.2.3 From 8ce4c2f836484676b5d5a98001613a72df15d22d Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 14 Jan 2015 10:27:47 +0100 Subject: add NewAuthenticationProvider (instantiated as Spring bean, reads JSON from db), add AuthConfiguration interface for Authentication providers --- .../moa/id/config/auth/AuthConfiguration.java | 85 ++++++++ .../id/config/auth/AuthConfigurationProvider.java | 2 +- .../config/auth/ConfigurationToJSONConverter.java | 23 ++- .../config/auth/NewAuthConfigurationProvider.java | 216 +++++++++++++++++++++ .../src/main/resources/configuration.beans.xml | 1 + 5 files changed, 317 insertions(+), 10 deletions(-) create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java new file mode 100644 index 000000000..760b2cd0a --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java @@ -0,0 +1,85 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.util.List; +import java.util.Properties; + +import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; +import at.gv.egovernment.moa.id.config.stork.STORKConfig; + +public interface AuthConfiguration { + + public Properties getGeneralPVP2ProperiesConfig(); + + public Properties getGeneralOAuth20ProperiesConfig(); + + public ProtocolAllowed getAllowedProtocols(); + + public PVP2 getGeneralPVP2DBConfig(); + + public TimeOuts getTimeOuts() throws ConfigurationException; + + public String getAlternativeSourceID() throws ConfigurationException; + + public List getLegacyAllowedProtocols(); + + public OAAuthParameter getOnlineApplicationParameter(String oaURL); + + public String getMoaSpAuthBlockTrustProfileID() throws ConfigurationException; + + public List getMoaSpAuthBlockVerifyTransformsInfoIDs() throws ConfigurationException; + + public ConnectionParameter getMoaSpConnectionParameter() throws ConfigurationException; + + public ConnectionParameter getForeignIDConnectionParameter() throws ConfigurationException; + + public ConnectionParameter getOnlineMandatesConnectionParameter() throws ConfigurationException; + + public String getMoaSpIdentityLinkTrustProfileID() throws ConfigurationException; + + public List getTransformsInfos() throws ConfigurationException; + + public List getIdentityLinkX509SubjectNames() throws ConfigurationException; + + public List getSLRequestTemplates() throws ConfigurationException; + + public String getSLRequestTemplates(String type) throws ConfigurationException; + + public List getDefaultBKUURLs() throws ConfigurationException; + + public String getDefaultBKUURL(String type) throws ConfigurationException; + + public String getSSOTagetIdentifier() throws ConfigurationException; + + public String getSSOFriendlyName(); + + public String getSSOSpecialText(); + + public String getMOASessionEncryptionKey(); + + public String getMOAConfigurationEncryptionKey(); + + public boolean isIdentityLinkResigning(); + + public String getIdentityLinkResigningKey(); + + public boolean isMonitoringActive(); + + public String getMonitoringTestIdentityLinkURL(); + + public String getMonitoringMessageSuccess(); + + public boolean isAdvancedLoggingActive(); + + public String getPublicURLPrefix(); + + public boolean isPVP2AssertionEncryptionActive(); + + public boolean isCertifiacteQCActive(); + + public STORKConfig getStorkConfig() throws ConfigurationException; + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index 5ccaa4f35..5fc416b16 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -137,7 +137,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; * * @version $Id$ */ -public class AuthConfigurationProvider extends ConfigurationProvider { +public class AuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration { // /** DEFAULT_ENCODING is "UTF-8" */ // private static final String DEFAULT_ENCODING="UTF-8"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index b47ba0e27..90543e588 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -5,6 +5,8 @@ import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -12,13 +14,15 @@ import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; import com.datentechnik.moa.id.conf.persistence.Configuration; -import com.datentechnik.moa.id.conf.persistence.ConfigurationImpl; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; public class ConfigurationToJSONConverter { - AuthConfigurationProvider configProvider; + @Autowired + NewAuthConfigurationProvider configProvider; + + @Autowired Configuration configDataBase; public static void main(String[] args) { @@ -39,11 +43,11 @@ public class ConfigurationToJSONConverter { } public ConfigurationToJSONConverter(String pathToDBConfigPropertiesFile) throws ConfigurationException { - configProvider = AuthConfigurationProvider.getInstance(); System.getProperties().setProperty("location", "file:" + pathToDBConfigPropertiesFile); ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - configDataBase = (ConfigurationImpl) context.getBean(ConfigurationImpl.class); + AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory(); + acbFactory.autowireBean(this); } @@ -51,9 +55,11 @@ public class ConfigurationToJSONConverter { try { // find all getter methods - for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class).getPropertyDescriptors()) { + for (PropertyDescriptor pd : Introspector.getBeanInfo(NewAuthConfigurationProvider.class).getPropertyDescriptors()) { // check if correct methods, and not annotated with @JsonIgnore - if ((pd.getReadMethod() != null) && (!"class".equals(pd.getName())) && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { + if ((pd.getReadMethod() != null) + && (!"class".equals(pd.getName())) + && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); // get result of get method @@ -86,13 +92,12 @@ public class ConfigurationToJSONConverter { public void readConfigFromDB() { try { // find all getter methods - for (PropertyDescriptor pd : Introspector.getBeanInfo(AuthConfigurationProvider.class) + for (PropertyDescriptor pd : Introspector.getBeanInfo(NewAuthConfigurationProvider.class) .getPropertyDescriptors()) { // check if correct methods, and not annotated with @JsonIgnore if ((pd.getReadMethod() != null) && (!"class".equals(pd.getName())) && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { - JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); // get result of get method if (name != null) { @@ -106,7 +111,7 @@ public class ConfigurationToJSONConverter { System.out.println("Problems while using reflection to get all getter methods."); } catch (IntrospectionException e) { System.out.println("Problems while using reflection to get all getter methods."); + } } - } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java new file mode 100644 index 000000000..4f2284d3d --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java @@ -0,0 +1,216 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.util.List; +import java.util.Properties; + +import org.springframework.beans.factory.annotation.Autowired; + +import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; +import at.gv.egovernment.moa.id.config.stork.STORKConfig; + +import com.datentechnik.moa.id.conf.persistence.ConfigurationImpl; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class NewAuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration { + + @Autowired + private ConfigurationImpl configuration; + + @JsonProperty("getGeneralPVP2ProperiesConfig") + public Properties getGeneralPVP2ProperiesConfig() { + return configuration.get("getGeneralPVP2ProperiesConfig", Properties.class); + } + + @JsonProperty("getGeneralOAuth20ProperiesConfig") + public Properties getGeneralOAuth20ProperiesConfig() { + return configuration.get("getGeneralOAuth20ProperiesConfig", Properties.class); + } + + @JsonProperty("getAllowedProtocols") + public ProtocolAllowed getAllowedProtocols() { + return configuration.get("getAllowedProtocols", ProtocolAllowed.class); + } + + @JsonProperty("getGeneralPVP2DBConfig") + public PVP2 getGeneralPVP2DBConfig() { + return configuration.get("getGeneralPVP2DBConfig", PVP2.class); + } + + @JsonProperty("getTimeOuts") + public TimeOuts getTimeOuts() throws ConfigurationException { + return configuration.get("getTimeOuts", TimeOuts.class); + } + + @JsonProperty("getAlternativeSourceID") + public String getAlternativeSourceID() throws ConfigurationException { + return configuration.get("getAlternativeSourceID", String.class); + } + + @JsonProperty("getLegacyAllowedProtocols") + public List getLegacyAllowedProtocols() { + return configuration.getList("getLegacyAllowedProtocols", String.class); + } + + @JsonProperty("getOnlineApplicationParameter") + public OAAuthParameter getOnlineApplicationParameter(String oaURL) { + return configuration.get("getOnlineApplicationParameter", OAAuthParameter.class); + } + + @JsonProperty("getMoaSpAuthBlockTrustProfileID") + public String getMoaSpAuthBlockTrustProfileID() throws ConfigurationException { + return configuration.get("getMoaSpAuthBlockTrustProfileID", String.class); + } + + @JsonProperty("getMoaSpAuthBlockVerifyTransformsInfoIDs") + public List getMoaSpAuthBlockVerifyTransformsInfoIDs() throws ConfigurationException { + return configuration.getList("getMoaSpAuthBlockVerifyTransformsInfoIDs", String.class); + } + + @JsonProperty("getMoaSpConnectionParameter") + public ConnectionParameter getMoaSpConnectionParameter() throws ConfigurationException { + return configuration.get("getMoaSpConnectionParameter", ConnectionParameter.class); + } + + @JsonProperty("getForeignIDConnectionParameter") + public ConnectionParameter getForeignIDConnectionParameter() throws ConfigurationException { + return configuration.get("getForeignIDConnectionParameter", ConnectionParameter.class); + } + + @JsonProperty("getOnlineMandatesConnectionParameter") + public ConnectionParameter getOnlineMandatesConnectionParameter() throws ConfigurationException { + return configuration.get("getOnlineMandatesConnectionParameter", ConnectionParameter.class); + } + + @JsonProperty("getMoaSpIdentityLinkTrustProfileID") + public String getMoaSpIdentityLinkTrustProfileID() throws ConfigurationException { + return configuration.get("getMoaSpIdentityLinkTrustProfileID", String.class); + } + + @JsonProperty("getTransformsInfos") + public List getTransformsInfos() throws ConfigurationException { + return configuration.getList("getTransformsInfos", String.class); + } + + @JsonProperty("getIdentityLinkX509SubjectNames") + public List getIdentityLinkX509SubjectNames() throws ConfigurationException { + return configuration.getList("getIdentityLinkX509SubjectNames", String.class); + } + + @JsonProperty("getSLRequestTemplates") + public List getSLRequestTemplates() throws ConfigurationException { + return configuration.getList("getSLRequestTemplates", String.class); + } + + @JsonProperty("getSLRequestTemplates") + public String getSLRequestTemplates(String type) throws ConfigurationException { + return configuration.get("getSLRequestTemplates", String.class); + } + + @JsonProperty("getDefaultBKUURLs") + public List getDefaultBKUURLs() throws ConfigurationException { + return configuration.getList("getDefaultBKUURLs", String.class); + } + + @JsonProperty("getDefaultBKUURL") + public String getDefaultBKUURL(String type) throws ConfigurationException { + + // FIXME find a solution for this getter + // String el = DefaultBKUURLs.get(type); + // if (MiscUtil.isNotEmpty(el)) + // return el; + // else { + // Logger.warn("getSLRequestTemplates: BKU Type does not match: " + + // IOAAuthParameters.ONLINEBKU + " or " + // + IOAAuthParameters.HANDYBKU + " or " + IOAAuthParameters.LOCALBKU); + // return null; + // } + return null; + } + + @JsonProperty("getSSOTagetIdentifier") + public String getSSOTagetIdentifier() throws ConfigurationException { + return configuration.get("getSSOTagetIdentifier", String.class); + } + + @JsonProperty("getSSOFriendlyName") + public String getSSOFriendlyName() { + return configuration.get("getSSOFriendlyName", String.class); + } + + @JsonProperty("getSSOSpecialText") + public String getSSOSpecialText() { + return configuration.get("getSSOSpecialText", String.class); + } + + @JsonProperty("getMOASessionEncryptionKey") + public String getMOASessionEncryptionKey() { + return configuration.get("getMOASessionEncryptionKey", String.class); + } + + @JsonProperty("getMOAConfigurationEncryptionKey") + public String getMOAConfigurationEncryptionKey() { + return configuration.get("getMOAConfigurationEncryptionKey", String.class); + } + + @JsonProperty("isIdentityLinkResigning") + public boolean isIdentityLinkResigning() { + return configuration.get("isIdentityLinkResigning", Boolean.class); + } + + @JsonProperty("getIdentityLinkResigningKey") + public String getIdentityLinkResigningKey() { + return configuration.get("getIdentityLinkResigningKey", String.class); + } + + @JsonProperty("isMonitoringActive") + public boolean isMonitoringActive() { + return configuration.get("isMonitoringActive", Boolean.class); + } + + @JsonProperty("getMonitoringTestIdentityLinkURL") + public String getMonitoringTestIdentityLinkURL() { + return configuration.get("getMonitoringTestIdentityLinkURL", String.class); + } + + @JsonProperty("getMonitoringMessageSuccess") + public String getMonitoringMessageSuccess() { + return configuration.get("getMonitoringMessageSuccess", String.class); + } + + @JsonProperty("isAdvancedLoggingActive") + public boolean isAdvancedLoggingActive() { + return configuration.get("isAdvancedLoggingActive", Boolean.class); + } + + @JsonProperty("getPublicURLPrefix") + public String getPublicURLPrefix() { + return configuration.get("getPublicURLPrefix", String.class); + } + + @JsonProperty("isPVP2AssertionEncryptionActive") + public boolean isPVP2AssertionEncryptionActive() { + return configuration.get("isPVP2AssertionEncryptionActive", Boolean.class); + } + + @JsonProperty("isCertifiacteQCActive") + public boolean isCertifiacteQCActive() { + return configuration.get("isCertifiacteQCActive", Boolean.class); + } + + /** + * Retruns the STORK Configuration + * + * @return STORK Configuration + * @throws ConfigurationException + */ + @JsonProperty("getStorkConfig") + public STORKConfig getStorkConfig() throws ConfigurationException { + return configuration.get("getStorkConfig", STORKConfig.class); + } + +} diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index 762c55507..a2e678a5f 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -21,6 +21,7 @@ + -- cgit v1.2.3 From 0b78a86a1cb499873c7ba86c5568d3c8f4bda357 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 14 Jan 2015 14:21:17 +0100 Subject: extract data via methods in ConfigurationDBRead and write to key-value database --- .../config/auth/ConfigurationToJSONConverter.java | 42 ++++++++++++++++++++-- .../moa/id/commons/db/ConfigurationDBRead.java | 22 +++++++----- 2 files changed, 53 insertions(+), 11 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 90543e588..39225a5b0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -4,12 +4,16 @@ import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; +import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; @@ -33,6 +37,14 @@ public class ConfigurationToJSONConverter { System.out.println("====================================="); System.out.println("====================================="); converter.readConfigFromDB(); + System.out.println("====================================="); + System.out.println("====================================="); + + // otherwise the database connection is not initialized + AuthConfigurationProvider.getInstance(); + List methodNames = Arrays.asList("getAllOnlineApplications", "getAllUsers", "getMOAIDConfiguration"); + converter.extractDataViaConfigurationDBRead(methodNames); + converter.readExtractedConfigurationDBReadData(methodNames); } catch (ConfigurationException e) { e.printStackTrace(); @@ -51,6 +63,33 @@ public class ConfigurationToJSONConverter { } + public void extractDataViaConfigurationDBRead(List methodNames) { + System.out.println("Start extracting"); + // read objects from db and write to key-value + for (String name : methodNames) { + try { + Method method = ConfigurationDBRead.class.getMethod(name); + Object tmp = method.invoke(null, new Object[] {}); + JsonProperty annotation = method.getAnnotation(JsonProperty.class); + if (annotation != null) { + configDataBase.set(annotation.value(), tmp); + } else { + System.out.println("Annotate Method with name: " + name); + } + } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException e) { + System.out.println("Problems while extracting ConfigurationDBRead data."); + } + } + } + + public void readExtractedConfigurationDBReadData(List methodNames) { + for (String name : methodNames) { + Object tmp = configDataBase.get(name); + System.out.println(">>> OBJECT: " + tmp); + } + } + public void writeConfigToJSONDB() { try { @@ -73,8 +112,7 @@ public class ConfigurationToJSONConverter { System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); } } catch (IllegalAccessException | InvocationTargetException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + System.out.println("Problems while writing the configuration to the database."); } } } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java index 6efdd6223..f5421a47d 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java @@ -22,6 +22,15 @@ *******************************************************************************/ package at.gv.egovernment.moa.id.commons.db; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.persistence.EntityManager; + +import org.apache.commons.lang3.StringEscapeUtils; + import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; @@ -29,15 +38,7 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; //import org.apache.commons.lang.StringEscapeUtils; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceException; - -import org.apache.commons.lang3.StringEscapeUtils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; @SuppressWarnings("rawtypes") public class ConfigurationDBRead { @@ -139,6 +140,7 @@ public class ConfigurationDBRead { return (OnlineApplication) result.get(0); } + @JsonProperty("getMOAIDConfiguration") public static MOAIDConfiguration getMOAIDConfiguration() { Logger.trace("Load MOAID Configuration from database."); @@ -158,6 +160,7 @@ public class ConfigurationDBRead { return (MOAIDConfiguration) result.get(0); } + @JsonProperty("getAllOnlineApplications") public static List getAllOnlineApplications() { Logger.trace("Get All OnlineApplications from database."); @@ -194,6 +197,7 @@ public class ConfigurationDBRead { return result; } + @JsonProperty("getAllUsers") public static List getAllUsers() { Logger.trace("Get All OnlineApplications from database."); -- cgit v1.2.3 From 22474d762e26931489593403774c1755601878be Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Wed, 14 Jan 2015 15:16:43 +0100 Subject: add a class that has the same method signatures as 'ConfiguratiohnDBRead' and is capable of reading from the new key-value DB --- .../moa/id/commons/db/NewConfigurationDBRead.java | 355 +++++++++++++++++++++ .../src/main/resources/configuration.beans.xml | 2 + 2 files changed, 357 insertions(+) create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java new file mode 100644 index 000000000..470d4d293 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -0,0 +1,355 @@ +package at.gv.egovernment.moa.id.commons.db; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; + +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; +import at.gv.egovernment.moa.logging.Logger; + +import com.datentechnik.moa.id.conf.persistence.Configuration; + +/** + * + * + */ +public class NewConfigurationDBRead { + + @Autowired + private static Configuration conf; + + /** + * + * @param key + * @param clazz + * @return + */ + private static List getAllObjects(String key, Class clazz) { + List result = null; + + result = conf.getList("getAllUsers", clazz); + + return result; + } + + /** + * + * @return + */ + public static List getAllUsers() { + + Logger.trace("Get All Users from database."); + + return getAllObjects("getAllUsers", UserDatabase.class); + } + + /** + * + * @return + */ + public static List getAllOnlineApplications() { + + Logger.trace("Get All OnlineApplications from database."); + + return getAllObjects("getAllOnlineApplications", OnlineApplication.class); + } + + /** + * + * @return + */ + public static List getAllNewOnlineApplications() { + + Logger.trace("Get All New OnlineApplications from database."); + + List result = new ArrayList(); + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : allOAs) { + if (!oa.isIsActive() && oa.isIsAdminRequired()) { + result.add(oa); + } + } + + return result; + } + + /** + * + * @return + */ + public static MOAIDConfiguration getMOAIDConfiguration() { + + Logger.trace("Load MOAID Configuration from database."); + + MOAIDConfiguration result = null; + + result = conf.get("getMOAIDConfiguration", MOAIDConfiguration.class); + + return result; + } + + /** + * + * @return + */ + public static List getAllActiveOnlineApplications() { + + Logger.trace("Get All New OnlineApplications from database."); + + List result = new ArrayList(); + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : allOAs) { + if (oa.isIsActive()) { + result.add(oa); + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static OnlineApplication getActiveOnlineApplication(String id) { + + Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); + + OnlineApplication result = null; + List allActiveOAs = getAllActiveOnlineApplications(); + + for (OnlineApplication oa : allActiveOAs) { + String publicUrlPrefix = oa.getPublicURLPrefix(); + if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { + if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { + if (result != null) { + Logger.warn("OAIdentifier match to more then one DB-entry!"); + return null; + } else { + result = oa; + } + } + } + } + + return result; + } + + /** + * + * @param dbid + * @return + */ + public static OnlineApplication getOnlineApplication(long dbid) { + Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); + + OnlineApplication result = null; + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : allOAs) { + if (oa.getHjid() == dbid) { + result = oa; + break; + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static OnlineApplication getOnlineApplication(String id) { + + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + OnlineApplication result = null; + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : allOAs) { + String publicUrlPrefix = oa.getPublicURLPrefix(); + if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { + if (id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix)) { + if (result != null) { + Logger.warn("OAIdentifier match to more then one DB-entry!"); + return null; + } else { + result = oa; + } + } + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static List searchOnlineApplications(String id) { + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + List result = new ArrayList(); + + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : allOAs) { + if (id.equals(oa.getFriendlyName())) { + result.add(oa); + } + } + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } else { + Logger.trace("Found entries: " + result.size()); + return result; + } + } + + /** + * + * @return + */ + public static List getAllOpenUsersRequests() { + Logger.trace("Get all new Users from Database"); + + List result = new ArrayList(); + List allUsers = getAllUsers(); + + for (UserDatabase user : allUsers) { + // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) + if ((user.getUserRequestTokken() != null || !user.getUserRequestTokken().equals("") || !user.getUserRequestTokken().equals("NULL")) + && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { + result.add(user); + } + } + return result; + } + + /** + * + * @param tokken + * @return + */ + public static UserDatabase getNewUserWithTokken(String tokken) { + + Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); + + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : allUsers) { + if (user.getUserRequestTokken().equals(tokken)) { + result = user; + break; + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static UserDatabase getUsersWithOADBID(long id) { + + UserDatabase result = null; + List allUsers = getAllUsers(); + + boolean quit = false; + for (UserDatabase user : allUsers) { + + for (OnlineApplication oa : user.getOnlineApplication()) { + + if (oa.getHjid() == id) { + result = user; + quit = true; + break; + } + } + + if (quit) { + break; + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static UserDatabase getUserWithID(long id) { + + Logger.trace("Getting Userinformation with ID " + id + " from database."); + + UserDatabase result = null; + List allUsers = getAllUsers(); + for (UserDatabase user : allUsers) { + if (user.getHjid() == id) { + result = user; + } + } + + return result; + } + + /** + * + * @param username + * @return + */ + public static UserDatabase getUserWithUserName(String username) { + + Logger.trace("Getting Userinformation with ID " + username + " from database."); + + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : allUsers) { + if (user.getUsername().equals(username)) { + result = user; + } + } + + return result; + } + + /** + * + * @param bpkwbpk + * @return + */ + public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { + + Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); + + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : allUsers) { + if (user.getBpk().equals(bpkwbpk)) { + result = user; + } + } + + return result; + } + +} diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index a2e678a5f..1a2e1fedd 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -22,6 +22,8 @@ + + -- cgit v1.2.3 From a7c3e354c481dcd0a0a59dbdae2e567ea57fa56d Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 14 Jan 2015 17:42:17 +0100 Subject: add initial getList implementation --- .../moa/id/conf/persistence/ConfigurationImpl.java | 29 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java index da2c4b7e6..7a52d0c9d 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java @@ -1,6 +1,7 @@ package com.datentechnik.moa.id.conf.persistence; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Required; @@ -8,13 +9,16 @@ import org.springframework.stereotype.Component; import com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty; import com.datentechnik.moa.id.conf.persistence.dal.ConfigPropertyDao; -import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.type.CollectionType; +import com.fasterxml.jackson.databind.type.TypeFactory; /** * @@ -89,12 +93,26 @@ public class ConfigurationImpl implements Configuration { } } + @SuppressWarnings("unchecked") @Override public List getList(String key, Class clazz) { - // return empty list if key does not exist - // TODO Auto-generated method stub - return null; + CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); + String json = configPropertyDao.getProperty(key).getValue(); + ObjectMapper mapper = new ObjectMapper(); + + try { + return (List) mapper.readValue(json, listType); + } catch (JsonMappingException e) { + ArrayList tmp = new ArrayList(); + T value = get(key, clazz); + if(value != null){ + tmp.add(value); + } + return tmp; + } catch (IOException e) { + return new ArrayList(); + } } private String getPropertyValue(String key) { @@ -150,7 +168,8 @@ public class ConfigurationImpl implements Configuration { ObjectMapper mapper = new ObjectMapper(); if (clazz != null) { - return mapper.readValue(value, clazz); + JavaType javaType = TypeFactory.defaultInstance().constructType(clazz); + return mapper.readValue(value, javaType); } else { return mapper.readValue(value, Object.class); } -- cgit v1.2.3 From 3e1ec05d5aeb0a02e6051c0f35607e6a91995092 Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Wed, 14 Jan 2015 17:48:21 +0100 Subject: avoid trying to iterate over a collection that is null (untested) --- .../moa/id/commons/db/NewConfigurationDBRead.java | 79 ++++++++++++++-------- 1 file changed, 49 insertions(+), 30 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 470d4d293..8e2ae7e46 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -1,6 +1,7 @@ package at.gv.egovernment.moa.id.commons.db; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +22,15 @@ public class NewConfigurationDBRead { @Autowired private static Configuration conf; + @SuppressWarnings("unchecked") + public static > T nullGuard(T item) { + if (item == null) { + return (T) Collections.emptyList(); + } else { + return item; + } + } + /** * * @param key @@ -28,10 +38,9 @@ public class NewConfigurationDBRead { * @return */ private static List getAllObjects(String key, Class clazz) { - List result = null; + List result = null; result = conf.getList("getAllUsers", clazz); - return result; } @@ -40,10 +49,15 @@ public class NewConfigurationDBRead { * @return */ public static List getAllUsers() { - Logger.trace("Get All Users from database."); - return getAllObjects("getAllUsers", UserDatabase.class); + List result = getAllObjects("getAllUsers", UserDatabase.class); + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return result; } /** @@ -51,7 +65,6 @@ public class NewConfigurationDBRead { * @return */ public static List getAllOnlineApplications() { - Logger.trace("Get All OnlineApplications from database."); return getAllObjects("getAllOnlineApplications", OnlineApplication.class); @@ -62,18 +75,22 @@ public class NewConfigurationDBRead { * @return */ public static List getAllNewOnlineApplications() { - Logger.trace("Get All New OnlineApplications from database."); List result = new ArrayList(); List allOAs = getAllOnlineApplications(); - for (OnlineApplication oa : allOAs) { + for (OnlineApplication oa : nullGuard(allOAs)) { if (!oa.isIsActive() && oa.isIsAdminRequired()) { result.add(oa); } } + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; } @@ -82,7 +99,6 @@ public class NewConfigurationDBRead { * @return */ public static MOAIDConfiguration getMOAIDConfiguration() { - Logger.trace("Load MOAID Configuration from database."); MOAIDConfiguration result = null; @@ -97,18 +113,22 @@ public class NewConfigurationDBRead { * @return */ public static List getAllActiveOnlineApplications() { - Logger.trace("Get All New OnlineApplications from database."); List result = new ArrayList(); List allOAs = getAllOnlineApplications(); - for (OnlineApplication oa : allOAs) { + for (OnlineApplication oa : nullGuard(allOAs)) { if (oa.isIsActive()) { result.add(oa); } } + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; } @@ -118,13 +138,12 @@ public class NewConfigurationDBRead { * @return */ public static OnlineApplication getActiveOnlineApplication(String id) { - Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); OnlineApplication result = null; List allActiveOAs = getAllActiveOnlineApplications(); - for (OnlineApplication oa : allActiveOAs) { + for (OnlineApplication oa : nullGuard(allActiveOAs)) { String publicUrlPrefix = oa.getPublicURLPrefix(); if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { @@ -152,7 +171,7 @@ public class NewConfigurationDBRead { OnlineApplication result = null; List allOAs = getAllOnlineApplications(); - for (OnlineApplication oa : allOAs) { + for (OnlineApplication oa : nullGuard(allOAs)) { if (oa.getHjid() == dbid) { result = oa; break; @@ -168,13 +187,12 @@ public class NewConfigurationDBRead { * @return */ public static OnlineApplication getOnlineApplication(String id) { - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); OnlineApplication result = null; List allOAs = getAllOnlineApplications(); - for (OnlineApplication oa : allOAs) { + for (OnlineApplication oa : nullGuard(allOAs)) { String publicUrlPrefix = oa.getPublicURLPrefix(); if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { if (id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix)) { @@ -200,10 +218,9 @@ public class NewConfigurationDBRead { Logger.trace("Getting OnlineApplication with ID " + id + " from database."); List result = new ArrayList(); - List allOAs = getAllOnlineApplications(); - for (OnlineApplication oa : allOAs) { + for (OnlineApplication oa : nullGuard(allOAs)) { if (id.equals(oa.getFriendlyName())) { result.add(oa); } @@ -212,10 +229,9 @@ public class NewConfigurationDBRead { if (result.size() == 0) { Logger.trace("No entries found."); return null; - } else { - Logger.trace("Found entries: " + result.size()); - return result; } + + return result; } /** @@ -228,13 +244,19 @@ public class NewConfigurationDBRead { List result = new ArrayList(); List allUsers = getAllUsers(); - for (UserDatabase user : allUsers) { + for (UserDatabase user : nullGuard(allUsers)) { // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) if ((user.getUserRequestTokken() != null || !user.getUserRequestTokken().equals("") || !user.getUserRequestTokken().equals("NULL")) && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { result.add(user); } } + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; } @@ -244,13 +266,12 @@ public class NewConfigurationDBRead { * @return */ public static UserDatabase getNewUserWithTokken(String tokken) { - Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); UserDatabase result = null; List allUsers = getAllUsers(); - for (UserDatabase user : allUsers) { + for (UserDatabase user : nullGuard(allUsers)) { if (user.getUserRequestTokken().equals(tokken)) { result = user; break; @@ -266,12 +287,13 @@ public class NewConfigurationDBRead { * @return */ public static UserDatabase getUsersWithOADBID(long id) { + Logger.trace("Getting Userinformation with OADBID " + id + " from database."); UserDatabase result = null; List allUsers = getAllUsers(); boolean quit = false; - for (UserDatabase user : allUsers) { + for (UserDatabase user : nullGuard(allUsers)) { for (OnlineApplication oa : user.getOnlineApplication()) { @@ -296,12 +318,11 @@ public class NewConfigurationDBRead { * @return */ public static UserDatabase getUserWithID(long id) { - Logger.trace("Getting Userinformation with ID " + id + " from database."); UserDatabase result = null; List allUsers = getAllUsers(); - for (UserDatabase user : allUsers) { + for (UserDatabase user : nullGuard(allUsers)) { if (user.getHjid() == id) { result = user; } @@ -316,13 +337,12 @@ public class NewConfigurationDBRead { * @return */ public static UserDatabase getUserWithUserName(String username) { - Logger.trace("Getting Userinformation with ID " + username + " from database."); UserDatabase result = null; List allUsers = getAllUsers(); - for (UserDatabase user : allUsers) { + for (UserDatabase user : nullGuard(allUsers)) { if (user.getUsername().equals(username)) { result = user; } @@ -337,13 +357,12 @@ public class NewConfigurationDBRead { * @return */ public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { - Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); UserDatabase result = null; List allUsers = getAllUsers(); - for (UserDatabase user : allUsers) { + for (UserDatabase user : nullGuard(allUsers)) { if (user.getBpk().equals(bpkwbpk)) { result = user; } -- cgit v1.2.3 From 1c8dc14de27abd95b79f4d515e80639ccb1cc366 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Thu, 15 Jan 2015 10:20:46 +0100 Subject: small codereview, added corresponding databasequeries as comments --- .../moa/id/commons/db/NewConfigurationDBRead.java | 52 +++++++++++++++------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 8e2ae7e46..e39f598b1 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -31,19 +31,6 @@ public class NewConfigurationDBRead { } } - /** - * - * @param key - * @param clazz - * @return - */ - private static List getAllObjects(String key, Class clazz) { - - List result = null; - result = conf.getList("getAllUsers", clazz); - return result; - } - /** * * @return @@ -51,7 +38,8 @@ public class NewConfigurationDBRead { public static List getAllUsers() { Logger.trace("Get All Users from database."); - List result = getAllObjects("getAllUsers", UserDatabase.class); + // select userdatabase from UserDatabase userdatabase + List result = conf.getList("getAllUsers", UserDatabase.class); if (result.size() == 0) { Logger.trace("No entries found."); return null; @@ -67,7 +55,8 @@ public class NewConfigurationDBRead { public static List getAllOnlineApplications() { Logger.trace("Get All OnlineApplications from database."); - return getAllObjects("getAllOnlineApplications", OnlineApplication.class); + // select onlineapplication from OnlineApplication onlineapplication + return conf.getList("getAllOnlineApplications", OnlineApplication.class); } /** @@ -77,6 +66,8 @@ public class NewConfigurationDBRead { public static List getAllNewOnlineApplications() { Logger.trace("Get All New OnlineApplications from database."); + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' List result = new ArrayList(); List allOAs = getAllOnlineApplications(); @@ -101,10 +92,14 @@ public class NewConfigurationDBRead { public static MOAIDConfiguration getMOAIDConfiguration() { Logger.trace("Load MOAID Configuration from database."); + // select moaidconfiguration from MOAIDConfiguration moaidconfiguration MOAIDConfiguration result = null; - result = conf.get("getMOAIDConfiguration", MOAIDConfiguration.class); + if(result == null){ + Logger.trace("No entries found. Create fresh instance."); + return new MOAIDConfiguration(); + } return result; } @@ -115,6 +110,8 @@ public class NewConfigurationDBRead { public static List getAllActiveOnlineApplications() { Logger.trace("Get All New OnlineApplications from database."); + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.isActive = '1' List result = new ArrayList(); List allOAs = getAllOnlineApplications(); @@ -140,6 +137,9 @@ public class NewConfigurationDBRead { public static OnlineApplication getActiveOnlineApplication(String id) { Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.publicURLPrefix = + // SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1' OnlineApplication result = null; List allActiveOAs = getAllActiveOnlineApplications(); @@ -168,6 +168,7 @@ public class NewConfigurationDBRead { public static OnlineApplication getOnlineApplication(long dbid) { Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); + // select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id OnlineApplication result = null; List allOAs = getAllOnlineApplications(); @@ -189,6 +190,8 @@ public class NewConfigurationDBRead { public static OnlineApplication getOnlineApplication(String id) { Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) OnlineApplication result = null; List allOAs = getAllOnlineApplications(); @@ -217,6 +220,8 @@ public class NewConfigurationDBRead { public static List searchOnlineApplications(String id) { Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.friendlyName like :id List result = new ArrayList(); List allOAs = getAllOnlineApplications(); @@ -241,12 +246,15 @@ public class NewConfigurationDBRead { public static List getAllOpenUsersRequests() { Logger.trace("Get all new Users from Database"); + // select userdatabase from UserDatabase userdatabase + // where userdatabase.userRequestTokken is not null + // and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0' List result = new ArrayList(); List allUsers = getAllUsers(); for (UserDatabase user : nullGuard(allUsers)) { // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) - if ((user.getUserRequestTokken() != null || !user.getUserRequestTokken().equals("") || !user.getUserRequestTokken().equals("NULL")) + if ((user.getUserRequestTokken() != null && !user.getUserRequestTokken().isEmpty() && !user.getUserRequestTokken().equals("NULL")) && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { result.add(user); } @@ -268,6 +276,7 @@ public class NewConfigurationDBRead { public static UserDatabase getNewUserWithTokken(String tokken) { Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); + // select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken UserDatabase result = null; List allUsers = getAllUsers(); @@ -289,6 +298,8 @@ public class NewConfigurationDBRead { public static UserDatabase getUsersWithOADBID(long id) { Logger.trace("Getting Userinformation with OADBID " + id + " from database."); + // select userdatabase from UserDatabase userdatabase + // inner join userdatabase.onlineApplication oa where oa.hjid = :id UserDatabase result = null; List allUsers = getAllUsers(); @@ -320,11 +331,14 @@ public class NewConfigurationDBRead { public static UserDatabase getUserWithID(long id) { Logger.trace("Getting Userinformation with ID " + id + " from database."); + // select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id UserDatabase result = null; List allUsers = getAllUsers(); + for (UserDatabase user : nullGuard(allUsers)) { if (user.getHjid() == id) { result = user; + break; } } @@ -339,12 +353,14 @@ public class NewConfigurationDBRead { public static UserDatabase getUserWithUserName(String username) { Logger.trace("Getting Userinformation with ID " + username + " from database."); + // select userdatabase from UserDatabase userdatabase where userdatabase.username = :username UserDatabase result = null; List allUsers = getAllUsers(); for (UserDatabase user : nullGuard(allUsers)) { if (user.getUsername().equals(username)) { result = user; + break; } } @@ -359,12 +375,14 @@ public class NewConfigurationDBRead { public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); + // select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk UserDatabase result = null; List allUsers = getAllUsers(); for (UserDatabase user : nullGuard(allUsers)) { if (user.getBpk().equals(bpkwbpk)) { result = user; + break; } } -- cgit v1.2.3 From c393a871d38abe1638addd106258d8211eaa6a92 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Fri, 16 Jan 2015 15:14:34 +0100 Subject: add ability to extract all database data needed to build a 'MOAIDConfiguration' object --- .../commons/db/ConfigurationFromDBExtractor.java | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java new file mode 100644 index 000000000..63c3b5bfb --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -0,0 +1,82 @@ +package at.gv.egovernment.moa.id.commons.db; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.persistence.EntityManager; +import javax.persistence.TypedQuery; + +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; + +public class ConfigurationFromDBExtractor { + + private ConfigurationFromDBExtractor() { + } + + private static T getSingleValue(String queryString, Class clazz) { + T result = null; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + TypedQuery query = session.createQuery(queryString, clazz); + try { + result = clazz.cast(query.getSingleResult()); + } catch (Exception e) { + return null; + } + return result; + } + + private static List getListOfValues(String queryString, Class clazz) { + List result = new ArrayList(); + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + TypedQuery query = session.createQuery(queryString, clazz); + try { + result = query.getResultList(); + } catch (Exception e) { + return new ArrayList(); + } + return result; + } + + public static AuthComponentGeneral getAuthComponentGeneral() { + return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); + } + + public static ChainingModes getChainingModes() { + return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); + } + + public static List getOnlineApplications() { + return getListOfValues("from OnlineApplication", OnlineApplication.class); + } + + public static List getGenericConfigurations() { + return getListOfValues("from GenericConfiguration", GenericConfiguration.class); + } + + public static String getTrustedCACertificates() { + return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); + } + + public static DefaultBKUs getDefaultBKUs() { + return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); + } + + public static SLRequestTemplates getSLRequestTemplates() { + return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); + } + + public static Date getTimeStampItem() { + return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); + } + + public static Date getPvp2RefreshItem() { + return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); + } + +} -- cgit v1.2.3 From 63c0626cb2a0bcfb37f903b98cf7975797186aca Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Fri, 16 Jan 2015 16:11:46 +0100 Subject: add JSON annotations, remove unnecessary cast --- .../moa/id/commons/db/ConfigurationFromDBExtractor.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java index 63c3b5bfb..d657ed16a 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -14,6 +14,8 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import com.fasterxml.jackson.annotation.JsonProperty; + public class ConfigurationFromDBExtractor { private ConfigurationFromDBExtractor() { @@ -24,7 +26,7 @@ public class ConfigurationFromDBExtractor { EntityManager session = ConfigurationDBUtils.getCurrentSession(); TypedQuery query = session.createQuery(queryString, clazz); try { - result = clazz.cast(query.getSingleResult()); + result = query.getSingleResult(); } catch (Exception e) { return null; } @@ -43,38 +45,47 @@ public class ConfigurationFromDBExtractor { return result; } + @JsonProperty("getAuthComponentGeneral") public static AuthComponentGeneral getAuthComponentGeneral() { return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); } + @JsonProperty("getChainingModes") public static ChainingModes getChainingModes() { return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); } + @JsonProperty("getOnlineApplications") public static List getOnlineApplications() { return getListOfValues("from OnlineApplication", OnlineApplication.class); } + @JsonProperty("getGenericConfigurations") public static List getGenericConfigurations() { return getListOfValues("from GenericConfiguration", GenericConfiguration.class); } + @JsonProperty("getTrustedCACertificates") public static String getTrustedCACertificates() { return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); } + @JsonProperty("getDefaultBKUs") public static DefaultBKUs getDefaultBKUs() { return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); } + @JsonProperty("getSLRequestTemplates") public static SLRequestTemplates getSLRequestTemplates() { return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); } + @JsonProperty("getTimeStampItem") public static Date getTimeStampItem() { return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); } + @JsonProperty("getPvp2RefreshItem") public static Date getPvp2RefreshItem() { return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); } -- cgit v1.2.3 From f2ebaedd107e0660150faeee6dbe06be5094ac0a Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 19 Jan 2015 10:00:36 +0100 Subject: add workaround for static field bean initialization, rework getMOAIDConfiguration() --- .../moa/id/commons/db/NewConfigurationDBRead.java | 55 ++++++++++++++++++---- .../src/main/resources/configuration.beans.xml | 2 +- 2 files changed, 48 insertions(+), 9 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index e39f598b1..29bf02ba9 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -2,12 +2,18 @@ package at.gv.egovernment.moa.id.commons.db; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.logging.Logger; @@ -19,9 +25,14 @@ import com.datentechnik.moa.id.conf.persistence.Configuration; */ public class NewConfigurationDBRead { - @Autowired private static Configuration conf; + @Autowired(required = true) + public void setConfiguration(Configuration conf) { + // https://jira.spring.io/browse/SPR-3845 + NewConfigurationDBRead.conf = conf; + } + @SuppressWarnings("unchecked") public static > T nullGuard(T item) { if (item == null) { @@ -56,7 +67,8 @@ public class NewConfigurationDBRead { Logger.trace("Get All OnlineApplications from database."); // select onlineapplication from OnlineApplication onlineapplication - return conf.getList("getAllOnlineApplications", OnlineApplication.class); + return conf.getList("getOnlineApplications", OnlineApplication.class); + } /** @@ -92,14 +104,41 @@ public class NewConfigurationDBRead { public static MOAIDConfiguration getMOAIDConfiguration() { Logger.trace("Load MOAID Configuration from database."); - // select moaidconfiguration from MOAIDConfiguration moaidconfiguration - MOAIDConfiguration result = null; - result = conf.get("getMOAIDConfiguration", MOAIDConfiguration.class); - - if(result == null){ - Logger.trace("No entries found. Create fresh instance."); + AuthComponentGeneral authComponent = (AuthComponentGeneral) conf.get("getAuthComponentGeneral", + AuthComponentGeneral.class); + ChainingModes chainingModes = (ChainingModes) conf.get("getChainingModes", ChainingModes.class); + List oas = (List) conf.getList("getOnlineApplications", + OnlineApplication.class); + List genericConfigurations = (List) conf.getList( + "getGenericConfigurations", GenericConfiguration.class); + String trustedCaCertificates = (String) conf.get("getTrustedCACertificates", String.class); + DefaultBKUs defaultBKUs = (DefaultBKUs) conf.get("getDefaultBKUs", DefaultBKUs.class); + SLRequestTemplates slrRequestRemplates = (SLRequestTemplates) conf.get("getSLRequestTemplates", + SLRequestTemplates.class); + Date timeStamp = (Date) conf.get("getTimeStampItem", Date.class); + Date pvp2Refresh = (Date) conf.get("getPvp2RefreshItem", Date.class); + + if (authComponent == null || chainingModes == null || trustedCaCertificates == null || defaultBKUs == null + || slrRequestRemplates == null || timeStamp == null || pvp2Refresh == null + + ) { + // TODO: is there a better approach in case of error? + Logger.trace("Not all necessary data available. Create fresh instance."); return new MOAIDConfiguration(); } + + // select moaidconfiguration from MOAIDConfiguration moaidconfiguration + MOAIDConfiguration result = new MOAIDConfiguration(); + result.setAuthComponentGeneral(authComponent); + result.setChainingModes(chainingModes); + result.setOnlineApplication(oas); + result.setGenericConfiguration(genericConfigurations); + result.setTrustedCACertificates(trustedCaCertificates); + result.setDefaultBKUs(defaultBKUs); + result.setSLRequestTemplates(slrRequestRemplates); + result.setTimestampItem(timeStamp); + result.setPvp2RefreshItem(pvp2Refresh); + return result; } diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index 1a2e1fedd..ee906a407 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -23,7 +23,7 @@ - + -- cgit v1.2.3 From 4791f1f77125e1c4c76d189f441924fd62874091 Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Mon, 19 Jan 2015 15:57:51 +0100 Subject: add writer to store the configuration in key-value database use solely kv database within 'AuthConfigurationProvider' add constants declaring db keys --- .../id/config/auth/AuthConfigurationProvider.java | 53 ++++--- .../commons/db/ConfigurationFromDBExtractor.java | 18 +-- .../id/commons/db/MOAIDConfigurationConstants.java | 35 +++++ .../moa/id/commons/db/NewConfigurationDBRead.java | 39 ++--- .../moa/id/commons/db/NewConfigurationDBWrite.java | 157 +++++++++++++++++++++ .../moa/id/conf/persistence/Configuration.java | 9 +- .../moa/id/conf/persistence/ConfigurationImpl.java | 16 ++- .../id/conf/persistence/dal/ConfigPropertyDao.java | 7 + .../persistence/dal/ConfigPropertyDaoImpl.java | 14 +- .../src/main/resources/configuration.beans.xml | 2 + 10 files changed, 300 insertions(+), 50 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index 5fc416b16..a4eab51d9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -69,7 +69,10 @@ import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; +import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBWrite; +import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; +import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; @@ -337,7 +340,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements synchronized (AuthConfigurationProvider.class) { //Initial config Database - ConfigurationDBUtils.initHibernate(configProp); + // ConfigurationDBUtils.initHibernate(configProp); //initial MOAID Session Database Configuration config = new Configuration(); @@ -413,14 +416,24 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements //check if XML config should be used if (MiscUtil.isNotEmpty(legacyconfig) || MiscUtil.isNotEmpty(xmlconfig)) { Logger.warn("WARNING! MOA-ID 2.0 is started with XML configuration. This setup overstrike the actual configuration in the Database!"); - moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); - if (moaidconfig != null) - ConfigurationDBUtils.delete(moaidconfig); + //moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); + moaidconfig = NewConfigurationDBRead.getMOAIDConfiguration(); + if (moaidconfig.getAuthComponentGeneral()!= null || moaidconfig.getChainingModes() != null || moaidconfig.getTrustedCACertificates() != null || moaidconfig.getDefaultBKUs() != null + || moaidconfig.getSLRequestTemplates() != null || moaidconfig.getTimestampItem() != null || moaidconfig.getPvp2RefreshItem() != null) { + + // ConfigurationDBUtils.delete(moaidconfig); + for(String key : MOAIDConfigurationConstants.getMOAIDConfigurationKeys()){ + NewConfigurationDBWrite.delete(key); + } + } + - List oas = ConfigurationDBRead.getAllOnlineApplications(); + //List oas = ConfigurationDBRead.getAllOnlineApplications(); + List oas = NewConfigurationDBRead.getAllOnlineApplications(); if (oas != null && oas.size() > 0) { - for (OnlineApplication oa : oas) - ConfigurationDBUtils.delete(oa); + // for (OnlineApplication oa : oas) + // ConfigurationDBUtils.delete(oa); + NewConfigurationDBWrite.delete("getOnlineApplications"); } } @@ -431,17 +444,19 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements MOAIDConfiguration moaconfig = BuildFromLegacyConfig.build(new File(legacyconfig), rootConfigFileDir, null); List oas = moaconfig.getOnlineApplication(); - for (OnlineApplication oa : oas) - ConfigurationDBUtils.save(oa); + // for (OnlineApplication oa : oas) + // ConfigurationDBUtils.save(oa); + NewConfigurationDBWrite.saveOnlineApplications(oas); moaconfig.setOnlineApplication(null); - ConfigurationDBUtils.save(moaconfig); + // ConfigurationDBUtils.save(moaconfig); + NewConfigurationDBWrite.save(moaconfig); Logger.info("Legacy Configuration load is completed."); } - + //load MOA-ID 2.x config from XML if (MiscUtil.isNotEmpty(xmlconfig)) { Logger.warn("Load configuration from MOA-ID 2.x XML configuration"); @@ -454,12 +469,15 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements //ConfigurationDBUtils.save(moaconfig); List importoas = moaconfig.getOnlineApplication(); - for (OnlineApplication importoa : importoas) { - ConfigurationDBUtils.saveOrUpdate(importoa); - } + // for (OnlineApplication importoa : importoas) { + // ConfigurationDBUtils.saveOrUpdate(importoa); + // } + + NewConfigurationDBWrite.saveOnlineApplications(importoas); moaconfig.setOnlineApplication(null); - ConfigurationDBUtils.saveOrUpdate(moaconfig); + //ConfigurationDBUtils.saveOrUpdate(moaconfig); + NewConfigurationDBWrite.save(moaconfig); } catch (Exception e) { Logger.warn("MOA-ID XML configuration can not be loaded from File.", e); @@ -479,7 +497,8 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements public synchronized void reloadDataBaseConfig() throws ConfigurationException { Logger.info("Read MOA-ID 2.0 configuration from database."); - moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); + //moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); + moaidconfig = NewConfigurationDBRead.getMOAIDConfiguration(); Logger.info("MOA-ID 2.0 is loaded."); if (moaidconfig == null) { @@ -759,7 +778,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements } //close Database - ConfigurationDBUtils.closeSession(); + // ConfigurationDBUtils.closeSession(); date = new Date(); } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java index d657ed16a..78cd8a670 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -45,47 +45,47 @@ public class ConfigurationFromDBExtractor { return result; } - @JsonProperty("getAuthComponentGeneral") + @JsonProperty(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY) public static AuthComponentGeneral getAuthComponentGeneral() { return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); } - @JsonProperty("getChainingModes") + @JsonProperty(MOAIDConfigurationConstants.CHAINING_MODES_KEY) public static ChainingModes getChainingModes() { return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); } - @JsonProperty("getOnlineApplications") + @JsonProperty(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY) public static List getOnlineApplications() { return getListOfValues("from OnlineApplication", OnlineApplication.class); } - @JsonProperty("getGenericConfigurations") + @JsonProperty(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY) public static List getGenericConfigurations() { return getListOfValues("from GenericConfiguration", GenericConfiguration.class); } - @JsonProperty("getTrustedCACertificates") + @JsonProperty(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY) public static String getTrustedCACertificates() { return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); } - @JsonProperty("getDefaultBKUs") + @JsonProperty(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY) public static DefaultBKUs getDefaultBKUs() { return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); } - @JsonProperty("getSLRequestTemplates") + @JsonProperty(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY) public static SLRequestTemplates getSLRequestTemplates() { return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); } - @JsonProperty("getTimeStampItem") + @JsonProperty(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY) public static Date getTimeStampItem() { return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); } - @JsonProperty("getPvp2RefreshItem") + @JsonProperty(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY) public static Date getPvp2RefreshItem() { return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java new file mode 100644 index 000000000..dc7c92a1d --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java @@ -0,0 +1,35 @@ +package at.gv.egovernment.moa.id.commons.db; + +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; + +/** + * + * + */ +public final class MOAIDConfigurationConstants { + + private MOAIDConfigurationConstants() { + // restrict instantiation + } + + // keys for the object in the key-value database + public static final String ONLINE_APPLICATIONS_KEY = "OnlineApplications"; + public static final String AUTH_COMPONENT_GENERAL_KEY = "AuthComponentGeneral"; + public static final String CHAINING_MODES_KEY = "ChainingModes"; + public static final String TRUSTED_CERTIFICATES_KEY = "TruestedCertificates"; + public static final String DEFAULT_BKUS_KEY = "DefaultBKUs"; + public static final String SLREQUEST_TEMPLATES_KEY = "SLRequestTemplates"; + public static final String TIMESTAMP_ITEM_KEY = "TimestampItem"; + public static final String PVP2REFRESH_ITEM_KEY = "Pvp2RefreshItem"; + public static final String GENERIC_CONFIGURATION_KEY = "GenericConfiguration"; + + /** + * Returns all relevant (database-) keys that {@link MOAIDConfiguration} contains. + * @return the keys as {@code String[]} + */ + public static final String[] getMOAIDConfigurationKeys() { + String[] keys = new String[] { AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, TRUSTED_CERTIFICATES_KEY, DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, + TIMESTAMP_ITEM_KEY, PVP2REFRESH_ITEM_KEY }; + return keys; + } +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 29bf02ba9..124a2e46a 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -67,7 +67,7 @@ public class NewConfigurationDBRead { Logger.trace("Get All OnlineApplications from database."); // select onlineapplication from OnlineApplication onlineapplication - return conf.getList("getOnlineApplications", OnlineApplication.class); + return conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); } @@ -104,28 +104,29 @@ public class NewConfigurationDBRead { public static MOAIDConfiguration getMOAIDConfiguration() { Logger.trace("Load MOAID Configuration from database."); - AuthComponentGeneral authComponent = (AuthComponentGeneral) conf.get("getAuthComponentGeneral", + AuthComponentGeneral authComponent = (AuthComponentGeneral) conf.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, AuthComponentGeneral.class); - ChainingModes chainingModes = (ChainingModes) conf.get("getChainingModes", ChainingModes.class); - List oas = (List) conf.getList("getOnlineApplications", + + ChainingModes chainingModes = (ChainingModes) conf.get(MOAIDConfigurationConstants.CHAINING_MODES_KEY, ChainingModes.class); + List oas = (List) conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); List genericConfigurations = (List) conf.getList( - "getGenericConfigurations", GenericConfiguration.class); - String trustedCaCertificates = (String) conf.get("getTrustedCACertificates", String.class); - DefaultBKUs defaultBKUs = (DefaultBKUs) conf.get("getDefaultBKUs", DefaultBKUs.class); - SLRequestTemplates slrRequestRemplates = (SLRequestTemplates) conf.get("getSLRequestTemplates", + MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); + String trustedCaCertificates = (String) conf.get(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, String.class); + DefaultBKUs defaultBKUs = (DefaultBKUs) conf.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); + SLRequestTemplates slrRequestRemplates = (SLRequestTemplates) conf.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); - Date timeStamp = (Date) conf.get("getTimeStampItem", Date.class); - Date pvp2Refresh = (Date) conf.get("getPvp2RefreshItem", Date.class); - - if (authComponent == null || chainingModes == null || trustedCaCertificates == null || defaultBKUs == null - || slrRequestRemplates == null || timeStamp == null || pvp2Refresh == null - - ) { - // TODO: is there a better approach in case of error? - Logger.trace("Not all necessary data available. Create fresh instance."); - return new MOAIDConfiguration(); - } + Date timeStamp = (Date) conf.get(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, Date.class); + Date pvp2Refresh = (Date) conf.get(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, Date.class); + + // if (authComponent == null || chainingModes == null || trustedCaCertificates == null || defaultBKUs == null + // || slrRequestRemplates == null || timeStamp == null || pvp2Refresh == null + // + // ) { + // // TODO: is there a better approach in case of error? + // Logger.trace("Not all necessary data available. Create fresh instance."); + // return new MOAIDConfiguration(); + // } // select moaidconfiguration from MOAIDConfiguration moaidconfiguration MOAIDConfiguration result = new MOAIDConfiguration(); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java new file mode 100644 index 000000000..d8ac55b4e --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java @@ -0,0 +1,157 @@ +package at.gv.egovernment.moa.id.commons.db; + +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; + +import com.datentechnik.moa.id.conf.persistence.Configuration; + +/** + * + * + */ +@Component +public class NewConfigurationDBWrite { + + private static Configuration conf; + + @Autowired(required = true) + public void setConfiguration(Configuration conf) { + // https://jira.spring.io/browse/SPR-3845 + NewConfigurationDBWrite.conf = conf; + } + + private static boolean saveAuthComponentGeneral(AuthComponentGeneral dbo) { + + conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); + return true; + } + + private static boolean saveChainingModes(ChainingModes dbo) { + conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); + return true; + } + + private static boolean saveOnlineApplication(OnlineApplication dbo) { + + List storedObjects = conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); + storedObjects.add(dbo); + conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); + + return true; + } + + private static boolean saveGenericConfiguration(GenericConfiguration dbo) { + + List storedObjects = conf.getList(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); + storedObjects.add(dbo); + conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); + return true; + } + + private static boolean saveTrustedCACertificates(String dbo) { + + conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); + return true; + } + + private static boolean saveDefaultBKUs(DefaultBKUs dbo) { + + conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); + return true; + } + + private static boolean saveSLRequestTemplates(SLRequestTemplates dbo) { + + conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); + return true; + } + + private static boolean saveTimeStampItem(Date dbo) { + + conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); + return true; + } + + private static boolean savePvp2RefreshItem(Date dbo) { + + conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); + return true; + } + + /** + * Saves the given list of {@link OnlineApplication} objects to database. + * @param oas the list + * @return {@code true} on success; {@code false} otherwise. + */ + public static boolean saveOnlineApplications(List oas) { + + conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); + return true; + } + + /** + * Saves the given list of {@link GenericConfiguration} objects to database. + * @param gcs the list + * @return {@code true} on success; {@code false} otherwise. + */ + public static boolean saveGenericConfigurations(List gcs) { + + return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, gcs); + } + + + /** + * Saves the given object to database + * @param dbo the object to save + * @return {@code true} on success; {@code false} otherwise. + */ + public static boolean save(Object dbo) { + + boolean result = false; + + if (dbo instanceof OnlineApplication) { + + result = saveOnlineApplication((OnlineApplication) dbo); + + } else if (dbo instanceof MOAIDConfiguration) { + + MOAIDConfiguration moaconfig = (MOAIDConfiguration) dbo; + result = true; + + result &= saveAuthComponentGeneral(moaconfig.getAuthComponentGeneral()); + result &= saveChainingModes(moaconfig.getChainingModes()); + result &= saveDefaultBKUs(moaconfig.getDefaultBKUs()); + result &= saveGenericConfigurations(moaconfig.getGenericConfiguration()); + result &= savePvp2RefreshItem(moaconfig.getPvp2RefreshItem()); + result &= saveSLRequestTemplates(moaconfig.getSLRequestTemplates()); + result &= saveTrustedCACertificates(moaconfig.getTrustedCACertificates()); + result &= saveTimeStampItem(moaconfig.getTimestampItem()); + + } else if (dbo instanceof UserDatabase) { + // TODO implement user handling + } + + return result; + } + + /** + * Deletes the object associated with the given key. + * @param key the key + */ + public static void delete(String key) { + conf.delete(key); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java index 6ec43c583..43f7d9454 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java @@ -27,7 +27,7 @@ public interface Configuration { * @param key * @param value */ - void set(String key, Object value); + boolean set(String key, Object value); /** * @@ -45,4 +45,11 @@ public interface Configuration { * @return */ List getList(String key, Class clazz); + + /** + * + * @param key + * @return + */ + void delete(String key); } \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java index 7a52d0c9d..eebecf509 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java @@ -66,7 +66,7 @@ public class ConfigurationImpl implements Configuration { } @Override - public void set(String key, Object value) { + public boolean set(String key, Object value) { ConfigProperty keyValue = new ConfigProperty(); keyValue.setKey(key); @@ -74,10 +74,11 @@ public class ConfigurationImpl implements Configuration { keyValue.setValue(mapper.serialize(value)); // System.out.println(">> key - value: " + keyValue.getKey() + " - " + keyValue.getValue() + "\n"); configPropertyDao.saveProperty(keyValue); - + return true; } catch (JsonProcessingException e) { // TODO do proper error handling e.printStackTrace(); + return false; } } @@ -98,6 +99,10 @@ public class ConfigurationImpl implements Configuration { public List getList(String key, Class clazz) { CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); + + if(configPropertyDao.getProperty(key)==null){ + return new ArrayList(); + } String json = configPropertyDao.getProperty(key).getValue(); ObjectMapper mapper = new ObjectMapper(); @@ -120,6 +125,12 @@ public class ConfigurationImpl implements Configuration { return property.getValue(); } + @Override + public void delete(String key) { + configPropertyDao.delete(key); + } + + /** * * @@ -178,4 +189,5 @@ public class ConfigurationImpl implements Configuration { }; + } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java index a11d23ce8..50dddd745 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java @@ -42,4 +42,11 @@ public interface ConfigPropertyDao { * @param properties The list containing all the properties to be persisted. */ public void saveProperties(Set properties); + + /** + * Deletes the object associated with the given key. + * @param key the key + */ + public void delete(String key); + } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java index 2b28cb245..752c7dc09 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java @@ -64,12 +64,12 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { @Override public List getProperties() { - + if (null == em) { log.error("No EntityManager set!"); return null; } - + log.debug("Retrieving all properties from database."); TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); try { @@ -90,4 +90,14 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { em.flush(); } + @Override + public void delete(String key) { + log.debug("Deleting entry with key '{}'.", key); + try{ + em.remove(em.find(ConfigProperty.class, key)); + }catch (IllegalArgumentException e){ + log.trace("Error while deleting entry with key '{}':" + e.getMessage(), key); + } + } + } diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index ee906a407..87cccc7b2 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -25,6 +25,8 @@ + + -- cgit v1.2.3 From dc50d90a4750600b4555c19c2b939200216b68bd Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 19 Jan 2015 16:59:05 +0100 Subject: add initial version of a moaid-configuration test, does not work if old db is not initialized --- .../id/config/auth/AuthConfigurationProvider.java | 2 +- id/server/moa-id-commons/pom.xml | 5 + .../moa/id/commons/db/NewConfigurationDBRead.java | 3 - .../moa/id/commons/db/ConfigurationDBReadTest.java | 127 +++++++++++++++++++++ .../moa/id/commons/db/configuration.beans-test.xml | 54 +++++++++ .../moa/id/commons/db/hibernate.properties | 20 ++++ .../moa/id/commons/db/testDatabase.properties | 7 ++ 7 files changed, 214 insertions(+), 4 deletions(-) create mode 100644 id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java create mode 100644 id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml create mode 100644 id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/hibernate.properties create mode 100644 id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/testDatabase.properties (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index a4eab51d9..a143eb636 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -433,7 +433,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements if (oas != null && oas.size() > 0) { // for (OnlineApplication oa : oas) // ConfigurationDBUtils.delete(oa); - NewConfigurationDBWrite.delete("getOnlineApplications"); + NewConfigurationDBWrite.delete(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY); } } diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 85bd82dd4..b228c4352 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -140,6 +140,11 @@ + + org.springframework + spring-test + test + cglib cglib diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 124a2e46a..0dd232773 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -108,8 +108,6 @@ public class NewConfigurationDBRead { AuthComponentGeneral.class); ChainingModes chainingModes = (ChainingModes) conf.get(MOAIDConfigurationConstants.CHAINING_MODES_KEY, ChainingModes.class); - List oas = (List) conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, - OnlineApplication.class); List genericConfigurations = (List) conf.getList( MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); String trustedCaCertificates = (String) conf.get(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, String.class); @@ -132,7 +130,6 @@ public class NewConfigurationDBRead { MOAIDConfiguration result = new MOAIDConfiguration(); result.setAuthComponentGeneral(authComponent); result.setChainingModes(chainingModes); - result.setOnlineApplication(oas); result.setGenericConfiguration(genericConfigurations); result.setTrustedCACertificates(trustedCaCertificates); result.setDefaultBKUs(defaultBKUs); diff --git a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java new file mode 100644 index 000000000..7147cd5bc --- /dev/null +++ b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java @@ -0,0 +1,127 @@ +package at.gv.egovernment.moa.id.commons.db; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.List; +import java.util.Properties; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; + +import com.datentechnik.moa.id.conf.persistence.Configuration; +import com.fasterxml.jackson.annotation.JsonProperty; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("configuration.beans-test.xml") +public class ConfigurationDBReadTest { + + @Autowired + Configuration configDataBase; + + private Properties getHibernateProperties() throws FileNotFoundException, IOException { + + Properties configProp = null; + try (InputStream in = ConfigurationDBReadTest.class.getResourceAsStream("hibernate.properties");) { + Properties props = new Properties(); + props.load(in); + // read Config Hibernate properties + configProp = new Properties(); + for (Object key : props.keySet()) { + String propPrefix = "configuration."; + if (key.toString().startsWith(propPrefix + "hibernate")) { + String propertyName = key.toString().substring(propPrefix.length()); + configProp.put(propertyName, props.get(key.toString())); + } + } + } + + return configProp; + } + + private void migrateDatabase(List methodNames) throws IllegalAccessException, IllegalArgumentException, + InvocationTargetException, NoSuchMethodException, SecurityException { + for (String name : methodNames) { + Method method = ConfigurationFromDBExtractor.class.getMethod(name); + Object tmp = method.invoke(null, new Object[] {}); + JsonProperty annotation = method.getAnnotation(JsonProperty.class); + if (annotation != null) { + configDataBase.set(annotation.value(), tmp); + } else { + System.out.println("Methods must be annotated, annotation is used as key in key-value db."); + assertTrue(false); + } + } + } + + @Before + public void initialize() throws FileNotFoundException, MOADatabaseException, IOException, IllegalAccessException, + IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { + + // initialize the connection to the old database + ConfigurationDBUtils.initHibernate(getHibernateProperties()); + + // migrate the data in the old database to a new key value database + List methodNames = Arrays.asList("getAuthComponentGeneral", "getChainingModes", + "getTrustedCACertificates", "getDefaultBKUs", "getSLRequestTemplates", "getTimeStampItem", + "getPvp2RefreshItem", "getOnlineApplications", "getGenericConfigurations"); + migrateDatabase(methodNames); + + // close the session with the old database + ConfigurationDBUtils.closeSession(); + } + + @Test + public void testGetMOAIDConfiguration() throws FileNotFoundException, MOADatabaseException, IOException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException { + + // get the old moaid configuration + MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); + + // get the a new moaid configuration from the data in the key value + // database + MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); + + // check if both configurations yield a similar MOAIDConfiguration + // object + assertTrue(oldConfig.equals(newConfig)); + + } + + @Test + public void testGetMOAIDConfigurationNotEqual() throws FileNotFoundException, MOADatabaseException, IOException, + IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, + SecurityException { + + // get the old moaid configuration + MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); + + // delete part of the configuration + oldConfig.setAuthComponentGeneral(new AuthComponentGeneral()); + + // get the a new moaid configuration from the data in the key value + // database + MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); + + // check if both configurations yield a similar MOAIDConfiguration + // object + assertFalse(oldConfig.equals(newConfig)); + + } + +} diff --git a/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml new file mode 100644 index 000000000..4c7cd3ab1 --- /dev/null +++ b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/hibernate.properties b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/hibernate.properties new file mode 100644 index 000000000..095a5e5ac --- /dev/null +++ b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/hibernate.properties @@ -0,0 +1,20 @@ +#Hibnerate configuration for MOA-ID 2.0 configuration +configuration.hibernate.dialect=org.hibernate.dialect.MySQLDialect +configuration.hibernate.connection.url=jdbc:mysql://localhost/moa-id-config?charSet=utf-8&autoReconnect=true +configuration.hibernate.connection.charSet=utf-8 +configuration.hibernate.connection.driver_class=com.mysql.jdbc.Driver +configuration.hibernate.connection.username=moaid +configuration.hibernate.connection.password=moaid + +configuration.hibernate.hbm2ddl.auto=update +configuration.hibernate.current_session_context_class=thread +configuration.hibernate.transaction.auto_close_session=true +configuration.hibernate.show_sql=false +configuration.hibernate.format_sql=true +configuration.hibernate.connection.provider_class=org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider +configuration.hibernate.c3p0.acquire_increment=3 +configuration.hibernate.c3p0.idle_test_period=60 +configuration.hibernate.c3p0.timeout=300 +configuration.hibernate.c3p0.max_size=20 +configuration.hibernate.c3p0.max_statements=0 +configuration.hibernate.c3p0.min_size=3 \ No newline at end of file diff --git a/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/testDatabase.properties b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/testDatabase.properties new file mode 100644 index 000000000..6036d2846 --- /dev/null +++ b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/testDatabase.properties @@ -0,0 +1,7 @@ +dataSource.driverClassName=org.h2.Driver +dataSource.url=jdbc:h2:mem:moaidconftest +dataSource.username= +dataSource.password= + +jpaVendorAdapter.databasePlatform=org.hibernate.dialect.H2Dialect +jpaVendorAdapter.generateDdl=true \ No newline at end of file -- cgit v1.2.3 From b6940b7aea1c901eac9da7eb2ed188393553c10d Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Mon, 19 Jan 2015 17:20:08 +0100 Subject: add missing junit artifact to 'moa-id-commons' and update its version to 4.11 --- id/server/moa-id-commons/pom.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index b228c4352..b3dc86f50 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -138,7 +138,12 @@ com.fasterxml.jackson.core jackson-databind - + + + junit + junit + + org.springframework @@ -162,6 +167,8 @@ commons-dbcp 1.4 + + -- cgit v1.2.3 From 775c9ddc5a13f813ec2392f5e1d5ea0a1b466923 Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Tue, 20 Jan 2015 17:26:08 +0100 Subject: rewrite 'AuthConfigurationProvider' in order to use key-value database --- .../config/auth/NewAuthConfigurationProvider.java | 757 ++++++++++++++++++--- 1 file changed, 671 insertions(+), 86 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java index 4f2284d3d..77a9f032c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java @@ -1,216 +1,801 @@ package at.gv.egovernment.moa.id.config.auth; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.math.BigInteger; +import java.util.ArrayList; import java.util.List; import java.util.Properties; import org.springframework.beans.factory.annotation.Autowired; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; +import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; +import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; +import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; +import at.gv.egovernment.moa.id.commons.db.dao.config.SAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; +import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConfigurationUtils; import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.ConnectionParameterForeign; +import at.gv.egovernment.moa.id.config.ConnectionParameterMOASP; +import at.gv.egovernment.moa.id.config.ConnectionParameterMandate; import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; import at.gv.egovernment.moa.id.config.stork.STORKConfig; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.MiscUtil; -import com.datentechnik.moa.id.conf.persistence.ConfigurationImpl; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.datentechnik.moa.id.conf.persistence.Configuration; +/** + * A class providing access to the Auth Part of the MOA-ID configuration data. + */ public class NewAuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration { @Autowired - private ConfigurationImpl configuration; + private Configuration configuration; - @JsonProperty("getGeneralPVP2ProperiesConfig") + private final Properties properties = new Properties(); + + public NewAuthConfigurationProvider(String fileName) throws ConfigurationException { + File propertiesFile = new File(fileName); + rootConfigFileDir = propertiesFile.getParent(); + + try (FileInputStream in = new FileInputStream(propertiesFile);) { + properties.load(in); + } catch (FileNotFoundException e) { + throw new ConfigurationException("config.03", null, e); + } catch (IOException e) { + throw new ConfigurationException("config.03", null, e); + } + } + + private Properties getProperties() { + return properties; + } + + /** + * Returns the general pvp2 properties config. NOTE: may be empty but never {@code null}. + * @return the general pvp2 properties config. + */ public Properties getGeneralPVP2ProperiesConfig() { - return configuration.get("getGeneralPVP2ProperiesConfig", Properties.class); + return this.getGeneralProperiesConfig("protocols.pvp2."); } - @JsonProperty("getGeneralOAuth20ProperiesConfig") + /** + * Returns the general oauth20 properties config. NOTE: may be empty but never {@code null}. + * @return the general oauth20 properties config. + */ public Properties getGeneralOAuth20ProperiesConfig() { - return configuration.get("getGeneralOAuth20ProperiesConfig", Properties.class); + return this.getGeneralProperiesConfig("protocols.oauth20."); } - @JsonProperty("getAllowedProtocols") + /** + * Returns the allowed protocols. NOTE: may return {@code null}. + * + * @return the allowed protocols or {@code null}. + */ public ProtocolAllowed getAllowedProtocols() { - return configuration.get("getAllowedProtocols", ProtocolAllowed.class); + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return null; + } + ProtocolAllowed allowedProtcols = new ProtocolAllowed(); + Protocols protocols = authComponentGeneral.getProtocols(); + if (protocols != null) { + allowedProtcols = new ProtocolAllowed(); + + if (protocols.getSAML1() != null) { + allowedProtcols.setSAML1Active(protocols.getSAML1().isIsActive()); + } + + if (protocols.getOAuth() != null) { + allowedProtcols.setOAUTHActive(protocols.getOAuth().isIsActive()); + } + + if (protocols.getPVP2() != null) { + allowedProtcols.setPVP21Active(protocols.getPVP2().isIsActive()); + } + return allowedProtcols; + } else { + Logger.warn("Error in MOA-ID Configuration. No general Protcol configuration found."); + return null; + } } - @JsonProperty("getGeneralPVP2DBConfig") + /** + * Returns the general PVP2 configuration. NOTE: may return {@code null}. + * + * @return the general PVP2 configuration or {@code null}. + */ public PVP2 getGeneralPVP2DBConfig() { - return configuration.get("getGeneralPVP2DBConfig", PVP2.class); + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return null; + } + Protocols protocols = authComponentGeneral.getProtocols(); + PVP2 result = null; + if (protocols != null) { + PVP2 pvp2 = protocols.getPVP2(); + if (pvp2 != null) { + result = new PVP2(); + result.setIssuerName(pvp2.getIssuerName()); + result.setPublicURLPrefix(pvp2.getPublicURLPrefix()); + + if (pvp2.getOrganization() != null) { + Organization org = new Organization(); + result.setOrganization(org); + org.setDisplayName(pvp2.getOrganization().getDisplayName()); + org.setName(pvp2.getOrganization().getName()); + org.setURL(pvp2.getOrganization().getURL()); + } + + if (pvp2.getContact() != null) { + List cont = new ArrayList(); + result.setContact(cont); + for (Contact e : pvp2.getContact()) { + Contact c = new Contact(); + c.setCompany(e.getCompany()); + c.setGivenName(e.getGivenName()); + c.getMail().addAll(e.getMail()); + c.getPhone().addAll(e.getPhone()); + c.setSurName(e.getSurName()); + c.setType(e.getType()); + cont.add(c); + } + } + } + + } else { + Logger.warn("Error in MOA-ID Configuration. No general Protcol configuration found."); + } + return result; } - @JsonProperty("getTimeOuts") + /** + * Returns the configured timeouts, or a default timeout. + * + * @return the configured timeout, or the default (never {@code null}). + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. + */ public TimeOuts getTimeOuts() throws ConfigurationException { - return configuration.get("getTimeOuts", TimeOuts.class); + + TimeOuts timeouts = new TimeOuts(); + + // set default timeouts + timeouts.setAssertion(new BigInteger("300")); + timeouts.setMOASessionCreated(new BigInteger("2700")); + timeouts.setMOASessionUpdated(new BigInteger("1200")); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + // search timeouts in config + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null) { + if (generalConfiguration.getTimeOuts() != null) { + if (generalConfiguration.getTimeOuts().getAssertion() != null) { + timeouts.setAssertion(generalConfiguration.getTimeOuts().getAssertion()); + } + + if (generalConfiguration.getTimeOuts().getMOASessionCreated() != null) { + timeouts.setMOASessionCreated(generalConfiguration.getTimeOuts().getMOASessionCreated()); + } + + if (generalConfiguration.getTimeOuts().getMOASessionUpdated() != null) { + timeouts.setMOASessionUpdated(generalConfiguration.getTimeOuts().getMOASessionUpdated()); + } + + } else { + Logger.info("No TimeOuts defined. Use default values"); + } + } + return timeouts; } - @JsonProperty("getAlternativeSourceID") + /** + * Returns an alternative source ID. NOTE: may return {@code null}. + * + * @return an alternative source ID or {@code null}. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ public String getAlternativeSourceID() throws ConfigurationException { - return configuration.get("getAlternativeSourceID", String.class); + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + String alternativeSourceId = null; + Protocols protocols = authComponentGeneral.getProtocols(); + if (protocols != null) { + SAML1 saml1 = protocols.getSAML1(); + if (saml1 != null && MiscUtil.isNotEmpty(saml1.getSourceID())) { + alternativeSourceId = saml1.getSourceID(); + } + } + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null && MiscUtil.isEmpty(alternativeSourceId)) { + alternativeSourceId = generalConfiguration.getAlternativeSourceID(); + } + return alternativeSourceId; } - @JsonProperty("getLegacyAllowedProtocols") + /** + * Returns a list of legacy allowed protocols. NOTE: may return an empty list but never {@code null}. + * + * @return the list of protocols. + */ public List getLegacyAllowedProtocols() { - return configuration.getList("getLegacyAllowedProtocols", String.class); + + try { + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + + if (authComponentGeneral.getProtocols() != null) { + Protocols procols = authComponentGeneral.getProtocols(); + if (procols.getLegacyAllowed() != null) { + LegacyAllowed legacy = procols.getLegacyAllowed(); + return legacy.getProtocolName(); + } + } + + return new ArrayList(); + + } catch (NullPointerException e) { + Logger.info("No protocols found with legacy allowed flag!"); + return new ArrayList(); + } catch (ConfigurationException e) { + return new ArrayList(); + } + } - @JsonProperty("getOnlineApplicationParameter") + /** + * Provides configuration information regarding the online application behind the given URL, relevant to the MOA-ID Auth component. + * + * @param oaURL URL requested for an online application + * @return an OAAuthParameter, or null if none is applicable + */ public OAAuthParameter getOnlineApplicationParameter(String oaURL) { - return configuration.get("getOnlineApplicationParameter", OAAuthParameter.class); + + OnlineApplication oa = NewConfigurationDBRead.getActiveOnlineApplication(oaURL); + if (oa == null) { + Logger.warn("Online application with identifier " + oaURL + " is not found."); + return null; + } + + return new OAAuthParameter(oa); } - @JsonProperty("getMoaSpAuthBlockTrustProfileID") + /** + * Returns a string with a url-reference to the VerifyAuthBlock trust profile id within the moa-sp part of the authentication component. + * + * @return a string with a url-reference to the VerifyAuthBlock trust profile ID. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. + */ public String getMoaSpAuthBlockTrustProfileID() throws ConfigurationException { - return configuration.get("getMoaSpAuthBlockTrustProfileID", String.class); + return getVerifyAuthBlock().getTrustProfileID(); } - @JsonProperty("getMoaSpAuthBlockVerifyTransformsInfoIDs") + /** + * Returns a list of strings with references to all verify transform info IDs within the moa-sp part of the authentication component. + * + * @return a list of strings containing all urls to the verify transform info IDs. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. + */ public List getMoaSpAuthBlockVerifyTransformsInfoIDs() throws ConfigurationException { - return configuration.getList("getMoaSpAuthBlockVerifyTransformsInfoIDs", String.class); + return getVerifyAuthBlock().getVerifyTransformsInfoProfileID(); } - @JsonProperty("getMoaSpConnectionParameter") + /** + * Returns a ConnectionParameter bean containing all information of the authentication component moa-sp element. + * + * @return ConnectionParameter of the authentication component moa-sp element. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. + */ public ConnectionParameter getMoaSpConnectionParameter() throws ConfigurationException { - return configuration.get("getMoaSpConnectionParameter", ConnectionParameter.class); + ConnectionParameter result = null; + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + MOASP moasp = authComponentGeneral.getMOASP(); + if (moasp != null) { + ConnectionParameterClientAuthType connectionParameter = moasp.getConnectionParameter(); + if (connectionParameter != null) { + result = new ConnectionParameterMOASP(moasp.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); + } + } + return result; } - @JsonProperty("getForeignIDConnectionParameter") + /** + * Returns the {@link ConnectionParameter} for the ForeignID. NOTE: may return {@code null}. + * + * @return the connection parameter. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. + */ public ConnectionParameter getForeignIDConnectionParameter() throws ConfigurationException { - return configuration.get("getForeignIDConnectionParameter", ConnectionParameter.class); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + ForeignIdentities foreign = authComponentGeneral.getForeignIdentities(); + if (foreign != null) { + return new ConnectionParameterForeign(foreign.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); + } else { + Logger.warn("Error in MOA-ID Configuration. No Connectionconfiguration to SZRGW Service found"); + return null; + } } - @JsonProperty("getOnlineMandatesConnectionParameter") + /** + * Returns the {@link ConnectionParameter} for the OnlineMandates. NOTE: may return {@code null}. + * + * @return the connection parameter. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ public ConnectionParameter getOnlineMandatesConnectionParameter() throws ConfigurationException { - return configuration.get("getOnlineMandatesConnectionParameter", ConnectionParameter.class); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + OnlineMandates ovs = authComponentGeneral.getOnlineMandates(); + if (ovs != null) { + return new ConnectionParameterMandate(ovs.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); + } + return null; } - @JsonProperty("getMoaSpIdentityLinkTrustProfileID") + /** + * Returns a string with a url-reference to the VerifyIdentityLink trust profile id within the moa-sp part of the authentication component + * + * @return String with a url-reference to the VerifyIdentityLink trust profile ID + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link VerifyIdentityLink}. + */ public String getMoaSpIdentityLinkTrustProfileID() throws ConfigurationException { - return configuration.get("getMoaSpIdentityLinkTrustProfileID", String.class); + + String result = null; + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + MOASP moasp = authComponentGeneral.getMOASP(); + if (moasp != null) { + VerifyIdentityLink verifyIdentityLink = moasp.getVerifyIdentityLink(); + if (verifyIdentityLink != null) { + result = verifyIdentityLink.getTrustProfileID(); + } else { + Logger.warn("Error in MOA-ID Configuration. No Trustprofile for IdentityLink validation."); + throw new ConfigurationException("config.02", null); + } + } + return result; } - @JsonProperty("getTransformsInfos") + /** + * Returns a non-empty list of transform infos. NOTE: list is never {@code empty} or {@code null}. + * + * @return a list of transform infos. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link SecurityLayer}. + */ public List getTransformsInfos() throws ConfigurationException { - return configuration.getList("getTransformsInfos", String.class); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + SecurityLayer securityLayer = authComponentGeneral.getSecurityLayer(); + if (securityLayer != null) { + + List result = ConfigurationUtils.getTransformInfos(securityLayer.getTransformsInfo()); + + if (result == null || result.isEmpty()) { + Logger.error("No Security-Layer Transformation found."); + throw new ConfigurationException("config.05", new Object[] { "Security-Layer Transformation" }); + } + return result; + + } else { + Logger.warn("Error in MOA-ID Configuration. No generalAuthConfiguration->SecurityLayer found"); + throw new ConfigurationException("config.02", null); + } } - @JsonProperty("getIdentityLinkX509SubjectNames") + /** + * Returns a list of IdentityLinkX509SubjectNames. NOTE: may return an empty list but never {@code null}. + * + * @return the list of IdentityLinkX509SubjectNames. + * + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ public List getIdentityLinkX509SubjectNames() throws ConfigurationException { - return configuration.getList("getIdentityLinkX509SubjectNames", String.class); + + ArrayList identityLinkX509SubjectNames = new ArrayList(); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + + IdentityLinkSigners idlsigners = authComponentGeneral.getIdentityLinkSigners(); + if (idlsigners != null) { + Logger.debug("Load own IdentityLinkX509SubjectNames"); + identityLinkX509SubjectNames.addAll(new ArrayList(idlsigners.getX509SubjectName())); + } + + String[] identityLinkSignersWithoutOID = MOAIDAuthConstants.IDENTITY_LINK_SIGNERS_WITHOUT_OID; + for (int i = 0; i < identityLinkSignersWithoutOID.length; i++) { + String identityLinkSigner = identityLinkSignersWithoutOID[i]; + if (!identityLinkX509SubjectNames.contains(identityLinkSigner)) { + identityLinkX509SubjectNames.add(identityLinkSigner); + } + } + + return identityLinkX509SubjectNames; } - @JsonProperty("getSLRequestTemplates") + /** + * Returns a list of default SLRequestTemplates. NOTE: may return an empty list but never {@code null}. + * + * @return list of default SLRequestTemplates. + * @throws ConfigurationException is never thrown + */ public List getSLRequestTemplates() throws ConfigurationException { - return configuration.getList("getSLRequestTemplates", String.class); + + SLRequestTemplates templates = configuration.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); + List templatesList = new ArrayList(); + + if (templates != null) { + templatesList.add(templates.getOnlineBKU()); + templatesList.add(templates.getLocalBKU()); + templatesList.add(templates.getHandyBKU()); + } + return templatesList; } - @JsonProperty("getSLRequestTemplates") + /** + * Returns the type's default SLRequestTemplate. NOTE: may return {@code null}. + * + * @param type the type of BKU. + * @return the default SLRequestTemplate for the given type. + * + * @throws ConfigurationException is never thrown + */ public String getSLRequestTemplates(String type) throws ConfigurationException { - return configuration.get("getSLRequestTemplates", String.class); + + SLRequestTemplates templates = configuration.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); + String slRequestTemplate = null; + + if (templates != null) { + switch (type) { + case IOAAuthParameters.ONLINEBKU: + slRequestTemplate = templates.getOnlineBKU(); + break; + case IOAAuthParameters.LOCALBKU: + slRequestTemplate = templates.getLocalBKU(); + break; + case IOAAuthParameters.HANDYBKU: + slRequestTemplate = templates.getHandyBKU(); + break; + default: + Logger.warn("getSLRequestTemplates: BKU Type does not match: " + IOAAuthParameters.ONLINEBKU + " or " + IOAAuthParameters.HANDYBKU + " or " + + IOAAuthParameters.LOCALBKU); + } + } + return slRequestTemplate; } - @JsonProperty("getDefaultBKUURLs") + /** + * Returns a list of default BKUURLs. NOTE: may return an empty list but never {@code null}. + * + * @return list of default BKUURLs. + * @throws ConfigurationException is never thrown + */ public List getDefaultBKUURLs() throws ConfigurationException { - return configuration.getList("getDefaultBKUURLs", String.class); + + DefaultBKUs bkuurls = configuration.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); + List bkuurlsList = new ArrayList(); + + if (bkuurls != null) { + bkuurlsList.add(bkuurls.getOnlineBKU()); + bkuurlsList.add(bkuurls.getLocalBKU()); + bkuurlsList.add(bkuurls.getHandyBKU()); + } + return bkuurlsList; } - @JsonProperty("getDefaultBKUURL") + /** + * Returns the type's default BKUURL. NOTE: may return {@code null}. + * + * @param type the type of BKU. + * @return the default BKUURL for the given type. + * + * @throws ConfigurationException is never thrown + */ public String getDefaultBKUURL(String type) throws ConfigurationException { - // FIXME find a solution for this getter - // String el = DefaultBKUURLs.get(type); - // if (MiscUtil.isNotEmpty(el)) - // return el; - // else { - // Logger.warn("getSLRequestTemplates: BKU Type does not match: " + - // IOAAuthParameters.ONLINEBKU + " or " - // + IOAAuthParameters.HANDYBKU + " or " + IOAAuthParameters.LOCALBKU); - // return null; - // } - return null; + DefaultBKUs bkuurls = configuration.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); + String defaultBKUUrl = null; + + if (bkuurls != null) { + switch (type) { + case IOAAuthParameters.ONLINEBKU: + defaultBKUUrl = bkuurls.getOnlineBKU(); + break; + case IOAAuthParameters.LOCALBKU: + defaultBKUUrl = bkuurls.getLocalBKU(); + break; + case IOAAuthParameters.HANDYBKU: + defaultBKUUrl = bkuurls.getHandyBKU(); + break; + default: + Logger.warn("getDefaultBKUURL: BKU Type does not match: " + IOAAuthParameters.ONLINEBKU + " or " + IOAAuthParameters.HANDYBKU + " or " + + IOAAuthParameters.LOCALBKU); + } + } + return defaultBKUUrl; } - @JsonProperty("getSSOTagetIdentifier") + /** + * Returns the SSOTagetIdentifier. NOTE: returns {@code null} if no SSOTargetIdentifier is set. + * + * @return the SSOTagetIdentifier or {@code null} + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ public String getSSOTagetIdentifier() throws ConfigurationException { - return configuration.get("getSSOTagetIdentifier", String.class); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + + SSO sso = authComponentGeneral.getSSO(); + if (sso != null) { + return sso.getTarget(); + } + return null; } - @JsonProperty("getSSOFriendlyName") + /** + * Returns the SSOFriendlyName. NOTE: never returns {@code null}, if no SSOFriendlyName is set, a default String is returned. + * + * @return the SSOFriendlyName or a default String + */ public String getSSOFriendlyName() { - return configuration.get("getSSOFriendlyName", String.class); + + AuthComponentGeneral authComponentGeneral; + String defaultValue = "Default MOA-ID friendly name for SSO"; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return defaultValue; + } + + SSO sso = authComponentGeneral.getSSO(); + if (sso != null) { + if (MiscUtil.isEmpty(sso.getFriendlyName())) { + return sso.getFriendlyName(); + } + } + return defaultValue; } - @JsonProperty("getSSOSpecialText") + /** + * Returns the SSOSpecialText. NOTE: never returns {@code null}, if no SSOSpecialText is set, an empty String is returned. + * + * @return the SSOSpecialText or an empty String + */ public String getSSOSpecialText() { - return configuration.get("getSSOSpecialText", String.class); + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return new String(); + } + + SSO sso = authComponentGeneral.getSSO(); + if (sso != null) { + String text = sso.getSpecialText(); + return MiscUtil.isEmpty(text) ? new String() : text; + } + return new String(); } - @JsonProperty("getMOASessionEncryptionKey") + /** + * Returns the MOASessionEncryptionKey NOTE: returns {@code null} if no MOASessionEncryptionKey is set. + * + * @return the MOASessionEncryptionKey or {@code null} + */ public String getMOASessionEncryptionKey() { - return configuration.get("getMOASessionEncryptionKey", String.class); + String prop = properties.getProperty("configuration.moasession.key"); + return MiscUtil.isNotEmpty(prop) ? prop : null; } - @JsonProperty("getMOAConfigurationEncryptionKey") + /** + * Returns the MOAConfigurationEncryptionKey NOTE: returns {@code null} if no MOAConfigurationEncryptionKey is set. + * + * @return the MOAConfigurationEncryptionKey or {@code null} + */ public String getMOAConfigurationEncryptionKey() { - return configuration.get("getMOAConfigurationEncryptionKey", String.class); + String prop = properties.getProperty("configuration.moaconfig.key"); + return MiscUtil.isNotEmpty(prop) ? prop : null; } - @JsonProperty("isIdentityLinkResigning") + /** + * @return {@code true} if IdentityLinkResigning is set, {@code false} otherwise. + */ public boolean isIdentityLinkResigning() { - return configuration.get("isIdentityLinkResigning", Boolean.class); + String prop = properties.getProperty("configuration.resignidentitylink.active", "false"); + return Boolean.valueOf(prop); } - @JsonProperty("getIdentityLinkResigningKey") + /** + * Returns the IdentityLinkResigningKey. NOTE: returns {@code null} if no IdentityLinkResigningKey is set. + * + * @return the IdentityLinkResigningKey or {@code null} + */ public String getIdentityLinkResigningKey() { - return configuration.get("getIdentityLinkResigningKey", String.class); + String prop = properties.getProperty("configuration.resignidentitylink.keygroup"); + return MiscUtil.isNotEmpty(prop) ? prop : null; } - @JsonProperty("isMonitoringActive") + /** + * @return {@code true} if MonitoringActive is set, {@code false} otherwise. + */ public boolean isMonitoringActive() { - return configuration.get("isMonitoringActive", Boolean.class); + String prop = properties.getProperty("configuration.monitoring.active", "false"); + return Boolean.valueOf(prop); } - @JsonProperty("getMonitoringTestIdentityLinkURL") + /** + * Returns the MonitoringTestIdentityLinkURL. NOTE: returns {@code null} if no MonitoringTestIdentityLinkURL is set. + * + * @return the MonitoringTestIdentityLinkURL or {@code null} + */ public String getMonitoringTestIdentityLinkURL() { - return configuration.get("getMonitoringTestIdentityLinkURL", String.class); + String prop = properties.getProperty("configuration.monitoring.test.identitylink.url"); + return MiscUtil.isNotEmpty(prop) ? prop : null; } - @JsonProperty("getMonitoringMessageSuccess") + /** + * Returns the MonitoringMessageSuccess. NOTE: returns {@code null} if no MonitoringMessageSuccess is set. + * + * @return the MonitoringMessageSuccess or {@code null} + */ public String getMonitoringMessageSuccess() { - return configuration.get("getMonitoringMessageSuccess", String.class); + String prop = properties.getProperty("configuration.monitoring.message.success"); + return MiscUtil.isNotEmpty(prop) ? prop : null; } - @JsonProperty("isAdvancedLoggingActive") + /** + * @return {@code true} if AdvancedLoggingActive is set, {@code false} otherwise. + */ public boolean isAdvancedLoggingActive() { - return configuration.get("isAdvancedLoggingActive", Boolean.class); + String prop = properties.getProperty("configuration.advancedlogging.active", "false"); + return Boolean.valueOf(prop); } - @JsonProperty("getPublicURLPrefix") + /** + * Returns the PublicURLPrefix. NOTE: returns {@code null} if no PublicURLPrefix is set. + * + * @return the PublicURLPrefix or {@code null} + */ public String getPublicURLPrefix() { - return configuration.get("getPublicURLPrefix", String.class); + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return null; + } + + String publicURLPreFix = null; + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null && MiscUtil.isNotEmpty(generalConfiguration.getPublicURLPreFix())) { + publicURLPreFix = generalConfiguration.getPublicURLPreFix(); + } else { + Logger.warn("Error in MOA-ID Configuration. No GeneralConfig defined."); + } + return publicURLPreFix; } - @JsonProperty("isPVP2AssertionEncryptionActive") + /** + * @return {@code true} if PVP2AssertionEncryptionActive is set, {@code false} otherwise. + */ public boolean isPVP2AssertionEncryptionActive() { - return configuration.get("isPVP2AssertionEncryptionActive", Boolean.class); + String prop = this.getProperties().getProperty("protocols.pvp2.assertion.encryption.active", "true"); + return Boolean.valueOf(prop); } - @JsonProperty("isCertifiacteQCActive") + /** + * @return {@code true} if CertifiacteQCActive is set, {@code false} otherwise. + */ public boolean isCertifiacteQCActive() { - return configuration.get("isCertifiacteQCActive", Boolean.class); + String prop = this.getProperties().getProperty("configuration.validation.certificate.QC.ignore", "false"); + return !Boolean.valueOf(prop); } /** - * Retruns the STORK Configuration + * Returns a STORK Configuration, NOTE: may return {@code null}. * - * @return STORK Configuration - * @throws ConfigurationException + * @return a new STORK Configuration or {@code null} + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} */ - @JsonProperty("getStorkConfig") public STORKConfig getStorkConfig() throws ConfigurationException { - return configuration.get("getStorkConfig", STORKConfig.class); + + STORKConfig result = null; + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + ForeignIdentities foreign = authComponentGeneral.getForeignIdentities(); + if (foreign == null) { + Logger.warn("Error in MOA-ID Configuration. No STORK configuration found."); + } else { + result = new STORKConfig(foreign.getSTORK(), this.getProperties(), this.getRootConfigFileDir()); + } + return result; + } + + /** + * Small helper method. + * + * @return the {@link AuthComponentGeneral} from the database + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ + private AuthComponentGeneral getAuthComponentGeneral() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = configuration.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, AuthComponentGeneral.class); + if (authComponentGeneral == null) { + Logger.warn("Error in MOA-ID Configuration. No generalAuthConfiguration found"); + throw new ConfigurationException("config.02", null); + } + return authComponentGeneral; + } + + /** + * Returns the {@link VerifyAuthBlock}. + * + * @return the {@link VerifyAuthBlock}. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. + */ + private VerifyAuthBlock getVerifyAuthBlock() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + MOASP moasp = authComponentGeneral.getMOASP(); + if (moasp != null) { + VerifyAuthBlock vab = moasp.getVerifyAuthBlock(); + if (vab != null) { + VerifyAuthBlock verifyIdl = new VerifyAuthBlock(); + verifyIdl.setTrustProfileID(vab.getTrustProfileID()); + verifyIdl.setVerifyTransformsInfoProfileID(new ArrayList(vab.getVerifyTransformsInfoProfileID())); + return verifyIdl; + } else { + Logger.warn("Error in MOA-ID Configuration. No Trustprofile for AuthBlock validation."); + throw new ConfigurationException("config.02", null); + } + } else { + Logger.warn("Error in MOA-ID Configuration. No MOASP configuration found"); + throw new ConfigurationException("config.02", null); + } + } + + /** + * Small helper method. NOTE: may return empty properties, but never {@code null}. + * @param propPrefix the prefix of the desired property. + * @return the {@link Properties} + */ + private Properties getGeneralProperiesConfig(final String propPrefix) { + + Properties configProp = new Properties(); + for (Object key : this.getProperties().keySet()) { + if (key.toString().startsWith(propPrefix)) { + String propertyName = key.toString().substring(propPrefix.length()); + configProp.put(propertyName, this.getProperties().get(key.toString())); + } + } + return configProp; } } -- cgit v1.2.3 From f4443baaba254a5005a417cc45fa2db9cf5ed9fc Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 11:45:55 +0100 Subject: Revert "add previously auto-generated java source files used for configuration" This reverts commit 10f5d736a93767cd7302cb30eb560781462edd76. --- .../config/AbstractSimpleIdentificationType.java | 161 --- .../db/dao/config/AttributeProviderPlugin.java | 254 ----- .../db/dao/config/AuthComponentGeneral.java | 80 -- .../id/commons/db/dao/config/AuthComponentOA.java | 735 ------------- .../commons/db/dao/config/AuthComponentType.java | 650 ------------ .../dao/config/BKUSelectionCustomizationType.java | 743 -------------- .../id/commons/db/dao/config/BKUSelectionType.java | 58 -- .../moa/id/commons/db/dao/config/BKUURLS.java | 256 ----- .../id/commons/db/dao/config/BPKDecryption.java | 293 ------ .../id/commons/db/dao/config/BPKEncryption.java | 252 ----- .../moa/id/commons/db/dao/config/BasicAuth.java | 214 ---- .../moa/id/commons/db/dao/config/CPEPS.java | 418 -------- .../db/dao/config/CPEPSAttributeValueItem.java | 93 -- .../id/commons/db/dao/config/ChainingModeType.java | 58 -- .../id/commons/db/dao/config/ChainingModes.java | 242 ----- .../id/commons/db/dao/config/ClientKeyStore.java | 206 ---- .../id/commons/db/dao/config/Configuration.java | 364 ------- .../config/ConnectionParameterClientAuthType.java | 143 --- .../config/ConnectionParameterServerAuthType.java | 214 ---- .../moa/id/commons/db/dao/config/Contact.java | 484 --------- .../id/commons/db/dao/config/ContactMailItem.java | 93 -- .../id/commons/db/dao/config/ContactPhoneItem.java | 93 -- .../moa/id/commons/db/dao/config/DefaultBKUs.java | 256 ----- .../commons/db/dao/config/DefaultTrustProfile.java | 164 --- .../commons/db/dao/config/EncBPKInformation.java | 257 ----- .../commons/db/dao/config/ForeignIdentities.java | 216 ---- .../db/dao/config/GeneralConfiguration.java | 365 ------- .../db/dao/config/GenericConfiguration.java | 216 ---- .../moa/id/commons/db/dao/config/Header.java | 212 ---- .../moa/id/commons/db/dao/config/HeaderAuth.java | 185 ---- .../db/dao/config/IdentificationNumber.java | 210 ---- .../commons/db/dao/config/IdentityLinkSigners.java | 209 ---- .../IdentityLinkSignersX509SubjectNameItem.java | 93 -- .../commons/db/dao/config/InputProcessorType.java | 206 ---- .../db/dao/config/InterfederationGatewayType.java | 208 ---- .../db/dao/config/InterfederationIDPType.java | 402 -------- .../moa/id/commons/db/dao/config/KeyName.java | 206 ---- .../moa/id/commons/db/dao/config/KeyStore.java | 208 ---- .../id/commons/db/dao/config/LegacyAllowed.java | 209 ---- .../dao/config/LegacyAllowedProtocolNameItem.java | 93 -- .../moa/id/commons/db/dao/config/LoginType.java | 58 -- .../id/commons/db/dao/config/MOAAuthDataType.java | 82 -- .../commons/db/dao/config/MOAIDConfiguration.java | 664 ------------ .../commons/db/dao/config/MOAKeyBoxSelector.java | 58 -- .../moa/id/commons/db/dao/config/MOASP.java | 281 ----- .../moa/id/commons/db/dao/config/Mandates.java | 254 ----- .../db/dao/config/MandatesProfileNameItem.java | 93 -- .../moa/id/commons/db/dao/config/OAOAUTH20.java | 254 ----- .../moa/id/commons/db/dao/config/OAPVP2.java | 274 ----- .../moa/id/commons/db/dao/config/OASAML1.java | 580 ----------- .../moa/id/commons/db/dao/config/OASSO.java | 260 ----- .../moa/id/commons/db/dao/config/OASTORK.java | 495 --------- .../id/commons/db/dao/config/OAStorkAttribute.java | 213 ---- .../moa/id/commons/db/dao/config/OAuth.java | 168 --- .../id/commons/db/dao/config/ObjectFactory.java | 757 -------------- .../commons/db/dao/config/OnlineApplication.java | 509 --------- .../db/dao/config/OnlineApplicationType.java | 565 ---------- .../id/commons/db/dao/config/OnlineMandates.java | 168 --- .../moa/id/commons/db/dao/config/Organization.java | 254 ----- .../moa/id/commons/db/dao/config/PVP2.java | 385 ------- .../moa/id/commons/db/dao/config/ParamAuth.java | 185 ---- .../moa/id/commons/db/dao/config/Parameter.java | 212 ---- .../db/dao/config/PartyRepresentationType.java | 331 ------ .../db/dao/config/PartyRepresentativeType.java | 457 --------- .../moa/id/commons/db/dao/config/Protocols.java | 361 ------- .../moa/id/commons/db/dao/config/SAML1.java | 216 ---- .../db/dao/config/SAMLSigningParameter.java | 216 ---- .../commons/db/dao/config/SLRequestTemplates.java | 256 ----- .../moa/id/commons/db/dao/config/SSO.java | 341 ------- .../moa/id/commons/db/dao/config/STORK.java | 342 ------- .../moa/id/commons/db/dao/config/Schema.java | 205 ---- .../commons/db/dao/config/SchemaLocationType.java | 195 ---- .../id/commons/db/dao/config/SecurityLayer.java | 183 ---- .../dao/config/SignatureCreationParameterType.java | 218 ---- .../config/SignatureVerificationParameterType.java | 168 --- .../id/commons/db/dao/config/StorkAttribute.java | 213 ---- .../moa/id/commons/db/dao/config/TemplateType.java | 165 --- .../id/commons/db/dao/config/TemplatesType.java | 367 ------- .../id/commons/db/dao/config/TestCredentials.java | 260 ----- .../config/TestCredentialsCredentialOIDItem.java | 93 -- .../moa/id/commons/db/dao/config/TimeOuts.java | 253 ----- .../commons/db/dao/config/TransformsInfoType.java | 215 ---- .../moa/id/commons/db/dao/config/TrustAnchor.java | 131 --- .../moa/id/commons/db/dao/config/UserDatabase.java | 1077 -------------------- .../id/commons/db/dao/config/VerifyAuthBlock.java | 254 ----- ...AuthBlockVerifyTransformsInfoProfileIDItem.java | 93 -- .../commons/db/dao/config/VerifyIdentityLink.java | 164 --- .../commons/db/dao/config/VerifyInfoboxesType.java | 181 ---- .../db/dao/config/X509IssuerSerialType.java | 213 ---- .../moa/id/commons/db/dao/config/package-info.java | 9 - 90 files changed, 23965 deletions(-) delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java deleted file mode 100644 index 0d1380def..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AbstractSimpleIdentificationType.java +++ /dev/null @@ -1,161 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for AbstractSimpleIdentificationType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="AbstractSimpleIdentificationType">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "AbstractSimpleIdentificationType", propOrder = { - "value" -}) -@Entity(name = "AbstractSimpleIdentificationType") -@Table(name = "ABSTRACTSIMPLEIDENTIFICATION_0") -@Inheritance(strategy = InheritanceType.JOINED) -public class AbstractSimpleIdentificationType - implements Serializable, Equals, HashCode -{ - - @XmlValue - protected String value; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof AbstractSimpleIdentificationType)) { - return false; - } - if (this == object) { - return true; - } - final AbstractSimpleIdentificationType that = ((AbstractSimpleIdentificationType) object); - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java deleted file mode 100644 index 5fe3065fb..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AttributeProviderPlugin.java +++ /dev/null @@ -1,254 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for AttributeProviderPlugin complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="AttributeProviderPlugin">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="url" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="attributes" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "AttributeProviderPlugin", propOrder = { - "name", - "url", - "attributes" -}) -@Entity(name = "AttributeProviderPlugin") -@Table(name = "ATTRIBUTEPROVIDERPLUGIN") -@Inheritance(strategy = InheritanceType.JOINED) -public class AttributeProviderPlugin - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected String name; - @XmlElement(required = true) - @XmlSchemaType(name = "anyURI") - protected String url; - @XmlElement(required = true) - protected String attributes; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_", length = 255) - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the url property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "URL") - public String getUrl() { - return url; - } - - /** - * Sets the value of the url property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setUrl(String value) { - this.url = value; - } - - /** - * Gets the value of the attributes property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ATTRIBUTES_", length = 255) - public String getAttributes() { - return attributes; - } - - /** - * Sets the value of the attributes property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAttributes(String value) { - this.attributes = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof AttributeProviderPlugin)) { - return false; - } - if (this == object) { - return true; - } - final AttributeProviderPlugin that = ((AttributeProviderPlugin) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - { - String lhsUrl; - lhsUrl = this.getUrl(); - String rhsUrl; - rhsUrl = that.getUrl(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsUrl), LocatorUtils.property(thatLocator, "url", rhsUrl), lhsUrl, rhsUrl)) { - return false; - } - } - { - String lhsAttributes; - lhsAttributes = this.getAttributes(); - String rhsAttributes; - rhsAttributes = that.getAttributes(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "attributes", lhsAttributes), LocatorUtils.property(thatLocator, "attributes", rhsAttributes), lhsAttributes, rhsAttributes)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - { - String theUrl; - theUrl = this.getUrl(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theUrl), currentHashCode, theUrl); - } - { - String theAttributes; - theAttributes = this.getAttributes(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributes", theAttributes), currentHashCode, theAttributes); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java deleted file mode 100644 index 4112d91d5..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentGeneral.java +++ /dev/null @@ -1,80 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}AuthComponentType">
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@Entity(name = "AuthComponentGeneral") -@Table(name = "AUTHCOMPONENTGENERAL") -public class AuthComponentGeneral - extends AuthComponentType - implements Serializable, Equals, HashCode -{ - - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof AuthComponentGeneral)) { - return false; - } - if (this == object) { - return true; - } - if (!super.equals(thisLocator, thatLocator, object, strategy)) { - return false; - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = super.hashCode(locator, strategy); - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java deleted file mode 100644 index c576f8169..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentOA.java +++ /dev/null @@ -1,735 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="BKUURLS">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber" minOccurs="0"/>
- *         <element name="Templates" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TemplatesType" minOccurs="0"/>
- *         <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="Mandates" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Profiles" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="ProfileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="testCredentials" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="credentialOID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                 </sequence>
- *                 <attribute name="enableTestCredentials" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_STORK" minOccurs="0"/>
- *         <element name="OA_SSO" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="UseSSO" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *                   <element name="AuthDataFrame" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *                   <element name="SingleLogOutURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_SAML1" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_PVP2" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_OAUTH20" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}EncBPKInformation" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "bkuurls", - "identificationNumber", - "templates", - "transformsInfo", - "mandates", - "testCredentials", - "oastork", - "oasso", - "oasaml1", - "oapvp2", - "oaoauth20", - "encBPKInformation" -}) -@Entity(name = "AuthComponentOA") -@Table(name = "AUTHCOMPONENTOA") -@Inheritance(strategy = InheritanceType.JOINED) -public class AuthComponentOA - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "BKUURLS", required = true) - protected BKUURLS bkuurls; - @XmlElement(name = "IdentificationNumber") - protected IdentificationNumber identificationNumber; - @XmlElement(name = "Templates") - protected TemplatesType templates; - @XmlElement(name = "TransformsInfo") - protected List transformsInfo; - @XmlElement(name = "Mandates") - protected Mandates mandates; - protected TestCredentials testCredentials; - @XmlElement(name = "OA_STORK") - protected OASTORK oastork; - @XmlElement(name = "OA_SSO") - protected OASSO oasso; - @XmlElement(name = "OA_SAML1") - protected OASAML1 oasaml1; - @XmlElement(name = "OA_PVP2") - protected OAPVP2 oapvp2; - @XmlElement(name = "OA_OAUTH20") - protected OAOAUTH20 oaoauth20; - @XmlElement(name = "EncBPKInformation") - protected EncBPKInformation encBPKInformation; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the bkuurls property. - * - * @return - * possible object is - * {@link BKUURLS } - * - */ - @ManyToOne(targetEntity = BKUURLS.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "BKUURLS_AUTHCOMPONENTOA_HJID") - public BKUURLS getBKUURLS() { - return bkuurls; - } - - /** - * Sets the value of the bkuurls property. - * - * @param value - * allowed object is - * {@link BKUURLS } - * - */ - public void setBKUURLS(BKUURLS value) { - this.bkuurls = value; - } - - /** - * Gets the value of the identificationNumber property. - * - * @return - * possible object is - * {@link IdentificationNumber } - * - */ - @ManyToOne(targetEntity = IdentificationNumber.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "IDENTIFICATIONNUMBER_AUTHCOM_0") - public IdentificationNumber getIdentificationNumber() { - return identificationNumber; - } - - /** - * Sets the value of the identificationNumber property. - * - * @param value - * allowed object is - * {@link IdentificationNumber } - * - */ - public void setIdentificationNumber(IdentificationNumber value) { - this.identificationNumber = value; - } - - /** - * Gets the value of the templates property. - * - * @return - * possible object is - * {@link TemplatesType } - * - */ - @ManyToOne(targetEntity = TemplatesType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TEMPLATES_AUTHCOMPONENTOA_HJ_0") - public TemplatesType getTemplates() { - return templates; - } - - /** - * Sets the value of the templates property. - * - * @param value - * allowed object is - * {@link TemplatesType } - * - */ - public void setTemplates(TemplatesType value) { - this.templates = value; - } - - /** - * Gets the value of the transformsInfo property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the transformsInfo property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTransformsInfo().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link TransformsInfoType } - * - * - */ - @OneToMany(targetEntity = TransformsInfoType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TRANSFORMSINFO_AUTHCOMPONENT_0") - public List getTransformsInfo() { - if (transformsInfo == null) { - transformsInfo = new ArrayList(); - } - return this.transformsInfo; - } - - /** - * - * - */ - public void setTransformsInfo(List transformsInfo) { - this.transformsInfo = transformsInfo; - } - - /** - * Gets the value of the mandates property. - * - * @return - * possible object is - * {@link Mandates } - * - */ - @ManyToOne(targetEntity = Mandates.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "MANDATES_AUTHCOMPONENTOA_HJID") - public Mandates getMandates() { - return mandates; - } - - /** - * Sets the value of the mandates property. - * - * @param value - * allowed object is - * {@link Mandates } - * - */ - public void setMandates(Mandates value) { - this.mandates = value; - } - - /** - * Gets the value of the testCredentials property. - * - * @return - * possible object is - * {@link TestCredentials } - * - */ - @ManyToOne(targetEntity = TestCredentials.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TESTCREDENTIALS_AUTHCOMPONEN_0") - public TestCredentials getTestCredentials() { - return testCredentials; - } - - /** - * Sets the value of the testCredentials property. - * - * @param value - * allowed object is - * {@link TestCredentials } - * - */ - public void setTestCredentials(TestCredentials value) { - this.testCredentials = value; - } - - /** - * Gets the value of the oastork property. - * - * @return - * possible object is - * {@link OASTORK } - * - */ - @ManyToOne(targetEntity = OASTORK.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OASTORK_AUTHCOMPONENTOA_HJID") - public OASTORK getOASTORK() { - return oastork; - } - - /** - * Sets the value of the oastork property. - * - * @param value - * allowed object is - * {@link OASTORK } - * - */ - public void setOASTORK(OASTORK value) { - this.oastork = value; - } - - /** - * Gets the value of the oasso property. - * - * @return - * possible object is - * {@link OASSO } - * - */ - @ManyToOne(targetEntity = OASSO.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OASSO_AUTHCOMPONENTOA_HJID") - public OASSO getOASSO() { - return oasso; - } - - /** - * Sets the value of the oasso property. - * - * @param value - * allowed object is - * {@link OASSO } - * - */ - public void setOASSO(OASSO value) { - this.oasso = value; - } - - /** - * Gets the value of the oasaml1 property. - * - * @return - * possible object is - * {@link OASAML1 } - * - */ - @ManyToOne(targetEntity = OASAML1 .class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OASAML1_AUTHCOMPONENTOA_HJID") - public OASAML1 getOASAML1() { - return oasaml1; - } - - /** - * Sets the value of the oasaml1 property. - * - * @param value - * allowed object is - * {@link OASAML1 } - * - */ - public void setOASAML1(OASAML1 value) { - this.oasaml1 = value; - } - - /** - * Gets the value of the oapvp2 property. - * - * @return - * possible object is - * {@link OAPVP2 } - * - */ - @ManyToOne(targetEntity = OAPVP2 .class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OAPVP2_AUTHCOMPONENTOA_HJID") - public OAPVP2 getOAPVP2() { - return oapvp2; - } - - /** - * Sets the value of the oapvp2 property. - * - * @param value - * allowed object is - * {@link OAPVP2 } - * - */ - public void setOAPVP2(OAPVP2 value) { - this.oapvp2 = value; - } - - /** - * Gets the value of the oaoauth20 property. - * - * @return - * possible object is - * {@link OAOAUTH20 } - * - */ - @ManyToOne(targetEntity = OAOAUTH20 .class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OAOAUTH20_AUTHCOMPONENTOA_HJ_0") - public OAOAUTH20 getOAOAUTH20() { - return oaoauth20; - } - - /** - * Sets the value of the oaoauth20 property. - * - * @param value - * allowed object is - * {@link OAOAUTH20 } - * - */ - public void setOAOAUTH20(OAOAUTH20 value) { - this.oaoauth20 = value; - } - - /** - * Gets the value of the encBPKInformation property. - * - * @return - * possible object is - * {@link EncBPKInformation } - * - */ - @ManyToOne(targetEntity = EncBPKInformation.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ENCBPKINFORMATION_AUTHCOMPON_0") - public EncBPKInformation getEncBPKInformation() { - return encBPKInformation; - } - - /** - * Sets the value of the encBPKInformation property. - * - * @param value - * allowed object is - * {@link EncBPKInformation } - * - */ - public void setEncBPKInformation(EncBPKInformation value) { - this.encBPKInformation = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof AuthComponentOA)) { - return false; - } - if (this == object) { - return true; - } - final AuthComponentOA that = ((AuthComponentOA) object); - { - BKUURLS lhsBKUURLS; - lhsBKUURLS = this.getBKUURLS(); - BKUURLS rhsBKUURLS; - rhsBKUURLS = that.getBKUURLS(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "bkuurls", lhsBKUURLS), LocatorUtils.property(thatLocator, "bkuurls", rhsBKUURLS), lhsBKUURLS, rhsBKUURLS)) { - return false; - } - } - { - IdentificationNumber lhsIdentificationNumber; - lhsIdentificationNumber = this.getIdentificationNumber(); - IdentificationNumber rhsIdentificationNumber; - rhsIdentificationNumber = that.getIdentificationNumber(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "identificationNumber", lhsIdentificationNumber), LocatorUtils.property(thatLocator, "identificationNumber", rhsIdentificationNumber), lhsIdentificationNumber, rhsIdentificationNumber)) { - return false; - } - } - { - TemplatesType lhsTemplates; - lhsTemplates = this.getTemplates(); - TemplatesType rhsTemplates; - rhsTemplates = that.getTemplates(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "templates", lhsTemplates), LocatorUtils.property(thatLocator, "templates", rhsTemplates), lhsTemplates, rhsTemplates)) { - return false; - } - } - { - List lhsTransformsInfo; - lhsTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); - List rhsTransformsInfo; - rhsTransformsInfo = (((that.transformsInfo!= null)&&(!that.transformsInfo.isEmpty()))?that.getTransformsInfo():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "transformsInfo", lhsTransformsInfo), LocatorUtils.property(thatLocator, "transformsInfo", rhsTransformsInfo), lhsTransformsInfo, rhsTransformsInfo)) { - return false; - } - } - { - Mandates lhsMandates; - lhsMandates = this.getMandates(); - Mandates rhsMandates; - rhsMandates = that.getMandates(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mandates", lhsMandates), LocatorUtils.property(thatLocator, "mandates", rhsMandates), lhsMandates, rhsMandates)) { - return false; - } - } - { - TestCredentials lhsTestCredentials; - lhsTestCredentials = this.getTestCredentials(); - TestCredentials rhsTestCredentials; - rhsTestCredentials = that.getTestCredentials(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "testCredentials", lhsTestCredentials), LocatorUtils.property(thatLocator, "testCredentials", rhsTestCredentials), lhsTestCredentials, rhsTestCredentials)) { - return false; - } - } - { - OASTORK lhsOASTORK; - lhsOASTORK = this.getOASTORK(); - OASTORK rhsOASTORK; - rhsOASTORK = that.getOASTORK(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oastork", lhsOASTORK), LocatorUtils.property(thatLocator, "oastork", rhsOASTORK), lhsOASTORK, rhsOASTORK)) { - return false; - } - } - { - OASSO lhsOASSO; - lhsOASSO = this.getOASSO(); - OASSO rhsOASSO; - rhsOASSO = that.getOASSO(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oasso", lhsOASSO), LocatorUtils.property(thatLocator, "oasso", rhsOASSO), lhsOASSO, rhsOASSO)) { - return false; - } - } - { - OASAML1 lhsOASAML1; - lhsOASAML1 = this.getOASAML1(); - OASAML1 rhsOASAML1; - rhsOASAML1 = that.getOASAML1(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oasaml1", lhsOASAML1), LocatorUtils.property(thatLocator, "oasaml1", rhsOASAML1), lhsOASAML1, rhsOASAML1)) { - return false; - } - } - { - OAPVP2 lhsOAPVP2; - lhsOAPVP2 = this.getOAPVP2(); - OAPVP2 rhsOAPVP2; - rhsOAPVP2 = that.getOAPVP2(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oapvp2", lhsOAPVP2), LocatorUtils.property(thatLocator, "oapvp2", rhsOAPVP2), lhsOAPVP2, rhsOAPVP2)) { - return false; - } - } - { - OAOAUTH20 lhsOAOAUTH20; - lhsOAOAUTH20 = this.getOAOAUTH20(); - OAOAUTH20 rhsOAOAUTH20; - rhsOAOAUTH20 = that.getOAOAUTH20(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oaoauth20", lhsOAOAUTH20), LocatorUtils.property(thatLocator, "oaoauth20", rhsOAOAUTH20), lhsOAOAUTH20, rhsOAOAUTH20)) { - return false; - } - } - { - EncBPKInformation lhsEncBPKInformation; - lhsEncBPKInformation = this.getEncBPKInformation(); - EncBPKInformation rhsEncBPKInformation; - rhsEncBPKInformation = that.getEncBPKInformation(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "encBPKInformation", lhsEncBPKInformation), LocatorUtils.property(thatLocator, "encBPKInformation", rhsEncBPKInformation), lhsEncBPKInformation, rhsEncBPKInformation)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - BKUURLS theBKUURLS; - theBKUURLS = this.getBKUURLS(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bkuurls", theBKUURLS), currentHashCode, theBKUURLS); - } - { - IdentificationNumber theIdentificationNumber; - theIdentificationNumber = this.getIdentificationNumber(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identificationNumber", theIdentificationNumber), currentHashCode, theIdentificationNumber); - } - { - TemplatesType theTemplates; - theTemplates = this.getTemplates(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "templates", theTemplates), currentHashCode, theTemplates); - } - { - List theTransformsInfo; - theTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transformsInfo", theTransformsInfo), currentHashCode, theTransformsInfo); - } - { - Mandates theMandates; - theMandates = this.getMandates(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandates", theMandates), currentHashCode, theMandates); - } - { - TestCredentials theTestCredentials; - theTestCredentials = this.getTestCredentials(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "testCredentials", theTestCredentials), currentHashCode, theTestCredentials); - } - { - OASTORK theOASTORK; - theOASTORK = this.getOASTORK(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oastork", theOASTORK), currentHashCode, theOASTORK); - } - { - OASSO theOASSO; - theOASSO = this.getOASSO(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oasso", theOASSO), currentHashCode, theOASSO); - } - { - OASAML1 theOASAML1; - theOASAML1 = this.getOASAML1(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oasaml1", theOASAML1), currentHashCode, theOASAML1); - } - { - OAPVP2 theOAPVP2; - theOAPVP2 = this.getOAPVP2(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oapvp2", theOAPVP2), currentHashCode, theOAPVP2); - } - { - OAOAUTH20 theOAOAUTH20; - theOAOAUTH20 = this.getOAOAUTH20(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oaoauth20", theOAOAUTH20), currentHashCode, theOAOAUTH20); - } - { - EncBPKInformation theEncBPKInformation; - theEncBPKInformation = this.getEncBPKInformation(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "encBPKInformation", theEncBPKInformation), currentHashCode, theEncBPKInformation); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java deleted file mode 100644 index e5bcd572d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/AuthComponentType.java +++ /dev/null @@ -1,650 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for AuthComponentType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="AuthComponentType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}GeneralConfiguration"/>
- *         <element name="Protocols">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="SAML1" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="SourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                           </sequence>
- *                           <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element name="PVP2" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="PublicURLPrefix" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                             <element name="IssuerName" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                             <element name="Organization">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <sequence>
- *                                       <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                                       <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                                       <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                                     </sequence>
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                             <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Contact" maxOccurs="unbounded"/>
- *                           </sequence>
- *                           <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element name="OAuth" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element name="LegacyAllowed">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="ProtocolName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="SSO">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <choice>
- *                   <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber"/>
- *                 </choice>
- *                 <attribute name="PublicURL" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="SpecialText" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="SecurityLayer">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="MOA-SP">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
- *                   <element name="VerifyIdentityLink">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element name="VerifyAuthBlock">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *                             <element name="VerifyTransformsInfoProfileID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="IdentityLinkSigners" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="X509SubjectName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="ForeignIdentities" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}STORK" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="OnlineMandates" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "AuthComponentType", propOrder = { - "generalConfiguration", - "protocols", - "sso", - "securityLayer", - "moasp", - "identityLinkSigners", - "foreignIdentities", - "onlineMandates" -}) -@XmlSeeAlso({ - AuthComponentGeneral.class -}) -@Entity(name = "AuthComponentType") -@Table(name = "AUTHCOMPONENTTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class AuthComponentType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "GeneralConfiguration", required = true) - protected GeneralConfiguration generalConfiguration; - @XmlElement(name = "Protocols", required = true) - protected Protocols protocols; - @XmlElement(name = "SSO", required = true) - protected SSO sso; - @XmlElement(name = "SecurityLayer", required = true) - protected SecurityLayer securityLayer; - @XmlElement(name = "MOA-SP", required = true) - protected MOASP moasp; - @XmlElement(name = "IdentityLinkSigners") - protected IdentityLinkSigners identityLinkSigners; - @XmlElement(name = "ForeignIdentities") - protected ForeignIdentities foreignIdentities; - @XmlElement(name = "OnlineMandates") - protected OnlineMandates onlineMandates; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the generalConfiguration property. - * - * @return - * possible object is - * {@link GeneralConfiguration } - * - */ - @ManyToOne(targetEntity = GeneralConfiguration.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "GENERALCONFIGURATION_AUTHCOM_0") - public GeneralConfiguration getGeneralConfiguration() { - return generalConfiguration; - } - - /** - * Sets the value of the generalConfiguration property. - * - * @param value - * allowed object is - * {@link GeneralConfiguration } - * - */ - public void setGeneralConfiguration(GeneralConfiguration value) { - this.generalConfiguration = value; - } - - /** - * Gets the value of the protocols property. - * - * @return - * possible object is - * {@link Protocols } - * - */ - @ManyToOne(targetEntity = Protocols.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PROTOCOLS_AUTHCOMPONENTTYPE__0") - public Protocols getProtocols() { - return protocols; - } - - /** - * Sets the value of the protocols property. - * - * @param value - * allowed object is - * {@link Protocols } - * - */ - public void setProtocols(Protocols value) { - this.protocols = value; - } - - /** - * Gets the value of the sso property. - * - * @return - * possible object is - * {@link SSO } - * - */ - @ManyToOne(targetEntity = SSO.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SSO_AUTHCOMPONENTTYPE_HJID") - public SSO getSSO() { - return sso; - } - - /** - * Sets the value of the sso property. - * - * @param value - * allowed object is - * {@link SSO } - * - */ - public void setSSO(SSO value) { - this.sso = value; - } - - /** - * Gets the value of the securityLayer property. - * - * @return - * possible object is - * {@link SecurityLayer } - * - */ - @ManyToOne(targetEntity = SecurityLayer.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SECURITYLAYER_AUTHCOMPONENTT_0") - public SecurityLayer getSecurityLayer() { - return securityLayer; - } - - /** - * Sets the value of the securityLayer property. - * - * @param value - * allowed object is - * {@link SecurityLayer } - * - */ - public void setSecurityLayer(SecurityLayer value) { - this.securityLayer = value; - } - - /** - * Gets the value of the moasp property. - * - * @return - * possible object is - * {@link MOASP } - * - */ - @ManyToOne(targetEntity = MOASP.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "MOASP_AUTHCOMPONENTTYPE_HJID") - public MOASP getMOASP() { - return moasp; - } - - /** - * Sets the value of the moasp property. - * - * @param value - * allowed object is - * {@link MOASP } - * - */ - public void setMOASP(MOASP value) { - this.moasp = value; - } - - /** - * Gets the value of the identityLinkSigners property. - * - * @return - * possible object is - * {@link IdentityLinkSigners } - * - */ - @ManyToOne(targetEntity = IdentityLinkSigners.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "IDENTITYLINKSIGNERS_AUTHCOMP_0") - public IdentityLinkSigners getIdentityLinkSigners() { - return identityLinkSigners; - } - - /** - * Sets the value of the identityLinkSigners property. - * - * @param value - * allowed object is - * {@link IdentityLinkSigners } - * - */ - public void setIdentityLinkSigners(IdentityLinkSigners value) { - this.identityLinkSigners = value; - } - - /** - * Gets the value of the foreignIdentities property. - * - * @return - * possible object is - * {@link ForeignIdentities } - * - */ - @ManyToOne(targetEntity = ForeignIdentities.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "FOREIGNIDENTITIES_AUTHCOMPON_0") - public ForeignIdentities getForeignIdentities() { - return foreignIdentities; - } - - /** - * Sets the value of the foreignIdentities property. - * - * @param value - * allowed object is - * {@link ForeignIdentities } - * - */ - public void setForeignIdentities(ForeignIdentities value) { - this.foreignIdentities = value; - } - - /** - * Gets the value of the onlineMandates property. - * - * @return - * possible object is - * {@link OnlineMandates } - * - */ - @ManyToOne(targetEntity = OnlineMandates.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ONLINEMANDATES_AUTHCOMPONENT_0") - public OnlineMandates getOnlineMandates() { - return onlineMandates; - } - - /** - * Sets the value of the onlineMandates property. - * - * @param value - * allowed object is - * {@link OnlineMandates } - * - */ - public void setOnlineMandates(OnlineMandates value) { - this.onlineMandates = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof AuthComponentType)) { - return false; - } - if (this == object) { - return true; - } - final AuthComponentType that = ((AuthComponentType) object); - { - GeneralConfiguration lhsGeneralConfiguration; - lhsGeneralConfiguration = this.getGeneralConfiguration(); - GeneralConfiguration rhsGeneralConfiguration; - rhsGeneralConfiguration = that.getGeneralConfiguration(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "generalConfiguration", lhsGeneralConfiguration), LocatorUtils.property(thatLocator, "generalConfiguration", rhsGeneralConfiguration), lhsGeneralConfiguration, rhsGeneralConfiguration)) { - return false; - } - } - { - Protocols lhsProtocols; - lhsProtocols = this.getProtocols(); - Protocols rhsProtocols; - rhsProtocols = that.getProtocols(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "protocols", lhsProtocols), LocatorUtils.property(thatLocator, "protocols", rhsProtocols), lhsProtocols, rhsProtocols)) { - return false; - } - } - { - SSO lhsSSO; - lhsSSO = this.getSSO(); - SSO rhsSSO; - rhsSSO = that.getSSO(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "sso", lhsSSO), LocatorUtils.property(thatLocator, "sso", rhsSSO), lhsSSO, rhsSSO)) { - return false; - } - } - { - SecurityLayer lhsSecurityLayer; - lhsSecurityLayer = this.getSecurityLayer(); - SecurityLayer rhsSecurityLayer; - rhsSecurityLayer = that.getSecurityLayer(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "securityLayer", lhsSecurityLayer), LocatorUtils.property(thatLocator, "securityLayer", rhsSecurityLayer), lhsSecurityLayer, rhsSecurityLayer)) { - return false; - } - } - { - MOASP lhsMOASP; - lhsMOASP = this.getMOASP(); - MOASP rhsMOASP; - rhsMOASP = that.getMOASP(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "moasp", lhsMOASP), LocatorUtils.property(thatLocator, "moasp", rhsMOASP), lhsMOASP, rhsMOASP)) { - return false; - } - } - { - IdentityLinkSigners lhsIdentityLinkSigners; - lhsIdentityLinkSigners = this.getIdentityLinkSigners(); - IdentityLinkSigners rhsIdentityLinkSigners; - rhsIdentityLinkSigners = that.getIdentityLinkSigners(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "identityLinkSigners", lhsIdentityLinkSigners), LocatorUtils.property(thatLocator, "identityLinkSigners", rhsIdentityLinkSigners), lhsIdentityLinkSigners, rhsIdentityLinkSigners)) { - return false; - } - } - { - ForeignIdentities lhsForeignIdentities; - lhsForeignIdentities = this.getForeignIdentities(); - ForeignIdentities rhsForeignIdentities; - rhsForeignIdentities = that.getForeignIdentities(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "foreignIdentities", lhsForeignIdentities), LocatorUtils.property(thatLocator, "foreignIdentities", rhsForeignIdentities), lhsForeignIdentities, rhsForeignIdentities)) { - return false; - } - } - { - OnlineMandates lhsOnlineMandates; - lhsOnlineMandates = this.getOnlineMandates(); - OnlineMandates rhsOnlineMandates; - rhsOnlineMandates = that.getOnlineMandates(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineMandates", lhsOnlineMandates), LocatorUtils.property(thatLocator, "onlineMandates", rhsOnlineMandates), lhsOnlineMandates, rhsOnlineMandates)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - GeneralConfiguration theGeneralConfiguration; - theGeneralConfiguration = this.getGeneralConfiguration(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "generalConfiguration", theGeneralConfiguration), currentHashCode, theGeneralConfiguration); - } - { - Protocols theProtocols; - theProtocols = this.getProtocols(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protocols", theProtocols), currentHashCode, theProtocols); - } - { - SSO theSSO; - theSSO = this.getSSO(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sso", theSSO), currentHashCode, theSSO); - } - { - SecurityLayer theSecurityLayer; - theSecurityLayer = this.getSecurityLayer(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "securityLayer", theSecurityLayer), currentHashCode, theSecurityLayer); - } - { - MOASP theMOASP; - theMOASP = this.getMOASP(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "moasp", theMOASP), currentHashCode, theMOASP); - } - { - IdentityLinkSigners theIdentityLinkSigners; - theIdentityLinkSigners = this.getIdentityLinkSigners(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identityLinkSigners", theIdentityLinkSigners), currentHashCode, theIdentityLinkSigners); - } - { - ForeignIdentities theForeignIdentities; - theForeignIdentities = this.getForeignIdentities(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "foreignIdentities", theForeignIdentities), currentHashCode, theForeignIdentities); - } - { - OnlineMandates theOnlineMandates; - theOnlineMandates = this.getOnlineMandates(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineMandates", theOnlineMandates), currentHashCode, theOnlineMandates); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java deleted file mode 100644 index 3c119a5bf..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionCustomizationType.java +++ /dev/null @@ -1,743 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for BKUSelectionCustomizationType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="BKUSelectionCustomizationType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="FontType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="BackGroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="FrontColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="HeaderBackGroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="HeaderFrontColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="HeaderText" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="ButtonBackGroundColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="ButtonBackGroundColorFocus" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="ButtonFontColor" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="AppletRedirectTarget" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="AppletHeight" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="AppletWidth" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="MandateLoginButton" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="OnlyMandateLoginAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "BKUSelectionCustomizationType", propOrder = { - "fontType", - "backGroundColor", - "frontColor", - "headerBackGroundColor", - "headerFrontColor", - "headerText", - "buttonBackGroundColor", - "buttonBackGroundColorFocus", - "buttonFontColor", - "appletRedirectTarget", - "appletHeight", - "appletWidth", - "mandateLoginButton", - "onlyMandateLoginAllowed" -}) -@Entity(name = "BKUSelectionCustomizationType") -@Table(name = "BKUSELECTIONCUSTOMIZATIONTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class BKUSelectionCustomizationType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "FontType") - protected String fontType; - @XmlElement(name = "BackGroundColor") - protected String backGroundColor; - @XmlElement(name = "FrontColor") - protected String frontColor; - @XmlElement(name = "HeaderBackGroundColor") - protected String headerBackGroundColor; - @XmlElement(name = "HeaderFrontColor") - protected String headerFrontColor; - @XmlElement(name = "HeaderText") - protected String headerText; - @XmlElement(name = "ButtonBackGroundColor") - protected String buttonBackGroundColor; - @XmlElement(name = "ButtonBackGroundColorFocus") - protected String buttonBackGroundColorFocus; - @XmlElement(name = "ButtonFontColor") - protected String buttonFontColor; - @XmlElement(name = "AppletRedirectTarget") - protected String appletRedirectTarget; - @XmlElement(name = "AppletHeight") - protected String appletHeight; - @XmlElement(name = "AppletWidth") - protected String appletWidth; - @XmlElement(name = "MandateLoginButton", type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean mandateLoginButton; - @XmlElement(name = "OnlyMandateLoginAllowed", type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean onlyMandateLoginAllowed; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the fontType property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FONTTYPE", length = 255) - public String getFontType() { - return fontType; - } - - /** - * Sets the value of the fontType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFontType(String value) { - this.fontType = value; - } - - /** - * Gets the value of the backGroundColor property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "BACKGROUNDCOLOR", length = 255) - public String getBackGroundColor() { - return backGroundColor; - } - - /** - * Sets the value of the backGroundColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBackGroundColor(String value) { - this.backGroundColor = value; - } - - /** - * Gets the value of the frontColor property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FRONTCOLOR", length = 255) - public String getFrontColor() { - return frontColor; - } - - /** - * Sets the value of the frontColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFrontColor(String value) { - this.frontColor = value; - } - - /** - * Gets the value of the headerBackGroundColor property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "HEADERBACKGROUNDCOLOR", length = 255) - public String getHeaderBackGroundColor() { - return headerBackGroundColor; - } - - /** - * Sets the value of the headerBackGroundColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHeaderBackGroundColor(String value) { - this.headerBackGroundColor = value; - } - - /** - * Gets the value of the headerFrontColor property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "HEADERFRONTCOLOR", length = 255) - public String getHeaderFrontColor() { - return headerFrontColor; - } - - /** - * Sets the value of the headerFrontColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHeaderFrontColor(String value) { - this.headerFrontColor = value; - } - - /** - * Gets the value of the headerText property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "HEADERTEXT", length = 255) - public String getHeaderText() { - return headerText; - } - - /** - * Sets the value of the headerText property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHeaderText(String value) { - this.headerText = value; - } - - /** - * Gets the value of the buttonBackGroundColor property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "BUTTONBACKGROUNDCOLOR", length = 255) - public String getButtonBackGroundColor() { - return buttonBackGroundColor; - } - - /** - * Sets the value of the buttonBackGroundColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setButtonBackGroundColor(String value) { - this.buttonBackGroundColor = value; - } - - /** - * Gets the value of the buttonBackGroundColorFocus property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "BUTTONBACKGROUNDCOLORFOCUS", length = 255) - public String getButtonBackGroundColorFocus() { - return buttonBackGroundColorFocus; - } - - /** - * Sets the value of the buttonBackGroundColorFocus property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setButtonBackGroundColorFocus(String value) { - this.buttonBackGroundColorFocus = value; - } - - /** - * Gets the value of the buttonFontColor property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "BUTTONFONTCOLOR", length = 255) - public String getButtonFontColor() { - return buttonFontColor; - } - - /** - * Sets the value of the buttonFontColor property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setButtonFontColor(String value) { - this.buttonFontColor = value; - } - - /** - * Gets the value of the appletRedirectTarget property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "APPLETREDIRECTTARGET", length = 255) - public String getAppletRedirectTarget() { - return appletRedirectTarget; - } - - /** - * Sets the value of the appletRedirectTarget property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAppletRedirectTarget(String value) { - this.appletRedirectTarget = value; - } - - /** - * Gets the value of the appletHeight property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "APPLETHEIGHT", length = 255) - public String getAppletHeight() { - return appletHeight; - } - - /** - * Sets the value of the appletHeight property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAppletHeight(String value) { - this.appletHeight = value; - } - - /** - * Gets the value of the appletWidth property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "APPLETWIDTH", length = 255) - public String getAppletWidth() { - return appletWidth; - } - - /** - * Sets the value of the appletWidth property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAppletWidth(String value) { - this.appletWidth = value; - } - - /** - * Gets the value of the mandateLoginButton property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "MANDATELOGINBUTTON") - public Boolean isMandateLoginButton() { - return mandateLoginButton; - } - - /** - * Sets the value of the mandateLoginButton property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMandateLoginButton(Boolean value) { - this.mandateLoginButton = value; - } - - /** - * Gets the value of the onlyMandateLoginAllowed property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ONLYMANDATELOGINALLOWED") - public Boolean isOnlyMandateLoginAllowed() { - return onlyMandateLoginAllowed; - } - - /** - * Sets the value of the onlyMandateLoginAllowed property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOnlyMandateLoginAllowed(Boolean value) { - this.onlyMandateLoginAllowed = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof BKUSelectionCustomizationType)) { - return false; - } - if (this == object) { - return true; - } - final BKUSelectionCustomizationType that = ((BKUSelectionCustomizationType) object); - { - String lhsFontType; - lhsFontType = this.getFontType(); - String rhsFontType; - rhsFontType = that.getFontType(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "fontType", lhsFontType), LocatorUtils.property(thatLocator, "fontType", rhsFontType), lhsFontType, rhsFontType)) { - return false; - } - } - { - String lhsBackGroundColor; - lhsBackGroundColor = this.getBackGroundColor(); - String rhsBackGroundColor; - rhsBackGroundColor = that.getBackGroundColor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "backGroundColor", lhsBackGroundColor), LocatorUtils.property(thatLocator, "backGroundColor", rhsBackGroundColor), lhsBackGroundColor, rhsBackGroundColor)) { - return false; - } - } - { - String lhsFrontColor; - lhsFrontColor = this.getFrontColor(); - String rhsFrontColor; - rhsFrontColor = that.getFrontColor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "frontColor", lhsFrontColor), LocatorUtils.property(thatLocator, "frontColor", rhsFrontColor), lhsFrontColor, rhsFrontColor)) { - return false; - } - } - { - String lhsHeaderBackGroundColor; - lhsHeaderBackGroundColor = this.getHeaderBackGroundColor(); - String rhsHeaderBackGroundColor; - rhsHeaderBackGroundColor = that.getHeaderBackGroundColor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "headerBackGroundColor", lhsHeaderBackGroundColor), LocatorUtils.property(thatLocator, "headerBackGroundColor", rhsHeaderBackGroundColor), lhsHeaderBackGroundColor, rhsHeaderBackGroundColor)) { - return false; - } - } - { - String lhsHeaderFrontColor; - lhsHeaderFrontColor = this.getHeaderFrontColor(); - String rhsHeaderFrontColor; - rhsHeaderFrontColor = that.getHeaderFrontColor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "headerFrontColor", lhsHeaderFrontColor), LocatorUtils.property(thatLocator, "headerFrontColor", rhsHeaderFrontColor), lhsHeaderFrontColor, rhsHeaderFrontColor)) { - return false; - } - } - { - String lhsHeaderText; - lhsHeaderText = this.getHeaderText(); - String rhsHeaderText; - rhsHeaderText = that.getHeaderText(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "headerText", lhsHeaderText), LocatorUtils.property(thatLocator, "headerText", rhsHeaderText), lhsHeaderText, rhsHeaderText)) { - return false; - } - } - { - String lhsButtonBackGroundColor; - lhsButtonBackGroundColor = this.getButtonBackGroundColor(); - String rhsButtonBackGroundColor; - rhsButtonBackGroundColor = that.getButtonBackGroundColor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "buttonBackGroundColor", lhsButtonBackGroundColor), LocatorUtils.property(thatLocator, "buttonBackGroundColor", rhsButtonBackGroundColor), lhsButtonBackGroundColor, rhsButtonBackGroundColor)) { - return false; - } - } - { - String lhsButtonBackGroundColorFocus; - lhsButtonBackGroundColorFocus = this.getButtonBackGroundColorFocus(); - String rhsButtonBackGroundColorFocus; - rhsButtonBackGroundColorFocus = that.getButtonBackGroundColorFocus(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "buttonBackGroundColorFocus", lhsButtonBackGroundColorFocus), LocatorUtils.property(thatLocator, "buttonBackGroundColorFocus", rhsButtonBackGroundColorFocus), lhsButtonBackGroundColorFocus, rhsButtonBackGroundColorFocus)) { - return false; - } - } - { - String lhsButtonFontColor; - lhsButtonFontColor = this.getButtonFontColor(); - String rhsButtonFontColor; - rhsButtonFontColor = that.getButtonFontColor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "buttonFontColor", lhsButtonFontColor), LocatorUtils.property(thatLocator, "buttonFontColor", rhsButtonFontColor), lhsButtonFontColor, rhsButtonFontColor)) { - return false; - } - } - { - String lhsAppletRedirectTarget; - lhsAppletRedirectTarget = this.getAppletRedirectTarget(); - String rhsAppletRedirectTarget; - rhsAppletRedirectTarget = that.getAppletRedirectTarget(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "appletRedirectTarget", lhsAppletRedirectTarget), LocatorUtils.property(thatLocator, "appletRedirectTarget", rhsAppletRedirectTarget), lhsAppletRedirectTarget, rhsAppletRedirectTarget)) { - return false; - } - } - { - String lhsAppletHeight; - lhsAppletHeight = this.getAppletHeight(); - String rhsAppletHeight; - rhsAppletHeight = that.getAppletHeight(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "appletHeight", lhsAppletHeight), LocatorUtils.property(thatLocator, "appletHeight", rhsAppletHeight), lhsAppletHeight, rhsAppletHeight)) { - return false; - } - } - { - String lhsAppletWidth; - lhsAppletWidth = this.getAppletWidth(); - String rhsAppletWidth; - rhsAppletWidth = that.getAppletWidth(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "appletWidth", lhsAppletWidth), LocatorUtils.property(thatLocator, "appletWidth", rhsAppletWidth), lhsAppletWidth, rhsAppletWidth)) { - return false; - } - } - { - Boolean lhsMandateLoginButton; - lhsMandateLoginButton = this.isMandateLoginButton(); - Boolean rhsMandateLoginButton; - rhsMandateLoginButton = that.isMandateLoginButton(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mandateLoginButton", lhsMandateLoginButton), LocatorUtils.property(thatLocator, "mandateLoginButton", rhsMandateLoginButton), lhsMandateLoginButton, rhsMandateLoginButton)) { - return false; - } - } - { - Boolean lhsOnlyMandateLoginAllowed; - lhsOnlyMandateLoginAllowed = this.isOnlyMandateLoginAllowed(); - Boolean rhsOnlyMandateLoginAllowed; - rhsOnlyMandateLoginAllowed = that.isOnlyMandateLoginAllowed(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlyMandateLoginAllowed", lhsOnlyMandateLoginAllowed), LocatorUtils.property(thatLocator, "onlyMandateLoginAllowed", rhsOnlyMandateLoginAllowed), lhsOnlyMandateLoginAllowed, rhsOnlyMandateLoginAllowed)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theFontType; - theFontType = this.getFontType(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "fontType", theFontType), currentHashCode, theFontType); - } - { - String theBackGroundColor; - theBackGroundColor = this.getBackGroundColor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "backGroundColor", theBackGroundColor), currentHashCode, theBackGroundColor); - } - { - String theFrontColor; - theFrontColor = this.getFrontColor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "frontColor", theFrontColor), currentHashCode, theFrontColor); - } - { - String theHeaderBackGroundColor; - theHeaderBackGroundColor = this.getHeaderBackGroundColor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerBackGroundColor", theHeaderBackGroundColor), currentHashCode, theHeaderBackGroundColor); - } - { - String theHeaderFrontColor; - theHeaderFrontColor = this.getHeaderFrontColor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerFrontColor", theHeaderFrontColor), currentHashCode, theHeaderFrontColor); - } - { - String theHeaderText; - theHeaderText = this.getHeaderText(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerText", theHeaderText), currentHashCode, theHeaderText); - } - { - String theButtonBackGroundColor; - theButtonBackGroundColor = this.getButtonBackGroundColor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "buttonBackGroundColor", theButtonBackGroundColor), currentHashCode, theButtonBackGroundColor); - } - { - String theButtonBackGroundColorFocus; - theButtonBackGroundColorFocus = this.getButtonBackGroundColorFocus(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "buttonBackGroundColorFocus", theButtonBackGroundColorFocus), currentHashCode, theButtonBackGroundColorFocus); - } - { - String theButtonFontColor; - theButtonFontColor = this.getButtonFontColor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "buttonFontColor", theButtonFontColor), currentHashCode, theButtonFontColor); - } - { - String theAppletRedirectTarget; - theAppletRedirectTarget = this.getAppletRedirectTarget(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "appletRedirectTarget", theAppletRedirectTarget), currentHashCode, theAppletRedirectTarget); - } - { - String theAppletHeight; - theAppletHeight = this.getAppletHeight(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "appletHeight", theAppletHeight), currentHashCode, theAppletHeight); - } - { - String theAppletWidth; - theAppletWidth = this.getAppletWidth(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "appletWidth", theAppletWidth), currentHashCode, theAppletWidth); - } - { - Boolean theMandateLoginButton; - theMandateLoginButton = this.isMandateLoginButton(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandateLoginButton", theMandateLoginButton), currentHashCode, theMandateLoginButton); - } - { - Boolean theOnlyMandateLoginAllowed; - theOnlyMandateLoginAllowed = this.isOnlyMandateLoginAllowed(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlyMandateLoginAllowed", theOnlyMandateLoginAllowed), currentHashCode, theOnlyMandateLoginAllowed); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java deleted file mode 100644 index 90ce82d9b..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUSelectionType.java +++ /dev/null @@ -1,58 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for BKUSelectionType. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="BKUSelectionType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
- *     <enumeration value="HTMLComplete"/>
- *     <enumeration value="HTMLSelect"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "BKUSelectionType") -@XmlEnum -public enum BKUSelectionType { - - @XmlEnumValue("HTMLComplete") - HTML_COMPLETE("HTMLComplete"), - @XmlEnumValue("HTMLSelect") - HTML_SELECT("HTMLSelect"); - private final String value; - - BKUSelectionType(String v) { - value = v; - } - - public String value() { - return value; - } - - public static BKUSelectionType fromValue(String v) { - for (BKUSelectionType c: BKUSelectionType.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java deleted file mode 100644 index 8f75fedfe..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BKUURLS.java +++ /dev/null @@ -1,256 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "onlineBKU", - "handyBKU", - "localBKU" -}) -@Entity(name = "BKUURLS") -@Table(name = "BKUURLS") -@Inheritance(strategy = InheritanceType.JOINED) -public class BKUURLS - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "OnlineBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String onlineBKU; - @XmlElement(name = "HandyBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String handyBKU; - @XmlElement(name = "LocalBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String localBKU; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the onlineBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ONLINEBKU") - public String getOnlineBKU() { - return onlineBKU; - } - - /** - * Sets the value of the onlineBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOnlineBKU(String value) { - this.onlineBKU = value; - } - - /** - * Gets the value of the handyBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "HANDYBKU") - public String getHandyBKU() { - return handyBKU; - } - - /** - * Sets the value of the handyBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHandyBKU(String value) { - this.handyBKU = value; - } - - /** - * Gets the value of the localBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "LOCALBKU") - public String getLocalBKU() { - return localBKU; - } - - /** - * Sets the value of the localBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLocalBKU(String value) { - this.localBKU = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof BKUURLS)) { - return false; - } - if (this == object) { - return true; - } - final BKUURLS that = ((BKUURLS) object); - { - String lhsOnlineBKU; - lhsOnlineBKU = this.getOnlineBKU(); - String rhsOnlineBKU; - rhsOnlineBKU = that.getOnlineBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineBKU", lhsOnlineBKU), LocatorUtils.property(thatLocator, "onlineBKU", rhsOnlineBKU), lhsOnlineBKU, rhsOnlineBKU)) { - return false; - } - } - { - String lhsHandyBKU; - lhsHandyBKU = this.getHandyBKU(); - String rhsHandyBKU; - rhsHandyBKU = that.getHandyBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "handyBKU", lhsHandyBKU), LocatorUtils.property(thatLocator, "handyBKU", rhsHandyBKU), lhsHandyBKU, rhsHandyBKU)) { - return false; - } - } - { - String lhsLocalBKU; - lhsLocalBKU = this.getLocalBKU(); - String rhsLocalBKU; - rhsLocalBKU = that.getLocalBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "localBKU", lhsLocalBKU), LocatorUtils.property(thatLocator, "localBKU", rhsLocalBKU), lhsLocalBKU, rhsLocalBKU)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theOnlineBKU; - theOnlineBKU = this.getOnlineBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineBKU", theOnlineBKU), currentHashCode, theOnlineBKU); - } - { - String theHandyBKU; - theHandyBKU = this.getHandyBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handyBKU", theHandyBKU), currentHashCode, theHandyBKU); - } - { - String theLocalBKU; - theLocalBKU = this.getLocalBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "localBKU", theLocalBKU), currentHashCode, theLocalBKU); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java deleted file mode 100644 index f3fb0ecf0..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKDecryption.java +++ /dev/null @@ -1,293 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Lob; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="keyInformation" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *         <element name="iv" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *         <element name="keyStoreFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="keyAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "keyInformation", - "iv", - "keyStoreFileName", - "keyAlias" -}) -@Entity(name = "BPKDecryption") -@Table(name = "BPKDECRYPTION") -@Inheritance(strategy = InheritanceType.JOINED) -public class BPKDecryption - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected byte[] keyInformation; - @XmlElement(required = true) - protected byte[] iv; - protected String keyStoreFileName; - protected String keyAlias; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the keyInformation property. - * - * @return - * possible object is - * byte[] - */ - @Basic - @Column(name = "KEYINFORMATION") - @Lob - public byte[] getKeyInformation() { - return keyInformation; - } - - /** - * Sets the value of the keyInformation property. - * - * @param value - * allowed object is - * byte[] - */ - public void setKeyInformation(byte[] value) { - this.keyInformation = value; - } - - /** - * Gets the value of the iv property. - * - * @return - * possible object is - * byte[] - */ - @Basic - @Column(name = "IV") - @Lob - public byte[] getIv() { - return iv; - } - - /** - * Sets the value of the iv property. - * - * @param value - * allowed object is - * byte[] - */ - public void setIv(byte[] value) { - this.iv = value; - } - - /** - * Gets the value of the keyStoreFileName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "KEYSTOREFILENAME", length = 255) - public String getKeyStoreFileName() { - return keyStoreFileName; - } - - /** - * Sets the value of the keyStoreFileName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKeyStoreFileName(String value) { - this.keyStoreFileName = value; - } - - /** - * Gets the value of the keyAlias property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "KEYALIAS", length = 255) - public String getKeyAlias() { - return keyAlias; - } - - /** - * Sets the value of the keyAlias property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setKeyAlias(String value) { - this.keyAlias = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof BPKDecryption)) { - return false; - } - if (this == object) { - return true; - } - final BPKDecryption that = ((BPKDecryption) object); - { - byte[] lhsKeyInformation; - lhsKeyInformation = this.getKeyInformation(); - byte[] rhsKeyInformation; - rhsKeyInformation = that.getKeyInformation(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "keyInformation", lhsKeyInformation), LocatorUtils.property(thatLocator, "keyInformation", rhsKeyInformation), lhsKeyInformation, rhsKeyInformation)) { - return false; - } - } - { - byte[] lhsIv; - lhsIv = this.getIv(); - byte[] rhsIv; - rhsIv = that.getIv(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "iv", lhsIv), LocatorUtils.property(thatLocator, "iv", rhsIv), lhsIv, rhsIv)) { - return false; - } - } - { - String lhsKeyStoreFileName; - lhsKeyStoreFileName = this.getKeyStoreFileName(); - String rhsKeyStoreFileName; - rhsKeyStoreFileName = that.getKeyStoreFileName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "keyStoreFileName", lhsKeyStoreFileName), LocatorUtils.property(thatLocator, "keyStoreFileName", rhsKeyStoreFileName), lhsKeyStoreFileName, rhsKeyStoreFileName)) { - return false; - } - } - { - String lhsKeyAlias; - lhsKeyAlias = this.getKeyAlias(); - String rhsKeyAlias; - rhsKeyAlias = that.getKeyAlias(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "keyAlias", lhsKeyAlias), LocatorUtils.property(thatLocator, "keyAlias", rhsKeyAlias), lhsKeyAlias, rhsKeyAlias)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - byte[] theKeyInformation; - theKeyInformation = this.getKeyInformation(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyInformation", theKeyInformation), currentHashCode, theKeyInformation); - } - { - byte[] theIv; - theIv = this.getIv(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "iv", theIv), currentHashCode, theIv); - } - { - String theKeyStoreFileName; - theKeyStoreFileName = this.getKeyStoreFileName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyStoreFileName", theKeyStoreFileName), currentHashCode, theKeyStoreFileName); - } - { - String theKeyAlias; - theKeyAlias = this.getKeyAlias(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyAlias", theKeyAlias), currentHashCode, theKeyAlias); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java deleted file mode 100644 index 207ede902..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BPKEncryption.java +++ /dev/null @@ -1,252 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Lob; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="publicKey" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *         <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="vkz" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "publicKey", - "target", - "vkz" -}) -@Entity(name = "BPKEncryption") -@Table(name = "BPKENCRYPTION") -@Inheritance(strategy = InheritanceType.JOINED) -public class BPKEncryption - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected byte[] publicKey; - @XmlElement(required = true) - protected String target; - @XmlElement(required = true) - protected String vkz; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the publicKey property. - * - * @return - * possible object is - * byte[] - */ - @Basic - @Column(name = "PUBLICKEY") - @Lob - public byte[] getPublicKey() { - return publicKey; - } - - /** - * Sets the value of the publicKey property. - * - * @param value - * allowed object is - * byte[] - */ - public void setPublicKey(byte[] value) { - this.publicKey = value; - } - - /** - * Gets the value of the target property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TARGET", length = 255) - public String getTarget() { - return target; - } - - /** - * Sets the value of the target property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTarget(String value) { - this.target = value; - } - - /** - * Gets the value of the vkz property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VKZ", length = 255) - public String getVkz() { - return vkz; - } - - /** - * Sets the value of the vkz property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setVkz(String value) { - this.vkz = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof BPKEncryption)) { - return false; - } - if (this == object) { - return true; - } - final BPKEncryption that = ((BPKEncryption) object); - { - byte[] lhsPublicKey; - lhsPublicKey = this.getPublicKey(); - byte[] rhsPublicKey; - rhsPublicKey = that.getPublicKey(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "publicKey", lhsPublicKey), LocatorUtils.property(thatLocator, "publicKey", rhsPublicKey), lhsPublicKey, rhsPublicKey)) { - return false; - } - } - { - String lhsTarget; - lhsTarget = this.getTarget(); - String rhsTarget; - rhsTarget = that.getTarget(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { - return false; - } - } - { - String lhsVkz; - lhsVkz = this.getVkz(); - String rhsVkz; - rhsVkz = that.getVkz(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "vkz", lhsVkz), LocatorUtils.property(thatLocator, "vkz", rhsVkz), lhsVkz, rhsVkz)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - byte[] thePublicKey; - thePublicKey = this.getPublicKey(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicKey", thePublicKey), currentHashCode, thePublicKey); - } - { - String theTarget; - theTarget = this.getTarget(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); - } - { - String theVkz; - theVkz = this.getVkz(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "vkz", theVkz), currentHashCode, theVkz); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java deleted file mode 100644 index 65fcaa886..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/BasicAuth.java +++ /dev/null @@ -1,214 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="UserID" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType"/>
- *         <element name="Password" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "userID", - "password" -}) -@XmlRootElement(name = "BasicAuth") -@Entity(name = "BasicAuth") -@Table(name = "BASICAUTH") -@Inheritance(strategy = InheritanceType.JOINED) -public class BasicAuth - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "UserID", required = true) - protected MOAAuthDataType userID; - @XmlElement(name = "Password", required = true) - protected MOAAuthDataType password; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the userID property. - * - * @return - * possible object is - * {@link MOAAuthDataType } - * - */ - @Basic - @Column(name = "USERID", length = 255) - @Enumerated(EnumType.STRING) - public MOAAuthDataType getUserID() { - return userID; - } - - /** - * Sets the value of the userID property. - * - * @param value - * allowed object is - * {@link MOAAuthDataType } - * - */ - public void setUserID(MOAAuthDataType value) { - this.userID = value; - } - - /** - * Gets the value of the password property. - * - * @return - * possible object is - * {@link MOAAuthDataType } - * - */ - @Basic - @Column(name = "PASSWORD_", length = 255) - @Enumerated(EnumType.STRING) - public MOAAuthDataType getPassword() { - return password; - } - - /** - * Sets the value of the password property. - * - * @param value - * allowed object is - * {@link MOAAuthDataType } - * - */ - public void setPassword(MOAAuthDataType value) { - this.password = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof BasicAuth)) { - return false; - } - if (this == object) { - return true; - } - final BasicAuth that = ((BasicAuth) object); - { - MOAAuthDataType lhsUserID; - lhsUserID = this.getUserID(); - MOAAuthDataType rhsUserID; - rhsUserID = that.getUserID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "userID", lhsUserID), LocatorUtils.property(thatLocator, "userID", rhsUserID), lhsUserID, rhsUserID)) { - return false; - } - } - { - MOAAuthDataType lhsPassword; - lhsPassword = this.getPassword(); - MOAAuthDataType rhsPassword; - rhsPassword = that.getPassword(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - MOAAuthDataType theUserID; - theUserID = this.getUserID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userID", theUserID), currentHashCode, theUserID); - } - { - MOAAuthDataType thePassword; - thePassword = this.getPassword(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java deleted file mode 100644 index 21476ced2..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPS.java +++ /dev/null @@ -1,418 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="AttributeValue" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_STORK" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="countryCode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}CountryCodeType" />
- *       <attribute name="URL" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       <attribute name="supportsXMLSignature" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "attributeValue", - "oastork" -}) -@XmlRootElement(name = "C-PEPS") -@Entity(name = "CPEPS") -@Table(name = "CPEPS") -@Inheritance(strategy = InheritanceType.JOINED) -public class CPEPS - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "AttributeValue") - protected List attributeValue; - @XmlElement(name = "OA_STORK") - protected List oastork; - @XmlAttribute(name = "countryCode", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String countryCode; - @XmlAttribute(name = "URL", required = true) - @XmlSchemaType(name = "anyURI") - protected String url; - @XmlAttribute(name = "supportsXMLSignature") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean supportsXMLSignature; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List attributeValueItems; - - /** - * Gets the value of the attributeValue property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the attributeValue property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAttributeValue().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getAttributeValue() { - if (attributeValue == null) { - attributeValue = new ArrayList(); - } - return this.attributeValue; - } - - /** - * - * - */ - public void setAttributeValue(List attributeValue) { - this.attributeValue = attributeValue; - } - - /** - * Gets the value of the oastork property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the oastork property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getOASTORK().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link OASTORK } - * - * - */ - @ManyToMany(targetEntity = OASTORK.class, cascade = { - CascadeType.ALL - }) - @JoinTable(name = "OA_CPEPS", joinColumns = { - @JoinColumn(name = "aid", referencedColumnName = "hjid") - }, inverseJoinColumns = { - @JoinColumn(name = "bid", referencedColumnName = "hjid") - }) - public List getOASTORK() { - if (oastork == null) { - oastork = new ArrayList(); - } - return this.oastork; - } - - /** - * - * - */ - public void setOASTORK(List oastork) { - this.oastork = oastork; - } - - /** - * Gets the value of the countryCode property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "COUNTRYCODE", length = 255) - public String getCountryCode() { - return countryCode; - } - - /** - * Sets the value of the countryCode property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCountryCode(String value) { - this.countryCode = value; - } - - /** - * Gets the value of the url property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "URL") - public String getURL() { - return url; - } - - /** - * Sets the value of the url property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setURL(String value) { - this.url = value; - } - - /** - * Gets the value of the supportsXMLSignature property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SUPPORTSXMLSIGNATURE") - public boolean isSupportsXMLSignature() { - if (supportsXMLSignature == null) { - return new ZeroOneBooleanAdapter().unmarshal("true"); - } else { - return supportsXMLSignature; - } - } - - /** - * Sets the value of the supportsXMLSignature property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSupportsXMLSignature(Boolean value) { - this.supportsXMLSignature = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = CPEPSAttributeValueItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ATTRIBUTEVALUEITEMS_CPEPS_HJ_0") - public List getAttributeValueItems() { - if (this.attributeValueItems == null) { - this.attributeValueItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.attributeValue)) { - this.attributeValue = ItemUtils.wrap(this.attributeValue, this.attributeValueItems, CPEPSAttributeValueItem.class); - } - return this.attributeValueItems; - } - - public void setAttributeValueItems(List value) { - this.attributeValue = null; - this.attributeValueItems = null; - this.attributeValueItems = value; - if (this.attributeValueItems == null) { - this.attributeValueItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.attributeValue)) { - this.attributeValue = ItemUtils.wrap(this.attributeValue, this.attributeValueItems, CPEPSAttributeValueItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof CPEPS)) { - return false; - } - if (this == object) { - return true; - } - final CPEPS that = ((CPEPS) object); - { - List lhsAttributeValue; - lhsAttributeValue = (((this.attributeValue!= null)&&(!this.attributeValue.isEmpty()))?this.getAttributeValue():null); - List rhsAttributeValue; - rhsAttributeValue = (((that.attributeValue!= null)&&(!that.attributeValue.isEmpty()))?that.getAttributeValue():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeValue", lhsAttributeValue), LocatorUtils.property(thatLocator, "attributeValue", rhsAttributeValue), lhsAttributeValue, rhsAttributeValue)) { - return false; - } - } - { - List lhsOASTORK; - lhsOASTORK = (((this.oastork!= null)&&(!this.oastork.isEmpty()))?this.getOASTORK():null); - List rhsOASTORK; - rhsOASTORK = (((that.oastork!= null)&&(!that.oastork.isEmpty()))?that.getOASTORK():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oastork", lhsOASTORK), LocatorUtils.property(thatLocator, "oastork", rhsOASTORK), lhsOASTORK, rhsOASTORK)) { - return false; - } - } - { - String lhsCountryCode; - lhsCountryCode = this.getCountryCode(); - String rhsCountryCode; - rhsCountryCode = that.getCountryCode(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "countryCode", lhsCountryCode), LocatorUtils.property(thatLocator, "countryCode", rhsCountryCode), lhsCountryCode, rhsCountryCode)) { - return false; - } - } - { - String lhsURL; - lhsURL = this.getURL(); - String rhsURL; - rhsURL = that.getURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { - return false; - } - } - { - boolean lhsSupportsXMLSignature; - lhsSupportsXMLSignature = ((this.supportsXMLSignature!= null)?this.isSupportsXMLSignature():false); - boolean rhsSupportsXMLSignature; - rhsSupportsXMLSignature = ((that.supportsXMLSignature!= null)?that.isSupportsXMLSignature():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "supportsXMLSignature", lhsSupportsXMLSignature), LocatorUtils.property(thatLocator, "supportsXMLSignature", rhsSupportsXMLSignature), lhsSupportsXMLSignature, rhsSupportsXMLSignature)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theAttributeValue; - theAttributeValue = (((this.attributeValue!= null)&&(!this.attributeValue.isEmpty()))?this.getAttributeValue():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeValue", theAttributeValue), currentHashCode, theAttributeValue); - } - { - List theOASTORK; - theOASTORK = (((this.oastork!= null)&&(!this.oastork.isEmpty()))?this.getOASTORK():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oastork", theOASTORK), currentHashCode, theOASTORK); - } - { - String theCountryCode; - theCountryCode = this.getCountryCode(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "countryCode", theCountryCode), currentHashCode, theCountryCode); - } - { - String theURL; - theURL = this.getURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); - } - { - boolean theSupportsXMLSignature; - theSupportsXMLSignature = ((this.supportsXMLSignature!= null)?this.isSupportsXMLSignature():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "supportsXMLSignature", theSupportsXMLSignature), currentHashCode, theSupportsXMLSignature); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java deleted file mode 100644 index 0b26ca5a3..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/CPEPSAttributeValueItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "CPEPSAttributeValueItem") -@Table(name = "CPEPSATTRIBUTEVALUEITEM") -@Inheritance(strategy = InheritanceType.JOINED) -public class CPEPSAttributeValueItem - implements Serializable, Item -{ - - @XmlElement(name = "AttributeValue", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java deleted file mode 100644 index 2dd3091e3..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModeType.java +++ /dev/null @@ -1,58 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for ChainingModeType. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="ChainingModeType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="chaining"/>
- *     <enumeration value="pkix"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "ChainingModeType") -@XmlEnum -public enum ChainingModeType { - - @XmlEnumValue("chaining") - CHAINING("chaining"), - @XmlEnumValue("pkix") - PKIX("pkix"); - private final String value; - - ChainingModeType(String v) { - value = v; - } - - public String value() { - return value; - } - - public static ChainingModeType fromValue(String v) { - for (ChainingModeType c: ChainingModeType.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java deleted file mode 100644 index 317fe51c5..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ChainingModes.java +++ /dev/null @@ -1,242 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence maxOccurs="unbounded" minOccurs="0">
- *         <element name="TrustAnchor">
- *           <complexType>
- *             <complexContent>
- *               <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}X509IssuerSerialType">
- *                 <attribute name="mode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" />
- *               </extension>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute name="systemDefaultMode" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" default="pkix" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "trustAnchor" -}) -@Entity(name = "ChainingModes") -@Table(name = "CHAININGMODES") -@Inheritance(strategy = InheritanceType.JOINED) -public class ChainingModes - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TrustAnchor") - protected List trustAnchor; - @XmlAttribute(name = "systemDefaultMode") - protected ChainingModeType systemDefaultMode; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the trustAnchor property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the trustAnchor property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTrustAnchor().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link TrustAnchor } - * - * - */ - @OneToMany(targetEntity = TrustAnchor.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TRUSTANCHOR_CHAININGMODES_HJ_0") - public List getTrustAnchor() { - if (trustAnchor == null) { - trustAnchor = new ArrayList(); - } - return this.trustAnchor; - } - - /** - * - * - */ - public void setTrustAnchor(List trustAnchor) { - this.trustAnchor = trustAnchor; - } - - /** - * Gets the value of the systemDefaultMode property. - * - * @return - * possible object is - * {@link ChainingModeType } - * - */ - @Basic - @Column(name = "SYSTEMDEFAULTMODE", length = 255) - @Enumerated(EnumType.STRING) - public ChainingModeType getSystemDefaultMode() { - if (systemDefaultMode == null) { - return ChainingModeType.PKIX; - } else { - return systemDefaultMode; - } - } - - /** - * Sets the value of the systemDefaultMode property. - * - * @param value - * allowed object is - * {@link ChainingModeType } - * - */ - public void setSystemDefaultMode(ChainingModeType value) { - this.systemDefaultMode = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof ChainingModes)) { - return false; - } - if (this == object) { - return true; - } - final ChainingModes that = ((ChainingModes) object); - { - List lhsTrustAnchor; - lhsTrustAnchor = (((this.trustAnchor!= null)&&(!this.trustAnchor.isEmpty()))?this.getTrustAnchor():null); - List rhsTrustAnchor; - rhsTrustAnchor = (((that.trustAnchor!= null)&&(!that.trustAnchor.isEmpty()))?that.getTrustAnchor():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustAnchor", lhsTrustAnchor), LocatorUtils.property(thatLocator, "trustAnchor", rhsTrustAnchor), lhsTrustAnchor, rhsTrustAnchor)) { - return false; - } - } - { - ChainingModeType lhsSystemDefaultMode; - lhsSystemDefaultMode = this.getSystemDefaultMode(); - ChainingModeType rhsSystemDefaultMode; - rhsSystemDefaultMode = that.getSystemDefaultMode(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "systemDefaultMode", lhsSystemDefaultMode), LocatorUtils.property(thatLocator, "systemDefaultMode", rhsSystemDefaultMode), lhsSystemDefaultMode, rhsSystemDefaultMode)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theTrustAnchor; - theTrustAnchor = (((this.trustAnchor!= null)&&(!this.trustAnchor.isEmpty()))?this.getTrustAnchor():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustAnchor", theTrustAnchor), currentHashCode, theTrustAnchor); - } - { - ChainingModeType theSystemDefaultMode; - theSystemDefaultMode = this.getSystemDefaultMode(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "systemDefaultMode", theSystemDefaultMode), currentHashCode, theSystemDefaultMode); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java deleted file mode 100644 index 3db58699a..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ClientKeyStore.java +++ /dev/null @@ -1,206 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
- *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "value" -}) -@Entity(name = "ClientKeyStore") -@Table(name = "CLIENTKEYSTORE") -@Inheritance(strategy = InheritanceType.JOINED) -public class ClientKeyStore - implements Serializable, Equals, HashCode -{ - - @XmlValue - @XmlSchemaType(name = "anyURI") - protected String value; - @XmlAttribute(name = "password") - protected String password; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_") - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the password property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PASSWORD_", length = 255) - public String getPassword() { - return password; - } - - /** - * Sets the value of the password property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPassword(String value) { - this.password = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof ClientKeyStore)) { - return false; - } - if (this == object) { - return true; - } - final ClientKeyStore that = ((ClientKeyStore) object); - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - { - String lhsPassword; - lhsPassword = this.getPassword(); - String rhsPassword; - rhsPassword = that.getPassword(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - { - String thePassword; - thePassword = this.getPassword(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java deleted file mode 100644 index 364af076a..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Configuration.java +++ /dev/null @@ -1,364 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="LoginType" type="{http://www.buergerkarte.at/namespaces/moaconfig#}LoginType"/>
- *         <element name="Binding" minOccurs="0">
- *           <simpleType>
- *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *               <enumeration value="full"/>
- *               <enumeration value="userName"/>
- *               <enumeration value="none"/>
- *             </restriction>
- *           </simpleType>
- *         </element>
- *         <choice>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}ParamAuth"/>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}BasicAuth"/>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}HeaderAuth"/>
- *         </choice>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "loginType", - "binding", - "paramAuth", - "basicAuth", - "headerAuth" -}) -@XmlRootElement(name = "Configuration") -@Entity(name = "Configuration") -@Table(name = "CONFIGURATION") -@Inheritance(strategy = InheritanceType.JOINED) -public class Configuration - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "LoginType", required = true, defaultValue = "stateful") - protected LoginType loginType; - @XmlElement(name = "Binding") - protected String binding; - @XmlElement(name = "ParamAuth") - protected ParamAuth paramAuth; - @XmlElement(name = "BasicAuth") - protected BasicAuth basicAuth; - @XmlElement(name = "HeaderAuth") - protected HeaderAuth headerAuth; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the loginType property. - * - * @return - * possible object is - * {@link LoginType } - * - */ - @Basic - @Column(name = "LOGINTYPE", length = 255) - @Enumerated(EnumType.STRING) - public LoginType getLoginType() { - return loginType; - } - - /** - * Sets the value of the loginType property. - * - * @param value - * allowed object is - * {@link LoginType } - * - */ - public void setLoginType(LoginType value) { - this.loginType = value; - } - - /** - * Gets the value of the binding property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "BINDING") - public String getBinding() { - return binding; - } - - /** - * Sets the value of the binding property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBinding(String value) { - this.binding = value; - } - - /** - * Gets the value of the paramAuth property. - * - * @return - * possible object is - * {@link ParamAuth } - * - */ - @ManyToOne(targetEntity = ParamAuth.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PARAMAUTH_CONFIGURATION_HJID") - public ParamAuth getParamAuth() { - return paramAuth; - } - - /** - * Sets the value of the paramAuth property. - * - * @param value - * allowed object is - * {@link ParamAuth } - * - */ - public void setParamAuth(ParamAuth value) { - this.paramAuth = value; - } - - /** - * Gets the value of the basicAuth property. - * - * @return - * possible object is - * {@link BasicAuth } - * - */ - @ManyToOne(targetEntity = BasicAuth.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "BASICAUTH_CONFIGURATION_HJID") - public BasicAuth getBasicAuth() { - return basicAuth; - } - - /** - * Sets the value of the basicAuth property. - * - * @param value - * allowed object is - * {@link BasicAuth } - * - */ - public void setBasicAuth(BasicAuth value) { - this.basicAuth = value; - } - - /** - * Gets the value of the headerAuth property. - * - * @return - * possible object is - * {@link HeaderAuth } - * - */ - @ManyToOne(targetEntity = HeaderAuth.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "HEADERAUTH_CONFIGURATION_HJID") - public HeaderAuth getHeaderAuth() { - return headerAuth; - } - - /** - * Sets the value of the headerAuth property. - * - * @param value - * allowed object is - * {@link HeaderAuth } - * - */ - public void setHeaderAuth(HeaderAuth value) { - this.headerAuth = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Configuration)) { - return false; - } - if (this == object) { - return true; - } - final Configuration that = ((Configuration) object); - { - LoginType lhsLoginType; - lhsLoginType = this.getLoginType(); - LoginType rhsLoginType; - rhsLoginType = that.getLoginType(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "loginType", lhsLoginType), LocatorUtils.property(thatLocator, "loginType", rhsLoginType), lhsLoginType, rhsLoginType)) { - return false; - } - } - { - String lhsBinding; - lhsBinding = this.getBinding(); - String rhsBinding; - rhsBinding = that.getBinding(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "binding", lhsBinding), LocatorUtils.property(thatLocator, "binding", rhsBinding), lhsBinding, rhsBinding)) { - return false; - } - } - { - ParamAuth lhsParamAuth; - lhsParamAuth = this.getParamAuth(); - ParamAuth rhsParamAuth; - rhsParamAuth = that.getParamAuth(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "paramAuth", lhsParamAuth), LocatorUtils.property(thatLocator, "paramAuth", rhsParamAuth), lhsParamAuth, rhsParamAuth)) { - return false; - } - } - { - BasicAuth lhsBasicAuth; - lhsBasicAuth = this.getBasicAuth(); - BasicAuth rhsBasicAuth; - rhsBasicAuth = that.getBasicAuth(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "basicAuth", lhsBasicAuth), LocatorUtils.property(thatLocator, "basicAuth", rhsBasicAuth), lhsBasicAuth, rhsBasicAuth)) { - return false; - } - } - { - HeaderAuth lhsHeaderAuth; - lhsHeaderAuth = this.getHeaderAuth(); - HeaderAuth rhsHeaderAuth; - rhsHeaderAuth = that.getHeaderAuth(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "headerAuth", lhsHeaderAuth), LocatorUtils.property(thatLocator, "headerAuth", rhsHeaderAuth), lhsHeaderAuth, rhsHeaderAuth)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - LoginType theLoginType; - theLoginType = this.getLoginType(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "loginType", theLoginType), currentHashCode, theLoginType); - } - { - String theBinding; - theBinding = this.getBinding(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "binding", theBinding), currentHashCode, theBinding); - } - { - ParamAuth theParamAuth; - theParamAuth = this.getParamAuth(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "paramAuth", theParamAuth), currentHashCode, theParamAuth); - } - { - BasicAuth theBasicAuth; - theBasicAuth = this.getBasicAuth(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "basicAuth", theBasicAuth), currentHashCode, theBasicAuth); - } - { - HeaderAuth theHeaderAuth; - theHeaderAuth = this.getHeaderAuth(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "headerAuth", theHeaderAuth), currentHashCode, theHeaderAuth); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java deleted file mode 100644 index 129508f35..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterClientAuthType.java +++ /dev/null @@ -1,143 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for ConnectionParameterClientAuthType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ConnectionParameterClientAuthType">
- *   <complexContent>
- *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterServerAuthType">
- *       <sequence>
- *         <element name="ClientKeyStore" minOccurs="0">
- *           <complexType>
- *             <simpleContent>
- *               <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
- *                 <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </extension>
- *             </simpleContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ConnectionParameterClientAuthType", propOrder = { - "clientKeyStore" -}) -@Entity(name = "ConnectionParameterClientAuthType") -@Table(name = "CONNECTIONPARAMETERCLIENTAUT_0") -public class ConnectionParameterClientAuthType - extends ConnectionParameterServerAuthType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "ClientKeyStore") - protected ClientKeyStore clientKeyStore; - - /** - * Gets the value of the clientKeyStore property. - * - * @return - * possible object is - * {@link ClientKeyStore } - * - */ - @ManyToOne(targetEntity = ClientKeyStore.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CLIENTKEYSTORE_CONNECTIONPAR_0") - public ClientKeyStore getClientKeyStore() { - return clientKeyStore; - } - - /** - * Sets the value of the clientKeyStore property. - * - * @param value - * allowed object is - * {@link ClientKeyStore } - * - */ - public void setClientKeyStore(ClientKeyStore value) { - this.clientKeyStore = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof ConnectionParameterClientAuthType)) { - return false; - } - if (this == object) { - return true; - } - if (!super.equals(thisLocator, thatLocator, object, strategy)) { - return false; - } - final ConnectionParameterClientAuthType that = ((ConnectionParameterClientAuthType) object); - { - ClientKeyStore lhsClientKeyStore; - lhsClientKeyStore = this.getClientKeyStore(); - ClientKeyStore rhsClientKeyStore; - rhsClientKeyStore = that.getClientKeyStore(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "clientKeyStore", lhsClientKeyStore), LocatorUtils.property(thatLocator, "clientKeyStore", rhsClientKeyStore), lhsClientKeyStore, rhsClientKeyStore)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = super.hashCode(locator, strategy); - { - ClientKeyStore theClientKeyStore; - theClientKeyStore = this.getClientKeyStore(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "clientKeyStore", theClientKeyStore), currentHashCode, theClientKeyStore); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java deleted file mode 100644 index 4c6ab5917..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConnectionParameterServerAuthType.java +++ /dev/null @@ -1,214 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for ConnectionParameterServerAuthType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="ConnectionParameterServerAuthType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="AcceptedServerCertificates" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="URL" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "ConnectionParameterServerAuthType", propOrder = { - "acceptedServerCertificates" -}) -@XmlSeeAlso({ - ConnectionParameterClientAuthType.class -}) -@Entity(name = "ConnectionParameterServerAuthType") -@Table(name = "CONNECTIONPARAMETERSERVERAUT_0") -@Inheritance(strategy = InheritanceType.JOINED) -public class ConnectionParameterServerAuthType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "AcceptedServerCertificates") - @XmlSchemaType(name = "anyURI") - protected String acceptedServerCertificates; - @XmlAttribute(name = "URL", required = true) - @XmlSchemaType(name = "anyURI") - protected String url; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the acceptedServerCertificates property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ACCEPTEDSERVERCERTIFICATES") - public String getAcceptedServerCertificates() { - return acceptedServerCertificates; - } - - /** - * Sets the value of the acceptedServerCertificates property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAcceptedServerCertificates(String value) { - this.acceptedServerCertificates = value; - } - - /** - * Gets the value of the url property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "URL") - public String getURL() { - return url; - } - - /** - * Sets the value of the url property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setURL(String value) { - this.url = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof ConnectionParameterServerAuthType)) { - return false; - } - if (this == object) { - return true; - } - final ConnectionParameterServerAuthType that = ((ConnectionParameterServerAuthType) object); - { - String lhsAcceptedServerCertificates; - lhsAcceptedServerCertificates = this.getAcceptedServerCertificates(); - String rhsAcceptedServerCertificates; - rhsAcceptedServerCertificates = that.getAcceptedServerCertificates(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "acceptedServerCertificates", lhsAcceptedServerCertificates), LocatorUtils.property(thatLocator, "acceptedServerCertificates", rhsAcceptedServerCertificates), lhsAcceptedServerCertificates, rhsAcceptedServerCertificates)) { - return false; - } - } - { - String lhsURL; - lhsURL = this.getURL(); - String rhsURL; - rhsURL = that.getURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theAcceptedServerCertificates; - theAcceptedServerCertificates = this.getAcceptedServerCertificates(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "acceptedServerCertificates", theAcceptedServerCertificates), currentHashCode, theAcceptedServerCertificates); - } - { - String theURL; - theURL = this.getURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java deleted file mode 100644 index e600930aa..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Contact.java +++ /dev/null @@ -1,484 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="SurName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="GivenName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="Mail" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *         <element name="Type">
- *           <simpleType>
- *             <restriction base="{http://www.w3.org/2001/XMLSchema}token">
- *               <enumeration value="technical"/>
- *               <enumeration value="support"/>
- *               <enumeration value="administrative"/>
- *               <enumeration value="billing"/>
- *               <enumeration value="other"/>
- *             </restriction>
- *           </simpleType>
- *         </element>
- *         <element name="Company" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="Phone" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "surName", - "givenName", - "mail", - "type", - "company", - "phone" -}) -@XmlRootElement(name = "Contact") -@Entity(name = "Contact") -@Table(name = "CONTACT") -@Inheritance(strategy = InheritanceType.JOINED) -public class Contact - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "SurName", required = true) - protected String surName; - @XmlElement(name = "GivenName", required = true) - protected String givenName; - @XmlElement(name = "Mail", required = true) - protected List mail; - @XmlElement(name = "Type", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String type; - @XmlElement(name = "Company", required = true) - protected String company; - @XmlElement(name = "Phone", required = true) - protected List phone; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List mailItems; - protected transient List phoneItems; - - /** - * Gets the value of the surName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SURNAME", length = 255) - public String getSurName() { - return surName; - } - - /** - * Sets the value of the surName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSurName(String value) { - this.surName = value; - } - - /** - * Gets the value of the givenName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "GIVENNAME", length = 255) - public String getGivenName() { - return givenName; - } - - /** - * Sets the value of the givenName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setGivenName(String value) { - this.givenName = value; - } - - /** - * Gets the value of the mail property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the mail property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getMail().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getMail() { - if (mail == null) { - mail = new ArrayList(); - } - return this.mail; - } - - /** - * - * - */ - public void setMail(List mail) { - this.mail = mail; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TYPE_") - public String getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the company property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "COMPANY", length = 255) - public String getCompany() { - return company; - } - - /** - * Sets the value of the company property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCompany(String value) { - this.company = value; - } - - /** - * Gets the value of the phone property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the phone property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getPhone().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getPhone() { - if (phone == null) { - phone = new ArrayList(); - } - return this.phone; - } - - /** - * - * - */ - public void setPhone(List phone) { - this.phone = phone; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = ContactMailItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "MAILITEMS_CONTACT_HJID") - public List getMailItems() { - if (this.mailItems == null) { - this.mailItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.mail)) { - this.mail = ItemUtils.wrap(this.mail, this.mailItems, ContactMailItem.class); - } - return this.mailItems; - } - - public void setMailItems(List value) { - this.mail = null; - this.mailItems = null; - this.mailItems = value; - if (this.mailItems == null) { - this.mailItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.mail)) { - this.mail = ItemUtils.wrap(this.mail, this.mailItems, ContactMailItem.class); - } - } - - @OneToMany(targetEntity = ContactPhoneItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PHONEITEMS_CONTACT_HJID") - public List getPhoneItems() { - if (this.phoneItems == null) { - this.phoneItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.phone)) { - this.phone = ItemUtils.wrap(this.phone, this.phoneItems, ContactPhoneItem.class); - } - return this.phoneItems; - } - - public void setPhoneItems(List value) { - this.phone = null; - this.phoneItems = null; - this.phoneItems = value; - if (this.phoneItems == null) { - this.phoneItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.phone)) { - this.phone = ItemUtils.wrap(this.phone, this.phoneItems, ContactPhoneItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Contact)) { - return false; - } - if (this == object) { - return true; - } - final Contact that = ((Contact) object); - { - String lhsSurName; - lhsSurName = this.getSurName(); - String rhsSurName; - rhsSurName = that.getSurName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "surName", lhsSurName), LocatorUtils.property(thatLocator, "surName", rhsSurName), lhsSurName, rhsSurName)) { - return false; - } - } - { - String lhsGivenName; - lhsGivenName = this.getGivenName(); - String rhsGivenName; - rhsGivenName = that.getGivenName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "givenName", lhsGivenName), LocatorUtils.property(thatLocator, "givenName", rhsGivenName), lhsGivenName, rhsGivenName)) { - return false; - } - } - { - List lhsMail; - lhsMail = (((this.mail!= null)&&(!this.mail.isEmpty()))?this.getMail():null); - List rhsMail; - rhsMail = (((that.mail!= null)&&(!that.mail.isEmpty()))?that.getMail():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mail", lhsMail), LocatorUtils.property(thatLocator, "mail", rhsMail), lhsMail, rhsMail)) { - return false; - } - } - { - String lhsType; - lhsType = this.getType(); - String rhsType; - rhsType = that.getType(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { - return false; - } - } - { - String lhsCompany; - lhsCompany = this.getCompany(); - String rhsCompany; - rhsCompany = that.getCompany(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "company", lhsCompany), LocatorUtils.property(thatLocator, "company", rhsCompany), lhsCompany, rhsCompany)) { - return false; - } - } - { - List lhsPhone; - lhsPhone = (((this.phone!= null)&&(!this.phone.isEmpty()))?this.getPhone():null); - List rhsPhone; - rhsPhone = (((that.phone!= null)&&(!that.phone.isEmpty()))?that.getPhone():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "phone", lhsPhone), LocatorUtils.property(thatLocator, "phone", rhsPhone), lhsPhone, rhsPhone)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theSurName; - theSurName = this.getSurName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "surName", theSurName), currentHashCode, theSurName); - } - { - String theGivenName; - theGivenName = this.getGivenName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "givenName", theGivenName), currentHashCode, theGivenName); - } - { - List theMail; - theMail = (((this.mail!= null)&&(!this.mail.isEmpty()))?this.getMail():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mail", theMail), currentHashCode, theMail); - } - { - String theType; - theType = this.getType(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); - } - { - String theCompany; - theCompany = this.getCompany(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "company", theCompany), currentHashCode, theCompany); - } - { - List thePhone; - thePhone = (((this.phone!= null)&&(!this.phone.isEmpty()))?this.getPhone():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "phone", thePhone), currentHashCode, thePhone); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java deleted file mode 100644 index 67bde993f..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactMailItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "ContactMailItem") -@Table(name = "CONTACTMAILITEM") -@Inheritance(strategy = InheritanceType.JOINED) -public class ContactMailItem - implements Serializable, Item -{ - - @XmlElement(name = "Mail", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java deleted file mode 100644 index 55b433c2b..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ContactPhoneItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "ContactPhoneItem") -@Table(name = "CONTACTPHONEITEM") -@Inheritance(strategy = InheritanceType.JOINED) -public class ContactPhoneItem - implements Serializable, Item -{ - - @XmlElement(name = "Phone", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java deleted file mode 100644 index c31742a9a..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultBKUs.java +++ /dev/null @@ -1,256 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
- *         <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "onlineBKU", - "handyBKU", - "localBKU" -}) -@Entity(name = "DefaultBKUs") -@Table(name = "DEFAULTBKUS") -@Inheritance(strategy = InheritanceType.JOINED) -public class DefaultBKUs - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "OnlineBKU") - @XmlSchemaType(name = "anyURI") - protected String onlineBKU; - @XmlElement(name = "HandyBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String handyBKU; - @XmlElement(name = "LocalBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String localBKU; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the onlineBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ONLINEBKU") - public String getOnlineBKU() { - return onlineBKU; - } - - /** - * Sets the value of the onlineBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOnlineBKU(String value) { - this.onlineBKU = value; - } - - /** - * Gets the value of the handyBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "HANDYBKU") - public String getHandyBKU() { - return handyBKU; - } - - /** - * Sets the value of the handyBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHandyBKU(String value) { - this.handyBKU = value; - } - - /** - * Gets the value of the localBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "LOCALBKU") - public String getLocalBKU() { - return localBKU; - } - - /** - * Sets the value of the localBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLocalBKU(String value) { - this.localBKU = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof DefaultBKUs)) { - return false; - } - if (this == object) { - return true; - } - final DefaultBKUs that = ((DefaultBKUs) object); - { - String lhsOnlineBKU; - lhsOnlineBKU = this.getOnlineBKU(); - String rhsOnlineBKU; - rhsOnlineBKU = that.getOnlineBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineBKU", lhsOnlineBKU), LocatorUtils.property(thatLocator, "onlineBKU", rhsOnlineBKU), lhsOnlineBKU, rhsOnlineBKU)) { - return false; - } - } - { - String lhsHandyBKU; - lhsHandyBKU = this.getHandyBKU(); - String rhsHandyBKU; - rhsHandyBKU = that.getHandyBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "handyBKU", lhsHandyBKU), LocatorUtils.property(thatLocator, "handyBKU", rhsHandyBKU), lhsHandyBKU, rhsHandyBKU)) { - return false; - } - } - { - String lhsLocalBKU; - lhsLocalBKU = this.getLocalBKU(); - String rhsLocalBKU; - rhsLocalBKU = that.getLocalBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "localBKU", lhsLocalBKU), LocatorUtils.property(thatLocator, "localBKU", rhsLocalBKU), lhsLocalBKU, rhsLocalBKU)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theOnlineBKU; - theOnlineBKU = this.getOnlineBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineBKU", theOnlineBKU), currentHashCode, theOnlineBKU); - } - { - String theHandyBKU; - theHandyBKU = this.getHandyBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handyBKU", theHandyBKU), currentHashCode, theHandyBKU); - } - { - String theLocalBKU; - theLocalBKU = this.getLocalBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "localBKU", theLocalBKU), currentHashCode, theLocalBKU); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java deleted file mode 100644 index 5161c7fe9..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DefaultTrustProfile.java +++ /dev/null @@ -1,164 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "trustProfileID" -}) -@Entity(name = "DefaultTrustProfile") -@Table(name = "DEFAULTTRUSTPROFILE") -@Inheritance(strategy = InheritanceType.JOINED) -public class DefaultTrustProfile - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TrustProfileID", required = true) - protected String trustProfileID; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the trustProfileID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TRUSTPROFILEID", length = 255) - public String getTrustProfileID() { - return trustProfileID; - } - - /** - * Sets the value of the trustProfileID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTrustProfileID(String value) { - this.trustProfileID = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof DefaultTrustProfile)) { - return false; - } - if (this == object) { - return true; - } - final DefaultTrustProfile that = ((DefaultTrustProfile) object); - { - String lhsTrustProfileID; - lhsTrustProfileID = this.getTrustProfileID(); - String rhsTrustProfileID; - rhsTrustProfileID = that.getTrustProfileID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theTrustProfileID; - theTrustProfileID = this.getTrustProfileID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java deleted file mode 100644 index b1639e1b0..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/EncBPKInformation.java +++ /dev/null @@ -1,257 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="bPKDecryption" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="keyInformation" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *                   <element name="iv" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *                   <element name="keyStoreFileName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                   <element name="keyAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="bPKEncryption" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="publicKey" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *                   <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="vkz" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "bpkDecryption", - "bpkEncryption" -}) -@XmlRootElement(name = "EncBPKInformation") -@Entity(name = "EncBPKInformation") -@Table(name = "ENCBPKINFORMATION") -@Inheritance(strategy = InheritanceType.JOINED) -public class EncBPKInformation - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "bPKDecryption") - protected BPKDecryption bpkDecryption; - @XmlElement(name = "bPKEncryption") - protected List bpkEncryption; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the bpkDecryption property. - * - * @return - * possible object is - * {@link BPKDecryption } - * - */ - @ManyToOne(targetEntity = BPKDecryption.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "BPKDECRYPTION_ENCBPKINFORMAT_0") - public BPKDecryption getBPKDecryption() { - return bpkDecryption; - } - - /** - * Sets the value of the bpkDecryption property. - * - * @param value - * allowed object is - * {@link BPKDecryption } - * - */ - public void setBPKDecryption(BPKDecryption value) { - this.bpkDecryption = value; - } - - /** - * Gets the value of the bpkEncryption property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the bpkEncryption property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getBPKEncryption().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link BPKEncryption } - * - * - */ - @OneToMany(targetEntity = BPKEncryption.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "BPKENCRYPTION_ENCBPKINFORMAT_0") - public List getBPKEncryption() { - if (bpkEncryption == null) { - bpkEncryption = new ArrayList(); - } - return this.bpkEncryption; - } - - /** - * - * - */ - public void setBPKEncryption(List bpkEncryption) { - this.bpkEncryption = bpkEncryption; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof EncBPKInformation)) { - return false; - } - if (this == object) { - return true; - } - final EncBPKInformation that = ((EncBPKInformation) object); - { - BPKDecryption lhsBPKDecryption; - lhsBPKDecryption = this.getBPKDecryption(); - BPKDecryption rhsBPKDecryption; - rhsBPKDecryption = that.getBPKDecryption(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "bpkDecryption", lhsBPKDecryption), LocatorUtils.property(thatLocator, "bpkDecryption", rhsBPKDecryption), lhsBPKDecryption, rhsBPKDecryption)) { - return false; - } - } - { - List lhsBPKEncryption; - lhsBPKEncryption = (((this.bpkEncryption!= null)&&(!this.bpkEncryption.isEmpty()))?this.getBPKEncryption():null); - List rhsBPKEncryption; - rhsBPKEncryption = (((that.bpkEncryption!= null)&&(!that.bpkEncryption.isEmpty()))?that.getBPKEncryption():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "bpkEncryption", lhsBPKEncryption), LocatorUtils.property(thatLocator, "bpkEncryption", rhsBPKEncryption), lhsBPKEncryption, rhsBPKEncryption)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - BPKDecryption theBPKDecryption; - theBPKDecryption = this.getBPKDecryption(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bpkDecryption", theBPKDecryption), currentHashCode, theBPKDecryption); - } - { - List theBPKEncryption; - theBPKEncryption = (((this.bpkEncryption!= null)&&(!this.bpkEncryption.isEmpty()))?this.getBPKEncryption():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bpkEncryption", theBPKEncryption), currentHashCode, theBPKEncryption); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java deleted file mode 100644 index 8ada16935..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ForeignIdentities.java +++ /dev/null @@ -1,216 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}STORK" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "connectionParameter", - "stork" -}) -@Entity(name = "ForeignIdentities") -@Table(name = "FOREIGNIDENTITIES") -@Inheritance(strategy = InheritanceType.JOINED) -public class ForeignIdentities - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "ConnectionParameter", required = true) - protected ConnectionParameterClientAuthType connectionParameter; - @XmlElement(name = "STORK") - protected STORK stork; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the connectionParameter property. - * - * @return - * possible object is - * {@link ConnectionParameterClientAuthType } - * - */ - @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CONNECTIONPARAMETER_FOREIGNI_0") - public ConnectionParameterClientAuthType getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the value of the connectionParameter property. - * - * @param value - * allowed object is - * {@link ConnectionParameterClientAuthType } - * - */ - public void setConnectionParameter(ConnectionParameterClientAuthType value) { - this.connectionParameter = value; - } - - /** - * Verbindungsparameter zu den Country-PEPS - * (C-PEPS) - * - * - * @return - * possible object is - * {@link STORK } - * - */ - @ManyToOne(targetEntity = STORK.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "STORK_FOREIGNIDENTITIES_HJID") - public STORK getSTORK() { - return stork; - } - - /** - * Sets the value of the stork property. - * - * @param value - * allowed object is - * {@link STORK } - * - */ - public void setSTORK(STORK value) { - this.stork = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof ForeignIdentities)) { - return false; - } - if (this == object) { - return true; - } - final ForeignIdentities that = ((ForeignIdentities) object); - { - ConnectionParameterClientAuthType lhsConnectionParameter; - lhsConnectionParameter = this.getConnectionParameter(); - ConnectionParameterClientAuthType rhsConnectionParameter; - rhsConnectionParameter = that.getConnectionParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { - return false; - } - } - { - STORK lhsSTORK; - lhsSTORK = this.getSTORK(); - STORK rhsSTORK; - rhsSTORK = that.getSTORK(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "stork", lhsSTORK), LocatorUtils.property(thatLocator, "stork", rhsSTORK), lhsSTORK, rhsSTORK)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - ConnectionParameterClientAuthType theConnectionParameter; - theConnectionParameter = this.getConnectionParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); - } - { - STORK theSTORK; - theSTORK = this.getSTORK(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "stork", theSTORK), currentHashCode, theSTORK); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java deleted file mode 100644 index 843b1bec7..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GeneralConfiguration.java +++ /dev/null @@ -1,365 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="TimeOuts">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Assertion" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *                   <element name="MOASessionCreated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *                   <element name="MOASessionUpdated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="AlternativeSourceID" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="CertStoreDirectory" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="TrustManagerRevocationChecking" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="PublicURLPreFix" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "timeOuts", - "alternativeSourceID", - "certStoreDirectory", - "trustManagerRevocationChecking", - "publicURLPreFix" -}) -@XmlRootElement(name = "GeneralConfiguration") -@Entity(name = "GeneralConfiguration") -@Table(name = "GENERALCONFIGURATION") -@Inheritance(strategy = InheritanceType.JOINED) -public class GeneralConfiguration - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TimeOuts", required = true) - protected TimeOuts timeOuts; - @XmlElement(name = "AlternativeSourceID", required = true) - protected String alternativeSourceID; - @XmlElement(name = "CertStoreDirectory", required = true) - @XmlSchemaType(name = "anyURI") - protected String certStoreDirectory; - @XmlElement(name = "TrustManagerRevocationChecking", required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean trustManagerRevocationChecking; - @XmlElement(name = "PublicURLPreFix", required = true) - protected String publicURLPreFix; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the timeOuts property. - * - * @return - * possible object is - * {@link TimeOuts } - * - */ - @ManyToOne(targetEntity = TimeOuts.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TIMEOUTS_GENERALCONFIGURATIO_0") - public TimeOuts getTimeOuts() { - return timeOuts; - } - - /** - * Sets the value of the timeOuts property. - * - * @param value - * allowed object is - * {@link TimeOuts } - * - */ - public void setTimeOuts(TimeOuts value) { - this.timeOuts = value; - } - - /** - * Gets the value of the alternativeSourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ALTERNATIVESOURCEID", length = 255) - public String getAlternativeSourceID() { - return alternativeSourceID; - } - - /** - * Sets the value of the alternativeSourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAlternativeSourceID(String value) { - this.alternativeSourceID = value; - } - - /** - * Gets the value of the certStoreDirectory property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "CERTSTOREDIRECTORY") - public String getCertStoreDirectory() { - return certStoreDirectory; - } - - /** - * Sets the value of the certStoreDirectory property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCertStoreDirectory(String value) { - this.certStoreDirectory = value; - } - - /** - * Gets the value of the trustManagerRevocationChecking property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TRUSTMANAGERREVOCATIONCHECKI_0") - public Boolean isTrustManagerRevocationChecking() { - return trustManagerRevocationChecking; - } - - /** - * Sets the value of the trustManagerRevocationChecking property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTrustManagerRevocationChecking(Boolean value) { - this.trustManagerRevocationChecking = value; - } - - /** - * Gets the value of the publicURLPreFix property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PUBLICURLPREFIX", length = 255) - public String getPublicURLPreFix() { - return publicURLPreFix; - } - - /** - * Sets the value of the publicURLPreFix property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPublicURLPreFix(String value) { - this.publicURLPreFix = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof GeneralConfiguration)) { - return false; - } - if (this == object) { - return true; - } - final GeneralConfiguration that = ((GeneralConfiguration) object); - { - TimeOuts lhsTimeOuts; - lhsTimeOuts = this.getTimeOuts(); - TimeOuts rhsTimeOuts; - rhsTimeOuts = that.getTimeOuts(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "timeOuts", lhsTimeOuts), LocatorUtils.property(thatLocator, "timeOuts", rhsTimeOuts), lhsTimeOuts, rhsTimeOuts)) { - return false; - } - } - { - String lhsAlternativeSourceID; - lhsAlternativeSourceID = this.getAlternativeSourceID(); - String rhsAlternativeSourceID; - rhsAlternativeSourceID = that.getAlternativeSourceID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "alternativeSourceID", lhsAlternativeSourceID), LocatorUtils.property(thatLocator, "alternativeSourceID", rhsAlternativeSourceID), lhsAlternativeSourceID, rhsAlternativeSourceID)) { - return false; - } - } - { - String lhsCertStoreDirectory; - lhsCertStoreDirectory = this.getCertStoreDirectory(); - String rhsCertStoreDirectory; - rhsCertStoreDirectory = that.getCertStoreDirectory(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "certStoreDirectory", lhsCertStoreDirectory), LocatorUtils.property(thatLocator, "certStoreDirectory", rhsCertStoreDirectory), lhsCertStoreDirectory, rhsCertStoreDirectory)) { - return false; - } - } - { - Boolean lhsTrustManagerRevocationChecking; - lhsTrustManagerRevocationChecking = this.isTrustManagerRevocationChecking(); - Boolean rhsTrustManagerRevocationChecking; - rhsTrustManagerRevocationChecking = that.isTrustManagerRevocationChecking(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustManagerRevocationChecking", lhsTrustManagerRevocationChecking), LocatorUtils.property(thatLocator, "trustManagerRevocationChecking", rhsTrustManagerRevocationChecking), lhsTrustManagerRevocationChecking, rhsTrustManagerRevocationChecking)) { - return false; - } - } - { - String lhsPublicURLPreFix; - lhsPublicURLPreFix = this.getPublicURLPreFix(); - String rhsPublicURLPreFix; - rhsPublicURLPreFix = that.getPublicURLPreFix(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURLPreFix", lhsPublicURLPreFix), LocatorUtils.property(thatLocator, "publicURLPreFix", rhsPublicURLPreFix), lhsPublicURLPreFix, rhsPublicURLPreFix)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - TimeOuts theTimeOuts; - theTimeOuts = this.getTimeOuts(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timeOuts", theTimeOuts), currentHashCode, theTimeOuts); - } - { - String theAlternativeSourceID; - theAlternativeSourceID = this.getAlternativeSourceID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alternativeSourceID", theAlternativeSourceID), currentHashCode, theAlternativeSourceID); - } - { - String theCertStoreDirectory; - theCertStoreDirectory = this.getCertStoreDirectory(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "certStoreDirectory", theCertStoreDirectory), currentHashCode, theCertStoreDirectory); - } - { - Boolean theTrustManagerRevocationChecking; - theTrustManagerRevocationChecking = this.isTrustManagerRevocationChecking(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustManagerRevocationChecking", theTrustManagerRevocationChecking), currentHashCode, theTrustManagerRevocationChecking); - } - { - String thePublicURLPreFix; - thePublicURLPreFix = this.getPublicURLPreFix(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURLPreFix", thePublicURLPreFix), currentHashCode, thePublicURLPreFix); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java deleted file mode 100644 index 031a5ff82..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/GenericConfiguration.java +++ /dev/null @@ -1,216 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" use="required">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <enumeration value="DirectoryCertStoreParameters.RootDir"/>
- *             <enumeration value="AuthenticationSession.TimeOut"/>
- *             <enumeration value="AuthenticationData.TimeOut"/>
- *             <enumeration value="TrustManager.RevocationChecking"/>
- *             <enumeration value="FrontendServlets.EnableHTTPConnection"/>
- *             <enumeration value="FrontendServlets.DataURLPrefix"/>
- *             <enumeration value="AuthenticationServer.KeepAssertion"/>
- *             <enumeration value="AuthenticationServer.WriteAssertionToFile"/>
- *             <enumeration value="AuthenticationServer.SourceID"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@Entity(name = "GenericConfiguration") -@Table(name = "GENERICCONFIGURATION") -@Inheritance(strategy = InheritanceType.JOINED) -public class GenericConfiguration - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "value", required = true) - protected String value; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_") - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof GenericConfiguration)) { - return false; - } - if (this == object) { - return true; - } - final GenericConfiguration that = ((GenericConfiguration) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java deleted file mode 100644 index 7cd1bdf36..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Header.java +++ /dev/null @@ -1,212 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}token" />
- *       <attribute name="Value" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "Header") -@Entity(name = "Header") -@Table(name = "HEADER") -@Inheritance(strategy = InheritanceType.JOINED) -public class Header - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "Name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "token") - protected String name; - @XmlAttribute(name = "Value", required = true) - protected MOAAuthDataType value; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_", length = 255) - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link MOAAuthDataType } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - @Enumerated(EnumType.STRING) - public MOAAuthDataType getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link MOAAuthDataType } - * - */ - public void setValue(MOAAuthDataType value) { - this.value = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Header)) { - return false; - } - if (this == object) { - return true; - } - final Header that = ((Header) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - { - MOAAuthDataType lhsValue; - lhsValue = this.getValue(); - MOAAuthDataType rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - { - MOAAuthDataType theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java deleted file mode 100644 index baf367238..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/HeaderAuth.java +++ /dev/null @@ -1,185 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Header" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "header" -}) -@XmlRootElement(name = "HeaderAuth") -@Entity(name = "HeaderAuth") -@Table(name = "HEADERAUTH") -@Inheritance(strategy = InheritanceType.JOINED) -public class HeaderAuth - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Header", required = true) - protected List
header; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the header property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the header property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getHeader().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Header } - * - * - */ - @OneToMany(targetEntity = Header.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "HEADER_HEADERAUTH_HJID") - public List

getHeader() { - if (header == null) { - header = new ArrayList
(); - } - return this.header; - } - - /** - * - * - */ - public void setHeader(List
header) { - this.header = header; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof HeaderAuth)) { - return false; - } - if (this == object) { - return true; - } - final HeaderAuth that = ((HeaderAuth) object); - { - List
lhsHeader; - lhsHeader = (((this.header!= null)&&(!this.header.isEmpty()))?this.getHeader():null); - List
rhsHeader; - rhsHeader = (((that.header!= null)&&(!that.header.isEmpty()))?that.getHeader():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "header", lhsHeader), LocatorUtils.property(thatLocator, "header", rhsHeader), lhsHeader, rhsHeader)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List
theHeader; - theHeader = (((this.header!= null)&&(!this.header.isEmpty()))?this.getHeader():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "header", theHeader), currentHashCode, theHeader); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java deleted file mode 100644 index c87f01c60..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentificationNumber.java +++ /dev/null @@ -1,210 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Type" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="Value" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "type", - "value" -}) -@XmlRootElement(name = "IdentificationNumber") -@Entity(name = "IdentificationNumber") -@Table(name = "IDENTIFICATIONNUMBER") -@Inheritance(strategy = InheritanceType.JOINED) -public class IdentificationNumber - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Type", required = true) - protected String type; - @XmlElement(name = "Value", required = true) - protected String value; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TYPE_", length = 255) - public String getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof IdentificationNumber)) { - return false; - } - if (this == object) { - return true; - } - final IdentificationNumber that = ((IdentificationNumber) object); - { - String lhsType; - lhsType = this.getType(); - String rhsType; - rhsType = that.getType(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { - return false; - } - } - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theType; - theType = this.getType(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); - } - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java deleted file mode 100644 index c4c9d2ec0..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSigners.java +++ /dev/null @@ -1,209 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="X509SubjectName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "x509SubjectName" -}) -@Entity(name = "IdentityLinkSigners") -@Table(name = "IDENTITYLINKSIGNERS") -@Inheritance(strategy = InheritanceType.JOINED) -public class IdentityLinkSigners - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "X509SubjectName", required = true) - protected List x509SubjectName; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List x509SubjectNameItems; - - /** - * Gets the value of the x509SubjectName property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the x509SubjectName property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getX509SubjectName().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getX509SubjectName() { - if (x509SubjectName == null) { - x509SubjectName = new ArrayList(); - } - return this.x509SubjectName; - } - - /** - * - * - */ - public void setX509SubjectName(List x509SubjectName) { - this.x509SubjectName = x509SubjectName; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = IdentityLinkSignersX509SubjectNameItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "X509SUBJECTNAMEITEMS_IDENTIT_0") - public List getX509SubjectNameItems() { - if (this.x509SubjectNameItems == null) { - this.x509SubjectNameItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.x509SubjectName)) { - this.x509SubjectName = ItemUtils.wrap(this.x509SubjectName, this.x509SubjectNameItems, IdentityLinkSignersX509SubjectNameItem.class); - } - return this.x509SubjectNameItems; - } - - public void setX509SubjectNameItems(List value) { - this.x509SubjectName = null; - this.x509SubjectNameItems = null; - this.x509SubjectNameItems = value; - if (this.x509SubjectNameItems == null) { - this.x509SubjectNameItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.x509SubjectName)) { - this.x509SubjectName = ItemUtils.wrap(this.x509SubjectName, this.x509SubjectNameItems, IdentityLinkSignersX509SubjectNameItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof IdentityLinkSigners)) { - return false; - } - if (this == object) { - return true; - } - final IdentityLinkSigners that = ((IdentityLinkSigners) object); - { - List lhsX509SubjectName; - lhsX509SubjectName = (((this.x509SubjectName!= null)&&(!this.x509SubjectName.isEmpty()))?this.getX509SubjectName():null); - List rhsX509SubjectName; - rhsX509SubjectName = (((that.x509SubjectName!= null)&&(!that.x509SubjectName.isEmpty()))?that.getX509SubjectName():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "x509SubjectName", lhsX509SubjectName), LocatorUtils.property(thatLocator, "x509SubjectName", rhsX509SubjectName), lhsX509SubjectName, rhsX509SubjectName)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theX509SubjectName; - theX509SubjectName = (((this.x509SubjectName!= null)&&(!this.x509SubjectName.isEmpty()))?this.getX509SubjectName():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "x509SubjectName", theX509SubjectName), currentHashCode, theX509SubjectName); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java deleted file mode 100644 index 04841e54c..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/IdentityLinkSignersX509SubjectNameItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "IdentityLinkSignersX509SubjectNameItem") -@Table(name = "IDENTITYLINKSIGNERSX509SUBJE_0") -@Inheritance(strategy = InheritanceType.JOINED) -public class IdentityLinkSignersX509SubjectNameItem - implements Serializable, Item -{ - - @XmlElement(name = "X509SubjectName", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java deleted file mode 100644 index 4995d51dd..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InputProcessorType.java +++ /dev/null @@ -1,206 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for InputProcessorType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="InputProcessorType">
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *       <attribute name="template" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "InputProcessorType", propOrder = { - "value" -}) -@Entity(name = "InputProcessorType") -@Table(name = "INPUTPROCESSORTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class InputProcessorType - implements Serializable, Equals, HashCode -{ - - @XmlValue - protected String value; - @XmlAttribute(name = "template") - @XmlSchemaType(name = "anyURI") - protected String template; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the template property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TEMPLATE_") - public String getTemplate() { - return template; - } - - /** - * Sets the value of the template property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTemplate(String value) { - this.template = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof InputProcessorType)) { - return false; - } - if (this == object) { - return true; - } - final InputProcessorType that = ((InputProcessorType) object); - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - { - String lhsTemplate; - lhsTemplate = this.getTemplate(); - String rhsTemplate; - rhsTemplate = that.getTemplate(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "template", lhsTemplate), LocatorUtils.property(thatLocator, "template", rhsTemplate), lhsTemplate, rhsTemplate)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - { - String theTemplate; - theTemplate = this.getTemplate(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "template", theTemplate), currentHashCode, theTemplate); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java deleted file mode 100644 index ec299b933..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationGatewayType.java +++ /dev/null @@ -1,208 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for InterfederationGatewayType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="InterfederationGatewayType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="forwardIDPIdentifier" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="forwardProtocolIdentifer" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "InterfederationGatewayType", propOrder = { - "forwardIDPIdentifier", - "forwardProtocolIdentifer" -}) -@Entity(name = "InterfederationGatewayType") -@Table(name = "INTERFEDERATIONGATEWAYTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class InterfederationGatewayType - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected String forwardIDPIdentifier; - @XmlElement(required = true) - protected String forwardProtocolIdentifer; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the forwardIDPIdentifier property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FORWARDIDPIDENTIFIER", length = 255) - public String getForwardIDPIdentifier() { - return forwardIDPIdentifier; - } - - /** - * Sets the value of the forwardIDPIdentifier property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setForwardIDPIdentifier(String value) { - this.forwardIDPIdentifier = value; - } - - /** - * Gets the value of the forwardProtocolIdentifer property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FORWARDPROTOCOLIDENTIFER", length = 255) - public String getForwardProtocolIdentifer() { - return forwardProtocolIdentifer; - } - - /** - * Sets the value of the forwardProtocolIdentifer property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setForwardProtocolIdentifer(String value) { - this.forwardProtocolIdentifer = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof InterfederationGatewayType)) { - return false; - } - if (this == object) { - return true; - } - final InterfederationGatewayType that = ((InterfederationGatewayType) object); - { - String lhsForwardIDPIdentifier; - lhsForwardIDPIdentifier = this.getForwardIDPIdentifier(); - String rhsForwardIDPIdentifier; - rhsForwardIDPIdentifier = that.getForwardIDPIdentifier(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "forwardIDPIdentifier", lhsForwardIDPIdentifier), LocatorUtils.property(thatLocator, "forwardIDPIdentifier", rhsForwardIDPIdentifier), lhsForwardIDPIdentifier, rhsForwardIDPIdentifier)) { - return false; - } - } - { - String lhsForwardProtocolIdentifer; - lhsForwardProtocolIdentifer = this.getForwardProtocolIdentifer(); - String rhsForwardProtocolIdentifer; - rhsForwardProtocolIdentifer = that.getForwardProtocolIdentifer(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "forwardProtocolIdentifer", lhsForwardProtocolIdentifer), LocatorUtils.property(thatLocator, "forwardProtocolIdentifer", rhsForwardProtocolIdentifer), lhsForwardProtocolIdentifer, rhsForwardProtocolIdentifer)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theForwardIDPIdentifier; - theForwardIDPIdentifier = this.getForwardIDPIdentifier(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "forwardIDPIdentifier", theForwardIDPIdentifier), currentHashCode, theForwardIDPIdentifier); - } - { - String theForwardProtocolIdentifer; - theForwardProtocolIdentifer = this.getForwardProtocolIdentifer(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "forwardProtocolIdentifer", theForwardProtocolIdentifer), currentHashCode, theForwardProtocolIdentifer); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java deleted file mode 100644 index 282360082..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/InterfederationIDPType.java +++ /dev/null @@ -1,402 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for InterfederationIDPType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="InterfederationIDPType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="attributeQueryURL" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="storeSSOSession" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="performPassivRequest" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="performLocalAuthenticationOnError" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *       </sequence>
- *       <attribute name="inboundSSO" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *       <attribute name="outboundSSO" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "InterfederationIDPType", propOrder = { - "attributeQueryURL", - "storeSSOSession", - "performPassivRequest", - "performLocalAuthenticationOnError" -}) -@Entity(name = "InterfederationIDPType") -@Table(name = "INTERFEDERATIONIDPTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class InterfederationIDPType - implements Serializable, Equals, HashCode -{ - - protected String attributeQueryURL; - @XmlElement(required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean storeSSOSession; - @XmlElement(required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean performPassivRequest; - @XmlElement(required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean performLocalAuthenticationOnError; - @XmlAttribute(name = "inboundSSO") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean inboundSSO; - @XmlAttribute(name = "outboundSSO") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean outboundSSO; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the attributeQueryURL property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ATTRIBUTEQUERYURL", length = 255) - public String getAttributeQueryURL() { - return attributeQueryURL; - } - - /** - * Sets the value of the attributeQueryURL property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAttributeQueryURL(String value) { - this.attributeQueryURL = value; - } - - /** - * Gets the value of the storeSSOSession property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "STORESSOSESSION") - public Boolean isStoreSSOSession() { - return storeSSOSession; - } - - /** - * Sets the value of the storeSSOSession property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setStoreSSOSession(Boolean value) { - this.storeSSOSession = value; - } - - /** - * Gets the value of the performPassivRequest property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PERFORMPASSIVREQUEST") - public Boolean isPerformPassivRequest() { - return performPassivRequest; - } - - /** - * Sets the value of the performPassivRequest property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPerformPassivRequest(Boolean value) { - this.performPassivRequest = value; - } - - /** - * Gets the value of the performLocalAuthenticationOnError property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PERFORMLOCALAUTHENTICATIONON_0") - public Boolean isPerformLocalAuthenticationOnError() { - return performLocalAuthenticationOnError; - } - - /** - * Sets the value of the performLocalAuthenticationOnError property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPerformLocalAuthenticationOnError(Boolean value) { - this.performLocalAuthenticationOnError = value; - } - - /** - * Gets the value of the inboundSSO property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "INBOUNDSSO") - public boolean isInboundSSO() { - if (inboundSSO == null) { - return new ZeroOneBooleanAdapter().unmarshal("true"); - } else { - return inboundSSO; - } - } - - /** - * Sets the value of the inboundSSO property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setInboundSSO(Boolean value) { - this.inboundSSO = value; - } - - /** - * Gets the value of the outboundSSO property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "OUTBOUNDSSO") - public boolean isOutboundSSO() { - if (outboundSSO == null) { - return new ZeroOneBooleanAdapter().unmarshal("true"); - } else { - return outboundSSO; - } - } - - /** - * Sets the value of the outboundSSO property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOutboundSSO(Boolean value) { - this.outboundSSO = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof InterfederationIDPType)) { - return false; - } - if (this == object) { - return true; - } - final InterfederationIDPType that = ((InterfederationIDPType) object); - { - String lhsAttributeQueryURL; - lhsAttributeQueryURL = this.getAttributeQueryURL(); - String rhsAttributeQueryURL; - rhsAttributeQueryURL = that.getAttributeQueryURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeQueryURL", lhsAttributeQueryURL), LocatorUtils.property(thatLocator, "attributeQueryURL", rhsAttributeQueryURL), lhsAttributeQueryURL, rhsAttributeQueryURL)) { - return false; - } - } - { - Boolean lhsStoreSSOSession; - lhsStoreSSOSession = this.isStoreSSOSession(); - Boolean rhsStoreSSOSession; - rhsStoreSSOSession = that.isStoreSSOSession(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "storeSSOSession", lhsStoreSSOSession), LocatorUtils.property(thatLocator, "storeSSOSession", rhsStoreSSOSession), lhsStoreSSOSession, rhsStoreSSOSession)) { - return false; - } - } - { - Boolean lhsPerformPassivRequest; - lhsPerformPassivRequest = this.isPerformPassivRequest(); - Boolean rhsPerformPassivRequest; - rhsPerformPassivRequest = that.isPerformPassivRequest(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "performPassivRequest", lhsPerformPassivRequest), LocatorUtils.property(thatLocator, "performPassivRequest", rhsPerformPassivRequest), lhsPerformPassivRequest, rhsPerformPassivRequest)) { - return false; - } - } - { - Boolean lhsPerformLocalAuthenticationOnError; - lhsPerformLocalAuthenticationOnError = this.isPerformLocalAuthenticationOnError(); - Boolean rhsPerformLocalAuthenticationOnError; - rhsPerformLocalAuthenticationOnError = that.isPerformLocalAuthenticationOnError(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "performLocalAuthenticationOnError", lhsPerformLocalAuthenticationOnError), LocatorUtils.property(thatLocator, "performLocalAuthenticationOnError", rhsPerformLocalAuthenticationOnError), lhsPerformLocalAuthenticationOnError, rhsPerformLocalAuthenticationOnError)) { - return false; - } - } - { - boolean lhsInboundSSO; - lhsInboundSSO = ((this.inboundSSO!= null)?this.isInboundSSO():false); - boolean rhsInboundSSO; - rhsInboundSSO = ((that.inboundSSO!= null)?that.isInboundSSO():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "inboundSSO", lhsInboundSSO), LocatorUtils.property(thatLocator, "inboundSSO", rhsInboundSSO), lhsInboundSSO, rhsInboundSSO)) { - return false; - } - } - { - boolean lhsOutboundSSO; - lhsOutboundSSO = ((this.outboundSSO!= null)?this.isOutboundSSO():false); - boolean rhsOutboundSSO; - rhsOutboundSSO = ((that.outboundSSO!= null)?that.isOutboundSSO():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "outboundSSO", lhsOutboundSSO), LocatorUtils.property(thatLocator, "outboundSSO", rhsOutboundSSO), lhsOutboundSSO, rhsOutboundSSO)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theAttributeQueryURL; - theAttributeQueryURL = this.getAttributeQueryURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeQueryURL", theAttributeQueryURL), currentHashCode, theAttributeQueryURL); - } - { - Boolean theStoreSSOSession; - theStoreSSOSession = this.isStoreSSOSession(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storeSSOSession", theStoreSSOSession), currentHashCode, theStoreSSOSession); - } - { - Boolean thePerformPassivRequest; - thePerformPassivRequest = this.isPerformPassivRequest(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "performPassivRequest", thePerformPassivRequest), currentHashCode, thePerformPassivRequest); - } - { - Boolean thePerformLocalAuthenticationOnError; - thePerformLocalAuthenticationOnError = this.isPerformLocalAuthenticationOnError(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "performLocalAuthenticationOnError", thePerformLocalAuthenticationOnError), currentHashCode, thePerformLocalAuthenticationOnError); - } - { - boolean theInboundSSO; - theInboundSSO = ((this.inboundSSO!= null)?this.isInboundSSO():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "inboundSSO", theInboundSSO), currentHashCode, theInboundSSO); - } - { - boolean theOutboundSSO; - theOutboundSSO = ((this.outboundSSO!= null)?this.isOutboundSSO():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "outboundSSO", theOutboundSSO), currentHashCode, theOutboundSSO); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java deleted file mode 100644 index 52c186536..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyName.java +++ /dev/null @@ -1,206 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
- *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "value" -}) -@XmlRootElement(name = "KeyName") -@Entity(name = "KeyName") -@Table(name = "KEYNAME") -@Inheritance(strategy = InheritanceType.JOINED) -public class KeyName - implements Serializable, Equals, HashCode -{ - - @XmlValue - protected String value; - @XmlAttribute(name = "password") - protected String password; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the password property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PASSWORD_", length = 255) - public String getPassword() { - return password; - } - - /** - * Sets the value of the password property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPassword(String value) { - this.password = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof KeyName)) { - return false; - } - if (this == object) { - return true; - } - final KeyName that = ((KeyName) object); - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - { - String lhsPassword; - lhsPassword = this.getPassword(); - String rhsPassword; - rhsPassword = that.getPassword(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - { - String thePassword; - thePassword = this.getPassword(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java deleted file mode 100644 index 04701955d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/KeyStore.java +++ /dev/null @@ -1,208 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <simpleContent>
- *     <extension base="<http://www.w3.org/2001/XMLSchema>anyURI">
- *       <attribute name="password" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </extension>
- *   </simpleContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "value" -}) -@XmlRootElement(name = "KeyStore") -@Entity(name = "KeyStore") -@Table(name = "KEYSTORE") -@Inheritance(strategy = InheritanceType.JOINED) -public class KeyStore - implements Serializable, Equals, HashCode -{ - - @XmlValue - @XmlSchemaType(name = "anyURI") - protected String value; - @XmlAttribute(name = "password") - protected String password; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VALUE_") - public String getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the password property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PASSWORD_", length = 255) - public String getPassword() { - return password; - } - - /** - * Sets the value of the password property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPassword(String value) { - this.password = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof KeyStore)) { - return false; - } - if (this == object) { - return true; - } - final KeyStore that = ((KeyStore) object); - { - String lhsValue; - lhsValue = this.getValue(); - String rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - { - String lhsPassword; - lhsPassword = this.getPassword(); - String rhsPassword; - rhsPassword = that.getPassword(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - { - String thePassword; - thePassword = this.getPassword(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java deleted file mode 100644 index dcb3d9059..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowed.java +++ /dev/null @@ -1,209 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="ProtocolName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "protocolName" -}) -@Entity(name = "LegacyAllowed") -@Table(name = "LEGACYALLOWED") -@Inheritance(strategy = InheritanceType.JOINED) -public class LegacyAllowed - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "ProtocolName") - protected List protocolName; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List protocolNameItems; - - /** - * Gets the value of the protocolName property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the protocolName property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getProtocolName().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getProtocolName() { - if (protocolName == null) { - protocolName = new ArrayList(); - } - return this.protocolName; - } - - /** - * - * - */ - public void setProtocolName(List protocolName) { - this.protocolName = protocolName; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = LegacyAllowedProtocolNameItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PROTOCOLNAMEITEMS_LEGACYALLO_0") - public List getProtocolNameItems() { - if (this.protocolNameItems == null) { - this.protocolNameItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.protocolName)) { - this.protocolName = ItemUtils.wrap(this.protocolName, this.protocolNameItems, LegacyAllowedProtocolNameItem.class); - } - return this.protocolNameItems; - } - - public void setProtocolNameItems(List value) { - this.protocolName = null; - this.protocolNameItems = null; - this.protocolNameItems = value; - if (this.protocolNameItems == null) { - this.protocolNameItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.protocolName)) { - this.protocolName = ItemUtils.wrap(this.protocolName, this.protocolNameItems, LegacyAllowedProtocolNameItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof LegacyAllowed)) { - return false; - } - if (this == object) { - return true; - } - final LegacyAllowed that = ((LegacyAllowed) object); - { - List lhsProtocolName; - lhsProtocolName = (((this.protocolName!= null)&&(!this.protocolName.isEmpty()))?this.getProtocolName():null); - List rhsProtocolName; - rhsProtocolName = (((that.protocolName!= null)&&(!that.protocolName.isEmpty()))?that.getProtocolName():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "protocolName", lhsProtocolName), LocatorUtils.property(thatLocator, "protocolName", rhsProtocolName), lhsProtocolName, rhsProtocolName)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theProtocolName; - theProtocolName = (((this.protocolName!= null)&&(!this.protocolName.isEmpty()))?this.getProtocolName():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protocolName", theProtocolName), currentHashCode, theProtocolName); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java deleted file mode 100644 index fe2fcd7fc..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LegacyAllowedProtocolNameItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "LegacyAllowedProtocolNameItem") -@Table(name = "LEGACYALLOWEDPROTOCOLNAMEITEM") -@Inheritance(strategy = InheritanceType.JOINED) -public class LegacyAllowedProtocolNameItem - implements Serializable, Item -{ - - @XmlElement(name = "ProtocolName", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java deleted file mode 100644 index 8dda6238c..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/LoginType.java +++ /dev/null @@ -1,58 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for LoginType. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="LoginType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
- *     <enumeration value="stateless"/>
- *     <enumeration value="stateful"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "LoginType") -@XmlEnum -public enum LoginType { - - @XmlEnumValue("stateless") - STATELESS("stateless"), - @XmlEnumValue("stateful") - STATEFUL("stateful"); - private final String value; - - LoginType(String v) { - value = v; - } - - public String value() { - return value; - } - - public static LoginType fromValue(String v) { - for (LoginType c: LoginType.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java deleted file mode 100644 index 27631773d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAAuthDataType.java +++ /dev/null @@ -1,82 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for MOAAuthDataType. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="MOAAuthDataType">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
- *     <enumeration value="MOAGivenName"/>
- *     <enumeration value="MOAFamilyName"/>
- *     <enumeration value="MOADateOfBirth"/>
- *     <enumeration value="MOABPK"/>
- *     <enumeration value="MOAWBPK"/>
- *     <enumeration value="MOAPublicAuthority"/>
- *     <enumeration value="MOABKZ"/>
- *     <enumeration value="MOAQualifiedCertificate"/>
- *     <enumeration value="MOAStammzahl"/>
- *     <enumeration value="MOAIdentificationValueType"/>
- *     <enumeration value="MOAIPAddress"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "MOAAuthDataType") -@XmlEnum -public enum MOAAuthDataType { - - @XmlEnumValue("MOAGivenName") - MOA_GIVEN_NAME("MOAGivenName"), - @XmlEnumValue("MOAFamilyName") - MOA_FAMILY_NAME("MOAFamilyName"), - @XmlEnumValue("MOADateOfBirth") - MOA_DATE_OF_BIRTH("MOADateOfBirth"), - MOABPK("MOABPK"), - MOAWBPK("MOAWBPK"), - @XmlEnumValue("MOAPublicAuthority") - MOA_PUBLIC_AUTHORITY("MOAPublicAuthority"), - MOABKZ("MOABKZ"), - @XmlEnumValue("MOAQualifiedCertificate") - MOA_QUALIFIED_CERTIFICATE("MOAQualifiedCertificate"), - @XmlEnumValue("MOAStammzahl") - MOA_STAMMZAHL("MOAStammzahl"), - @XmlEnumValue("MOAIdentificationValueType") - MOA_IDENTIFICATION_VALUE_TYPE("MOAIdentificationValueType"), - @XmlEnumValue("MOAIPAddress") - MOAIP_ADDRESS("MOAIPAddress"); - private final String value; - - MOAAuthDataType(String v) { - value = v; - } - - public String value() { - return value; - } - - public static MOAAuthDataType fromValue(String v) { - for (MOAAuthDataType c: MOAAuthDataType.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java deleted file mode 100644 index 5a23240a9..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAIDConfiguration.java +++ /dev/null @@ -1,664 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.datatype.XMLGregorianCalendar; -import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XMLGregorianCalendarAsDateTime; -import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XmlAdapterUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="AuthComponent_General" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}AuthComponentType">
- *               </extension>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="OnlineApplication" type="{http://www.buergerkarte.at/namespaces/moaconfig#}OnlineApplication" maxOccurs="unbounded"/>
- *         <element name="ChainingModes" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence maxOccurs="unbounded" minOccurs="0">
- *                   <element name="TrustAnchor">
- *                     <complexType>
- *                       <complexContent>
- *                         <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}X509IssuerSerialType">
- *                           <attribute name="mode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" />
- *                         </extension>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *                 <attribute name="systemDefaultMode" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" default="pkix" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="TrustedCACertificates" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
- *         <element name="GenericConfiguration" maxOccurs="unbounded" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="name" use="required">
- *                   <simpleType>
- *                     <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *                       <enumeration value="DirectoryCertStoreParameters.RootDir"/>
- *                       <enumeration value="AuthenticationSession.TimeOut"/>
- *                       <enumeration value="AuthenticationData.TimeOut"/>
- *                       <enumeration value="TrustManager.RevocationChecking"/>
- *                       <enumeration value="FrontendServlets.EnableHTTPConnection"/>
- *                       <enumeration value="FrontendServlets.DataURLPrefix"/>
- *                       <enumeration value="AuthenticationServer.KeepAssertion"/>
- *                       <enumeration value="AuthenticationServer.WriteAssertionToFile"/>
- *                       <enumeration value="AuthenticationServer.SourceID"/>
- *                     </restriction>
- *                   </simpleType>
- *                 </attribute>
- *                 <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="DefaultBKUs">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
- *                   <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="SLRequestTemplates">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
- *       <attribute name="pvp2refresh" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "authComponentGeneral", - "onlineApplication", - "chainingModes", - "trustedCACertificates", - "genericConfiguration", - "defaultBKUs", - "slRequestTemplates" -}) -@XmlRootElement(name = "MOA-IDConfiguration") -@Entity(name = "MOAIDConfiguration") -@Table(name = "MOAIDCONFIGURATION") -@Inheritance(strategy = InheritanceType.JOINED) -public class MOAIDConfiguration - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "AuthComponent_General") - protected AuthComponentGeneral authComponentGeneral; - @XmlElement(name = "OnlineApplication", required = true) - protected List onlineApplication; - @XmlElement(name = "ChainingModes") - protected ChainingModes chainingModes; - @XmlElement(name = "TrustedCACertificates") - @XmlSchemaType(name = "anyURI") - protected String trustedCACertificates; - @XmlElement(name = "GenericConfiguration") - protected List genericConfiguration; - @XmlElement(name = "DefaultBKUs", required = true) - protected DefaultBKUs defaultBKUs; - @XmlElement(name = "SLRequestTemplates", required = true) - protected SLRequestTemplates slRequestTemplates; - @XmlAttribute(name = "timestamp") - @XmlSchemaType(name = "dateTime") - protected XMLGregorianCalendar timestamp; - @XmlAttribute(name = "pvp2refresh") - @XmlSchemaType(name = "dateTime") - protected XMLGregorianCalendar pvp2Refresh; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the authComponentGeneral property. - * - * @return - * possible object is - * {@link AuthComponentGeneral } - * - */ - @ManyToOne(targetEntity = AuthComponentGeneral.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "AUTHCOMPONENTGENERAL_MOAIDCO_0") - public AuthComponentGeneral getAuthComponentGeneral() { - return authComponentGeneral; - } - - /** - * Sets the value of the authComponentGeneral property. - * - * @param value - * allowed object is - * {@link AuthComponentGeneral } - * - */ - public void setAuthComponentGeneral(AuthComponentGeneral value) { - this.authComponentGeneral = value; - } - - /** - * Gets the value of the onlineApplication property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the onlineApplication property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getOnlineApplication().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link OnlineApplication } - * - * - */ - @OneToMany(targetEntity = OnlineApplication.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ONLINEAPPLICATION_MOAIDCONFI_0") - public List getOnlineApplication() { - if (onlineApplication == null) { - onlineApplication = new ArrayList(); - } - return this.onlineApplication; - } - - /** - * - * - */ - public void setOnlineApplication(List onlineApplication) { - this.onlineApplication = onlineApplication; - } - - /** - * Gets the value of the chainingModes property. - * - * @return - * possible object is - * {@link ChainingModes } - * - */ - @ManyToOne(targetEntity = ChainingModes.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CHAININGMODES_MOAIDCONFIGURA_0") - public ChainingModes getChainingModes() { - return chainingModes; - } - - /** - * Sets the value of the chainingModes property. - * - * @param value - * allowed object is - * {@link ChainingModes } - * - */ - public void setChainingModes(ChainingModes value) { - this.chainingModes = value; - } - - /** - * Gets the value of the trustedCACertificates property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TRUSTEDCACERTIFICATES") - public String getTrustedCACertificates() { - return trustedCACertificates; - } - - /** - * Sets the value of the trustedCACertificates property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTrustedCACertificates(String value) { - this.trustedCACertificates = value; - } - - /** - * Gets the value of the genericConfiguration property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the genericConfiguration property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getGenericConfiguration().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link GenericConfiguration } - * - * - */ - @OneToMany(targetEntity = GenericConfiguration.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "GENERICCONFIGURATION_MOAIDCO_0") - public List getGenericConfiguration() { - if (genericConfiguration == null) { - genericConfiguration = new ArrayList(); - } - return this.genericConfiguration; - } - - /** - * - * - */ - public void setGenericConfiguration(List genericConfiguration) { - this.genericConfiguration = genericConfiguration; - } - - /** - * Gets the value of the defaultBKUs property. - * - * @return - * possible object is - * {@link DefaultBKUs } - * - */ - @ManyToOne(targetEntity = DefaultBKUs.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "DEFAULTBKUS_MOAIDCONFIGURATI_0") - public DefaultBKUs getDefaultBKUs() { - return defaultBKUs; - } - - /** - * Sets the value of the defaultBKUs property. - * - * @param value - * allowed object is - * {@link DefaultBKUs } - * - */ - public void setDefaultBKUs(DefaultBKUs value) { - this.defaultBKUs = value; - } - - /** - * Gets the value of the slRequestTemplates property. - * - * @return - * possible object is - * {@link SLRequestTemplates } - * - */ - @ManyToOne(targetEntity = SLRequestTemplates.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SLREQUESTTEMPLATES_MOAIDCONF_0") - public SLRequestTemplates getSLRequestTemplates() { - return slRequestTemplates; - } - - /** - * Sets the value of the slRequestTemplates property. - * - * @param value - * allowed object is - * {@link SLRequestTemplates } - * - */ - public void setSLRequestTemplates(SLRequestTemplates value) { - this.slRequestTemplates = value; - } - - /** - * Gets the value of the timestamp property. - * - * @return - * possible object is - * {@link XMLGregorianCalendar } - * - */ - @Transient - public XMLGregorianCalendar getTimestamp() { - return timestamp; - } - - /** - * Sets the value of the timestamp property. - * - * @param value - * allowed object is - * {@link XMLGregorianCalendar } - * - */ - public void setTimestamp(XMLGregorianCalendar value) { - this.timestamp = value; - } - - /** - * Gets the value of the pvp2Refresh property. - * - * @return - * possible object is - * {@link XMLGregorianCalendar } - * - */ - @Transient - public XMLGregorianCalendar getPvp2Refresh() { - return pvp2Refresh; - } - - /** - * Sets the value of the pvp2Refresh property. - * - * @param value - * allowed object is - * {@link XMLGregorianCalendar } - * - */ - public void setPvp2Refresh(XMLGregorianCalendar value) { - this.pvp2Refresh = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @Basic - @Column(name = "TIMESTAMPITEM") - @Temporal(TemporalType.TIMESTAMP) - public Date getTimestampItem() { - return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getTimestamp()); - } - - public void setTimestampItem(Date target) { - setTimestamp(XmlAdapterUtils.marshall(XMLGregorianCalendarAsDateTime.class, target)); - } - - @Basic - @Column(name = "PVP2REFRESHITEM") - @Temporal(TemporalType.TIMESTAMP) - public Date getPvp2RefreshItem() { - return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getPvp2Refresh()); - } - - public void setPvp2RefreshItem(Date target) { - setPvp2Refresh(XmlAdapterUtils.marshall(XMLGregorianCalendarAsDateTime.class, target)); - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof MOAIDConfiguration)) { - return false; - } - if (this == object) { - return true; - } - final MOAIDConfiguration that = ((MOAIDConfiguration) object); - { - AuthComponentGeneral lhsAuthComponentGeneral; - lhsAuthComponentGeneral = this.getAuthComponentGeneral(); - AuthComponentGeneral rhsAuthComponentGeneral; - rhsAuthComponentGeneral = that.getAuthComponentGeneral(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "authComponentGeneral", lhsAuthComponentGeneral), LocatorUtils.property(thatLocator, "authComponentGeneral", rhsAuthComponentGeneral), lhsAuthComponentGeneral, rhsAuthComponentGeneral)) { - return false; - } - } - { - List lhsOnlineApplication; - lhsOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); - List rhsOnlineApplication; - rhsOnlineApplication = (((that.onlineApplication!= null)&&(!that.onlineApplication.isEmpty()))?that.getOnlineApplication():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineApplication", lhsOnlineApplication), LocatorUtils.property(thatLocator, "onlineApplication", rhsOnlineApplication), lhsOnlineApplication, rhsOnlineApplication)) { - return false; - } - } - { - ChainingModes lhsChainingModes; - lhsChainingModes = this.getChainingModes(); - ChainingModes rhsChainingModes; - rhsChainingModes = that.getChainingModes(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "chainingModes", lhsChainingModes), LocatorUtils.property(thatLocator, "chainingModes", rhsChainingModes), lhsChainingModes, rhsChainingModes)) { - return false; - } - } - { - String lhsTrustedCACertificates; - lhsTrustedCACertificates = this.getTrustedCACertificates(); - String rhsTrustedCACertificates; - rhsTrustedCACertificates = that.getTrustedCACertificates(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustedCACertificates", lhsTrustedCACertificates), LocatorUtils.property(thatLocator, "trustedCACertificates", rhsTrustedCACertificates), lhsTrustedCACertificates, rhsTrustedCACertificates)) { - return false; - } - } - { - List lhsGenericConfiguration; - lhsGenericConfiguration = (((this.genericConfiguration!= null)&&(!this.genericConfiguration.isEmpty()))?this.getGenericConfiguration():null); - List rhsGenericConfiguration; - rhsGenericConfiguration = (((that.genericConfiguration!= null)&&(!that.genericConfiguration.isEmpty()))?that.getGenericConfiguration():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "genericConfiguration", lhsGenericConfiguration), LocatorUtils.property(thatLocator, "genericConfiguration", rhsGenericConfiguration), lhsGenericConfiguration, rhsGenericConfiguration)) { - return false; - } - } - { - DefaultBKUs lhsDefaultBKUs; - lhsDefaultBKUs = this.getDefaultBKUs(); - DefaultBKUs rhsDefaultBKUs; - rhsDefaultBKUs = that.getDefaultBKUs(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "defaultBKUs", lhsDefaultBKUs), LocatorUtils.property(thatLocator, "defaultBKUs", rhsDefaultBKUs), lhsDefaultBKUs, rhsDefaultBKUs)) { - return false; - } - } - { - SLRequestTemplates lhsSLRequestTemplates; - lhsSLRequestTemplates = this.getSLRequestTemplates(); - SLRequestTemplates rhsSLRequestTemplates; - rhsSLRequestTemplates = that.getSLRequestTemplates(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "slRequestTemplates", lhsSLRequestTemplates), LocatorUtils.property(thatLocator, "slRequestTemplates", rhsSLRequestTemplates), lhsSLRequestTemplates, rhsSLRequestTemplates)) { - return false; - } - } - { - XMLGregorianCalendar lhsTimestamp; - lhsTimestamp = this.getTimestamp(); - XMLGregorianCalendar rhsTimestamp; - rhsTimestamp = that.getTimestamp(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "timestamp", lhsTimestamp), LocatorUtils.property(thatLocator, "timestamp", rhsTimestamp), lhsTimestamp, rhsTimestamp)) { - return false; - } - } - { - XMLGregorianCalendar lhsPvp2Refresh; - lhsPvp2Refresh = this.getPvp2Refresh(); - XMLGregorianCalendar rhsPvp2Refresh; - rhsPvp2Refresh = that.getPvp2Refresh(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "pvp2Refresh", lhsPvp2Refresh), LocatorUtils.property(thatLocator, "pvp2Refresh", rhsPvp2Refresh), lhsPvp2Refresh, rhsPvp2Refresh)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - AuthComponentGeneral theAuthComponentGeneral; - theAuthComponentGeneral = this.getAuthComponentGeneral(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "authComponentGeneral", theAuthComponentGeneral), currentHashCode, theAuthComponentGeneral); - } - { - List theOnlineApplication; - theOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineApplication", theOnlineApplication), currentHashCode, theOnlineApplication); - } - { - ChainingModes theChainingModes; - theChainingModes = this.getChainingModes(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "chainingModes", theChainingModes), currentHashCode, theChainingModes); - } - { - String theTrustedCACertificates; - theTrustedCACertificates = this.getTrustedCACertificates(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustedCACertificates", theTrustedCACertificates), currentHashCode, theTrustedCACertificates); - } - { - List theGenericConfiguration; - theGenericConfiguration = (((this.genericConfiguration!= null)&&(!this.genericConfiguration.isEmpty()))?this.getGenericConfiguration():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "genericConfiguration", theGenericConfiguration), currentHashCode, theGenericConfiguration); - } - { - DefaultBKUs theDefaultBKUs; - theDefaultBKUs = this.getDefaultBKUs(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "defaultBKUs", theDefaultBKUs), currentHashCode, theDefaultBKUs); - } - { - SLRequestTemplates theSLRequestTemplates; - theSLRequestTemplates = this.getSLRequestTemplates(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "slRequestTemplates", theSLRequestTemplates), currentHashCode, theSLRequestTemplates); - } - { - XMLGregorianCalendar theTimestamp; - theTimestamp = this.getTimestamp(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "timestamp", theTimestamp), currentHashCode, theTimestamp); - } - { - XMLGregorianCalendar thePvp2Refresh; - thePvp2Refresh = this.getPvp2Refresh(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "pvp2Refresh", thePvp2Refresh), currentHashCode, thePvp2Refresh); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java deleted file mode 100644 index f418ef719..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOAKeyBoxSelector.java +++ /dev/null @@ -1,58 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for MOAKeyBoxSelector. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="MOAKeyBoxSelector">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
- *     <enumeration value="SecureSignatureKeypair"/>
- *     <enumeration value="CertifiedKeypair"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "MOAKeyBoxSelector") -@XmlEnum -public enum MOAKeyBoxSelector { - - @XmlEnumValue("SecureSignatureKeypair") - SECURE_SIGNATURE_KEYPAIR("SecureSignatureKeypair"), - @XmlEnumValue("CertifiedKeypair") - CERTIFIED_KEYPAIR("CertifiedKeypair"); - private final String value; - - MOAKeyBoxSelector(String v) { - value = v; - } - - public String value() { - return value; - } - - public static MOAKeyBoxSelector fromValue(String v) { - for (MOAKeyBoxSelector c: MOAKeyBoxSelector.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java deleted file mode 100644 index d93b38a26..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MOASP.java +++ /dev/null @@ -1,281 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
- *         <element name="VerifyIdentityLink">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="VerifyAuthBlock">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *                   <element name="VerifyTransformsInfoProfileID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "connectionParameter", - "verifyIdentityLink", - "verifyAuthBlock" -}) -@Entity(name = "MOASP") -@Table(name = "MOASP") -@Inheritance(strategy = InheritanceType.JOINED) -public class MOASP - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "ConnectionParameter") - protected ConnectionParameterClientAuthType connectionParameter; - @XmlElement(name = "VerifyIdentityLink", required = true) - protected VerifyIdentityLink verifyIdentityLink; - @XmlElement(name = "VerifyAuthBlock", required = true) - protected VerifyAuthBlock verifyAuthBlock; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the connectionParameter property. - * - * @return - * possible object is - * {@link ConnectionParameterClientAuthType } - * - */ - @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CONNECTIONPARAMETER_MOASP_HJ_0") - public ConnectionParameterClientAuthType getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the value of the connectionParameter property. - * - * @param value - * allowed object is - * {@link ConnectionParameterClientAuthType } - * - */ - public void setConnectionParameter(ConnectionParameterClientAuthType value) { - this.connectionParameter = value; - } - - /** - * Gets the value of the verifyIdentityLink property. - * - * @return - * possible object is - * {@link VerifyIdentityLink } - * - */ - @ManyToOne(targetEntity = VerifyIdentityLink.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "VERIFYIDENTITYLINK_MOASP_HJID") - public VerifyIdentityLink getVerifyIdentityLink() { - return verifyIdentityLink; - } - - /** - * Sets the value of the verifyIdentityLink property. - * - * @param value - * allowed object is - * {@link VerifyIdentityLink } - * - */ - public void setVerifyIdentityLink(VerifyIdentityLink value) { - this.verifyIdentityLink = value; - } - - /** - * Gets the value of the verifyAuthBlock property. - * - * @return - * possible object is - * {@link VerifyAuthBlock } - * - */ - @ManyToOne(targetEntity = VerifyAuthBlock.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "VERIFYAUTHBLOCK_MOASP_HJID") - public VerifyAuthBlock getVerifyAuthBlock() { - return verifyAuthBlock; - } - - /** - * Sets the value of the verifyAuthBlock property. - * - * @param value - * allowed object is - * {@link VerifyAuthBlock } - * - */ - public void setVerifyAuthBlock(VerifyAuthBlock value) { - this.verifyAuthBlock = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof MOASP)) { - return false; - } - if (this == object) { - return true; - } - final MOASP that = ((MOASP) object); - { - ConnectionParameterClientAuthType lhsConnectionParameter; - lhsConnectionParameter = this.getConnectionParameter(); - ConnectionParameterClientAuthType rhsConnectionParameter; - rhsConnectionParameter = that.getConnectionParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { - return false; - } - } - { - VerifyIdentityLink lhsVerifyIdentityLink; - lhsVerifyIdentityLink = this.getVerifyIdentityLink(); - VerifyIdentityLink rhsVerifyIdentityLink; - rhsVerifyIdentityLink = that.getVerifyIdentityLink(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "verifyIdentityLink", lhsVerifyIdentityLink), LocatorUtils.property(thatLocator, "verifyIdentityLink", rhsVerifyIdentityLink), lhsVerifyIdentityLink, rhsVerifyIdentityLink)) { - return false; - } - } - { - VerifyAuthBlock lhsVerifyAuthBlock; - lhsVerifyAuthBlock = this.getVerifyAuthBlock(); - VerifyAuthBlock rhsVerifyAuthBlock; - rhsVerifyAuthBlock = that.getVerifyAuthBlock(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "verifyAuthBlock", lhsVerifyAuthBlock), LocatorUtils.property(thatLocator, "verifyAuthBlock", rhsVerifyAuthBlock), lhsVerifyAuthBlock, rhsVerifyAuthBlock)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - ConnectionParameterClientAuthType theConnectionParameter; - theConnectionParameter = this.getConnectionParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); - } - { - VerifyIdentityLink theVerifyIdentityLink; - theVerifyIdentityLink = this.getVerifyIdentityLink(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "verifyIdentityLink", theVerifyIdentityLink), currentHashCode, theVerifyIdentityLink); - } - { - VerifyAuthBlock theVerifyAuthBlock; - theVerifyAuthBlock = this.getVerifyAuthBlock(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "verifyAuthBlock", theVerifyAuthBlock), currentHashCode, theVerifyAuthBlock); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java deleted file mode 100644 index 9c91d3c5c..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Mandates.java +++ /dev/null @@ -1,254 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Profiles" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="ProfileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "profiles", - "profileName" -}) -@Entity(name = "Mandates") -@Table(name = "MANDATES") -@Inheritance(strategy = InheritanceType.JOINED) -public class Mandates - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Profiles", required = true) - protected String profiles; - @XmlElement(name = "ProfileName") - protected List profileName; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List profileNameItems; - - /** - * Gets the value of the profiles property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROFILES", length = 255) - public String getProfiles() { - return profiles; - } - - /** - * Sets the value of the profiles property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProfiles(String value) { - this.profiles = value; - } - - /** - * Gets the value of the profileName property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the profileName property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getProfileName().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getProfileName() { - if (profileName == null) { - profileName = new ArrayList(); - } - return this.profileName; - } - - /** - * - * - */ - public void setProfileName(List profileName) { - this.profileName = profileName; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = MandatesProfileNameItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PROFILENAMEITEMS_MANDATES_HJ_0") - public List getProfileNameItems() { - if (this.profileNameItems == null) { - this.profileNameItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.profileName)) { - this.profileName = ItemUtils.wrap(this.profileName, this.profileNameItems, MandatesProfileNameItem.class); - } - return this.profileNameItems; - } - - public void setProfileNameItems(List value) { - this.profileName = null; - this.profileNameItems = null; - this.profileNameItems = value; - if (this.profileNameItems == null) { - this.profileNameItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.profileName)) { - this.profileName = ItemUtils.wrap(this.profileName, this.profileNameItems, MandatesProfileNameItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Mandates)) { - return false; - } - if (this == object) { - return true; - } - final Mandates that = ((Mandates) object); - { - String lhsProfiles; - lhsProfiles = this.getProfiles(); - String rhsProfiles; - rhsProfiles = that.getProfiles(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "profiles", lhsProfiles), LocatorUtils.property(thatLocator, "profiles", rhsProfiles), lhsProfiles, rhsProfiles)) { - return false; - } - } - { - List lhsProfileName; - lhsProfileName = (((this.profileName!= null)&&(!this.profileName.isEmpty()))?this.getProfileName():null); - List rhsProfileName; - rhsProfileName = (((that.profileName!= null)&&(!that.profileName.isEmpty()))?that.getProfileName():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "profileName", lhsProfileName), LocatorUtils.property(thatLocator, "profileName", rhsProfileName), lhsProfileName, rhsProfileName)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theProfiles; - theProfiles = this.getProfiles(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "profiles", theProfiles), currentHashCode, theProfiles); - } - { - List theProfileName; - theProfileName = (((this.profileName!= null)&&(!this.profileName.isEmpty()))?this.getProfileName():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "profileName", theProfileName), currentHashCode, theProfileName); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java deleted file mode 100644 index b9dc096aa..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/MandatesProfileNameItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "MandatesProfileNameItem") -@Table(name = "MANDATESPROFILENAMEITEM") -@Inheritance(strategy = InheritanceType.JOINED) -public class MandatesProfileNameItem - implements Serializable, Item -{ - - @XmlElement(name = "ProfileName", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java deleted file mode 100644 index 790cf660f..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAOAUTH20.java +++ /dev/null @@ -1,254 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="oAuthClientId" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="oAuthClientSecret" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="oAuthRedirectUri" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "oAuthClientId", - "oAuthClientSecret", - "oAuthRedirectUri" -}) -@XmlRootElement(name = "OA_OAUTH20") -@Entity(name = "OAOAUTH20") -@Table(name = "OAOAUTH20") -@Inheritance(strategy = InheritanceType.JOINED) -public class OAOAUTH20 - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected String oAuthClientId; - @XmlElement(required = true) - protected String oAuthClientSecret; - @XmlElement(required = true) - protected String oAuthRedirectUri; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the oAuthClientId property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "OAUTHCLIENTID", length = 255) - public String getOAuthClientId() { - return oAuthClientId; - } - - /** - * Sets the value of the oAuthClientId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOAuthClientId(String value) { - this.oAuthClientId = value; - } - - /** - * Gets the value of the oAuthClientSecret property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "OAUTHCLIENTSECRET", length = 255) - public String getOAuthClientSecret() { - return oAuthClientSecret; - } - - /** - * Sets the value of the oAuthClientSecret property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOAuthClientSecret(String value) { - this.oAuthClientSecret = value; - } - - /** - * Gets the value of the oAuthRedirectUri property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "OAUTHREDIRECTURI", length = 255) - public String getOAuthRedirectUri() { - return oAuthRedirectUri; - } - - /** - * Sets the value of the oAuthRedirectUri property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOAuthRedirectUri(String value) { - this.oAuthRedirectUri = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OAOAUTH20)) { - return false; - } - if (this == object) { - return true; - } - final OAOAUTH20 that = ((OAOAUTH20) object); - { - String lhsOAuthClientId; - lhsOAuthClientId = this.getOAuthClientId(); - String rhsOAuthClientId; - rhsOAuthClientId = that.getOAuthClientId(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuthClientId", lhsOAuthClientId), LocatorUtils.property(thatLocator, "oAuthClientId", rhsOAuthClientId), lhsOAuthClientId, rhsOAuthClientId)) { - return false; - } - } - { - String lhsOAuthClientSecret; - lhsOAuthClientSecret = this.getOAuthClientSecret(); - String rhsOAuthClientSecret; - rhsOAuthClientSecret = that.getOAuthClientSecret(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuthClientSecret", lhsOAuthClientSecret), LocatorUtils.property(thatLocator, "oAuthClientSecret", rhsOAuthClientSecret), lhsOAuthClientSecret, rhsOAuthClientSecret)) { - return false; - } - } - { - String lhsOAuthRedirectUri; - lhsOAuthRedirectUri = this.getOAuthRedirectUri(); - String rhsOAuthRedirectUri; - rhsOAuthRedirectUri = that.getOAuthRedirectUri(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuthRedirectUri", lhsOAuthRedirectUri), LocatorUtils.property(thatLocator, "oAuthRedirectUri", rhsOAuthRedirectUri), lhsOAuthRedirectUri, rhsOAuthRedirectUri)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theOAuthClientId; - theOAuthClientId = this.getOAuthClientId(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuthClientId", theOAuthClientId), currentHashCode, theOAuthClientId); - } - { - String theOAuthClientSecret; - theOAuthClientSecret = this.getOAuthClientSecret(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuthClientSecret", theOAuthClientSecret), currentHashCode, theOAuthClientSecret); - } - { - String theOAuthRedirectUri; - theOAuthRedirectUri = this.getOAuthRedirectUri(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuthRedirectUri", theOAuthRedirectUri), currentHashCode, theOAuthRedirectUri); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java deleted file mode 100644 index 2183021dc..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAPVP2.java +++ /dev/null @@ -1,274 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.Date; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Lob; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.datatype.XMLGregorianCalendar; -import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XMLGregorianCalendarAsDateTime; -import org.jvnet.hyperjaxb3.xml.bind.annotation.adapters.XmlAdapterUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="metadataURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="certificate" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *         <element name="updateRequired" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "metadataURL", - "certificate", - "updateRequired" -}) -@XmlRootElement(name = "OA_PVP2") -@Entity(name = "OAPVP2") -@Table(name = "OAPVP2") -@Inheritance(strategy = InheritanceType.JOINED) -public class OAPVP2 - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - @XmlSchemaType(name = "anyURI") - protected String metadataURL; - @XmlElement(required = true) - protected byte[] certificate; - @XmlElement(required = true) - @XmlSchemaType(name = "dateTime") - protected XMLGregorianCalendar updateRequired; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the metadataURL property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "METADATAURL") - public String getMetadataURL() { - return metadataURL; - } - - /** - * Sets the value of the metadataURL property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMetadataURL(String value) { - this.metadataURL = value; - } - - /** - * Gets the value of the certificate property. - * - * @return - * possible object is - * byte[] - */ - @Basic - @Column(name = "CERTIFICATE") - @Lob - public byte[] getCertificate() { - return certificate; - } - - /** - * Sets the value of the certificate property. - * - * @param value - * allowed object is - * byte[] - */ - public void setCertificate(byte[] value) { - this.certificate = value; - } - - /** - * Gets the value of the updateRequired property. - * - * @return - * possible object is - * {@link XMLGregorianCalendar } - * - */ - @Transient - public XMLGregorianCalendar getUpdateRequired() { - return updateRequired; - } - - /** - * Sets the value of the updateRequired property. - * - * @param value - * allowed object is - * {@link XMLGregorianCalendar } - * - */ - public void setUpdateRequired(XMLGregorianCalendar value) { - this.updateRequired = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @Basic - @Column(name = "UPDATEREQUIREDITEM") - @Temporal(TemporalType.TIMESTAMP) - public Date getUpdateRequiredItem() { - return XmlAdapterUtils.unmarshall(XMLGregorianCalendarAsDateTime.class, this.getUpdateRequired()); - } - - public void setUpdateRequiredItem(Date target) { - setUpdateRequired(XmlAdapterUtils.marshall(XMLGregorianCalendarAsDateTime.class, target)); - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OAPVP2)) { - return false; - } - if (this == object) { - return true; - } - final OAPVP2 that = ((OAPVP2) object); - { - String lhsMetadataURL; - lhsMetadataURL = this.getMetadataURL(); - String rhsMetadataURL; - rhsMetadataURL = that.getMetadataURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "metadataURL", lhsMetadataURL), LocatorUtils.property(thatLocator, "metadataURL", rhsMetadataURL), lhsMetadataURL, rhsMetadataURL)) { - return false; - } - } - { - byte[] lhsCertificate; - lhsCertificate = this.getCertificate(); - byte[] rhsCertificate; - rhsCertificate = that.getCertificate(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "certificate", lhsCertificate), LocatorUtils.property(thatLocator, "certificate", rhsCertificate), lhsCertificate, rhsCertificate)) { - return false; - } - } - { - XMLGregorianCalendar lhsUpdateRequired; - lhsUpdateRequired = this.getUpdateRequired(); - XMLGregorianCalendar rhsUpdateRequired; - rhsUpdateRequired = that.getUpdateRequired(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "updateRequired", lhsUpdateRequired), LocatorUtils.property(thatLocator, "updateRequired", rhsUpdateRequired), lhsUpdateRequired, rhsUpdateRequired)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theMetadataURL; - theMetadataURL = this.getMetadataURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "metadataURL", theMetadataURL), currentHashCode, theMetadataURL); - } - { - byte[] theCertificate; - theCertificate = this.getCertificate(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "certificate", theCertificate), currentHashCode, theCertificate); - } - { - XMLGregorianCalendar theUpdateRequired; - theUpdateRequired = this.getUpdateRequired(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "updateRequired", theUpdateRequired), currentHashCode, theUpdateRequired); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java deleted file mode 100644 index b6fcbecbe..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASAML1.java +++ /dev/null @@ -1,580 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.math.BigInteger; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="provideStammzahl" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="provideAUTHBlock" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="provideIdentityLink" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="provideCertificate" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="provideFullMandatorData" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="useCondition" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="conditionLength" type="{http://www.w3.org/2001/XMLSchema}integer" minOccurs="0"/>
- *         <element name="sourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="provideAllErrors" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "isActive", - "provideStammzahl", - "provideAUTHBlock", - "provideIdentityLink", - "provideCertificate", - "provideFullMandatorData", - "useCondition", - "conditionLength", - "sourceID", - "provideAllErrors" -}) -@XmlRootElement(name = "OA_SAML1") -@Entity(name = "OASAML1") -@Table(name = "OASAML1") -@Inheritance(strategy = InheritanceType.JOINED) -public class OASAML1 - implements Serializable, Equals, HashCode -{ - - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isActive; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean provideStammzahl; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean provideAUTHBlock; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean provideIdentityLink; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean provideCertificate; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean provideFullMandatorData; - @XmlElement(type = String.class) - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean useCondition; - protected BigInteger conditionLength; - protected String sourceID; - @XmlElement(type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean provideAllErrors; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the isActive property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISACTIVE") - public Boolean isIsActive() { - return isActive; - } - - /** - * Sets the value of the isActive property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsActive(Boolean value) { - this.isActive = value; - } - - /** - * Gets the value of the provideStammzahl property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROVIDESTAMMZAHL") - public Boolean isProvideStammzahl() { - return provideStammzahl; - } - - /** - * Sets the value of the provideStammzahl property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvideStammzahl(Boolean value) { - this.provideStammzahl = value; - } - - /** - * Gets the value of the provideAUTHBlock property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROVIDEAUTHBLOCK") - public Boolean isProvideAUTHBlock() { - return provideAUTHBlock; - } - - /** - * Sets the value of the provideAUTHBlock property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvideAUTHBlock(Boolean value) { - this.provideAUTHBlock = value; - } - - /** - * Gets the value of the provideIdentityLink property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROVIDEIDENTITYLINK") - public Boolean isProvideIdentityLink() { - return provideIdentityLink; - } - - /** - * Sets the value of the provideIdentityLink property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvideIdentityLink(Boolean value) { - this.provideIdentityLink = value; - } - - /** - * Gets the value of the provideCertificate property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROVIDECERTIFICATE") - public Boolean isProvideCertificate() { - return provideCertificate; - } - - /** - * Sets the value of the provideCertificate property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvideCertificate(Boolean value) { - this.provideCertificate = value; - } - - /** - * Gets the value of the provideFullMandatorData property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROVIDEFULLMANDATORDATA") - public Boolean isProvideFullMandatorData() { - return provideFullMandatorData; - } - - /** - * Sets the value of the provideFullMandatorData property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvideFullMandatorData(Boolean value) { - this.provideFullMandatorData = value; - } - - /** - * Gets the value of the useCondition property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "USECONDITION") - public Boolean isUseCondition() { - return useCondition; - } - - /** - * Sets the value of the useCondition property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setUseCondition(Boolean value) { - this.useCondition = value; - } - - /** - * Gets the value of the conditionLength property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - @Basic - @Column(name = "CONDITIONLENGTH", precision = 20, scale = 0) - public BigInteger getConditionLength() { - return conditionLength; - } - - /** - * Sets the value of the conditionLength property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setConditionLength(BigInteger value) { - this.conditionLength = value; - } - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SOURCEID", length = 255) - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = value; - } - - /** - * Gets the value of the provideAllErrors property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PROVIDEALLERRORS") - public Boolean isProvideAllErrors() { - return provideAllErrors; - } - - /** - * Sets the value of the provideAllErrors property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setProvideAllErrors(Boolean value) { - this.provideAllErrors = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OASAML1)) { - return false; - } - if (this == object) { - return true; - } - final OASAML1 that = ((OASAML1) object); - { - Boolean lhsIsActive; - lhsIsActive = this.isIsActive(); - Boolean rhsIsActive; - rhsIsActive = that.isIsActive(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { - return false; - } - } - { - Boolean lhsProvideStammzahl; - lhsProvideStammzahl = this.isProvideStammzahl(); - Boolean rhsProvideStammzahl; - rhsProvideStammzahl = that.isProvideStammzahl(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "provideStammzahl", lhsProvideStammzahl), LocatorUtils.property(thatLocator, "provideStammzahl", rhsProvideStammzahl), lhsProvideStammzahl, rhsProvideStammzahl)) { - return false; - } - } - { - Boolean lhsProvideAUTHBlock; - lhsProvideAUTHBlock = this.isProvideAUTHBlock(); - Boolean rhsProvideAUTHBlock; - rhsProvideAUTHBlock = that.isProvideAUTHBlock(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "provideAUTHBlock", lhsProvideAUTHBlock), LocatorUtils.property(thatLocator, "provideAUTHBlock", rhsProvideAUTHBlock), lhsProvideAUTHBlock, rhsProvideAUTHBlock)) { - return false; - } - } - { - Boolean lhsProvideIdentityLink; - lhsProvideIdentityLink = this.isProvideIdentityLink(); - Boolean rhsProvideIdentityLink; - rhsProvideIdentityLink = that.isProvideIdentityLink(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "provideIdentityLink", lhsProvideIdentityLink), LocatorUtils.property(thatLocator, "provideIdentityLink", rhsProvideIdentityLink), lhsProvideIdentityLink, rhsProvideIdentityLink)) { - return false; - } - } - { - Boolean lhsProvideCertificate; - lhsProvideCertificate = this.isProvideCertificate(); - Boolean rhsProvideCertificate; - rhsProvideCertificate = that.isProvideCertificate(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "provideCertificate", lhsProvideCertificate), LocatorUtils.property(thatLocator, "provideCertificate", rhsProvideCertificate), lhsProvideCertificate, rhsProvideCertificate)) { - return false; - } - } - { - Boolean lhsProvideFullMandatorData; - lhsProvideFullMandatorData = this.isProvideFullMandatorData(); - Boolean rhsProvideFullMandatorData; - rhsProvideFullMandatorData = that.isProvideFullMandatorData(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "provideFullMandatorData", lhsProvideFullMandatorData), LocatorUtils.property(thatLocator, "provideFullMandatorData", rhsProvideFullMandatorData), lhsProvideFullMandatorData, rhsProvideFullMandatorData)) { - return false; - } - } - { - Boolean lhsUseCondition; - lhsUseCondition = this.isUseCondition(); - Boolean rhsUseCondition; - rhsUseCondition = that.isUseCondition(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "useCondition", lhsUseCondition), LocatorUtils.property(thatLocator, "useCondition", rhsUseCondition), lhsUseCondition, rhsUseCondition)) { - return false; - } - } - { - BigInteger lhsConditionLength; - lhsConditionLength = this.getConditionLength(); - BigInteger rhsConditionLength; - rhsConditionLength = that.getConditionLength(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "conditionLength", lhsConditionLength), LocatorUtils.property(thatLocator, "conditionLength", rhsConditionLength), lhsConditionLength, rhsConditionLength)) { - return false; - } - } - { - String lhsSourceID; - lhsSourceID = this.getSourceID(); - String rhsSourceID; - rhsSourceID = that.getSourceID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceID", lhsSourceID), LocatorUtils.property(thatLocator, "sourceID", rhsSourceID), lhsSourceID, rhsSourceID)) { - return false; - } - } - { - Boolean lhsProvideAllErrors; - lhsProvideAllErrors = this.isProvideAllErrors(); - Boolean rhsProvideAllErrors; - rhsProvideAllErrors = that.isProvideAllErrors(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "provideAllErrors", lhsProvideAllErrors), LocatorUtils.property(thatLocator, "provideAllErrors", rhsProvideAllErrors), lhsProvideAllErrors, rhsProvideAllErrors)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - Boolean theIsActive; - theIsActive = this.isIsActive(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); - } - { - Boolean theProvideStammzahl; - theProvideStammzahl = this.isProvideStammzahl(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideStammzahl", theProvideStammzahl), currentHashCode, theProvideStammzahl); - } - { - Boolean theProvideAUTHBlock; - theProvideAUTHBlock = this.isProvideAUTHBlock(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideAUTHBlock", theProvideAUTHBlock), currentHashCode, theProvideAUTHBlock); - } - { - Boolean theProvideIdentityLink; - theProvideIdentityLink = this.isProvideIdentityLink(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideIdentityLink", theProvideIdentityLink), currentHashCode, theProvideIdentityLink); - } - { - Boolean theProvideCertificate; - theProvideCertificate = this.isProvideCertificate(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideCertificate", theProvideCertificate), currentHashCode, theProvideCertificate); - } - { - Boolean theProvideFullMandatorData; - theProvideFullMandatorData = this.isProvideFullMandatorData(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideFullMandatorData", theProvideFullMandatorData), currentHashCode, theProvideFullMandatorData); - } - { - Boolean theUseCondition; - theUseCondition = this.isUseCondition(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "useCondition", theUseCondition), currentHashCode, theUseCondition); - } - { - BigInteger theConditionLength; - theConditionLength = this.getConditionLength(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "conditionLength", theConditionLength), currentHashCode, theConditionLength); - } - { - String theSourceID; - theSourceID = this.getSourceID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceID", theSourceID), currentHashCode, theSourceID); - } - { - Boolean theProvideAllErrors; - theProvideAllErrors = this.isProvideAllErrors(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "provideAllErrors", theProvideAllErrors), currentHashCode, theProvideAllErrors); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java deleted file mode 100644 index a41c3ac0f..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASSO.java +++ /dev/null @@ -1,260 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="UseSSO" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="AuthDataFrame" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="SingleLogOutURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "useSSO", - "authDataFrame", - "singleLogOutURL" -}) -@Entity(name = "OASSO") -@Table(name = "OASSO") -@Inheritance(strategy = InheritanceType.JOINED) -public class OASSO - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "UseSSO", required = true, type = String.class) - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean useSSO; - @XmlElement(name = "AuthDataFrame", required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean authDataFrame; - @XmlElement(name = "SingleLogOutURL", required = true) - @XmlSchemaType(name = "anyURI") - protected String singleLogOutURL; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the useSSO property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "USESSO") - public Boolean isUseSSO() { - return useSSO; - } - - /** - * Sets the value of the useSSO property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setUseSSO(Boolean value) { - this.useSSO = value; - } - - /** - * Gets the value of the authDataFrame property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "AUTHDATAFRAME") - public Boolean isAuthDataFrame() { - return authDataFrame; - } - - /** - * Sets the value of the authDataFrame property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAuthDataFrame(Boolean value) { - this.authDataFrame = value; - } - - /** - * Gets the value of the singleLogOutURL property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SINGLELOGOUTURL") - public String getSingleLogOutURL() { - return singleLogOutURL; - } - - /** - * Sets the value of the singleLogOutURL property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSingleLogOutURL(String value) { - this.singleLogOutURL = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OASSO)) { - return false; - } - if (this == object) { - return true; - } - final OASSO that = ((OASSO) object); - { - Boolean lhsUseSSO; - lhsUseSSO = this.isUseSSO(); - Boolean rhsUseSSO; - rhsUseSSO = that.isUseSSO(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "useSSO", lhsUseSSO), LocatorUtils.property(thatLocator, "useSSO", rhsUseSSO), lhsUseSSO, rhsUseSSO)) { - return false; - } - } - { - Boolean lhsAuthDataFrame; - lhsAuthDataFrame = this.isAuthDataFrame(); - Boolean rhsAuthDataFrame; - rhsAuthDataFrame = that.isAuthDataFrame(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "authDataFrame", lhsAuthDataFrame), LocatorUtils.property(thatLocator, "authDataFrame", rhsAuthDataFrame), lhsAuthDataFrame, rhsAuthDataFrame)) { - return false; - } - } - { - String lhsSingleLogOutURL; - lhsSingleLogOutURL = this.getSingleLogOutURL(); - String rhsSingleLogOutURL; - rhsSingleLogOutURL = that.getSingleLogOutURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "singleLogOutURL", lhsSingleLogOutURL), LocatorUtils.property(thatLocator, "singleLogOutURL", rhsSingleLogOutURL), lhsSingleLogOutURL, rhsSingleLogOutURL)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - Boolean theUseSSO; - theUseSSO = this.isUseSSO(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "useSSO", theUseSSO), currentHashCode, theUseSSO); - } - { - Boolean theAuthDataFrame; - theAuthDataFrame = this.isAuthDataFrame(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "authDataFrame", theAuthDataFrame), currentHashCode, theAuthDataFrame); - } - { - String theSingleLogOutURL; - theSingleLogOutURL = this.getSingleLogOutURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "singleLogOutURL", theSingleLogOutURL), currentHashCode, theSingleLogOutURL); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java deleted file mode 100644 index 9d4f5d699..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OASTORK.java +++ /dev/null @@ -1,495 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; -import javax.persistence.ManyToMany; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="StorkLogonEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Qaa" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OAAttributes" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="VidpEnabled" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}AttributeProviders" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="requireConsent" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}C-PEPS" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "storkLogonEnabled", - "qaa", - "oaAttributes", - "vidpEnabled", - "attributeProviders", - "requireConsent", - "cpeps" -}) -@XmlRootElement(name = "OA_STORK") -@Entity(name = "OASTORK") -@Table(name = "OASTORK") -@Inheritance(strategy = InheritanceType.JOINED) -public class OASTORK - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "StorkLogonEnabled", required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean storkLogonEnabled; - @XmlElement(name = "Qaa") - protected Integer qaa; - @XmlElement(name = "OAAttributes") - protected List oaAttributes; - @XmlElement(name = "VidpEnabled", required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean vidpEnabled; - @XmlElement(name = "AttributeProviders") - protected List attributeProviders; - @XmlElement(required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean requireConsent; - @XmlElement(name = "C-PEPS", required = true) - protected List cpeps; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the storkLogonEnabled property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "STORKLOGONENABLED") - public Boolean isStorkLogonEnabled() { - return storkLogonEnabled; - } - - /** - * Sets the value of the storkLogonEnabled property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setStorkLogonEnabled(Boolean value) { - this.storkLogonEnabled = value; - } - - /** - * Gets the value of the qaa property. - * - * @return - * possible object is - * {@link Integer } - * - */ - @Basic - @Column(name = "QAA", precision = 20, scale = 0) - public Integer getQaa() { - return qaa; - } - - /** - * Sets the value of the qaa property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setQaa(Integer value) { - this.qaa = value; - } - - /** - * Gets the value of the oaAttributes property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the oaAttributes property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getOAAttributes().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link OAStorkAttribute } - * - * - */ - @OneToMany(targetEntity = OAStorkAttribute.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OAATTRIBUTES_OASTORK_HJID") - public List getOAAttributes() { - if (oaAttributes == null) { - oaAttributes = new ArrayList(); - } - return this.oaAttributes; - } - - /** - * - * - */ - public void setOAAttributes(List oaAttributes) { - this.oaAttributes = oaAttributes; - } - - /** - * Gets the value of the vidpEnabled property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "VIDPENABLED") - public Boolean isVidpEnabled() { - return vidpEnabled; - } - - /** - * Sets the value of the vidpEnabled property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setVidpEnabled(Boolean value) { - this.vidpEnabled = value; - } - - /** - * Gets the value of the attributeProviders property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the attributeProviders property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAttributeProviders().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link AttributeProviderPlugin } - * - * - */ - @OneToMany(targetEntity = AttributeProviderPlugin.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ATTRIBUTEPROVIDERS_OASTORK_H_0") - public List getAttributeProviders() { - if (attributeProviders == null) { - attributeProviders = new ArrayList(); - } - return this.attributeProviders; - } - - /** - * - * - */ - public void setAttributeProviders(List attributeProviders) { - this.attributeProviders = attributeProviders; - } - - /** - * Gets the value of the requireConsent property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "REQUIRECONSENT") - public Boolean isRequireConsent() { - return requireConsent; - } - - /** - * Sets the value of the requireConsent property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRequireConsent(Boolean value) { - this.requireConsent = value; - } - - /** - * Gets the value of the cpeps property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the cpeps property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getCPEPS().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CPEPS } - * - * - */ - @ManyToMany(targetEntity = CPEPS.class, cascade = { - CascadeType.ALL - }) - @JoinTable(name = "OASTORK_CPEPS_CPEPS", joinColumns = { - @JoinColumn(name = "PARENT_OASTORK_HJID") - }, inverseJoinColumns = { - @JoinColumn(name = "CHILD_CPEPS_HJID") - }) - public List getCPEPS() { - if (cpeps == null) { - cpeps = new ArrayList(); - } - return this.cpeps; - } - - /** - * - * - */ - public void setCPEPS(List cpeps) { - this.cpeps = cpeps; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OASTORK)) { - return false; - } - if (this == object) { - return true; - } - final OASTORK that = ((OASTORK) object); - { - Boolean lhsStorkLogonEnabled; - lhsStorkLogonEnabled = this.isStorkLogonEnabled(); - Boolean rhsStorkLogonEnabled; - rhsStorkLogonEnabled = that.isStorkLogonEnabled(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "storkLogonEnabled", lhsStorkLogonEnabled), LocatorUtils.property(thatLocator, "storkLogonEnabled", rhsStorkLogonEnabled), lhsStorkLogonEnabled, rhsStorkLogonEnabled)) { - return false; - } - } - { - Integer lhsQaa; - lhsQaa = this.getQaa(); - Integer rhsQaa; - rhsQaa = that.getQaa(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "qaa", lhsQaa), LocatorUtils.property(thatLocator, "qaa", rhsQaa), lhsQaa, rhsQaa)) { - return false; - } - } - { - List lhsOAAttributes; - lhsOAAttributes = (((this.oaAttributes!= null)&&(!this.oaAttributes.isEmpty()))?this.getOAAttributes():null); - List rhsOAAttributes; - rhsOAAttributes = (((that.oaAttributes!= null)&&(!that.oaAttributes.isEmpty()))?that.getOAAttributes():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oaAttributes", lhsOAAttributes), LocatorUtils.property(thatLocator, "oaAttributes", rhsOAAttributes), lhsOAAttributes, rhsOAAttributes)) { - return false; - } - } - { - Boolean lhsVidpEnabled; - lhsVidpEnabled = this.isVidpEnabled(); - Boolean rhsVidpEnabled; - rhsVidpEnabled = that.isVidpEnabled(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "vidpEnabled", lhsVidpEnabled), LocatorUtils.property(thatLocator, "vidpEnabled", rhsVidpEnabled), lhsVidpEnabled, rhsVidpEnabled)) { - return false; - } - } - { - List lhsAttributeProviders; - lhsAttributeProviders = (((this.attributeProviders!= null)&&(!this.attributeProviders.isEmpty()))?this.getAttributeProviders():null); - List rhsAttributeProviders; - rhsAttributeProviders = (((that.attributeProviders!= null)&&(!that.attributeProviders.isEmpty()))?that.getAttributeProviders():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "attributeProviders", lhsAttributeProviders), LocatorUtils.property(thatLocator, "attributeProviders", rhsAttributeProviders), lhsAttributeProviders, rhsAttributeProviders)) { - return false; - } - } - { - Boolean lhsRequireConsent; - lhsRequireConsent = this.isRequireConsent(); - Boolean rhsRequireConsent; - rhsRequireConsent = that.isRequireConsent(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "requireConsent", lhsRequireConsent), LocatorUtils.property(thatLocator, "requireConsent", rhsRequireConsent), lhsRequireConsent, rhsRequireConsent)) { - return false; - } - } - { - List lhsCPEPS; - lhsCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); - List rhsCPEPS; - rhsCPEPS = (((that.cpeps!= null)&&(!that.cpeps.isEmpty()))?that.getCPEPS():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "cpeps", lhsCPEPS), LocatorUtils.property(thatLocator, "cpeps", rhsCPEPS), lhsCPEPS, rhsCPEPS)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - Boolean theStorkLogonEnabled; - theStorkLogonEnabled = this.isStorkLogonEnabled(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storkLogonEnabled", theStorkLogonEnabled), currentHashCode, theStorkLogonEnabled); - } - { - Integer theQaa; - theQaa = this.getQaa(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "qaa", theQaa), currentHashCode, theQaa); - } - { - List theOAAttributes; - theOAAttributes = (((this.oaAttributes!= null)&&(!this.oaAttributes.isEmpty()))?this.getOAAttributes():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oaAttributes", theOAAttributes), currentHashCode, theOAAttributes); - } - { - Boolean theVidpEnabled; - theVidpEnabled = this.isVidpEnabled(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "vidpEnabled", theVidpEnabled), currentHashCode, theVidpEnabled); - } - { - List theAttributeProviders; - theAttributeProviders = (((this.attributeProviders!= null)&&(!this.attributeProviders.isEmpty()))?this.getAttributeProviders():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributeProviders", theAttributeProviders), currentHashCode, theAttributeProviders); - } - { - Boolean theRequireConsent; - theRequireConsent = this.isRequireConsent(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "requireConsent", theRequireConsent), currentHashCode, theRequireConsent); - } - { - List theCPEPS; - theCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "cpeps", theCPEPS), currentHashCode, theCPEPS); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java deleted file mode 100644 index 1226afdf9..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAStorkAttribute.java +++ /dev/null @@ -1,213 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for OAStorkAttribute complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="OAStorkAttribute">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="mandatory" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "OAStorkAttribute", propOrder = { - "mandatory", - "name" -}) -@Entity(name = "OAStorkAttribute") -@Table(name = "OASTORKATTRIBUTE") -@Inheritance(strategy = InheritanceType.JOINED) -public class OAStorkAttribute - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true, type = String.class) - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean mandatory; - @XmlElement(required = true) - protected String name; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the mandatory property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "MANDATORY") - public Boolean isMandatory() { - return mandatory; - } - - /** - * Sets the value of the mandatory property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMandatory(Boolean value) { - this.mandatory = value; - } - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_", length = 255) - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OAStorkAttribute)) { - return false; - } - if (this == object) { - return true; - } - final OAStorkAttribute that = ((OAStorkAttribute) object); - { - Boolean lhsMandatory; - lhsMandatory = this.isMandatory(); - Boolean rhsMandatory; - rhsMandatory = that.isMandatory(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mandatory", lhsMandatory), LocatorUtils.property(thatLocator, "mandatory", rhsMandatory), lhsMandatory, rhsMandatory)) { - return false; - } - } - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - Boolean theMandatory; - theMandatory = this.isMandatory(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandatory", theMandatory), currentHashCode, theMandatory); - } - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java deleted file mode 100644 index b8f10ff52..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OAuth.java +++ /dev/null @@ -1,168 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@Entity(name = "OAuth") -@Table(name = "OAUTH") -@Inheritance(strategy = InheritanceType.JOINED) -public class OAuth - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "isActive") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isActive; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the isActive property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISACTIVE") - public boolean isIsActive() { - if (isActive == null) { - return new ZeroOneBooleanAdapter().unmarshal("true"); - } else { - return isActive; - } - } - - /** - * Sets the value of the isActive property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsActive(Boolean value) { - this.isActive = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OAuth)) { - return false; - } - if (this == object) { - return true; - } - final OAuth that = ((OAuth) object); - { - boolean lhsIsActive; - lhsIsActive = ((this.isActive!= null)?this.isIsActive():false); - boolean rhsIsActive; - rhsIsActive = ((that.isActive!= null)?that.isIsActive():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - boolean theIsActive; - theIsActive = ((this.isActive!= null)?this.isIsActive():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java deleted file mode 100644 index aec99bb3a..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ObjectFactory.java +++ /dev/null @@ -1,757 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import javax.xml.namespace.QName; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the at.gv.egovernment.moa.id.commons.db.dao.config package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _EnableInfoboxValidator_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "EnableInfoboxValidator"); - private final static QName _AlwaysShowForm_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AlwaysShowForm"); - private final static QName _AbstractSimpleIdentification_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AbstractSimpleIdentification"); - private final static QName _QualityAuthenticationAssuranceLevel_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "QualityAuthenticationAssuranceLevel"); - private final static QName _Attributes_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "Attributes"); - private final static QName _AttributeProviders_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AttributeProviders"); - private final static QName _OAAttributes_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "OAAttributes"); - private final static QName _AttributeValue_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "AttributeValue"); - private final static QName _CompatibilityMode_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "CompatibilityMode"); - private final static QName _TrustProfileID_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "TrustProfileID"); - private final static QName _Qaa_QNAME = new QName("http://www.buergerkarte.at/namespaces/moaconfig#", "Qaa"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.gv.egovernment.moa.id.commons.db.dao.config - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link StorkAttribute } - * - */ - public StorkAttribute createStorkAttribute() { - return new StorkAttribute(); - } - - /** - * Create an instance of {@link CPEPS } - * - */ - public CPEPS createCPEPS() { - return new CPEPS(); - } - - /** - * Create an instance of {@link OASTORK } - * - */ - public OASTORK createOASTORK() { - return new OASTORK(); - } - - /** - * Create an instance of {@link OAStorkAttribute } - * - */ - public OAStorkAttribute createOAStorkAttribute() { - return new OAStorkAttribute(); - } - - /** - * Create an instance of {@link AttributeProviderPlugin } - * - */ - public AttributeProviderPlugin createAttributeProviderPlugin() { - return new AttributeProviderPlugin(); - } - - /** - * Create an instance of {@link OAPVP2 } - * - */ - public OAPVP2 createOAPVP2() { - return new OAPVP2(); - } - - /** - * Create an instance of {@link Header } - * - */ - public Header createHeader() { - return new Header(); - } - - /** - * Create an instance of {@link Parameter } - * - */ - public Parameter createParameter() { - return new Parameter(); - } - - /** - * Create an instance of {@link EncBPKInformation } - * - */ - public EncBPKInformation createEncBPKInformation() { - return new EncBPKInformation(); - } - - /** - * Create an instance of {@link BPKDecryption } - * - */ - public BPKDecryption createBPKDecryption() { - return new BPKDecryption(); - } - - /** - * Create an instance of {@link BPKEncryption } - * - */ - public BPKEncryption createBPKEncryption() { - return new BPKEncryption(); - } - - /** - * Create an instance of {@link MOAIDConfiguration } - * - */ - public MOAIDConfiguration createMOAIDConfiguration() { - return new MOAIDConfiguration(); - } - - /** - * Create an instance of {@link AuthComponentGeneral } - * - */ - public AuthComponentGeneral createAuthComponentGeneral() { - return new AuthComponentGeneral(); - } - - /** - * Create an instance of {@link OnlineApplication } - * - */ - public OnlineApplication createOnlineApplication() { - return new OnlineApplication(); - } - - /** - * Create an instance of {@link ChainingModes } - * - */ - public ChainingModes createChainingModes() { - return new ChainingModes(); - } - - /** - * Create an instance of {@link GenericConfiguration } - * - */ - public GenericConfiguration createGenericConfiguration() { - return new GenericConfiguration(); - } - - /** - * Create an instance of {@link DefaultBKUs } - * - */ - public DefaultBKUs createDefaultBKUs() { - return new DefaultBKUs(); - } - - /** - * Create an instance of {@link SLRequestTemplates } - * - */ - public SLRequestTemplates createSLRequestTemplates() { - return new SLRequestTemplates(); - } - - /** - * Create an instance of {@link GeneralConfiguration } - * - */ - public GeneralConfiguration createGeneralConfiguration() { - return new GeneralConfiguration(); - } - - /** - * Create an instance of {@link TimeOuts } - * - */ - public TimeOuts createTimeOuts() { - return new TimeOuts(); - } - - /** - * Create an instance of {@link Contact } - * - */ - public Contact createContact() { - return new Contact(); - } - - /** - * Create an instance of {@link ParamAuth } - * - */ - public ParamAuth createParamAuth() { - return new ParamAuth(); - } - - /** - * Create an instance of {@link Configuration } - * - */ - public Configuration createConfiguration() { - return new Configuration(); - } - - /** - * Create an instance of {@link BasicAuth } - * - */ - public BasicAuth createBasicAuth() { - return new BasicAuth(); - } - - /** - * Create an instance of {@link HeaderAuth } - * - */ - public HeaderAuth createHeaderAuth() { - return new HeaderAuth(); - } - - /** - * Create an instance of {@link OAOAUTH20 } - * - */ - public OAOAUTH20 createOAOAUTH20() { - return new OAOAUTH20(); - } - - /** - * Create an instance of {@link SAMLSigningParameter } - * - */ - public SAMLSigningParameter createSAMLSigningParameter() { - return new SAMLSigningParameter(); - } - - /** - * Create an instance of {@link SignatureCreationParameterType } - * - */ - public SignatureCreationParameterType createSignatureCreationParameterType() { - return new SignatureCreationParameterType(); - } - - /** - * Create an instance of {@link SignatureVerificationParameterType } - * - */ - public SignatureVerificationParameterType createSignatureVerificationParameterType() { - return new SignatureVerificationParameterType(); - } - - /** - * Create an instance of {@link OASAML1 } - * - */ - public OASAML1 createOASAML1() { - return new OASAML1(); - } - - /** - * Create an instance of {@link IdentificationNumber } - * - */ - public IdentificationNumber createIdentificationNumber() { - return new IdentificationNumber(); - } - - /** - * Create an instance of {@link KeyStore } - * - */ - public KeyStore createKeyStore() { - return new KeyStore(); - } - - /** - * Create an instance of {@link STORK } - * - */ - public STORK createSTORK() { - return new STORK(); - } - - /** - * Create an instance of {@link KeyName } - * - */ - public KeyName createKeyName() { - return new KeyName(); - } - - /** - * Create an instance of {@link X509IssuerSerialType } - * - */ - public X509IssuerSerialType createX509IssuerSerialType() { - return new X509IssuerSerialType(); - } - - /** - * Create an instance of {@link TemplateType } - * - */ - public TemplateType createTemplateType() { - return new TemplateType(); - } - - /** - * Create an instance of {@link ConnectionParameterClientAuthType } - * - */ - public ConnectionParameterClientAuthType createConnectionParameterClientAuthType() { - return new ConnectionParameterClientAuthType(); - } - - /** - * Create an instance of {@link BKUSelectionCustomizationType } - * - */ - public BKUSelectionCustomizationType createBKUSelectionCustomizationType() { - return new BKUSelectionCustomizationType(); - } - - /** - * Create an instance of {@link PartyRepresentativeType } - * - */ - public PartyRepresentativeType createPartyRepresentativeType() { - return new PartyRepresentativeType(); - } - - /** - * Create an instance of {@link AuthComponentType } - * - */ - public AuthComponentType createAuthComponentType() { - return new AuthComponentType(); - } - - /** - * Create an instance of {@link TemplatesType } - * - */ - public TemplatesType createTemplatesType() { - return new TemplatesType(); - } - - /** - * Create an instance of {@link OnlineApplicationType } - * - */ - public OnlineApplicationType createOnlineApplicationType() { - return new OnlineApplicationType(); - } - - /** - * Create an instance of {@link TransformsInfoType } - * - */ - public TransformsInfoType createTransformsInfoType() { - return new TransformsInfoType(); - } - - /** - * Create an instance of {@link InterfederationIDPType } - * - */ - public InterfederationIDPType createInterfederationIDPType() { - return new InterfederationIDPType(); - } - - /** - * Create an instance of {@link VerifyInfoboxesType } - * - */ - public VerifyInfoboxesType createVerifyInfoboxesType() { - return new VerifyInfoboxesType(); - } - - /** - * Create an instance of {@link AbstractSimpleIdentificationType } - * - */ - public AbstractSimpleIdentificationType createAbstractSimpleIdentificationType() { - return new AbstractSimpleIdentificationType(); - } - - /** - * Create an instance of {@link SchemaLocationType } - * - */ - public SchemaLocationType createSchemaLocationType() { - return new SchemaLocationType(); - } - - /** - * Create an instance of {@link ConnectionParameterServerAuthType } - * - */ - public ConnectionParameterServerAuthType createConnectionParameterServerAuthType() { - return new ConnectionParameterServerAuthType(); - } - - /** - * Create an instance of {@link PartyRepresentationType } - * - */ - public PartyRepresentationType createPartyRepresentationType() { - return new PartyRepresentationType(); - } - - /** - * Create an instance of {@link UserDatabase } - * - */ - public UserDatabase createUserDatabase() { - return new UserDatabase(); - } - - /** - * Create an instance of {@link InputProcessorType } - * - */ - public InputProcessorType createInputProcessorType() { - return new InputProcessorType(); - } - - /** - * Create an instance of {@link InterfederationGatewayType } - * - */ - public InterfederationGatewayType createInterfederationGatewayType() { - return new InterfederationGatewayType(); - } - - /** - * Create an instance of {@link Schema } - * - */ - public Schema createSchema() { - return new Schema(); - } - - /** - * Create an instance of {@link DefaultTrustProfile } - * - */ - public DefaultTrustProfile createDefaultTrustProfile() { - return new DefaultTrustProfile(); - } - - /** - * Create an instance of {@link AuthComponentOA } - * - */ - public AuthComponentOA createAuthComponentOA() { - return new AuthComponentOA(); - } - - /** - * Create an instance of {@link BKUURLS } - * - */ - public BKUURLS createBKUURLS() { - return new BKUURLS(); - } - - /** - * Create an instance of {@link Mandates } - * - */ - public Mandates createMandates() { - return new Mandates(); - } - - /** - * Create an instance of {@link TestCredentials } - * - */ - public TestCredentials createTestCredentials() { - return new TestCredentials(); - } - - /** - * Create an instance of {@link OASSO } - * - */ - public OASSO createOASSO() { - return new OASSO(); - } - - /** - * Create an instance of {@link Protocols } - * - */ - public Protocols createProtocols() { - return new Protocols(); - } - - /** - * Create an instance of {@link SSO } - * - */ - public SSO createSSO() { - return new SSO(); - } - - /** - * Create an instance of {@link SecurityLayer } - * - */ - public SecurityLayer createSecurityLayer() { - return new SecurityLayer(); - } - - /** - * Create an instance of {@link MOASP } - * - */ - public MOASP createMOASP() { - return new MOASP(); - } - - /** - * Create an instance of {@link IdentityLinkSigners } - * - */ - public IdentityLinkSigners createIdentityLinkSigners() { - return new IdentityLinkSigners(); - } - - /** - * Create an instance of {@link ForeignIdentities } - * - */ - public ForeignIdentities createForeignIdentities() { - return new ForeignIdentities(); - } - - /** - * Create an instance of {@link OnlineMandates } - * - */ - public OnlineMandates createOnlineMandates() { - return new OnlineMandates(); - } - - /** - * Create an instance of {@link VerifyIdentityLink } - * - */ - public VerifyIdentityLink createVerifyIdentityLink() { - return new VerifyIdentityLink(); - } - - /** - * Create an instance of {@link VerifyAuthBlock } - * - */ - public VerifyAuthBlock createVerifyAuthBlock() { - return new VerifyAuthBlock(); - } - - /** - * Create an instance of {@link SAML1 } - * - */ - public SAML1 createSAML1() { - return new SAML1(); - } - - /** - * Create an instance of {@link PVP2 } - * - */ - public PVP2 createPVP2() { - return new PVP2(); - } - - /** - * Create an instance of {@link OAuth } - * - */ - public OAuth createOAuth() { - return new OAuth(); - } - - /** - * Create an instance of {@link LegacyAllowed } - * - */ - public LegacyAllowed createLegacyAllowed() { - return new LegacyAllowed(); - } - - /** - * Create an instance of {@link Organization } - * - */ - public Organization createOrganization() { - return new Organization(); - } - - /** - * Create an instance of {@link ClientKeyStore } - * - */ - public ClientKeyStore createClientKeyStore() { - return new ClientKeyStore(); - } - - /** - * Create an instance of {@link TrustAnchor } - * - */ - public TrustAnchor createTrustAnchor() { - return new TrustAnchor(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "EnableInfoboxValidator", defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - public JAXBElement createEnableInfoboxValidator(Boolean value) { - return new JAXBElement(_EnableInfoboxValidator_QNAME, Boolean.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AlwaysShowForm", defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - public JAXBElement createAlwaysShowForm(Boolean value) { - return new JAXBElement(_AlwaysShowForm_QNAME, Boolean.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link AttributeProviderPlugin }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AbstractSimpleIdentification") - public JAXBElement createAbstractSimpleIdentification(AttributeProviderPlugin value) { - return new JAXBElement(_AbstractSimpleIdentification_QNAME, AttributeProviderPlugin.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "QualityAuthenticationAssuranceLevel") - public JAXBElement createQualityAuthenticationAssuranceLevel(Integer value) { - return new JAXBElement(_QualityAuthenticationAssuranceLevel_QNAME, Integer.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link StorkAttribute }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "Attributes") - public JAXBElement createAttributes(StorkAttribute value) { - return new JAXBElement(_Attributes_QNAME, StorkAttribute.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link AttributeProviderPlugin }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AttributeProviders") - public JAXBElement createAttributeProviders(AttributeProviderPlugin value) { - return new JAXBElement(_AttributeProviders_QNAME, AttributeProviderPlugin.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link OAStorkAttribute }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "OAAttributes") - public JAXBElement createOAAttributes(OAStorkAttribute value) { - return new JAXBElement(_OAAttributes_QNAME, OAStorkAttribute.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "AttributeValue") - public JAXBElement createAttributeValue(Object value) { - return new JAXBElement(_AttributeValue_QNAME, Object.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "CompatibilityMode", defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - public JAXBElement createCompatibilityMode(Boolean value) { - return new JAXBElement(_CompatibilityMode_QNAME, Boolean.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "TrustProfileID") - public JAXBElement createTrustProfileID(String value) { - return new JAXBElement(_TrustProfileID_QNAME, String.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", name = "Qaa") - public JAXBElement createQaa(Integer value) { - return new JAXBElement(_Qaa_QNAME, Integer.class, null, value); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java deleted file mode 100644 index b71428782..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplication.java +++ /dev/null @@ -1,509 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for OnlineApplication complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="OnlineApplication">
- *   <complexContent>
- *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}OnlineApplicationType">
- *       <attribute name="publicURLPrefix" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       <attribute name="keyBoxIdentifier" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAKeyBoxSelector" default="SecureSignatureKeypair" />
- *       <attribute name="type" default="publicService">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
- *             <enumeration value="businessService"/>
- *             <enumeration value="publicService"/>
- *             <enumeration value="storkService"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="calculateHPI" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *       <attribute name="friendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="target" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="targetFriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="storkSPTargetCountry" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="removeBPKFromAuthBlock" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "OnlineApplication") -@Entity(name = "OnlineApplication") -@Table(name = "ONLINEAPPLICATION") -public class OnlineApplication - extends OnlineApplicationType - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "publicURLPrefix", required = true) - @XmlSchemaType(name = "anyURI") - protected String publicURLPrefix; - @XmlAttribute(name = "keyBoxIdentifier") - protected MOAKeyBoxSelector keyBoxIdentifier; - @XmlAttribute(name = "type") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - protected String type; - @XmlAttribute(name = "calculateHPI") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean calculateHPI; - @XmlAttribute(name = "friendlyName") - protected String friendlyName; - @XmlAttribute(name = "target") - protected String target; - @XmlAttribute(name = "targetFriendlyName") - protected String targetFriendlyName; - @XmlAttribute(name = "storkSPTargetCountry") - protected String storkSPTargetCountry; - @XmlAttribute(name = "removeBPKFromAuthBlock") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean removeBPKFromAuthBlock; - - /** - * Gets the value of the publicURLPrefix property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PUBLICURLPREFIX") - public String getPublicURLPrefix() { - return publicURLPrefix; - } - - /** - * Sets the value of the publicURLPrefix property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPublicURLPrefix(String value) { - this.publicURLPrefix = value; - } - - /** - * Gets the value of the keyBoxIdentifier property. - * - * @return - * possible object is - * {@link MOAKeyBoxSelector } - * - */ - @Basic - @Column(name = "KEYBOXIDENTIFIER", length = 255) - @Enumerated(EnumType.STRING) - public MOAKeyBoxSelector getKeyBoxIdentifier() { - if (keyBoxIdentifier == null) { - return MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR; - } else { - return keyBoxIdentifier; - } - } - - /** - * Sets the value of the keyBoxIdentifier property. - * - * @param value - * allowed object is - * {@link MOAKeyBoxSelector } - * - */ - public void setKeyBoxIdentifier(MOAKeyBoxSelector value) { - this.keyBoxIdentifier = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TYPE_") - public String getType() { - if (type == null) { - return "publicService"; - } else { - return type; - } - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the calculateHPI property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "CALCULATEHPI") - public boolean isCalculateHPI() { - if (calculateHPI == null) { - return new ZeroOneBooleanAdapter().unmarshal("false"); - } else { - return calculateHPI; - } - } - - /** - * Sets the value of the calculateHPI property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCalculateHPI(Boolean value) { - this.calculateHPI = value; - } - - /** - * Gets the value of the friendlyName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FRIENDLYNAME", length = 255) - public String getFriendlyName() { - return friendlyName; - } - - /** - * Sets the value of the friendlyName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFriendlyName(String value) { - this.friendlyName = value; - } - - /** - * Gets the value of the target property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TARGET", length = 255) - public String getTarget() { - return target; - } - - /** - * Sets the value of the target property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTarget(String value) { - this.target = value; - } - - /** - * Gets the value of the targetFriendlyName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TARGETFRIENDLYNAME", length = 255) - public String getTargetFriendlyName() { - return targetFriendlyName; - } - - /** - * Sets the value of the targetFriendlyName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTargetFriendlyName(String value) { - this.targetFriendlyName = value; - } - - /** - * Gets the value of the storkSPTargetCountry property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "STORKSPTARGETCOUNTRY", length = 255) - public String getStorkSPTargetCountry() { - return storkSPTargetCountry; - } - - /** - * Sets the value of the storkSPTargetCountry property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setStorkSPTargetCountry(String value) { - this.storkSPTargetCountry = value; - } - - /** - * Gets the value of the removeBPKFromAuthBlock property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "REMOVEBPKFROMAUTHBLOCK") - public boolean isRemoveBPKFromAuthBlock() { - if (removeBPKFromAuthBlock == null) { - return new ZeroOneBooleanAdapter().unmarshal("false"); - } else { - return removeBPKFromAuthBlock; - } - } - - /** - * Sets the value of the removeBPKFromAuthBlock property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRemoveBPKFromAuthBlock(Boolean value) { - this.removeBPKFromAuthBlock = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OnlineApplication)) { - return false; - } - if (this == object) { - return true; - } - if (!super.equals(thisLocator, thatLocator, object, strategy)) { - return false; - } - final OnlineApplication that = ((OnlineApplication) object); - { - String lhsPublicURLPrefix; - lhsPublicURLPrefix = this.getPublicURLPrefix(); - String rhsPublicURLPrefix; - rhsPublicURLPrefix = that.getPublicURLPrefix(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURLPrefix", lhsPublicURLPrefix), LocatorUtils.property(thatLocator, "publicURLPrefix", rhsPublicURLPrefix), lhsPublicURLPrefix, rhsPublicURLPrefix)) { - return false; - } - } - { - MOAKeyBoxSelector lhsKeyBoxIdentifier; - lhsKeyBoxIdentifier = this.getKeyBoxIdentifier(); - MOAKeyBoxSelector rhsKeyBoxIdentifier; - rhsKeyBoxIdentifier = that.getKeyBoxIdentifier(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "keyBoxIdentifier", lhsKeyBoxIdentifier), LocatorUtils.property(thatLocator, "keyBoxIdentifier", rhsKeyBoxIdentifier), lhsKeyBoxIdentifier, rhsKeyBoxIdentifier)) { - return false; - } - } - { - String lhsType; - lhsType = this.getType(); - String rhsType; - rhsType = that.getType(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType)) { - return false; - } - } - { - boolean lhsCalculateHPI; - lhsCalculateHPI = ((this.calculateHPI!= null)?this.isCalculateHPI():false); - boolean rhsCalculateHPI; - rhsCalculateHPI = ((that.calculateHPI!= null)?that.isCalculateHPI():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "calculateHPI", lhsCalculateHPI), LocatorUtils.property(thatLocator, "calculateHPI", rhsCalculateHPI), lhsCalculateHPI, rhsCalculateHPI)) { - return false; - } - } - { - String lhsFriendlyName; - lhsFriendlyName = this.getFriendlyName(); - String rhsFriendlyName; - rhsFriendlyName = that.getFriendlyName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "friendlyName", lhsFriendlyName), LocatorUtils.property(thatLocator, "friendlyName", rhsFriendlyName), lhsFriendlyName, rhsFriendlyName)) { - return false; - } - } - { - String lhsTarget; - lhsTarget = this.getTarget(); - String rhsTarget; - rhsTarget = that.getTarget(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { - return false; - } - } - { - String lhsTargetFriendlyName; - lhsTargetFriendlyName = this.getTargetFriendlyName(); - String rhsTargetFriendlyName; - rhsTargetFriendlyName = that.getTargetFriendlyName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "targetFriendlyName", lhsTargetFriendlyName), LocatorUtils.property(thatLocator, "targetFriendlyName", rhsTargetFriendlyName), lhsTargetFriendlyName, rhsTargetFriendlyName)) { - return false; - } - } - { - String lhsStorkSPTargetCountry; - lhsStorkSPTargetCountry = this.getStorkSPTargetCountry(); - String rhsStorkSPTargetCountry; - rhsStorkSPTargetCountry = that.getStorkSPTargetCountry(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "storkSPTargetCountry", lhsStorkSPTargetCountry), LocatorUtils.property(thatLocator, "storkSPTargetCountry", rhsStorkSPTargetCountry), lhsStorkSPTargetCountry, rhsStorkSPTargetCountry)) { - return false; - } - } - { - boolean lhsRemoveBPKFromAuthBlock; - lhsRemoveBPKFromAuthBlock = ((this.removeBPKFromAuthBlock!= null)?this.isRemoveBPKFromAuthBlock():false); - boolean rhsRemoveBPKFromAuthBlock; - rhsRemoveBPKFromAuthBlock = ((that.removeBPKFromAuthBlock!= null)?that.isRemoveBPKFromAuthBlock():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "removeBPKFromAuthBlock", lhsRemoveBPKFromAuthBlock), LocatorUtils.property(thatLocator, "removeBPKFromAuthBlock", rhsRemoveBPKFromAuthBlock), lhsRemoveBPKFromAuthBlock, rhsRemoveBPKFromAuthBlock)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = super.hashCode(locator, strategy); - { - String thePublicURLPrefix; - thePublicURLPrefix = this.getPublicURLPrefix(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURLPrefix", thePublicURLPrefix), currentHashCode, thePublicURLPrefix); - } - { - MOAKeyBoxSelector theKeyBoxIdentifier; - theKeyBoxIdentifier = this.getKeyBoxIdentifier(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyBoxIdentifier", theKeyBoxIdentifier), currentHashCode, theKeyBoxIdentifier); - } - { - String theType; - theType = this.getType(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "type", theType), currentHashCode, theType); - } - { - boolean theCalculateHPI; - theCalculateHPI = ((this.calculateHPI!= null)?this.isCalculateHPI():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "calculateHPI", theCalculateHPI), currentHashCode, theCalculateHPI); - } - { - String theFriendlyName; - theFriendlyName = this.getFriendlyName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "friendlyName", theFriendlyName), currentHashCode, theFriendlyName); - } - { - String theTarget; - theTarget = this.getTarget(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); - } - { - String theTargetFriendlyName; - theTargetFriendlyName = this.getTargetFriendlyName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "targetFriendlyName", theTargetFriendlyName), currentHashCode, theTargetFriendlyName); - } - { - String theStorkSPTargetCountry; - theStorkSPTargetCountry = this.getStorkSPTargetCountry(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "storkSPTargetCountry", theStorkSPTargetCountry), currentHashCode, theStorkSPTargetCountry); - } - { - boolean theRemoveBPKFromAuthBlock; - theRemoveBPKFromAuthBlock = ((this.removeBPKFromAuthBlock!= null)?this.isRemoveBPKFromAuthBlock():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "removeBPKFromAuthBlock", theRemoveBPKFromAuthBlock), currentHashCode, theRemoveBPKFromAuthBlock); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java deleted file mode 100644 index 413d790e5..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineApplicationType.java +++ /dev/null @@ -1,565 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for OnlineApplicationType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="OnlineApplicationType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="isNew" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="isAdminRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="isInterfederationIDP" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="InterfederationIDP" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InterfederationIDPType" minOccurs="0"/>
- *         <element name="isInterfederationGateway" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="InterfederationGateway" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InterfederationGatewayType" minOccurs="0"/>
- *         <element name="AuthComponent_OA" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="BKUURLS">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                             <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                             <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber" minOccurs="0"/>
- *                   <element name="Templates" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TemplatesType" minOccurs="0"/>
- *                   <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded" minOccurs="0"/>
- *                   <element name="Mandates" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Profiles" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                             <element name="ProfileName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element name="testCredentials" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="credentialOID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                           </sequence>
- *                           <attribute name="enableTestCredentials" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_STORK" minOccurs="0"/>
- *                   <element name="OA_SSO" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="UseSSO" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *                             <element name="AuthDataFrame" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *                             <element name="SingleLogOutURL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_SAML1" minOccurs="0"/>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_PVP2" minOccurs="0"/>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}OA_OAUTH20" minOccurs="0"/>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}EncBPKInformation" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "OnlineApplicationType", propOrder = { - "isNew", - "isActive", - "isAdminRequired", - "isInterfederationIDP", - "interfederationIDP", - "isInterfederationGateway", - "interfederationGateway", - "authComponentOA" -}) -@XmlSeeAlso({ - OnlineApplication.class -}) -@Entity(name = "OnlineApplicationType") -@Table(name = "ONLINEAPPLICATIONTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class OnlineApplicationType - implements Serializable, Equals, HashCode -{ - - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isNew; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isActive; - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isAdminRequired; - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isInterfederationIDP; - @XmlElement(name = "InterfederationIDP") - protected InterfederationIDPType interfederationIDP; - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isInterfederationGateway; - @XmlElement(name = "InterfederationGateway") - protected InterfederationGatewayType interfederationGateway; - @XmlElement(name = "AuthComponent_OA") - protected AuthComponentOA authComponentOA; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the isNew property. - * - * @return - * possible object is - * {@link String } - * - */ - @Transient - public Boolean isIsNew() { - return isNew; - } - - /** - * Sets the value of the isNew property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsNew(Boolean value) { - this.isNew = value; - } - - /** - * Gets the value of the isActive property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISACTIVE") - public Boolean isIsActive() { - return isActive; - } - - /** - * Sets the value of the isActive property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsActive(Boolean value) { - this.isActive = value; - } - - /** - * Gets the value of the isAdminRequired property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISADMINREQUIRED") - public Boolean isIsAdminRequired() { - return isAdminRequired; - } - - /** - * Sets the value of the isAdminRequired property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsAdminRequired(Boolean value) { - this.isAdminRequired = value; - } - - /** - * Gets the value of the isInterfederationIDP property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISINTERFEDERATIONIDP") - public Boolean isIsInterfederationIDP() { - return isInterfederationIDP; - } - - /** - * Sets the value of the isInterfederationIDP property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsInterfederationIDP(Boolean value) { - this.isInterfederationIDP = value; - } - - /** - * Gets the value of the interfederationIDP property. - * - * @return - * possible object is - * {@link InterfederationIDPType } - * - */ - @ManyToOne(targetEntity = InterfederationIDPType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "INTERFEDERATIONIDP_ONLINEAPP_0") - public InterfederationIDPType getInterfederationIDP() { - return interfederationIDP; - } - - /** - * Sets the value of the interfederationIDP property. - * - * @param value - * allowed object is - * {@link InterfederationIDPType } - * - */ - public void setInterfederationIDP(InterfederationIDPType value) { - this.interfederationIDP = value; - } - - /** - * Gets the value of the isInterfederationGateway property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISINTERFEDERATIONGATEWAY") - public Boolean isIsInterfederationGateway() { - return isInterfederationGateway; - } - - /** - * Sets the value of the isInterfederationGateway property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsInterfederationGateway(Boolean value) { - this.isInterfederationGateway = value; - } - - /** - * Gets the value of the interfederationGateway property. - * - * @return - * possible object is - * {@link InterfederationGatewayType } - * - */ - @ManyToOne(targetEntity = InterfederationGatewayType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "INTERFEDERATIONGATEWAY_ONLIN_0") - public InterfederationGatewayType getInterfederationGateway() { - return interfederationGateway; - } - - /** - * Sets the value of the interfederationGateway property. - * - * @param value - * allowed object is - * {@link InterfederationGatewayType } - * - */ - public void setInterfederationGateway(InterfederationGatewayType value) { - this.interfederationGateway = value; - } - - /** - * Gets the value of the authComponentOA property. - * - * @return - * possible object is - * {@link AuthComponentOA } - * - */ - @ManyToOne(targetEntity = AuthComponentOA.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "AUTHCOMPONENTOA_ONLINEAPPLIC_0") - public AuthComponentOA getAuthComponentOA() { - return authComponentOA; - } - - /** - * Sets the value of the authComponentOA property. - * - * @param value - * allowed object is - * {@link AuthComponentOA } - * - */ - public void setAuthComponentOA(AuthComponentOA value) { - this.authComponentOA = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OnlineApplicationType)) { - return false; - } - if (this == object) { - return true; - } - final OnlineApplicationType that = ((OnlineApplicationType) object); - { - Boolean lhsIsNew; - lhsIsNew = this.isIsNew(); - Boolean rhsIsNew; - rhsIsNew = that.isIsNew(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isNew", lhsIsNew), LocatorUtils.property(thatLocator, "isNew", rhsIsNew), lhsIsNew, rhsIsNew)) { - return false; - } - } - { - Boolean lhsIsActive; - lhsIsActive = this.isIsActive(); - Boolean rhsIsActive; - rhsIsActive = that.isIsActive(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { - return false; - } - } - { - Boolean lhsIsAdminRequired; - lhsIsAdminRequired = this.isIsAdminRequired(); - Boolean rhsIsAdminRequired; - rhsIsAdminRequired = that.isIsAdminRequired(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isAdminRequired", lhsIsAdminRequired), LocatorUtils.property(thatLocator, "isAdminRequired", rhsIsAdminRequired), lhsIsAdminRequired, rhsIsAdminRequired)) { - return false; - } - } - { - Boolean lhsIsInterfederationIDP; - lhsIsInterfederationIDP = this.isIsInterfederationIDP(); - Boolean rhsIsInterfederationIDP; - rhsIsInterfederationIDP = that.isIsInterfederationIDP(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isInterfederationIDP", lhsIsInterfederationIDP), LocatorUtils.property(thatLocator, "isInterfederationIDP", rhsIsInterfederationIDP), lhsIsInterfederationIDP, rhsIsInterfederationIDP)) { - return false; - } - } - { - InterfederationIDPType lhsInterfederationIDP; - lhsInterfederationIDP = this.getInterfederationIDP(); - InterfederationIDPType rhsInterfederationIDP; - rhsInterfederationIDP = that.getInterfederationIDP(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "interfederationIDP", lhsInterfederationIDP), LocatorUtils.property(thatLocator, "interfederationIDP", rhsInterfederationIDP), lhsInterfederationIDP, rhsInterfederationIDP)) { - return false; - } - } - { - Boolean lhsIsInterfederationGateway; - lhsIsInterfederationGateway = this.isIsInterfederationGateway(); - Boolean rhsIsInterfederationGateway; - rhsIsInterfederationGateway = that.isIsInterfederationGateway(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isInterfederationGateway", lhsIsInterfederationGateway), LocatorUtils.property(thatLocator, "isInterfederationGateway", rhsIsInterfederationGateway), lhsIsInterfederationGateway, rhsIsInterfederationGateway)) { - return false; - } - } - { - InterfederationGatewayType lhsInterfederationGateway; - lhsInterfederationGateway = this.getInterfederationGateway(); - InterfederationGatewayType rhsInterfederationGateway; - rhsInterfederationGateway = that.getInterfederationGateway(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "interfederationGateway", lhsInterfederationGateway), LocatorUtils.property(thatLocator, "interfederationGateway", rhsInterfederationGateway), lhsInterfederationGateway, rhsInterfederationGateway)) { - return false; - } - } - { - AuthComponentOA lhsAuthComponentOA; - lhsAuthComponentOA = this.getAuthComponentOA(); - AuthComponentOA rhsAuthComponentOA; - rhsAuthComponentOA = that.getAuthComponentOA(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "authComponentOA", lhsAuthComponentOA), LocatorUtils.property(thatLocator, "authComponentOA", rhsAuthComponentOA), lhsAuthComponentOA, rhsAuthComponentOA)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - Boolean theIsNew; - theIsNew = this.isIsNew(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isNew", theIsNew), currentHashCode, theIsNew); - } - { - Boolean theIsActive; - theIsActive = this.isIsActive(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); - } - { - Boolean theIsAdminRequired; - theIsAdminRequired = this.isIsAdminRequired(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAdminRequired", theIsAdminRequired), currentHashCode, theIsAdminRequired); - } - { - Boolean theIsInterfederationIDP; - theIsInterfederationIDP = this.isIsInterfederationIDP(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isInterfederationIDP", theIsInterfederationIDP), currentHashCode, theIsInterfederationIDP); - } - { - InterfederationIDPType theInterfederationIDP; - theInterfederationIDP = this.getInterfederationIDP(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "interfederationIDP", theInterfederationIDP), currentHashCode, theInterfederationIDP); - } - { - Boolean theIsInterfederationGateway; - theIsInterfederationGateway = this.isIsInterfederationGateway(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isInterfederationGateway", theIsInterfederationGateway), currentHashCode, theIsInterfederationGateway); - } - { - InterfederationGatewayType theInterfederationGateway; - theInterfederationGateway = this.getInterfederationGateway(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "interfederationGateway", theInterfederationGateway), currentHashCode, theInterfederationGateway); - } - { - AuthComponentOA theAuthComponentOA; - theAuthComponentOA = this.getAuthComponentOA(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "authComponentOA", theAuthComponentOA), currentHashCode, theAuthComponentOA); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java deleted file mode 100644 index 18b400d73..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/OnlineMandates.java +++ /dev/null @@ -1,168 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "connectionParameter" -}) -@Entity(name = "OnlineMandates") -@Table(name = "ONLINEMANDATES") -@Inheritance(strategy = InheritanceType.JOINED) -public class OnlineMandates - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "ConnectionParameter", required = true) - protected ConnectionParameterClientAuthType connectionParameter; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the connectionParameter property. - * - * @return - * possible object is - * {@link ConnectionParameterClientAuthType } - * - */ - @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CONNECTIONPARAMETER_ONLINEMA_0") - public ConnectionParameterClientAuthType getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the value of the connectionParameter property. - * - * @param value - * allowed object is - * {@link ConnectionParameterClientAuthType } - * - */ - public void setConnectionParameter(ConnectionParameterClientAuthType value) { - this.connectionParameter = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof OnlineMandates)) { - return false; - } - if (this == object) { - return true; - } - final OnlineMandates that = ((OnlineMandates) object); - { - ConnectionParameterClientAuthType lhsConnectionParameter; - lhsConnectionParameter = this.getConnectionParameter(); - ConnectionParameterClientAuthType rhsConnectionParameter; - rhsConnectionParameter = that.getConnectionParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - ConnectionParameterClientAuthType theConnectionParameter; - theConnectionParameter = this.getConnectionParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java deleted file mode 100644 index fe2ff6933..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Organization.java +++ /dev/null @@ -1,254 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "name", - "displayName", - "url" -}) -@Entity(name = "Organization") -@Table(name = "ORGANIZATION") -@Inheritance(strategy = InheritanceType.JOINED) -public class Organization - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Name", required = true) - protected String name; - @XmlElement(name = "DisplayName", required = true) - protected String displayName; - @XmlElement(name = "URL", required = true) - @XmlSchemaType(name = "anyURI") - protected String url; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_", length = 255) - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the displayName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "DISPLAYNAME", length = 255) - public String getDisplayName() { - return displayName; - } - - /** - * Sets the value of the displayName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDisplayName(String value) { - this.displayName = value; - } - - /** - * Gets the value of the url property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "URL") - public String getURL() { - return url; - } - - /** - * Sets the value of the url property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setURL(String value) { - this.url = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Organization)) { - return false; - } - if (this == object) { - return true; - } - final Organization that = ((Organization) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - { - String lhsDisplayName; - lhsDisplayName = this.getDisplayName(); - String rhsDisplayName; - rhsDisplayName = that.getDisplayName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "displayName", lhsDisplayName), LocatorUtils.property(thatLocator, "displayName", rhsDisplayName), lhsDisplayName, rhsDisplayName)) { - return false; - } - } - { - String lhsURL; - lhsURL = this.getURL(); - String rhsURL; - rhsURL = that.getURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - { - String theDisplayName; - theDisplayName = this.getDisplayName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "displayName", theDisplayName), currentHashCode, theDisplayName); - } - { - String theURL; - theURL = this.getURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java deleted file mode 100644 index 2cd4bdd0d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PVP2.java +++ /dev/null @@ -1,385 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="PublicURLPrefix" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="IssuerName" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="Organization">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Contact" maxOccurs="unbounded"/>
- *       </sequence>
- *       <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "publicURLPrefix", - "issuerName", - "organization", - "contact" -}) -@Entity(name = "PVP2") -@Table(name = "PVP2") -@Inheritance(strategy = InheritanceType.JOINED) -public class PVP2 - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "PublicURLPrefix", required = true) - @XmlSchemaType(name = "anyURI") - protected String publicURLPrefix; - @XmlElement(name = "IssuerName", required = true) - @XmlSchemaType(name = "anyURI") - protected String issuerName; - @XmlElement(name = "Organization", required = true) - protected Organization organization; - @XmlElement(name = "Contact", required = true) - protected List contact; - @XmlAttribute(name = "isActive") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isActive; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the publicURLPrefix property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PUBLICURLPREFIX") - public String getPublicURLPrefix() { - return publicURLPrefix; - } - - /** - * Sets the value of the publicURLPrefix property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPublicURLPrefix(String value) { - this.publicURLPrefix = value; - } - - /** - * Gets the value of the issuerName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISSUERNAME") - public String getIssuerName() { - return issuerName; - } - - /** - * Sets the value of the issuerName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIssuerName(String value) { - this.issuerName = value; - } - - /** - * Gets the value of the organization property. - * - * @return - * possible object is - * {@link Organization } - * - */ - @ManyToOne(targetEntity = Organization.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ORGANIZATION_PVP2_HJID") - public Organization getOrganization() { - return organization; - } - - /** - * Sets the value of the organization property. - * - * @param value - * allowed object is - * {@link Organization } - * - */ - public void setOrganization(Organization value) { - this.organization = value; - } - - /** - * Gets the value of the contact property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the contact property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getContact().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Contact } - * - * - */ - @OneToMany(targetEntity = Contact.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CONTACT_PVP2_HJID") - public List getContact() { - if (contact == null) { - contact = new ArrayList(); - } - return this.contact; - } - - /** - * - * - */ - public void setContact(List contact) { - this.contact = contact; - } - - /** - * Gets the value of the isActive property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISACTIVE") - public boolean isIsActive() { - if (isActive == null) { - return new ZeroOneBooleanAdapter().unmarshal("true"); - } else { - return isActive; - } - } - - /** - * Sets the value of the isActive property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsActive(Boolean value) { - this.isActive = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof PVP2)) { - return false; - } - if (this == object) { - return true; - } - final PVP2 that = ((PVP2) object); - { - String lhsPublicURLPrefix; - lhsPublicURLPrefix = this.getPublicURLPrefix(); - String rhsPublicURLPrefix; - rhsPublicURLPrefix = that.getPublicURLPrefix(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURLPrefix", lhsPublicURLPrefix), LocatorUtils.property(thatLocator, "publicURLPrefix", rhsPublicURLPrefix), lhsPublicURLPrefix, rhsPublicURLPrefix)) { - return false; - } - } - { - String lhsIssuerName; - lhsIssuerName = this.getIssuerName(); - String rhsIssuerName; - rhsIssuerName = that.getIssuerName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "issuerName", lhsIssuerName), LocatorUtils.property(thatLocator, "issuerName", rhsIssuerName), lhsIssuerName, rhsIssuerName)) { - return false; - } - } - { - Organization lhsOrganization; - lhsOrganization = this.getOrganization(); - Organization rhsOrganization; - rhsOrganization = that.getOrganization(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "organization", lhsOrganization), LocatorUtils.property(thatLocator, "organization", rhsOrganization), lhsOrganization, rhsOrganization)) { - return false; - } - } - { - List lhsContact; - lhsContact = (((this.contact!= null)&&(!this.contact.isEmpty()))?this.getContact():null); - List rhsContact; - rhsContact = (((that.contact!= null)&&(!that.contact.isEmpty()))?that.getContact():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "contact", lhsContact), LocatorUtils.property(thatLocator, "contact", rhsContact), lhsContact, rhsContact)) { - return false; - } - } - { - boolean lhsIsActive; - lhsIsActive = ((this.isActive!= null)?this.isIsActive():false); - boolean rhsIsActive; - rhsIsActive = ((that.isActive!= null)?that.isIsActive():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String thePublicURLPrefix; - thePublicURLPrefix = this.getPublicURLPrefix(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURLPrefix", thePublicURLPrefix), currentHashCode, thePublicURLPrefix); - } - { - String theIssuerName; - theIssuerName = this.getIssuerName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "issuerName", theIssuerName), currentHashCode, theIssuerName); - } - { - Organization theOrganization; - theOrganization = this.getOrganization(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "organization", theOrganization), currentHashCode, theOrganization); - } - { - List theContact; - theContact = (((this.contact!= null)&&(!this.contact.isEmpty()))?this.getContact():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "contact", theContact), currentHashCode, theContact); - } - { - boolean theIsActive; - theIsActive = ((this.isActive!= null)?this.isIsActive():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java deleted file mode 100644 index 19504c804..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ParamAuth.java +++ /dev/null @@ -1,185 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Parameter" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "parameter" -}) -@XmlRootElement(name = "ParamAuth") -@Entity(name = "ParamAuth") -@Table(name = "PARAMAUTH") -@Inheritance(strategy = InheritanceType.JOINED) -public class ParamAuth - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Parameter", required = true) - protected List parameter; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the parameter property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the parameter property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getParameter().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Parameter } - * - * - */ - @OneToMany(targetEntity = Parameter.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PARAMETER__PARAMAUTH_HJID") - public List getParameter() { - if (parameter == null) { - parameter = new ArrayList(); - } - return this.parameter; - } - - /** - * - * - */ - public void setParameter(List parameter) { - this.parameter = parameter; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof ParamAuth)) { - return false; - } - if (this == object) { - return true; - } - final ParamAuth that = ((ParamAuth) object); - { - List lhsParameter; - lhsParameter = (((this.parameter!= null)&&(!this.parameter.isEmpty()))?this.getParameter():null); - List rhsParameter; - rhsParameter = (((that.parameter!= null)&&(!that.parameter.isEmpty()))?that.getParameter():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "parameter", lhsParameter), LocatorUtils.property(thatLocator, "parameter", rhsParameter), lhsParameter, rhsParameter)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theParameter; - theParameter = (((this.parameter!= null)&&(!this.parameter.isEmpty()))?this.getParameter():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "parameter", theParameter), currentHashCode, theParameter); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java deleted file mode 100644 index b4231d975..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Parameter.java +++ /dev/null @@ -1,212 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}token" />
- *       <attribute name="Value" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}MOAAuthDataType" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@XmlRootElement(name = "Parameter") -@Entity(name = "Parameter") -@Table(name = "PARAMETER_") -@Inheritance(strategy = InheritanceType.JOINED) -public class Parameter - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "Name", required = true) - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlSchemaType(name = "token") - protected String name; - @XmlAttribute(name = "Value", required = true) - protected MOAAuthDataType value; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_", length = 255) - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * {@link MOAAuthDataType } - * - */ - @Basic - @Column(name = "VALUE_", length = 255) - @Enumerated(EnumType.STRING) - public MOAAuthDataType getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * {@link MOAAuthDataType } - * - */ - public void setValue(MOAAuthDataType value) { - this.value = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Parameter)) { - return false; - } - if (this == object) { - return true; - } - final Parameter that = ((Parameter) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - { - MOAAuthDataType lhsValue; - lhsValue = this.getValue(); - MOAAuthDataType rhsValue; - rhsValue = that.getValue(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "value", lhsValue), LocatorUtils.property(thatLocator, "value", rhsValue), lhsValue, rhsValue)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - { - MOAAuthDataType theValue; - theValue = this.getValue(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "value", theValue), currentHashCode, theValue); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java deleted file mode 100644 index 8ce43675a..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentationType.java +++ /dev/null @@ -1,331 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for PartyRepresentationType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="PartyRepresentationType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="InputProcessor" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InputProcessorType" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}AlwaysShowForm" minOccurs="0"/>
- *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
- *         <element name="PartyRepresentative" type="{http://www.buergerkarte.at/namespaces/moaconfig#}PartyRepresentativeType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "PartyRepresentationType", propOrder = { - "inputProcessor", - "alwaysShowForm", - "connectionParameter", - "partyRepresentative" -}) -@Entity(name = "PartyRepresentationType") -@Table(name = "PARTYREPRESENTATIONTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class PartyRepresentationType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "InputProcessor") - protected InputProcessorType inputProcessor; - @XmlElement(name = "AlwaysShowForm", type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - protected Boolean alwaysShowForm; - @XmlElement(name = "ConnectionParameter") - protected ConnectionParameterClientAuthType connectionParameter; - @XmlElement(name = "PartyRepresentative") - protected List partyRepresentative; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the inputProcessor property. - * - * @return - * possible object is - * {@link InputProcessorType } - * - */ - @ManyToOne(targetEntity = InputProcessorType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "INPUTPROCESSOR_PARTYREPRESEN_1") - public InputProcessorType getInputProcessor() { - return inputProcessor; - } - - /** - * Sets the value of the inputProcessor property. - * - * @param value - * allowed object is - * {@link InputProcessorType } - * - */ - public void setInputProcessor(InputProcessorType value) { - this.inputProcessor = value; - } - - /** - * Default Wert fuer Formularanzeige. Soll nicht nur - * bei leerer oder standardisierter Vollmacht mit unvollstaendigen - * Daten, sondern beispielsweise zu Kontrollzwecken das - * Eingabeformular zur vervollstaendigung der Vertretenendaten immer - * angezeigt werden, wenn ein Einschreiten durch berufliche - * Parteienvertretung geschieht so kann dies mittels dieses Schalters - * veranlasst werden - * - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ALWAYSSHOWFORM") - public Boolean isAlwaysShowForm() { - return alwaysShowForm; - } - - /** - * Sets the value of the alwaysShowForm property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAlwaysShowForm(Boolean value) { - this.alwaysShowForm = value; - } - - /** - * Gets the value of the connectionParameter property. - * - * @return - * possible object is - * {@link ConnectionParameterClientAuthType } - * - */ - @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CONNECTIONPARAMETER_PARTYREP_1") - public ConnectionParameterClientAuthType getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the value of the connectionParameter property. - * - * @param value - * allowed object is - * {@link ConnectionParameterClientAuthType } - * - */ - public void setConnectionParameter(ConnectionParameterClientAuthType value) { - this.connectionParameter = value; - } - - /** - * Gets the value of the partyRepresentative property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the partyRepresentative property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getPartyRepresentative().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link PartyRepresentativeType } - * - * - */ - @OneToMany(targetEntity = PartyRepresentativeType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PARTYREPRESENTATIVE_PARTYREP_0") - public List getPartyRepresentative() { - if (partyRepresentative == null) { - partyRepresentative = new ArrayList(); - } - return this.partyRepresentative; - } - - /** - * - * - */ - public void setPartyRepresentative(List partyRepresentative) { - this.partyRepresentative = partyRepresentative; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof PartyRepresentationType)) { - return false; - } - if (this == object) { - return true; - } - final PartyRepresentationType that = ((PartyRepresentationType) object); - { - InputProcessorType lhsInputProcessor; - lhsInputProcessor = this.getInputProcessor(); - InputProcessorType rhsInputProcessor; - rhsInputProcessor = that.getInputProcessor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "inputProcessor", lhsInputProcessor), LocatorUtils.property(thatLocator, "inputProcessor", rhsInputProcessor), lhsInputProcessor, rhsInputProcessor)) { - return false; - } - } - { - Boolean lhsAlwaysShowForm; - lhsAlwaysShowForm = this.isAlwaysShowForm(); - Boolean rhsAlwaysShowForm; - rhsAlwaysShowForm = that.isAlwaysShowForm(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "alwaysShowForm", lhsAlwaysShowForm), LocatorUtils.property(thatLocator, "alwaysShowForm", rhsAlwaysShowForm), lhsAlwaysShowForm, rhsAlwaysShowForm)) { - return false; - } - } - { - ConnectionParameterClientAuthType lhsConnectionParameter; - lhsConnectionParameter = this.getConnectionParameter(); - ConnectionParameterClientAuthType rhsConnectionParameter; - rhsConnectionParameter = that.getConnectionParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { - return false; - } - } - { - List lhsPartyRepresentative; - lhsPartyRepresentative = (((this.partyRepresentative!= null)&&(!this.partyRepresentative.isEmpty()))?this.getPartyRepresentative():null); - List rhsPartyRepresentative; - rhsPartyRepresentative = (((that.partyRepresentative!= null)&&(!that.partyRepresentative.isEmpty()))?that.getPartyRepresentative():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "partyRepresentative", lhsPartyRepresentative), LocatorUtils.property(thatLocator, "partyRepresentative", rhsPartyRepresentative), lhsPartyRepresentative, rhsPartyRepresentative)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - InputProcessorType theInputProcessor; - theInputProcessor = this.getInputProcessor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "inputProcessor", theInputProcessor), currentHashCode, theInputProcessor); - } - { - Boolean theAlwaysShowForm; - theAlwaysShowForm = this.isAlwaysShowForm(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alwaysShowForm", theAlwaysShowForm), currentHashCode, theAlwaysShowForm); - } - { - ConnectionParameterClientAuthType theConnectionParameter; - theConnectionParameter = this.getConnectionParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); - } - { - List thePartyRepresentative; - thePartyRepresentative = (((this.partyRepresentative!= null)&&(!this.partyRepresentative.isEmpty()))?this.getPartyRepresentative():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "partyRepresentative", thePartyRepresentative), currentHashCode, thePartyRepresentative); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java deleted file mode 100644 index ea6e957ec..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/PartyRepresentativeType.java +++ /dev/null @@ -1,457 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for PartyRepresentativeType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="PartyRepresentativeType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="InputProcessor" type="{http://www.buergerkarte.at/namespaces/moaconfig#}InputProcessorType" minOccurs="0"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}AlwaysShowForm" minOccurs="0"/>
- *         <element name="ConnectionParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ConnectionParameterClientAuthType" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="oid" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
- *       <attribute name="representPhysicalParty" default="false">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}boolean">
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="representCorporateParty" default="false">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}boolean">
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *       <attribute name="representationText" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "PartyRepresentativeType", propOrder = { - "inputProcessor", - "alwaysShowForm", - "connectionParameter" -}) -@Entity(name = "PartyRepresentativeType") -@Table(name = "PARTYREPRESENTATIVETYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class PartyRepresentativeType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "InputProcessor") - protected InputProcessorType inputProcessor; - @XmlElement(name = "AlwaysShowForm", type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - protected Boolean alwaysShowForm; - @XmlElement(name = "ConnectionParameter") - protected ConnectionParameterClientAuthType connectionParameter; - @XmlAttribute(name = "oid", required = true) - @XmlSchemaType(name = "anySimpleType") - protected String oid; - @XmlAttribute(name = "representPhysicalParty") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - protected Boolean representPhysicalParty; - @XmlAttribute(name = "representCorporateParty") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - protected Boolean representCorporateParty; - @XmlAttribute(name = "representationText") - @XmlSchemaType(name = "anySimpleType") - protected String representationText; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the inputProcessor property. - * - * @return - * possible object is - * {@link InputProcessorType } - * - */ - @ManyToOne(targetEntity = InputProcessorType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "INPUTPROCESSOR_PARTYREPRESEN_0") - public InputProcessorType getInputProcessor() { - return inputProcessor; - } - - /** - * Sets the value of the inputProcessor property. - * - * @param value - * allowed object is - * {@link InputProcessorType } - * - */ - public void setInputProcessor(InputProcessorType value) { - this.inputProcessor = value; - } - - /** - * Gets the value of the alwaysShowForm property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ALWAYSSHOWFORM") - public Boolean isAlwaysShowForm() { - return alwaysShowForm; - } - - /** - * Sets the value of the alwaysShowForm property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAlwaysShowForm(Boolean value) { - this.alwaysShowForm = value; - } - - /** - * Gets the value of the connectionParameter property. - * - * @return - * possible object is - * {@link ConnectionParameterClientAuthType } - * - */ - @ManyToOne(targetEntity = ConnectionParameterClientAuthType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CONNECTIONPARAMETER_PARTYREP_0") - public ConnectionParameterClientAuthType getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the value of the connectionParameter property. - * - * @param value - * allowed object is - * {@link ConnectionParameterClientAuthType } - * - */ - public void setConnectionParameter(ConnectionParameterClientAuthType value) { - this.connectionParameter = value; - } - - /** - * Gets the value of the oid property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "OID_") - public String getOid() { - return oid; - } - - /** - * Sets the value of the oid property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOid(String value) { - this.oid = value; - } - - /** - * Gets the value of the representPhysicalParty property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "REPRESENTPHYSICALPARTY") - public boolean isRepresentPhysicalParty() { - if (representPhysicalParty == null) { - return new ZeroOneBooleanAdapter().unmarshal("false"); - } else { - return representPhysicalParty; - } - } - - /** - * Sets the value of the representPhysicalParty property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRepresentPhysicalParty(Boolean value) { - this.representPhysicalParty = value; - } - - /** - * Gets the value of the representCorporateParty property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "REPRESENTCORPORATEPARTY") - public boolean isRepresentCorporateParty() { - if (representCorporateParty == null) { - return new ZeroOneBooleanAdapter().unmarshal("false"); - } else { - return representCorporateParty; - } - } - - /** - * Sets the value of the representCorporateParty property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRepresentCorporateParty(Boolean value) { - this.representCorporateParty = value; - } - - /** - * Gets the value of the representationText property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "REPRESENTATIONTEXT") - public String getRepresentationText() { - return representationText; - } - - /** - * Sets the value of the representationText property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRepresentationText(String value) { - this.representationText = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof PartyRepresentativeType)) { - return false; - } - if (this == object) { - return true; - } - final PartyRepresentativeType that = ((PartyRepresentativeType) object); - { - InputProcessorType lhsInputProcessor; - lhsInputProcessor = this.getInputProcessor(); - InputProcessorType rhsInputProcessor; - rhsInputProcessor = that.getInputProcessor(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "inputProcessor", lhsInputProcessor), LocatorUtils.property(thatLocator, "inputProcessor", rhsInputProcessor), lhsInputProcessor, rhsInputProcessor)) { - return false; - } - } - { - Boolean lhsAlwaysShowForm; - lhsAlwaysShowForm = this.isAlwaysShowForm(); - Boolean rhsAlwaysShowForm; - rhsAlwaysShowForm = that.isAlwaysShowForm(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "alwaysShowForm", lhsAlwaysShowForm), LocatorUtils.property(thatLocator, "alwaysShowForm", rhsAlwaysShowForm), lhsAlwaysShowForm, rhsAlwaysShowForm)) { - return false; - } - } - { - ConnectionParameterClientAuthType lhsConnectionParameter; - lhsConnectionParameter = this.getConnectionParameter(); - ConnectionParameterClientAuthType rhsConnectionParameter; - rhsConnectionParameter = that.getConnectionParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "connectionParameter", lhsConnectionParameter), LocatorUtils.property(thatLocator, "connectionParameter", rhsConnectionParameter), lhsConnectionParameter, rhsConnectionParameter)) { - return false; - } - } - { - String lhsOid; - lhsOid = this.getOid(); - String rhsOid; - rhsOid = that.getOid(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oid", lhsOid), LocatorUtils.property(thatLocator, "oid", rhsOid), lhsOid, rhsOid)) { - return false; - } - } - { - boolean lhsRepresentPhysicalParty; - lhsRepresentPhysicalParty = ((this.representPhysicalParty!= null)?this.isRepresentPhysicalParty():false); - boolean rhsRepresentPhysicalParty; - rhsRepresentPhysicalParty = ((that.representPhysicalParty!= null)?that.isRepresentPhysicalParty():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "representPhysicalParty", lhsRepresentPhysicalParty), LocatorUtils.property(thatLocator, "representPhysicalParty", rhsRepresentPhysicalParty), lhsRepresentPhysicalParty, rhsRepresentPhysicalParty)) { - return false; - } - } - { - boolean lhsRepresentCorporateParty; - lhsRepresentCorporateParty = ((this.representCorporateParty!= null)?this.isRepresentCorporateParty():false); - boolean rhsRepresentCorporateParty; - rhsRepresentCorporateParty = ((that.representCorporateParty!= null)?that.isRepresentCorporateParty():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "representCorporateParty", lhsRepresentCorporateParty), LocatorUtils.property(thatLocator, "representCorporateParty", rhsRepresentCorporateParty), lhsRepresentCorporateParty, rhsRepresentCorporateParty)) { - return false; - } - } - { - String lhsRepresentationText; - lhsRepresentationText = this.getRepresentationText(); - String rhsRepresentationText; - rhsRepresentationText = that.getRepresentationText(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "representationText", lhsRepresentationText), LocatorUtils.property(thatLocator, "representationText", rhsRepresentationText), lhsRepresentationText, rhsRepresentationText)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - InputProcessorType theInputProcessor; - theInputProcessor = this.getInputProcessor(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "inputProcessor", theInputProcessor), currentHashCode, theInputProcessor); - } - { - Boolean theAlwaysShowForm; - theAlwaysShowForm = this.isAlwaysShowForm(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "alwaysShowForm", theAlwaysShowForm), currentHashCode, theAlwaysShowForm); - } - { - ConnectionParameterClientAuthType theConnectionParameter; - theConnectionParameter = this.getConnectionParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "connectionParameter", theConnectionParameter), currentHashCode, theConnectionParameter); - } - { - String theOid; - theOid = this.getOid(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oid", theOid), currentHashCode, theOid); - } - { - boolean theRepresentPhysicalParty; - theRepresentPhysicalParty = ((this.representPhysicalParty!= null)?this.isRepresentPhysicalParty():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "representPhysicalParty", theRepresentPhysicalParty), currentHashCode, theRepresentPhysicalParty); - } - { - boolean theRepresentCorporateParty; - theRepresentCorporateParty = ((this.representCorporateParty!= null)?this.isRepresentCorporateParty():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "representCorporateParty", theRepresentCorporateParty), currentHashCode, theRepresentCorporateParty); - } - { - String theRepresentationText; - theRepresentationText = this.getRepresentationText(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "representationText", theRepresentationText), currentHashCode, theRepresentationText); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java deleted file mode 100644 index 2158b1953..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Protocols.java +++ /dev/null @@ -1,361 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="SAML1" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="SourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                 </sequence>
- *                 <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="PVP2" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="PublicURLPrefix" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="IssuerName" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                   <element name="Organization">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="Name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                             <element name="DisplayName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                             <element name="URL" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Contact" maxOccurs="unbounded"/>
- *                 </sequence>
- *                 <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="OAuth" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="LegacyAllowed">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="ProtocolName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "saml1", - "pvp2", - "oAuth", - "legacyAllowed" -}) -@Entity(name = "Protocols") -@Table(name = "PROTOCOLS") -@Inheritance(strategy = InheritanceType.JOINED) -public class Protocols - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "SAML1") - protected SAML1 saml1; - @XmlElement(name = "PVP2") - protected PVP2 pvp2; - @XmlElement(name = "OAuth") - protected OAuth oAuth; - @XmlElement(name = "LegacyAllowed", required = true) - protected LegacyAllowed legacyAllowed; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the saml1 property. - * - * @return - * possible object is - * {@link SAML1 } - * - */ - @ManyToOne(targetEntity = SAML1 .class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SAML1_PROTOCOLS_HJID") - public SAML1 getSAML1() { - return saml1; - } - - /** - * Sets the value of the saml1 property. - * - * @param value - * allowed object is - * {@link SAML1 } - * - */ - public void setSAML1(SAML1 value) { - this.saml1 = value; - } - - /** - * Gets the value of the pvp2 property. - * - * @return - * possible object is - * {@link PVP2 } - * - */ - @ManyToOne(targetEntity = PVP2 .class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "PVP2_PROTOCOLS_HJID") - public PVP2 getPVP2() { - return pvp2; - } - - /** - * Sets the value of the pvp2 property. - * - * @param value - * allowed object is - * {@link PVP2 } - * - */ - public void setPVP2(PVP2 value) { - this.pvp2 = value; - } - - /** - * Gets the value of the oAuth property. - * - * @return - * possible object is - * {@link OAuth } - * - */ - @ManyToOne(targetEntity = OAuth.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "OAUTH_PROTOCOLS_HJID") - public OAuth getOAuth() { - return oAuth; - } - - /** - * Sets the value of the oAuth property. - * - * @param value - * allowed object is - * {@link OAuth } - * - */ - public void setOAuth(OAuth value) { - this.oAuth = value; - } - - /** - * Gets the value of the legacyAllowed property. - * - * @return - * possible object is - * {@link LegacyAllowed } - * - */ - @ManyToOne(targetEntity = LegacyAllowed.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "LEGACYALLOWED_PROTOCOLS_HJID") - public LegacyAllowed getLegacyAllowed() { - return legacyAllowed; - } - - /** - * Sets the value of the legacyAllowed property. - * - * @param value - * allowed object is - * {@link LegacyAllowed } - * - */ - public void setLegacyAllowed(LegacyAllowed value) { - this.legacyAllowed = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Protocols)) { - return false; - } - if (this == object) { - return true; - } - final Protocols that = ((Protocols) object); - { - SAML1 lhsSAML1; - lhsSAML1 = this.getSAML1(); - SAML1 rhsSAML1; - rhsSAML1 = that.getSAML1(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "saml1", lhsSAML1), LocatorUtils.property(thatLocator, "saml1", rhsSAML1), lhsSAML1, rhsSAML1)) { - return false; - } - } - { - PVP2 lhsPVP2; - lhsPVP2 = this.getPVP2(); - PVP2 rhsPVP2; - rhsPVP2 = that.getPVP2(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "pvp2", lhsPVP2), LocatorUtils.property(thatLocator, "pvp2", rhsPVP2), lhsPVP2, rhsPVP2)) { - return false; - } - } - { - OAuth lhsOAuth; - lhsOAuth = this.getOAuth(); - OAuth rhsOAuth; - rhsOAuth = that.getOAuth(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "oAuth", lhsOAuth), LocatorUtils.property(thatLocator, "oAuth", rhsOAuth), lhsOAuth, rhsOAuth)) { - return false; - } - } - { - LegacyAllowed lhsLegacyAllowed; - lhsLegacyAllowed = this.getLegacyAllowed(); - LegacyAllowed rhsLegacyAllowed; - rhsLegacyAllowed = that.getLegacyAllowed(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "legacyAllowed", lhsLegacyAllowed), LocatorUtils.property(thatLocator, "legacyAllowed", rhsLegacyAllowed), lhsLegacyAllowed, rhsLegacyAllowed)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - SAML1 theSAML1; - theSAML1 = this.getSAML1(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "saml1", theSAML1), currentHashCode, theSAML1); - } - { - PVP2 thePVP2; - thePVP2 = this.getPVP2(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "pvp2", thePVP2), currentHashCode, thePVP2); - } - { - OAuth theOAuth; - theOAuth = this.getOAuth(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "oAuth", theOAuth), currentHashCode, theOAuth); - } - { - LegacyAllowed theLegacyAllowed; - theLegacyAllowed = this.getLegacyAllowed(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "legacyAllowed", theLegacyAllowed), currentHashCode, theLegacyAllowed); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java deleted file mode 100644 index 516c27e91..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAML1.java +++ /dev/null @@ -1,216 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="SourceID" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "sourceID" -}) -@Entity(name = "SAML1") -@Table(name = "SAML1") -@Inheritance(strategy = InheritanceType.JOINED) -public class SAML1 - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "SourceID") - protected String sourceID; - @XmlAttribute(name = "isActive") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isActive; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the sourceID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SOURCEID", length = 255) - public String getSourceID() { - return sourceID; - } - - /** - * Sets the value of the sourceID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSourceID(String value) { - this.sourceID = value; - } - - /** - * Gets the value of the isActive property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISACTIVE") - public boolean isIsActive() { - if (isActive == null) { - return new ZeroOneBooleanAdapter().unmarshal("false"); - } else { - return isActive; - } - } - - /** - * Sets the value of the isActive property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsActive(Boolean value) { - this.isActive = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SAML1)) { - return false; - } - if (this == object) { - return true; - } - final SAML1 that = ((SAML1) object); - { - String lhsSourceID; - lhsSourceID = this.getSourceID(); - String rhsSourceID; - rhsSourceID = that.getSourceID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "sourceID", lhsSourceID), LocatorUtils.property(thatLocator, "sourceID", rhsSourceID), lhsSourceID, rhsSourceID)) { - return false; - } - } - { - boolean lhsIsActive; - lhsIsActive = ((this.isActive!= null)?this.isIsActive():false); - boolean rhsIsActive; - rhsIsActive = ((that.isActive!= null)?that.isIsActive():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theSourceID; - theSourceID = this.getSourceID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sourceID", theSourceID), currentHashCode, theSourceID); - } - { - boolean theIsActive; - theIsActive = ((this.isActive!= null)?this.isIsActive():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java deleted file mode 100644 index 685aa6299..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SAMLSigningParameter.java +++ /dev/null @@ -1,216 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="SignatureCreationParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}SignatureCreationParameterType"/>
- *         <element name="SignatureVerificationParameter" type="{http://www.buergerkarte.at/namespaces/moaconfig#}SignatureVerificationParameterType"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "signatureCreationParameter", - "signatureVerificationParameter" -}) -@XmlRootElement(name = "SAMLSigningParameter") -@Entity(name = "SAMLSigningParameter") -@Table(name = "SAMLSIGNINGPARAMETER") -@Inheritance(strategy = InheritanceType.JOINED) -public class SAMLSigningParameter - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "SignatureCreationParameter", required = true) - protected SignatureCreationParameterType signatureCreationParameter; - @XmlElement(name = "SignatureVerificationParameter", required = true) - protected SignatureVerificationParameterType signatureVerificationParameter; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the signatureCreationParameter property. - * - * @return - * possible object is - * {@link SignatureCreationParameterType } - * - */ - @ManyToOne(targetEntity = SignatureCreationParameterType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SIGNATURECREATIONPARAMETER_S_0") - public SignatureCreationParameterType getSignatureCreationParameter() { - return signatureCreationParameter; - } - - /** - * Sets the value of the signatureCreationParameter property. - * - * @param value - * allowed object is - * {@link SignatureCreationParameterType } - * - */ - public void setSignatureCreationParameter(SignatureCreationParameterType value) { - this.signatureCreationParameter = value; - } - - /** - * Gets the value of the signatureVerificationParameter property. - * - * @return - * possible object is - * {@link SignatureVerificationParameterType } - * - */ - @ManyToOne(targetEntity = SignatureVerificationParameterType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SIGNATUREVERIFICATIONPARAMET_1") - public SignatureVerificationParameterType getSignatureVerificationParameter() { - return signatureVerificationParameter; - } - - /** - * Sets the value of the signatureVerificationParameter property. - * - * @param value - * allowed object is - * {@link SignatureVerificationParameterType } - * - */ - public void setSignatureVerificationParameter(SignatureVerificationParameterType value) { - this.signatureVerificationParameter = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SAMLSigningParameter)) { - return false; - } - if (this == object) { - return true; - } - final SAMLSigningParameter that = ((SAMLSigningParameter) object); - { - SignatureCreationParameterType lhsSignatureCreationParameter; - lhsSignatureCreationParameter = this.getSignatureCreationParameter(); - SignatureCreationParameterType rhsSignatureCreationParameter; - rhsSignatureCreationParameter = that.getSignatureCreationParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "signatureCreationParameter", lhsSignatureCreationParameter), LocatorUtils.property(thatLocator, "signatureCreationParameter", rhsSignatureCreationParameter), lhsSignatureCreationParameter, rhsSignatureCreationParameter)) { - return false; - } - } - { - SignatureVerificationParameterType lhsSignatureVerificationParameter; - lhsSignatureVerificationParameter = this.getSignatureVerificationParameter(); - SignatureVerificationParameterType rhsSignatureVerificationParameter; - rhsSignatureVerificationParameter = that.getSignatureVerificationParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "signatureVerificationParameter", lhsSignatureVerificationParameter), LocatorUtils.property(thatLocator, "signatureVerificationParameter", rhsSignatureVerificationParameter), lhsSignatureVerificationParameter, rhsSignatureVerificationParameter)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - SignatureCreationParameterType theSignatureCreationParameter; - theSignatureCreationParameter = this.getSignatureCreationParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "signatureCreationParameter", theSignatureCreationParameter), currentHashCode, theSignatureCreationParameter); - } - { - SignatureVerificationParameterType theSignatureVerificationParameter; - theSignatureVerificationParameter = this.getSignatureVerificationParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "signatureVerificationParameter", theSignatureVerificationParameter), currentHashCode, theSignatureVerificationParameter); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java deleted file mode 100644 index a10e7941e..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SLRequestTemplates.java +++ /dev/null @@ -1,256 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="OnlineBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="HandyBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="LocalBKU" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "onlineBKU", - "handyBKU", - "localBKU" -}) -@Entity(name = "SLRequestTemplates") -@Table(name = "SLREQUESTTEMPLATES") -@Inheritance(strategy = InheritanceType.JOINED) -public class SLRequestTemplates - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "OnlineBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String onlineBKU; - @XmlElement(name = "HandyBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String handyBKU; - @XmlElement(name = "LocalBKU", required = true) - @XmlSchemaType(name = "anyURI") - protected String localBKU; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the onlineBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ONLINEBKU") - public String getOnlineBKU() { - return onlineBKU; - } - - /** - * Sets the value of the onlineBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOnlineBKU(String value) { - this.onlineBKU = value; - } - - /** - * Gets the value of the handyBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "HANDYBKU") - public String getHandyBKU() { - return handyBKU; - } - - /** - * Sets the value of the handyBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setHandyBKU(String value) { - this.handyBKU = value; - } - - /** - * Gets the value of the localBKU property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "LOCALBKU") - public String getLocalBKU() { - return localBKU; - } - - /** - * Sets the value of the localBKU property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLocalBKU(String value) { - this.localBKU = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SLRequestTemplates)) { - return false; - } - if (this == object) { - return true; - } - final SLRequestTemplates that = ((SLRequestTemplates) object); - { - String lhsOnlineBKU; - lhsOnlineBKU = this.getOnlineBKU(); - String rhsOnlineBKU; - rhsOnlineBKU = that.getOnlineBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineBKU", lhsOnlineBKU), LocatorUtils.property(thatLocator, "onlineBKU", rhsOnlineBKU), lhsOnlineBKU, rhsOnlineBKU)) { - return false; - } - } - { - String lhsHandyBKU; - lhsHandyBKU = this.getHandyBKU(); - String rhsHandyBKU; - rhsHandyBKU = that.getHandyBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "handyBKU", lhsHandyBKU), LocatorUtils.property(thatLocator, "handyBKU", rhsHandyBKU), lhsHandyBKU, rhsHandyBKU)) { - return false; - } - } - { - String lhsLocalBKU; - lhsLocalBKU = this.getLocalBKU(); - String rhsLocalBKU; - rhsLocalBKU = that.getLocalBKU(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "localBKU", lhsLocalBKU), LocatorUtils.property(thatLocator, "localBKU", rhsLocalBKU), lhsLocalBKU, rhsLocalBKU)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theOnlineBKU; - theOnlineBKU = this.getOnlineBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineBKU", theOnlineBKU), currentHashCode, theOnlineBKU); - } - { - String theHandyBKU; - theHandyBKU = this.getHandyBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "handyBKU", theHandyBKU), currentHashCode, theHandyBKU); - } - { - String theLocalBKU; - theLocalBKU = this.getLocalBKU(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "localBKU", theLocalBKU), currentHashCode, theLocalBKU); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java deleted file mode 100644 index 2321ee884..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SSO.java +++ /dev/null @@ -1,341 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice>
- *         <element name="target" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}IdentificationNumber"/>
- *       </choice>
- *       <attribute name="PublicURL" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
- *       <attribute name="SpecialText" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "target", - "identificationNumber" -}) -@Entity(name = "SSO") -@Table(name = "SSO") -@Inheritance(strategy = InheritanceType.JOINED) -public class SSO - implements Serializable, Equals, HashCode -{ - - protected String target; - @XmlElement(name = "IdentificationNumber") - protected IdentificationNumber identificationNumber; - @XmlAttribute(name = "PublicURL") - protected String publicURL; - @XmlAttribute(name = "FriendlyName") - protected String friendlyName; - @XmlAttribute(name = "SpecialText") - protected String specialText; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the target property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TARGET", length = 255) - public String getTarget() { - return target; - } - - /** - * Sets the value of the target property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTarget(String value) { - this.target = value; - } - - /** - * Gets the value of the identificationNumber property. - * - * @return - * possible object is - * {@link IdentificationNumber } - * - */ - @ManyToOne(targetEntity = IdentificationNumber.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "IDENTIFICATIONNUMBER_SSO_HJID") - public IdentificationNumber getIdentificationNumber() { - return identificationNumber; - } - - /** - * Sets the value of the identificationNumber property. - * - * @param value - * allowed object is - * {@link IdentificationNumber } - * - */ - public void setIdentificationNumber(IdentificationNumber value) { - this.identificationNumber = value; - } - - /** - * Gets the value of the publicURL property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PUBLICURL", length = 255) - public String getPublicURL() { - return publicURL; - } - - /** - * Sets the value of the publicURL property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPublicURL(String value) { - this.publicURL = value; - } - - /** - * Gets the value of the friendlyName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FRIENDLYNAME", length = 255) - public String getFriendlyName() { - return friendlyName; - } - - /** - * Sets the value of the friendlyName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFriendlyName(String value) { - this.friendlyName = value; - } - - /** - * Gets the value of the specialText property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SPECIALTEXT", length = 255) - public String getSpecialText() { - return specialText; - } - - /** - * Sets the value of the specialText property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSpecialText(String value) { - this.specialText = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SSO)) { - return false; - } - if (this == object) { - return true; - } - final SSO that = ((SSO) object); - { - String lhsTarget; - lhsTarget = this.getTarget(); - String rhsTarget; - rhsTarget = that.getTarget(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "target", lhsTarget), LocatorUtils.property(thatLocator, "target", rhsTarget), lhsTarget, rhsTarget)) { - return false; - } - } - { - IdentificationNumber lhsIdentificationNumber; - lhsIdentificationNumber = this.getIdentificationNumber(); - IdentificationNumber rhsIdentificationNumber; - rhsIdentificationNumber = that.getIdentificationNumber(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "identificationNumber", lhsIdentificationNumber), LocatorUtils.property(thatLocator, "identificationNumber", rhsIdentificationNumber), lhsIdentificationNumber, rhsIdentificationNumber)) { - return false; - } - } - { - String lhsPublicURL; - lhsPublicURL = this.getPublicURL(); - String rhsPublicURL; - rhsPublicURL = that.getPublicURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "publicURL", lhsPublicURL), LocatorUtils.property(thatLocator, "publicURL", rhsPublicURL), lhsPublicURL, rhsPublicURL)) { - return false; - } - } - { - String lhsFriendlyName; - lhsFriendlyName = this.getFriendlyName(); - String rhsFriendlyName; - rhsFriendlyName = that.getFriendlyName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "friendlyName", lhsFriendlyName), LocatorUtils.property(thatLocator, "friendlyName", rhsFriendlyName), lhsFriendlyName, rhsFriendlyName)) { - return false; - } - } - { - String lhsSpecialText; - lhsSpecialText = this.getSpecialText(); - String rhsSpecialText; - rhsSpecialText = that.getSpecialText(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "specialText", lhsSpecialText), LocatorUtils.property(thatLocator, "specialText", rhsSpecialText), lhsSpecialText, rhsSpecialText)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theTarget; - theTarget = this.getTarget(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "target", theTarget), currentHashCode, theTarget); - } - { - IdentificationNumber theIdentificationNumber; - theIdentificationNumber = this.getIdentificationNumber(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "identificationNumber", theIdentificationNumber), currentHashCode, theIdentificationNumber); - } - { - String thePublicURL; - thePublicURL = this.getPublicURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "publicURL", thePublicURL), currentHashCode, thePublicURL); - } - { - String theFriendlyName; - theFriendlyName = this.getFriendlyName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "friendlyName", theFriendlyName), currentHashCode, theFriendlyName); - } - { - String theSpecialText; - theSpecialText = this.getSpecialText(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "specialText", theSpecialText), currentHashCode, theSpecialText); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java deleted file mode 100644 index 42bedb94c..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/STORK.java +++ /dev/null @@ -1,342 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice>
- *         <sequence>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}C-PEPS" maxOccurs="unbounded"/>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}SAMLSigningParameter"/>
- *         </sequence>
- *         <sequence>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}QualityAuthenticationAssuranceLevel" minOccurs="0"/>
- *         </sequence>
- *         <sequence>
- *           <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}Attributes" maxOccurs="unbounded" minOccurs="0"/>
- *         </sequence>
- *       </choice>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "cpeps", - "samlSigningParameter", - "qualityAuthenticationAssuranceLevel", - "attributes" -}) -@XmlRootElement(name = "STORK") -@Entity(name = "STORK") -@Table(name = "STORK") -@Inheritance(strategy = InheritanceType.JOINED) -public class STORK - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "C-PEPS") - protected List cpeps; - @XmlElement(name = "SAMLSigningParameter") - protected SAMLSigningParameter samlSigningParameter; - @XmlElement(name = "QualityAuthenticationAssuranceLevel") - protected Integer qualityAuthenticationAssuranceLevel; - @XmlElement(name = "Attributes") - protected List attributes; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the cpeps property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the cpeps property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getCPEPS().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link CPEPS } - * - * - */ - @OneToMany(targetEntity = CPEPS.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CPEPS_STORK_HJID") - public List getCPEPS() { - if (cpeps == null) { - cpeps = new ArrayList(); - } - return this.cpeps; - } - - /** - * - * - */ - public void setCPEPS(List cpeps) { - this.cpeps = cpeps; - } - - /** - * Gets the value of the samlSigningParameter property. - * - * @return - * possible object is - * {@link SAMLSigningParameter } - * - */ - @ManyToOne(targetEntity = SAMLSigningParameter.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SAMLSIGNINGPARAMETER_STORK_H_0") - public SAMLSigningParameter getSAMLSigningParameter() { - return samlSigningParameter; - } - - /** - * Sets the value of the samlSigningParameter property. - * - * @param value - * allowed object is - * {@link SAMLSigningParameter } - * - */ - public void setSAMLSigningParameter(SAMLSigningParameter value) { - this.samlSigningParameter = value; - } - - /** - * Gets the value of the qualityAuthenticationAssuranceLevel property. - * - * @return - * possible object is - * {@link Integer } - * - */ - @Basic - @Column(name = "QUALITYAUTHENTICATIONASSURAN_0", precision = 20, scale = 0) - public Integer getQualityAuthenticationAssuranceLevel() { - return qualityAuthenticationAssuranceLevel; - } - - /** - * Sets the value of the qualityAuthenticationAssuranceLevel property. - * - * @param value - * allowed object is - * {@link Integer } - * - */ - public void setQualityAuthenticationAssuranceLevel(Integer value) { - this.qualityAuthenticationAssuranceLevel = value; - } - - /** - * Gets the value of the attributes property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the attributes property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getAttributes().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link StorkAttribute } - * - * - */ - @OneToMany(targetEntity = StorkAttribute.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ATTRIBUTES__STORK_HJID") - public List getAttributes() { - if (attributes == null) { - attributes = new ArrayList(); - } - return this.attributes; - } - - /** - * - * - */ - public void setAttributes(List attributes) { - this.attributes = attributes; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof STORK)) { - return false; - } - if (this == object) { - return true; - } - final STORK that = ((STORK) object); - { - List lhsCPEPS; - lhsCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); - List rhsCPEPS; - rhsCPEPS = (((that.cpeps!= null)&&(!that.cpeps.isEmpty()))?that.getCPEPS():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "cpeps", lhsCPEPS), LocatorUtils.property(thatLocator, "cpeps", rhsCPEPS), lhsCPEPS, rhsCPEPS)) { - return false; - } - } - { - SAMLSigningParameter lhsSAMLSigningParameter; - lhsSAMLSigningParameter = this.getSAMLSigningParameter(); - SAMLSigningParameter rhsSAMLSigningParameter; - rhsSAMLSigningParameter = that.getSAMLSigningParameter(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "samlSigningParameter", lhsSAMLSigningParameter), LocatorUtils.property(thatLocator, "samlSigningParameter", rhsSAMLSigningParameter), lhsSAMLSigningParameter, rhsSAMLSigningParameter)) { - return false; - } - } - { - Integer lhsQualityAuthenticationAssuranceLevel; - lhsQualityAuthenticationAssuranceLevel = this.getQualityAuthenticationAssuranceLevel(); - Integer rhsQualityAuthenticationAssuranceLevel; - rhsQualityAuthenticationAssuranceLevel = that.getQualityAuthenticationAssuranceLevel(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "qualityAuthenticationAssuranceLevel", lhsQualityAuthenticationAssuranceLevel), LocatorUtils.property(thatLocator, "qualityAuthenticationAssuranceLevel", rhsQualityAuthenticationAssuranceLevel), lhsQualityAuthenticationAssuranceLevel, rhsQualityAuthenticationAssuranceLevel)) { - return false; - } - } - { - List lhsAttributes; - lhsAttributes = (((this.attributes!= null)&&(!this.attributes.isEmpty()))?this.getAttributes():null); - List rhsAttributes; - rhsAttributes = (((that.attributes!= null)&&(!that.attributes.isEmpty()))?that.getAttributes():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "attributes", lhsAttributes), LocatorUtils.property(thatLocator, "attributes", rhsAttributes), lhsAttributes, rhsAttributes)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theCPEPS; - theCPEPS = (((this.cpeps!= null)&&(!this.cpeps.isEmpty()))?this.getCPEPS():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "cpeps", theCPEPS), currentHashCode, theCPEPS); - } - { - SAMLSigningParameter theSAMLSigningParameter; - theSAMLSigningParameter = this.getSAMLSigningParameter(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "samlSigningParameter", theSAMLSigningParameter), currentHashCode, theSAMLSigningParameter); - } - { - Integer theQualityAuthenticationAssuranceLevel; - theQualityAuthenticationAssuranceLevel = this.getQualityAuthenticationAssuranceLevel(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "qualityAuthenticationAssuranceLevel", theQualityAuthenticationAssuranceLevel), currentHashCode, theQualityAuthenticationAssuranceLevel); - } - { - List theAttributes; - theAttributes = (((this.attributes!= null)&&(!this.attributes.isEmpty()))?this.getAttributes():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "attributes", theAttributes), currentHashCode, theAttributes); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java deleted file mode 100644 index 37fdc522d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/Schema.java +++ /dev/null @@ -1,205 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *       <attribute name="schemaLocation" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@Entity(name = "Schema") -@Table(name = "SCHEMA_") -@Inheritance(strategy = InheritanceType.JOINED) -public class Schema - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "namespace", required = true) - @XmlSchemaType(name = "anyURI") - protected String namespace; - @XmlAttribute(name = "schemaLocation", required = true) - @XmlSchemaType(name = "anyURI") - protected String schemaLocation; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the namespace property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAMESPACE") - public String getNamespace() { - return namespace; - } - - /** - * Sets the value of the namespace property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setNamespace(String value) { - this.namespace = value; - } - - /** - * Gets the value of the schemaLocation property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "SCHEMALOCATION") - public String getSchemaLocation() { - return schemaLocation; - } - - /** - * Sets the value of the schemaLocation property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSchemaLocation(String value) { - this.schemaLocation = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof Schema)) { - return false; - } - if (this == object) { - return true; - } - final Schema that = ((Schema) object); - { - String lhsNamespace; - lhsNamespace = this.getNamespace(); - String rhsNamespace; - rhsNamespace = that.getNamespace(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "namespace", lhsNamespace), LocatorUtils.property(thatLocator, "namespace", rhsNamespace), lhsNamespace, rhsNamespace)) { - return false; - } - } - { - String lhsSchemaLocation; - lhsSchemaLocation = this.getSchemaLocation(); - String rhsSchemaLocation; - rhsSchemaLocation = that.getSchemaLocation(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "schemaLocation", lhsSchemaLocation), LocatorUtils.property(thatLocator, "schemaLocation", rhsSchemaLocation), lhsSchemaLocation, rhsSchemaLocation)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theNamespace; - theNamespace = this.getNamespace(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "namespace", theNamespace), currentHashCode, theNamespace); - } - { - String theSchemaLocation; - theSchemaLocation = this.getSchemaLocation(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "schemaLocation", theSchemaLocation), currentHashCode, theSchemaLocation); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java deleted file mode 100644 index 11a5a7bac..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SchemaLocationType.java +++ /dev/null @@ -1,195 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - * Spezifiziert die Lage von XML Schemas - * - * - *

Java class for SchemaLocationType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="SchemaLocationType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Schema" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="namespace" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *                 <attribute name="schemaLocation" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "SchemaLocationType", propOrder = { - "schema" -}) -@Entity(name = "SchemaLocationType") -@Table(name = "SCHEMALOCATIONTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class SchemaLocationType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Schema", required = true) - protected List schema; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the schema property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the schema property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getSchema().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link Schema } - * - * - */ - @OneToMany(targetEntity = Schema.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SCHEMA__SCHEMALOCATIONTYPE_H_0") - public List getSchema() { - if (schema == null) { - schema = new ArrayList(); - } - return this.schema; - } - - /** - * - * - */ - public void setSchema(List schema) { - this.schema = schema; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SchemaLocationType)) { - return false; - } - if (this == object) { - return true; - } - final SchemaLocationType that = ((SchemaLocationType) object); - { - List lhsSchema; - lhsSchema = (((this.schema!= null)&&(!this.schema.isEmpty()))?this.getSchema():null); - List rhsSchema; - rhsSchema = (((that.schema!= null)&&(!that.schema.isEmpty()))?that.getSchema():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "schema", lhsSchema), LocatorUtils.property(thatLocator, "schema", rhsSchema), lhsSchema, rhsSchema)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theSchema; - theSchema = (((this.schema!= null)&&(!this.schema.isEmpty()))?this.getSchema():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "schema", theSchema), currentHashCode, theSchema); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java deleted file mode 100644 index 13001493a..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SecurityLayer.java +++ /dev/null @@ -1,183 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="TransformsInfo" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "transformsInfo" -}) -@Entity(name = "SecurityLayer") -@Table(name = "SECURITYLAYER") -@Inheritance(strategy = InheritanceType.JOINED) -public class SecurityLayer - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TransformsInfo", required = true) - protected List transformsInfo; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the transformsInfo property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the transformsInfo property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTransformsInfo().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link TransformsInfoType } - * - * - */ - @OneToMany(targetEntity = TransformsInfoType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TRANSFORMSINFO_SECURITYLAYER_0") - public List getTransformsInfo() { - if (transformsInfo == null) { - transformsInfo = new ArrayList(); - } - return this.transformsInfo; - } - - /** - * - * - */ - public void setTransformsInfo(List transformsInfo) { - this.transformsInfo = transformsInfo; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SecurityLayer)) { - return false; - } - if (this == object) { - return true; - } - final SecurityLayer that = ((SecurityLayer) object); - { - List lhsTransformsInfo; - lhsTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); - List rhsTransformsInfo; - rhsTransformsInfo = (((that.transformsInfo!= null)&&(!that.transformsInfo.isEmpty()))?that.getTransformsInfo():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "transformsInfo", lhsTransformsInfo), LocatorUtils.property(thatLocator, "transformsInfo", rhsTransformsInfo), lhsTransformsInfo, rhsTransformsInfo)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theTransformsInfo; - theTransformsInfo = (((this.transformsInfo!= null)&&(!this.transformsInfo.isEmpty()))?this.getTransformsInfo():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transformsInfo", theTransformsInfo), currentHashCode, theTransformsInfo); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java deleted file mode 100644 index 7d67f1784..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureCreationParameterType.java +++ /dev/null @@ -1,218 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - * Enthaelt Informationen zu einem KeyStore bzw. Key - * zur STORK SAML AuthnRequest Signaturerstellung - * - * - *

Java class for SignatureCreationParameterType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="SignatureCreationParameterType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}KeyStore"/>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}KeyName"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "SignatureCreationParameterType", propOrder = { - "keyStore", - "keyName" -}) -@Entity(name = "SignatureCreationParameterType") -@Table(name = "SIGNATURECREATIONPARAMETERTY_0") -@Inheritance(strategy = InheritanceType.JOINED) -public class SignatureCreationParameterType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "KeyStore", required = true) - protected KeyStore keyStore; - @XmlElement(name = "KeyName", required = true) - protected KeyName keyName; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the keyStore property. - * - * @return - * possible object is - * {@link KeyStore } - * - */ - @ManyToOne(targetEntity = KeyStore.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "KEYSTORE_SIGNATURECREATIONPA_0") - public KeyStore getKeyStore() { - return keyStore; - } - - /** - * Sets the value of the keyStore property. - * - * @param value - * allowed object is - * {@link KeyStore } - * - */ - public void setKeyStore(KeyStore value) { - this.keyStore = value; - } - - /** - * Gets the value of the keyName property. - * - * @return - * possible object is - * {@link KeyName } - * - */ - @ManyToOne(targetEntity = KeyName.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "KEYNAME_SIGNATURECREATIONPAR_0") - public KeyName getKeyName() { - return keyName; - } - - /** - * Sets the value of the keyName property. - * - * @param value - * allowed object is - * {@link KeyName } - * - */ - public void setKeyName(KeyName value) { - this.keyName = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SignatureCreationParameterType)) { - return false; - } - if (this == object) { - return true; - } - final SignatureCreationParameterType that = ((SignatureCreationParameterType) object); - { - KeyStore lhsKeyStore; - lhsKeyStore = this.getKeyStore(); - KeyStore rhsKeyStore; - rhsKeyStore = that.getKeyStore(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "keyStore", lhsKeyStore), LocatorUtils.property(thatLocator, "keyStore", rhsKeyStore), lhsKeyStore, rhsKeyStore)) { - return false; - } - } - { - KeyName lhsKeyName; - lhsKeyName = this.getKeyName(); - KeyName rhsKeyName; - rhsKeyName = that.getKeyName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "keyName", lhsKeyName), LocatorUtils.property(thatLocator, "keyName", rhsKeyName), lhsKeyName, rhsKeyName)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - KeyStore theKeyStore; - theKeyStore = this.getKeyStore(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyStore", theKeyStore), currentHashCode, theKeyStore); - } - { - KeyName theKeyName; - theKeyName = this.getKeyName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "keyName", theKeyName), currentHashCode, theKeyName); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java deleted file mode 100644 index 9f72d4297..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/SignatureVerificationParameterType.java +++ /dev/null @@ -1,168 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - * Enthaelt Informationen zur Verfikation von - * Signaturen einer STORK SAML Response - * - * - *

Java class for SignatureVerificationParameterType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="SignatureVerificationParameterType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "SignatureVerificationParameterType", propOrder = { - "trustProfileID" -}) -@Entity(name = "SignatureVerificationParameterType") -@Table(name = "SIGNATUREVERIFICATIONPARAMET_2") -@Inheritance(strategy = InheritanceType.JOINED) -public class SignatureVerificationParameterType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TrustProfileID", required = true) - protected String trustProfileID; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the trustProfileID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TRUSTPROFILEID", length = 255) - public String getTrustProfileID() { - return trustProfileID; - } - - /** - * Sets the value of the trustProfileID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTrustProfileID(String value) { - this.trustProfileID = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof SignatureVerificationParameterType)) { - return false; - } - if (this == object) { - return true; - } - final SignatureVerificationParameterType that = ((SignatureVerificationParameterType) object); - { - String lhsTrustProfileID; - lhsTrustProfileID = this.getTrustProfileID(); - String rhsTrustProfileID; - rhsTrustProfileID = that.getTrustProfileID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theTrustProfileID; - theTrustProfileID = this.getTrustProfileID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java deleted file mode 100644 index ad24cadf6..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/StorkAttribute.java +++ /dev/null @@ -1,213 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for StorkAttribute complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="StorkAttribute">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="mandatory" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "StorkAttribute", propOrder = { - "name", - "mandatory" -}) -@Entity(name = "StorkAttribute") -@Table(name = "STORKATTRIBUTE") -@Inheritance(strategy = InheritanceType.JOINED) -public class StorkAttribute - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected String name; - @XmlElement(required = true, type = String.class) - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean mandatory; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the name property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "NAME_", length = 255) - public String getName() { - return name; - } - - /** - * Sets the value of the name property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the mandatory property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "MANDATORY") - public Boolean isMandatory() { - return mandatory; - } - - /** - * Sets the value of the mandatory property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMandatory(Boolean value) { - this.mandatory = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof StorkAttribute)) { - return false; - } - if (this == object) { - return true; - } - final StorkAttribute that = ((StorkAttribute) object); - { - String lhsName; - lhsName = this.getName(); - String rhsName; - rhsName = that.getName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "name", lhsName), LocatorUtils.property(thatLocator, "name", rhsName), lhsName, rhsName)) { - return false; - } - } - { - Boolean lhsMandatory; - lhsMandatory = this.isMandatory(); - Boolean rhsMandatory; - rhsMandatory = that.isMandatory(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mandatory", lhsMandatory), LocatorUtils.property(thatLocator, "mandatory", rhsMandatory), lhsMandatory, rhsMandatory)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theName; - theName = this.getName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "name", theName), currentHashCode, theName); - } - { - Boolean theMandatory; - theMandatory = this.isMandatory(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mandatory", theMandatory), currentHashCode, theMandatory); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java deleted file mode 100644 index f3fb1e5d0..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplateType.java +++ /dev/null @@ -1,165 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - * das Attribut URL spezifiziert die Lage des - * Templates - * - * - *

Java class for TemplateType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="TemplateType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="URL" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "TemplateType") -@Entity(name = "TemplateType") -@Table(name = "TEMPLATETYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class TemplateType - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "URL", required = true) - @XmlSchemaType(name = "anyURI") - protected String url; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the url property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "URL") - public String getURL() { - return url; - } - - /** - * Sets the value of the url property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setURL(String value) { - this.url = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof TemplateType)) { - return false; - } - if (this == object) { - return true; - } - final TemplateType that = ((TemplateType) object); - { - String lhsURL; - lhsURL = this.getURL(); - String rhsURL; - rhsURL = that.getURL(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "url", lhsURL), LocatorUtils.property(thatLocator, "url", rhsURL), lhsURL, rhsURL)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theURL; - theURL = this.getURL(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "url", theURL), currentHashCode, theURL); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java deleted file mode 100644 index 1dc94e718..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TemplatesType.java +++ /dev/null @@ -1,367 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for TemplatesType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="TemplatesType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Template" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TemplateType" maxOccurs="3" minOccurs="0"/>
- *         <element name="AditionalAuthBlockText" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="BKUSelectionCustomization" type="{http://www.buergerkarte.at/namespaces/moaconfig#}BKUSelectionCustomizationType" minOccurs="0"/>
- *         <element name="BKUSelectionTemplate" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" minOccurs="0"/>
- *         <element name="SendAssertionTemplate" type="{http://www.buergerkarte.at/namespaces/moaconfig#}TransformsInfoType" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "TemplatesType", propOrder = { - "template", - "aditionalAuthBlockText", - "bkuSelectionCustomization", - "bkuSelectionTemplate", - "sendAssertionTemplate" -}) -@Entity(name = "TemplatesType") -@Table(name = "TEMPLATESTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class TemplatesType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Template") - protected List template; - @XmlElement(name = "AditionalAuthBlockText") - protected String aditionalAuthBlockText; - @XmlElement(name = "BKUSelectionCustomization") - protected BKUSelectionCustomizationType bkuSelectionCustomization; - @XmlElement(name = "BKUSelectionTemplate") - protected TransformsInfoType bkuSelectionTemplate; - @XmlElement(name = "SendAssertionTemplate") - protected TransformsInfoType sendAssertionTemplate; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the template property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the template property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getTemplate().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link TemplateType } - * - * - */ - @OneToMany(targetEntity = TemplateType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "TEMPLATE__TEMPLATESTYPE_HJID") - public List getTemplate() { - if (template == null) { - template = new ArrayList(); - } - return this.template; - } - - /** - * - * - */ - public void setTemplate(List template) { - this.template = template; - } - - /** - * Gets the value of the aditionalAuthBlockText property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ADITIONALAUTHBLOCKTEXT", length = 255) - public String getAditionalAuthBlockText() { - return aditionalAuthBlockText; - } - - /** - * Sets the value of the aditionalAuthBlockText property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setAditionalAuthBlockText(String value) { - this.aditionalAuthBlockText = value; - } - - /** - * Gets the value of the bkuSelectionCustomization property. - * - * @return - * possible object is - * {@link BKUSelectionCustomizationType } - * - */ - @ManyToOne(targetEntity = BKUSelectionCustomizationType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "BKUSELECTIONCUSTOMIZATION_TE_0") - public BKUSelectionCustomizationType getBKUSelectionCustomization() { - return bkuSelectionCustomization; - } - - /** - * Sets the value of the bkuSelectionCustomization property. - * - * @param value - * allowed object is - * {@link BKUSelectionCustomizationType } - * - */ - public void setBKUSelectionCustomization(BKUSelectionCustomizationType value) { - this.bkuSelectionCustomization = value; - } - - /** - * Gets the value of the bkuSelectionTemplate property. - * - * @return - * possible object is - * {@link TransformsInfoType } - * - */ - @ManyToOne(targetEntity = TransformsInfoType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "BKUSELECTIONTEMPLATE_TEMPLAT_0") - public TransformsInfoType getBKUSelectionTemplate() { - return bkuSelectionTemplate; - } - - /** - * Sets the value of the bkuSelectionTemplate property. - * - * @param value - * allowed object is - * {@link TransformsInfoType } - * - */ - public void setBKUSelectionTemplate(TransformsInfoType value) { - this.bkuSelectionTemplate = value; - } - - /** - * Gets the value of the sendAssertionTemplate property. - * - * @return - * possible object is - * {@link TransformsInfoType } - * - */ - @ManyToOne(targetEntity = TransformsInfoType.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "SENDASSERTIONTEMPLATE_TEMPLA_0") - public TransformsInfoType getSendAssertionTemplate() { - return sendAssertionTemplate; - } - - /** - * Sets the value of the sendAssertionTemplate property. - * - * @param value - * allowed object is - * {@link TransformsInfoType } - * - */ - public void setSendAssertionTemplate(TransformsInfoType value) { - this.sendAssertionTemplate = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof TemplatesType)) { - return false; - } - if (this == object) { - return true; - } - final TemplatesType that = ((TemplatesType) object); - { - List lhsTemplate; - lhsTemplate = (((this.template!= null)&&(!this.template.isEmpty()))?this.getTemplate():null); - List rhsTemplate; - rhsTemplate = (((that.template!= null)&&(!that.template.isEmpty()))?that.getTemplate():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "template", lhsTemplate), LocatorUtils.property(thatLocator, "template", rhsTemplate), lhsTemplate, rhsTemplate)) { - return false; - } - } - { - String lhsAditionalAuthBlockText; - lhsAditionalAuthBlockText = this.getAditionalAuthBlockText(); - String rhsAditionalAuthBlockText; - rhsAditionalAuthBlockText = that.getAditionalAuthBlockText(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "aditionalAuthBlockText", lhsAditionalAuthBlockText), LocatorUtils.property(thatLocator, "aditionalAuthBlockText", rhsAditionalAuthBlockText), lhsAditionalAuthBlockText, rhsAditionalAuthBlockText)) { - return false; - } - } - { - BKUSelectionCustomizationType lhsBKUSelectionCustomization; - lhsBKUSelectionCustomization = this.getBKUSelectionCustomization(); - BKUSelectionCustomizationType rhsBKUSelectionCustomization; - rhsBKUSelectionCustomization = that.getBKUSelectionCustomization(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "bkuSelectionCustomization", lhsBKUSelectionCustomization), LocatorUtils.property(thatLocator, "bkuSelectionCustomization", rhsBKUSelectionCustomization), lhsBKUSelectionCustomization, rhsBKUSelectionCustomization)) { - return false; - } - } - { - TransformsInfoType lhsBKUSelectionTemplate; - lhsBKUSelectionTemplate = this.getBKUSelectionTemplate(); - TransformsInfoType rhsBKUSelectionTemplate; - rhsBKUSelectionTemplate = that.getBKUSelectionTemplate(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "bkuSelectionTemplate", lhsBKUSelectionTemplate), LocatorUtils.property(thatLocator, "bkuSelectionTemplate", rhsBKUSelectionTemplate), lhsBKUSelectionTemplate, rhsBKUSelectionTemplate)) { - return false; - } - } - { - TransformsInfoType lhsSendAssertionTemplate; - lhsSendAssertionTemplate = this.getSendAssertionTemplate(); - TransformsInfoType rhsSendAssertionTemplate; - rhsSendAssertionTemplate = that.getSendAssertionTemplate(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "sendAssertionTemplate", lhsSendAssertionTemplate), LocatorUtils.property(thatLocator, "sendAssertionTemplate", rhsSendAssertionTemplate), lhsSendAssertionTemplate, rhsSendAssertionTemplate)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theTemplate; - theTemplate = (((this.template!= null)&&(!this.template.isEmpty()))?this.getTemplate():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "template", theTemplate), currentHashCode, theTemplate); - } - { - String theAditionalAuthBlockText; - theAditionalAuthBlockText = this.getAditionalAuthBlockText(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "aditionalAuthBlockText", theAditionalAuthBlockText), currentHashCode, theAditionalAuthBlockText); - } - { - BKUSelectionCustomizationType theBKUSelectionCustomization; - theBKUSelectionCustomization = this.getBKUSelectionCustomization(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bkuSelectionCustomization", theBKUSelectionCustomization), currentHashCode, theBKUSelectionCustomization); - } - { - TransformsInfoType theBKUSelectionTemplate; - theBKUSelectionTemplate = this.getBKUSelectionTemplate(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bkuSelectionTemplate", theBKUSelectionTemplate), currentHashCode, theBKUSelectionTemplate); - } - { - TransformsInfoType theSendAssertionTemplate; - theSendAssertionTemplate = this.getSendAssertionTemplate(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "sendAssertionTemplate", theSendAssertionTemplate), currentHashCode, theSendAssertionTemplate); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java deleted file mode 100644 index fb061d2eb..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentials.java +++ /dev/null @@ -1,260 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="credentialOID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="enableTestCredentials" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "credentialOID" -}) -@Entity(name = "TestCredentials") -@Table(name = "TESTCREDENTIALS") -@Inheritance(strategy = InheritanceType.JOINED) -public class TestCredentials - implements Serializable, Equals, HashCode -{ - - protected List credentialOID; - @XmlAttribute(name = "enableTestCredentials") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean enableTestCredentials; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List credentialOIDItems; - - /** - * Gets the value of the credentialOID property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the credentialOID property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getCredentialOID().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getCredentialOID() { - if (credentialOID == null) { - credentialOID = new ArrayList(); - } - return this.credentialOID; - } - - /** - * - * - */ - public void setCredentialOID(List credentialOID) { - this.credentialOID = credentialOID; - } - - /** - * Gets the value of the enableTestCredentials property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ENABLETESTCREDENTIALS") - public boolean isEnableTestCredentials() { - if (enableTestCredentials == null) { - return new ZeroOneBooleanAdapter().unmarshal("false"); - } else { - return enableTestCredentials; - } - } - - /** - * Sets the value of the enableTestCredentials property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEnableTestCredentials(Boolean value) { - this.enableTestCredentials = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = TestCredentialsCredentialOIDItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "CREDENTIALOIDITEMS_TESTCREDE_0") - public List getCredentialOIDItems() { - if (this.credentialOIDItems == null) { - this.credentialOIDItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.credentialOID)) { - this.credentialOID = ItemUtils.wrap(this.credentialOID, this.credentialOIDItems, TestCredentialsCredentialOIDItem.class); - } - return this.credentialOIDItems; - } - - public void setCredentialOIDItems(List value) { - this.credentialOID = null; - this.credentialOIDItems = null; - this.credentialOIDItems = value; - if (this.credentialOIDItems == null) { - this.credentialOIDItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.credentialOID)) { - this.credentialOID = ItemUtils.wrap(this.credentialOID, this.credentialOIDItems, TestCredentialsCredentialOIDItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof TestCredentials)) { - return false; - } - if (this == object) { - return true; - } - final TestCredentials that = ((TestCredentials) object); - { - List lhsCredentialOID; - lhsCredentialOID = (((this.credentialOID!= null)&&(!this.credentialOID.isEmpty()))?this.getCredentialOID():null); - List rhsCredentialOID; - rhsCredentialOID = (((that.credentialOID!= null)&&(!that.credentialOID.isEmpty()))?that.getCredentialOID():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "credentialOID", lhsCredentialOID), LocatorUtils.property(thatLocator, "credentialOID", rhsCredentialOID), lhsCredentialOID, rhsCredentialOID)) { - return false; - } - } - { - boolean lhsEnableTestCredentials; - lhsEnableTestCredentials = ((this.enableTestCredentials!= null)?this.isEnableTestCredentials():false); - boolean rhsEnableTestCredentials; - rhsEnableTestCredentials = ((that.enableTestCredentials!= null)?that.isEnableTestCredentials():false); - if (!strategy.equals(LocatorUtils.property(thisLocator, "enableTestCredentials", lhsEnableTestCredentials), LocatorUtils.property(thatLocator, "enableTestCredentials", rhsEnableTestCredentials), lhsEnableTestCredentials, rhsEnableTestCredentials)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - List theCredentialOID; - theCredentialOID = (((this.credentialOID!= null)&&(!this.credentialOID.isEmpty()))?this.getCredentialOID():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "credentialOID", theCredentialOID), currentHashCode, theCredentialOID); - } - { - boolean theEnableTestCredentials; - theEnableTestCredentials = ((this.enableTestCredentials!= null)?this.isEnableTestCredentials():false); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "enableTestCredentials", theEnableTestCredentials), currentHashCode, theEnableTestCredentials); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java deleted file mode 100644 index 92d92bda7..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TestCredentialsCredentialOIDItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "TestCredentialsCredentialOIDItem") -@Table(name = "TESTCREDENTIALSCREDENTIALOID_0") -@Inheritance(strategy = InheritanceType.JOINED) -public class TestCredentialsCredentialOIDItem - implements Serializable, Item -{ - - @XmlElement(name = "credentialOID", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java deleted file mode 100644 index c33a2d500..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TimeOuts.java +++ /dev/null @@ -1,253 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.math.BigInteger; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Assertion" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *         <element name="MOASessionCreated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *         <element name="MOASessionUpdated" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "assertion", - "moaSessionCreated", - "moaSessionUpdated" -}) -@Entity(name = "TimeOuts") -@Table(name = "TIMEOUTS") -@Inheritance(strategy = InheritanceType.JOINED) -public class TimeOuts - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "Assertion", required = true) - protected BigInteger assertion; - @XmlElement(name = "MOASessionCreated", required = true) - protected BigInteger moaSessionCreated; - @XmlElement(name = "MOASessionUpdated", required = true) - protected BigInteger moaSessionUpdated; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the assertion property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - @Basic - @Column(name = "ASSERTION_", precision = 20, scale = 0) - public BigInteger getAssertion() { - return assertion; - } - - /** - * Sets the value of the assertion property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setAssertion(BigInteger value) { - this.assertion = value; - } - - /** - * Gets the value of the moaSessionCreated property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - @Basic - @Column(name = "MOASESSIONCREATED", precision = 20, scale = 0) - public BigInteger getMOASessionCreated() { - return moaSessionCreated; - } - - /** - * Sets the value of the moaSessionCreated property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setMOASessionCreated(BigInteger value) { - this.moaSessionCreated = value; - } - - /** - * Gets the value of the moaSessionUpdated property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - @Basic - @Column(name = "MOASESSIONUPDATED", precision = 20, scale = 0) - public BigInteger getMOASessionUpdated() { - return moaSessionUpdated; - } - - /** - * Sets the value of the moaSessionUpdated property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setMOASessionUpdated(BigInteger value) { - this.moaSessionUpdated = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof TimeOuts)) { - return false; - } - if (this == object) { - return true; - } - final TimeOuts that = ((TimeOuts) object); - { - BigInteger lhsAssertion; - lhsAssertion = this.getAssertion(); - BigInteger rhsAssertion; - rhsAssertion = that.getAssertion(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "assertion", lhsAssertion), LocatorUtils.property(thatLocator, "assertion", rhsAssertion), lhsAssertion, rhsAssertion)) { - return false; - } - } - { - BigInteger lhsMOASessionCreated; - lhsMOASessionCreated = this.getMOASessionCreated(); - BigInteger rhsMOASessionCreated; - rhsMOASessionCreated = that.getMOASessionCreated(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "moaSessionCreated", lhsMOASessionCreated), LocatorUtils.property(thatLocator, "moaSessionCreated", rhsMOASessionCreated), lhsMOASessionCreated, rhsMOASessionCreated)) { - return false; - } - } - { - BigInteger lhsMOASessionUpdated; - lhsMOASessionUpdated = this.getMOASessionUpdated(); - BigInteger rhsMOASessionUpdated; - rhsMOASessionUpdated = that.getMOASessionUpdated(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "moaSessionUpdated", lhsMOASessionUpdated), LocatorUtils.property(thatLocator, "moaSessionUpdated", rhsMOASessionUpdated), lhsMOASessionUpdated, rhsMOASessionUpdated)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - BigInteger theAssertion; - theAssertion = this.getAssertion(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "assertion", theAssertion), currentHashCode, theAssertion); - } - { - BigInteger theMOASessionCreated; - theMOASessionCreated = this.getMOASessionCreated(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "moaSessionCreated", theMOASessionCreated), currentHashCode, theMOASessionCreated); - } - { - BigInteger theMOASessionUpdated; - theMOASessionUpdated = this.getMOASessionUpdated(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "moaSessionUpdated", theMOASessionUpdated), currentHashCode, theMOASessionUpdated); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java deleted file mode 100644 index c1706a591..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TransformsInfoType.java +++ /dev/null @@ -1,215 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Lob; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - * das Attribut filename verweist auf eine Datei mit - * globalem Element TransformsInfo vom Typ sl10:TransformsInfo; diese - * TransformsInfo werden in den CreateXMLSignatureRequest fuer die - * Signatur des AUTH-Blocks inkludiert - * - * - *

Java class for TransformsInfoType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="TransformsInfoType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="transformation" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
- *       </sequence>
- *       <attribute name="filename" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "TransformsInfoType", propOrder = { - "transformation" -}) -@Entity(name = "TransformsInfoType") -@Table(name = "TRANSFORMSINFOTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class TransformsInfoType - implements Serializable, Equals, HashCode -{ - - @XmlElement(required = true) - protected byte[] transformation; - @XmlAttribute(name = "filename", required = true) - @XmlSchemaType(name = "anyURI") - protected String filename; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the transformation property. - * - * @return - * possible object is - * byte[] - */ - @Basic - @Column(name = "TRANSFORMATION") - @Lob - public byte[] getTransformation() { - return transformation; - } - - /** - * Sets the value of the transformation property. - * - * @param value - * allowed object is - * byte[] - */ - public void setTransformation(byte[] value) { - this.transformation = value; - } - - /** - * Gets the value of the filename property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FILENAME") - public String getFilename() { - return filename; - } - - /** - * Sets the value of the filename property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFilename(String value) { - this.filename = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof TransformsInfoType)) { - return false; - } - if (this == object) { - return true; - } - final TransformsInfoType that = ((TransformsInfoType) object); - { - byte[] lhsTransformation; - lhsTransformation = this.getTransformation(); - byte[] rhsTransformation; - rhsTransformation = that.getTransformation(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "transformation", lhsTransformation), LocatorUtils.property(thatLocator, "transformation", rhsTransformation), lhsTransformation, rhsTransformation)) { - return false; - } - } - { - String lhsFilename; - lhsFilename = this.getFilename(); - String rhsFilename; - rhsFilename = that.getFilename(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "filename", lhsFilename), LocatorUtils.property(thatLocator, "filename", rhsFilename), lhsFilename, rhsFilename)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - byte[] theTransformation; - theTransformation = this.getTransformation(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "transformation", theTransformation), currentHashCode, theTransformation); - } - { - String theFilename; - theFilename = this.getFilename(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "filename", theFilename), currentHashCode, theFilename); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java deleted file mode 100644 index 8bf36c415..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/TrustAnchor.java +++ /dev/null @@ -1,131 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://www.buergerkarte.at/namespaces/moaconfig#}X509IssuerSerialType">
- *       <attribute name="mode" use="required" type="{http://www.buergerkarte.at/namespaces/moaconfig#}ChainingModeType" />
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "") -@Entity(name = "TrustAnchor") -@Table(name = "TRUSTANCHOR") -public class TrustAnchor - extends X509IssuerSerialType - implements Serializable, Equals, HashCode -{ - - @XmlAttribute(name = "mode", required = true) - protected ChainingModeType mode; - - /** - * Gets the value of the mode property. - * - * @return - * possible object is - * {@link ChainingModeType } - * - */ - @Basic - @Column(name = "MODE_", length = 255) - @Enumerated(EnumType.STRING) - public ChainingModeType getMode() { - return mode; - } - - /** - * Sets the value of the mode property. - * - * @param value - * allowed object is - * {@link ChainingModeType } - * - */ - public void setMode(ChainingModeType value) { - this.mode = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof TrustAnchor)) { - return false; - } - if (this == object) { - return true; - } - if (!super.equals(thisLocator, thatLocator, object, strategy)) { - return false; - } - final TrustAnchor that = ((TrustAnchor) object); - { - ChainingModeType lhsMode; - lhsMode = this.getMode(); - ChainingModeType rhsMode; - rhsMode = that.getMode(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mode", lhsMode), LocatorUtils.property(thatLocator, "mode", rhsMode), lhsMode, rhsMode)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = super.hashCode(locator, strategy); - { - ChainingModeType theMode; - theMode = this.getMode(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mode", theMode), currentHashCode, theMode); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java deleted file mode 100644 index 5e29131ad..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java +++ /dev/null @@ -1,1077 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.sun.tools.xjc.runtime.ZeroOneBooleanAdapter; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for UserDatabase complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="UserDatabase">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="bpk" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="familyname" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="givenname" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="institut" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="mail" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="phone" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="username" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="password" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="password_salt" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="userRequestTokken" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="isActive" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="isAdmin" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="isUsernamePasswordAllowed" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="isMandateUser" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="isMailAddressVerified" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="isAdminRequest" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="isPVP2Generated" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
- *         <element name="lastLogin" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="OnlineApplication" type="{http://www.buergerkarte.at/namespaces/moaconfig#}OnlineApplication" maxOccurs="unbounded" minOccurs="0"/>
- *         <element name="onlyBusinessService" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *         <element name="businessServiceType" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "UserDatabase", propOrder = { - "bpk", - "familyname", - "givenname", - "institut", - "mail", - "phone", - "username", - "password", - "passwordSalt", - "userRequestTokken", - "isActive", - "isAdmin", - "isUsernamePasswordAllowed", - "isMandateUser", - "isMailAddressVerified", - "isAdminRequest", - "isPVP2Generated", - "lastLogin", - "onlineApplication", - "onlyBusinessService", - "businessServiceType" -}) -@Entity(name = "UserDatabase") -@Table(name = "USERDATABASE") -@Inheritance(strategy = InheritanceType.JOINED) -public class UserDatabase - implements Serializable, Equals, HashCode -{ - - protected String bpk; - protected String familyname; - protected String givenname; - @XmlElement(required = true) - protected String institut; - @XmlElement(required = true) - protected String mail; - @XmlElement(required = true) - protected String phone; - @XmlElement(required = true) - protected String username; - @XmlElement(required = true) - protected String password; - @XmlElement(name = "password_salt") - protected String passwordSalt; - protected String userRequestTokken; - @XmlElement(required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isActive; - @XmlElement(required = true, type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isAdmin; - @XmlElement(type = String.class, defaultValue = "true") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isUsernamePasswordAllowed; - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isMandateUser; - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isMailAddressVerified; - @XmlElement(type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isAdminRequest; - @XmlElement(type = String.class) - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean isPVP2Generated; - @XmlElement(required = true) - protected String lastLogin; - @XmlElement(name = "OnlineApplication") - protected List onlineApplication; - @XmlElement(required = true, type = String.class, defaultValue = "false") - @XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class) - @XmlSchemaType(name = "boolean") - protected Boolean onlyBusinessService; - protected String businessServiceType; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the bpk property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "BPK", length = 255) - public String getBpk() { - return bpk; - } - - /** - * Sets the value of the bpk property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBpk(String value) { - this.bpk = value; - } - - /** - * Gets the value of the familyname property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "FAMILYNAME", length = 255) - public String getFamilyname() { - return familyname; - } - - /** - * Sets the value of the familyname property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setFamilyname(String value) { - this.familyname = value; - } - - /** - * Gets the value of the givenname property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "GIVENNAME", length = 255) - public String getGivenname() { - return givenname; - } - - /** - * Sets the value of the givenname property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setGivenname(String value) { - this.givenname = value; - } - - /** - * Gets the value of the institut property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "INSTITUT", length = 255) - public String getInstitut() { - return institut; - } - - /** - * Sets the value of the institut property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setInstitut(String value) { - this.institut = value; - } - - /** - * Gets the value of the mail property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "MAIL", length = 255) - public String getMail() { - return mail; - } - - /** - * Sets the value of the mail property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMail(String value) { - this.mail = value; - } - - /** - * Gets the value of the phone property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PHONE", length = 255) - public String getPhone() { - return phone; - } - - /** - * Sets the value of the phone property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPhone(String value) { - this.phone = value; - } - - /** - * Gets the value of the username property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "USERNAME", length = 255) - public String getUsername() { - return username; - } - - /** - * Sets the value of the username property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setUsername(String value) { - this.username = value; - } - - /** - * Gets the value of the password property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PASSWORD_", length = 255) - public String getPassword() { - return password; - } - - /** - * Sets the value of the password property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPassword(String value) { - this.password = value; - } - - /** - * Gets the value of the passwordSalt property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "PASSWORDSALT", length = 255) - public String getPasswordSalt() { - return passwordSalt; - } - - /** - * Sets the value of the passwordSalt property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setPasswordSalt(String value) { - this.passwordSalt = value; - } - - /** - * Gets the value of the userRequestTokken property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "USERREQUESTTOKKEN", length = 255) - public String getUserRequestTokken() { - return userRequestTokken; - } - - /** - * Sets the value of the userRequestTokken property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setUserRequestTokken(String value) { - this.userRequestTokken = value; - } - - /** - * Gets the value of the isActive property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISACTIVE") - public Boolean isIsActive() { - return isActive; - } - - /** - * Sets the value of the isActive property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsActive(Boolean value) { - this.isActive = value; - } - - /** - * Gets the value of the isAdmin property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISADMIN") - public Boolean isIsAdmin() { - return isAdmin; - } - - /** - * Sets the value of the isAdmin property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsAdmin(Boolean value) { - this.isAdmin = value; - } - - /** - * Gets the value of the isUsernamePasswordAllowed property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISUSERNAMEPASSWORDALLOWED") - public Boolean isIsUsernamePasswordAllowed() { - return isUsernamePasswordAllowed; - } - - /** - * Sets the value of the isUsernamePasswordAllowed property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsUsernamePasswordAllowed(Boolean value) { - this.isUsernamePasswordAllowed = value; - } - - /** - * Gets the value of the isMandateUser property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISMANDATEUSER") - public Boolean isIsMandateUser() { - return isMandateUser; - } - - /** - * Sets the value of the isMandateUser property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsMandateUser(Boolean value) { - this.isMandateUser = value; - } - - /** - * Gets the value of the isMailAddressVerified property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISMAILADDRESSVERIFIED") - public Boolean isIsMailAddressVerified() { - return isMailAddressVerified; - } - - /** - * Sets the value of the isMailAddressVerified property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsMailAddressVerified(Boolean value) { - this.isMailAddressVerified = value; - } - - /** - * Gets the value of the isAdminRequest property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISADMINREQUEST") - public Boolean isIsAdminRequest() { - return isAdminRequest; - } - - /** - * Sets the value of the isAdminRequest property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsAdminRequest(Boolean value) { - this.isAdminRequest = value; - } - - /** - * Gets the value of the isPVP2Generated property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ISPVP2GENERATED") - public Boolean isIsPVP2Generated() { - return isPVP2Generated; - } - - /** - * Sets the value of the isPVP2Generated property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setIsPVP2Generated(Boolean value) { - this.isPVP2Generated = value; - } - - /** - * Gets the value of the lastLogin property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "LASTLOGIN", length = 255) - public String getLastLogin() { - return lastLogin; - } - - /** - * Sets the value of the lastLogin property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setLastLogin(String value) { - this.lastLogin = value; - } - - /** - * Gets the value of the onlineApplication property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the onlineApplication property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getOnlineApplication().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link OnlineApplication } - * - * - */ - @OneToMany(targetEntity = OnlineApplication.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "ONLINEAPPLICATION_USERDATABA_0") - public List getOnlineApplication() { - if (onlineApplication == null) { - onlineApplication = new ArrayList(); - } - return this.onlineApplication; - } - - /** - * - * - */ - public void setOnlineApplication(List onlineApplication) { - this.onlineApplication = onlineApplication; - } - - /** - * Gets the value of the onlyBusinessService property. - * - * @return - * possible object is - * {@link String } - * - */ - @Transient - public Boolean isOnlyBusinessService() { - return onlyBusinessService; - } - - /** - * Sets the value of the onlyBusinessService property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setOnlyBusinessService(Boolean value) { - this.onlyBusinessService = value; - } - - /** - * Gets the value of the businessServiceType property. - * - * @return - * possible object is - * {@link String } - * - */ - @Transient - public String getBusinessServiceType() { - return businessServiceType; - } - - /** - * Sets the value of the businessServiceType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setBusinessServiceType(String value) { - this.businessServiceType = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof UserDatabase)) { - return false; - } - if (this == object) { - return true; - } - final UserDatabase that = ((UserDatabase) object); - { - String lhsBpk; - lhsBpk = this.getBpk(); - String rhsBpk; - rhsBpk = that.getBpk(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "bpk", lhsBpk), LocatorUtils.property(thatLocator, "bpk", rhsBpk), lhsBpk, rhsBpk)) { - return false; - } - } - { - String lhsFamilyname; - lhsFamilyname = this.getFamilyname(); - String rhsFamilyname; - rhsFamilyname = that.getFamilyname(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "familyname", lhsFamilyname), LocatorUtils.property(thatLocator, "familyname", rhsFamilyname), lhsFamilyname, rhsFamilyname)) { - return false; - } - } - { - String lhsGivenname; - lhsGivenname = this.getGivenname(); - String rhsGivenname; - rhsGivenname = that.getGivenname(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "givenname", lhsGivenname), LocatorUtils.property(thatLocator, "givenname", rhsGivenname), lhsGivenname, rhsGivenname)) { - return false; - } - } - { - String lhsInstitut; - lhsInstitut = this.getInstitut(); - String rhsInstitut; - rhsInstitut = that.getInstitut(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "institut", lhsInstitut), LocatorUtils.property(thatLocator, "institut", rhsInstitut), lhsInstitut, rhsInstitut)) { - return false; - } - } - { - String lhsMail; - lhsMail = this.getMail(); - String rhsMail; - rhsMail = that.getMail(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "mail", lhsMail), LocatorUtils.property(thatLocator, "mail", rhsMail), lhsMail, rhsMail)) { - return false; - } - } - { - String lhsPhone; - lhsPhone = this.getPhone(); - String rhsPhone; - rhsPhone = that.getPhone(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "phone", lhsPhone), LocatorUtils.property(thatLocator, "phone", rhsPhone), lhsPhone, rhsPhone)) { - return false; - } - } - { - String lhsUsername; - lhsUsername = this.getUsername(); - String rhsUsername; - rhsUsername = that.getUsername(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "username", lhsUsername), LocatorUtils.property(thatLocator, "username", rhsUsername), lhsUsername, rhsUsername)) { - return false; - } - } - { - String lhsPassword; - lhsPassword = this.getPassword(); - String rhsPassword; - rhsPassword = that.getPassword(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword)) { - return false; - } - } - { - String lhsPasswordSalt; - lhsPasswordSalt = this.getPasswordSalt(); - String rhsPasswordSalt; - rhsPasswordSalt = that.getPasswordSalt(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "passwordSalt", lhsPasswordSalt), LocatorUtils.property(thatLocator, "passwordSalt", rhsPasswordSalt), lhsPasswordSalt, rhsPasswordSalt)) { - return false; - } - } - { - String lhsUserRequestTokken; - lhsUserRequestTokken = this.getUserRequestTokken(); - String rhsUserRequestTokken; - rhsUserRequestTokken = that.getUserRequestTokken(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "userRequestTokken", lhsUserRequestTokken), LocatorUtils.property(thatLocator, "userRequestTokken", rhsUserRequestTokken), lhsUserRequestTokken, rhsUserRequestTokken)) { - return false; - } - } - { - Boolean lhsIsActive; - lhsIsActive = this.isIsActive(); - Boolean rhsIsActive; - rhsIsActive = that.isIsActive(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isActive", lhsIsActive), LocatorUtils.property(thatLocator, "isActive", rhsIsActive), lhsIsActive, rhsIsActive)) { - return false; - } - } - { - Boolean lhsIsAdmin; - lhsIsAdmin = this.isIsAdmin(); - Boolean rhsIsAdmin; - rhsIsAdmin = that.isIsAdmin(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isAdmin", lhsIsAdmin), LocatorUtils.property(thatLocator, "isAdmin", rhsIsAdmin), lhsIsAdmin, rhsIsAdmin)) { - return false; - } - } - { - Boolean lhsIsUsernamePasswordAllowed; - lhsIsUsernamePasswordAllowed = this.isIsUsernamePasswordAllowed(); - Boolean rhsIsUsernamePasswordAllowed; - rhsIsUsernamePasswordAllowed = that.isIsUsernamePasswordAllowed(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isUsernamePasswordAllowed", lhsIsUsernamePasswordAllowed), LocatorUtils.property(thatLocator, "isUsernamePasswordAllowed", rhsIsUsernamePasswordAllowed), lhsIsUsernamePasswordAllowed, rhsIsUsernamePasswordAllowed)) { - return false; - } - } - { - Boolean lhsIsMandateUser; - lhsIsMandateUser = this.isIsMandateUser(); - Boolean rhsIsMandateUser; - rhsIsMandateUser = that.isIsMandateUser(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isMandateUser", lhsIsMandateUser), LocatorUtils.property(thatLocator, "isMandateUser", rhsIsMandateUser), lhsIsMandateUser, rhsIsMandateUser)) { - return false; - } - } - { - Boolean lhsIsMailAddressVerified; - lhsIsMailAddressVerified = this.isIsMailAddressVerified(); - Boolean rhsIsMailAddressVerified; - rhsIsMailAddressVerified = that.isIsMailAddressVerified(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isMailAddressVerified", lhsIsMailAddressVerified), LocatorUtils.property(thatLocator, "isMailAddressVerified", rhsIsMailAddressVerified), lhsIsMailAddressVerified, rhsIsMailAddressVerified)) { - return false; - } - } - { - Boolean lhsIsAdminRequest; - lhsIsAdminRequest = this.isIsAdminRequest(); - Boolean rhsIsAdminRequest; - rhsIsAdminRequest = that.isIsAdminRequest(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isAdminRequest", lhsIsAdminRequest), LocatorUtils.property(thatLocator, "isAdminRequest", rhsIsAdminRequest), lhsIsAdminRequest, rhsIsAdminRequest)) { - return false; - } - } - { - Boolean lhsIsPVP2Generated; - lhsIsPVP2Generated = this.isIsPVP2Generated(); - Boolean rhsIsPVP2Generated; - rhsIsPVP2Generated = that.isIsPVP2Generated(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "isPVP2Generated", lhsIsPVP2Generated), LocatorUtils.property(thatLocator, "isPVP2Generated", rhsIsPVP2Generated), lhsIsPVP2Generated, rhsIsPVP2Generated)) { - return false; - } - } - { - String lhsLastLogin; - lhsLastLogin = this.getLastLogin(); - String rhsLastLogin; - rhsLastLogin = that.getLastLogin(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "lastLogin", lhsLastLogin), LocatorUtils.property(thatLocator, "lastLogin", rhsLastLogin), lhsLastLogin, rhsLastLogin)) { - return false; - } - } - { - List lhsOnlineApplication; - lhsOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); - List rhsOnlineApplication; - rhsOnlineApplication = (((that.onlineApplication!= null)&&(!that.onlineApplication.isEmpty()))?that.getOnlineApplication():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlineApplication", lhsOnlineApplication), LocatorUtils.property(thatLocator, "onlineApplication", rhsOnlineApplication), lhsOnlineApplication, rhsOnlineApplication)) { - return false; - } - } - { - Boolean lhsOnlyBusinessService; - lhsOnlyBusinessService = this.isOnlyBusinessService(); - Boolean rhsOnlyBusinessService; - rhsOnlyBusinessService = that.isOnlyBusinessService(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "onlyBusinessService", lhsOnlyBusinessService), LocatorUtils.property(thatLocator, "onlyBusinessService", rhsOnlyBusinessService), lhsOnlyBusinessService, rhsOnlyBusinessService)) { - return false; - } - } - { - String lhsBusinessServiceType; - lhsBusinessServiceType = this.getBusinessServiceType(); - String rhsBusinessServiceType; - rhsBusinessServiceType = that.getBusinessServiceType(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "businessServiceType", lhsBusinessServiceType), LocatorUtils.property(thatLocator, "businessServiceType", rhsBusinessServiceType), lhsBusinessServiceType, rhsBusinessServiceType)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theBpk; - theBpk = this.getBpk(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "bpk", theBpk), currentHashCode, theBpk); - } - { - String theFamilyname; - theFamilyname = this.getFamilyname(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "familyname", theFamilyname), currentHashCode, theFamilyname); - } - { - String theGivenname; - theGivenname = this.getGivenname(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "givenname", theGivenname), currentHashCode, theGivenname); - } - { - String theInstitut; - theInstitut = this.getInstitut(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "institut", theInstitut), currentHashCode, theInstitut); - } - { - String theMail; - theMail = this.getMail(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mail", theMail), currentHashCode, theMail); - } - { - String thePhone; - thePhone = this.getPhone(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "phone", thePhone), currentHashCode, thePhone); - } - { - String theUsername; - theUsername = this.getUsername(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "username", theUsername), currentHashCode, theUsername); - } - { - String thePassword; - thePassword = this.getPassword(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword); - } - { - String thePasswordSalt; - thePasswordSalt = this.getPasswordSalt(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "passwordSalt", thePasswordSalt), currentHashCode, thePasswordSalt); - } - { - String theUserRequestTokken; - theUserRequestTokken = this.getUserRequestTokken(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "userRequestTokken", theUserRequestTokken), currentHashCode, theUserRequestTokken); - } - { - Boolean theIsActive; - theIsActive = this.isIsActive(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isActive", theIsActive), currentHashCode, theIsActive); - } - { - Boolean theIsAdmin; - theIsAdmin = this.isIsAdmin(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAdmin", theIsAdmin), currentHashCode, theIsAdmin); - } - { - Boolean theIsUsernamePasswordAllowed; - theIsUsernamePasswordAllowed = this.isIsUsernamePasswordAllowed(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isUsernamePasswordAllowed", theIsUsernamePasswordAllowed), currentHashCode, theIsUsernamePasswordAllowed); - } - { - Boolean theIsMandateUser; - theIsMandateUser = this.isIsMandateUser(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isMandateUser", theIsMandateUser), currentHashCode, theIsMandateUser); - } - { - Boolean theIsMailAddressVerified; - theIsMailAddressVerified = this.isIsMailAddressVerified(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isMailAddressVerified", theIsMailAddressVerified), currentHashCode, theIsMailAddressVerified); - } - { - Boolean theIsAdminRequest; - theIsAdminRequest = this.isIsAdminRequest(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isAdminRequest", theIsAdminRequest), currentHashCode, theIsAdminRequest); - } - { - Boolean theIsPVP2Generated; - theIsPVP2Generated = this.isIsPVP2Generated(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "isPVP2Generated", theIsPVP2Generated), currentHashCode, theIsPVP2Generated); - } - { - String theLastLogin; - theLastLogin = this.getLastLogin(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "lastLogin", theLastLogin), currentHashCode, theLastLogin); - } - { - List theOnlineApplication; - theOnlineApplication = (((this.onlineApplication!= null)&&(!this.onlineApplication.isEmpty()))?this.getOnlineApplication():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlineApplication", theOnlineApplication), currentHashCode, theOnlineApplication); - } - { - Boolean theOnlyBusinessService; - theOnlyBusinessService = this.isOnlyBusinessService(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "onlyBusinessService", theOnlyBusinessService), currentHashCode, theOnlyBusinessService); - } - { - String theBusinessServiceType; - theBusinessServiceType = this.getBusinessServiceType(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "businessServiceType", theBusinessServiceType), currentHashCode, theBusinessServiceType); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java deleted file mode 100644 index ff1c8f97d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlock.java +++ /dev/null @@ -1,254 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import javax.persistence.Basic; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.hyperjaxb3.item.ItemUtils; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *         <element name="VerifyTransformsInfoProfileID" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "trustProfileID", - "verifyTransformsInfoProfileID" -}) -@Entity(name = "VerifyAuthBlock") -@Table(name = "VERIFYAUTHBLOCK") -@Inheritance(strategy = InheritanceType.JOINED) -public class VerifyAuthBlock - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TrustProfileID", required = true) - protected String trustProfileID; - @XmlElement(name = "VerifyTransformsInfoProfileID") - protected List verifyTransformsInfoProfileID; - @XmlAttribute(name = "Hjid") - protected Long hjid; - protected transient List verifyTransformsInfoProfileIDItems; - - /** - * Gets the value of the trustProfileID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TRUSTPROFILEID", length = 255) - public String getTrustProfileID() { - return trustProfileID; - } - - /** - * Sets the value of the trustProfileID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTrustProfileID(String value) { - this.trustProfileID = value; - } - - /** - * Gets the value of the verifyTransformsInfoProfileID property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the verifyTransformsInfoProfileID property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getVerifyTransformsInfoProfileID().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link String } - * - * - */ - @Transient - public List getVerifyTransformsInfoProfileID() { - if (verifyTransformsInfoProfileID == null) { - verifyTransformsInfoProfileID = new ArrayList(); - } - return this.verifyTransformsInfoProfileID; - } - - /** - * - * - */ - public void setVerifyTransformsInfoProfileID(List verifyTransformsInfoProfileID) { - this.verifyTransformsInfoProfileID = verifyTransformsInfoProfileID; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - @OneToMany(targetEntity = VerifyAuthBlockVerifyTransformsInfoProfileIDItem.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "VERIFYTRANSFORMSINFOPROFILEI_1") - public List getVerifyTransformsInfoProfileIDItems() { - if (this.verifyTransformsInfoProfileIDItems == null) { - this.verifyTransformsInfoProfileIDItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.verifyTransformsInfoProfileID)) { - this.verifyTransformsInfoProfileID = ItemUtils.wrap(this.verifyTransformsInfoProfileID, this.verifyTransformsInfoProfileIDItems, VerifyAuthBlockVerifyTransformsInfoProfileIDItem.class); - } - return this.verifyTransformsInfoProfileIDItems; - } - - public void setVerifyTransformsInfoProfileIDItems(List value) { - this.verifyTransformsInfoProfileID = null; - this.verifyTransformsInfoProfileIDItems = null; - this.verifyTransformsInfoProfileIDItems = value; - if (this.verifyTransformsInfoProfileIDItems == null) { - this.verifyTransformsInfoProfileIDItems = new ArrayList(); - } - if (ItemUtils.shouldBeWrapped(this.verifyTransformsInfoProfileID)) { - this.verifyTransformsInfoProfileID = ItemUtils.wrap(this.verifyTransformsInfoProfileID, this.verifyTransformsInfoProfileIDItems, VerifyAuthBlockVerifyTransformsInfoProfileIDItem.class); - } - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof VerifyAuthBlock)) { - return false; - } - if (this == object) { - return true; - } - final VerifyAuthBlock that = ((VerifyAuthBlock) object); - { - String lhsTrustProfileID; - lhsTrustProfileID = this.getTrustProfileID(); - String rhsTrustProfileID; - rhsTrustProfileID = that.getTrustProfileID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { - return false; - } - } - { - List lhsVerifyTransformsInfoProfileID; - lhsVerifyTransformsInfoProfileID = (((this.verifyTransformsInfoProfileID!= null)&&(!this.verifyTransformsInfoProfileID.isEmpty()))?this.getVerifyTransformsInfoProfileID():null); - List rhsVerifyTransformsInfoProfileID; - rhsVerifyTransformsInfoProfileID = (((that.verifyTransformsInfoProfileID!= null)&&(!that.verifyTransformsInfoProfileID.isEmpty()))?that.getVerifyTransformsInfoProfileID():null); - if (!strategy.equals(LocatorUtils.property(thisLocator, "verifyTransformsInfoProfileID", lhsVerifyTransformsInfoProfileID), LocatorUtils.property(thatLocator, "verifyTransformsInfoProfileID", rhsVerifyTransformsInfoProfileID), lhsVerifyTransformsInfoProfileID, rhsVerifyTransformsInfoProfileID)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theTrustProfileID; - theTrustProfileID = this.getTrustProfileID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); - } - { - List theVerifyTransformsInfoProfileID; - theVerifyTransformsInfoProfileID = (((this.verifyTransformsInfoProfileID!= null)&&(!this.verifyTransformsInfoProfileID.isEmpty()))?this.getVerifyTransformsInfoProfileID():null); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "verifyTransformsInfoProfileID", theVerifyTransformsInfoProfileID), currentHashCode, theVerifyTransformsInfoProfileID); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java deleted file mode 100644 index fef7c185b..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyAuthBlockVerifyTransformsInfoProfileIDItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import org.jvnet.hyperjaxb3.item.Item; - -@XmlAccessorType(XmlAccessType.FIELD) -@Entity(name = "VerifyAuthBlockVerifyTransformsInfoProfileIDItem") -@Table(name = "VERIFYAUTHBLOCKVERIFYTRANSFO_0") -@Inheritance(strategy = InheritanceType.JOINED) -public class VerifyAuthBlockVerifyTransformsInfoProfileIDItem - implements Serializable, Item -{ - - @XmlElement(name = "VerifyTransformsInfoProfileID", namespace = "http://www.buergerkarte.at/namespaces/moaconfig#") - protected String item; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the item property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "ITEM", length = 255) - public String getItem() { - return item; - } - - /** - * Sets the value of the item property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setItem(String value) { - this.item = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java deleted file mode 100644 index 3b6ee5fcd..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyIdentityLink.java +++ /dev/null @@ -1,164 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "trustProfileID" -}) -@Entity(name = "VerifyIdentityLink") -@Table(name = "VERIFYIDENTITYLINK") -@Inheritance(strategy = InheritanceType.JOINED) -public class VerifyIdentityLink - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "TrustProfileID", required = true) - protected String trustProfileID; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the trustProfileID property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "TRUSTPROFILEID", length = 255) - public String getTrustProfileID() { - return trustProfileID; - } - - /** - * Sets the value of the trustProfileID property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setTrustProfileID(String value) { - this.trustProfileID = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof VerifyIdentityLink)) { - return false; - } - if (this == object) { - return true; - } - final VerifyIdentityLink that = ((VerifyIdentityLink) object); - { - String lhsTrustProfileID; - lhsTrustProfileID = this.getTrustProfileID(); - String rhsTrustProfileID; - rhsTrustProfileID = that.getTrustProfileID(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "trustProfileID", lhsTrustProfileID), LocatorUtils.property(thatLocator, "trustProfileID", rhsTrustProfileID), lhsTrustProfileID, rhsTrustProfileID)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theTrustProfileID; - theTrustProfileID = this.getTrustProfileID(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "trustProfileID", theTrustProfileID), currentHashCode, theTrustProfileID); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java deleted file mode 100644 index 762b6f884..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/VerifyInfoboxesType.java +++ /dev/null @@ -1,181 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - * Verifikation zusaetzlicher Infoboxen - * - * - *

Java class for VerifyInfoboxesType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="VerifyInfoboxesType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="DefaultTrustProfile" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element ref="{http://www.buergerkarte.at/namespaces/moaconfig#}TrustProfileID"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "VerifyInfoboxesType", propOrder = { - "defaultTrustProfile" -}) -@Entity(name = "VerifyInfoboxesType") -@Table(name = "VERIFYINFOBOXESTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class VerifyInfoboxesType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "DefaultTrustProfile") - protected DefaultTrustProfile defaultTrustProfile; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the defaultTrustProfile property. - * - * @return - * possible object is - * {@link DefaultTrustProfile } - * - */ - @ManyToOne(targetEntity = DefaultTrustProfile.class, cascade = { - CascadeType.ALL - }) - @JoinColumn(name = "DEFAULTTRUSTPROFILE_VERIFYIN_0") - public DefaultTrustProfile getDefaultTrustProfile() { - return defaultTrustProfile; - } - - /** - * Sets the value of the defaultTrustProfile property. - * - * @param value - * allowed object is - * {@link DefaultTrustProfile } - * - */ - public void setDefaultTrustProfile(DefaultTrustProfile value) { - this.defaultTrustProfile = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof VerifyInfoboxesType)) { - return false; - } - if (this == object) { - return true; - } - final VerifyInfoboxesType that = ((VerifyInfoboxesType) object); - { - DefaultTrustProfile lhsDefaultTrustProfile; - lhsDefaultTrustProfile = this.getDefaultTrustProfile(); - DefaultTrustProfile rhsDefaultTrustProfile; - rhsDefaultTrustProfile = that.getDefaultTrustProfile(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "defaultTrustProfile", lhsDefaultTrustProfile), LocatorUtils.property(thatLocator, "defaultTrustProfile", rhsDefaultTrustProfile), lhsDefaultTrustProfile, rhsDefaultTrustProfile)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - DefaultTrustProfile theDefaultTrustProfile; - theDefaultTrustProfile = this.getDefaultTrustProfile(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "defaultTrustProfile", theDefaultTrustProfile), currentHashCode, theDefaultTrustProfile); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java deleted file mode 100644 index 1195930e2..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/X509IssuerSerialType.java +++ /dev/null @@ -1,213 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - - -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.math.BigInteger; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.Table; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.lang.Equals; -import org.jvnet.jaxb2_commons.lang.EqualsStrategy; -import org.jvnet.jaxb2_commons.lang.HashCode; -import org.jvnet.jaxb2_commons.lang.HashCodeStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy; -import org.jvnet.jaxb2_commons.lang.JAXBHashCodeStrategy; -import org.jvnet.jaxb2_commons.locator.ObjectLocator; -import org.jvnet.jaxb2_commons.locator.util.LocatorUtils; - - -/** - *

Java class for X509IssuerSerialType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="X509IssuerSerialType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="X509IssuerName" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="X509SerialNumber" type="{http://www.w3.org/2001/XMLSchema}integer"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "X509IssuerSerialType", propOrder = { - "x509IssuerName", - "x509SerialNumber" -}) -@XmlSeeAlso({ - TrustAnchor.class -}) -@Entity(name = "X509IssuerSerialType") -@Table(name = "X509ISSUERSERIALTYPE") -@Inheritance(strategy = InheritanceType.JOINED) -public class X509IssuerSerialType - implements Serializable, Equals, HashCode -{ - - @XmlElement(name = "X509IssuerName", required = true) - protected String x509IssuerName; - @XmlElement(name = "X509SerialNumber", required = true) - protected BigInteger x509SerialNumber; - @XmlAttribute(name = "Hjid") - protected Long hjid; - - /** - * Gets the value of the x509IssuerName property. - * - * @return - * possible object is - * {@link String } - * - */ - @Basic - @Column(name = "X509ISSUERNAME", length = 255) - public String getX509IssuerName() { - return x509IssuerName; - } - - /** - * Sets the value of the x509IssuerName property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setX509IssuerName(String value) { - this.x509IssuerName = value; - } - - /** - * Gets the value of the x509SerialNumber property. - * - * @return - * possible object is - * {@link BigInteger } - * - */ - @Basic - @Column(name = "X509SERIALNUMBER", precision = 20, scale = 0) - public BigInteger getX509SerialNumber() { - return x509SerialNumber; - } - - /** - * Sets the value of the x509SerialNumber property. - * - * @param value - * allowed object is - * {@link BigInteger } - * - */ - public void setX509SerialNumber(BigInteger value) { - this.x509SerialNumber = value; - } - - /** - * Gets the value of the hjid property. - * - * @return - * possible object is - * {@link Long } - * - */ - @Id - @Column(name = "HJID") - @GeneratedValue(strategy = GenerationType.AUTO) - public Long getHjid() { - return hjid; - } - - /** - * Sets the value of the hjid property. - * - * @param value - * allowed object is - * {@link Long } - * - */ - public void setHjid(Long value) { - this.hjid = value; - } - - public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) { - if (!(object instanceof X509IssuerSerialType)) { - return false; - } - if (this == object) { - return true; - } - final X509IssuerSerialType that = ((X509IssuerSerialType) object); - { - String lhsX509IssuerName; - lhsX509IssuerName = this.getX509IssuerName(); - String rhsX509IssuerName; - rhsX509IssuerName = that.getX509IssuerName(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "x509IssuerName", lhsX509IssuerName), LocatorUtils.property(thatLocator, "x509IssuerName", rhsX509IssuerName), lhsX509IssuerName, rhsX509IssuerName)) { - return false; - } - } - { - BigInteger lhsX509SerialNumber; - lhsX509SerialNumber = this.getX509SerialNumber(); - BigInteger rhsX509SerialNumber; - rhsX509SerialNumber = that.getX509SerialNumber(); - if (!strategy.equals(LocatorUtils.property(thisLocator, "x509SerialNumber", lhsX509SerialNumber), LocatorUtils.property(thatLocator, "x509SerialNumber", rhsX509SerialNumber), lhsX509SerialNumber, rhsX509SerialNumber)) { - return false; - } - } - return true; - } - - public boolean equals(Object object) { - final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; - return equals(null, null, object, strategy); - } - - public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) { - int currentHashCode = 1; - { - String theX509IssuerName; - theX509IssuerName = this.getX509IssuerName(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "x509IssuerName", theX509IssuerName), currentHashCode, theX509IssuerName); - } - { - BigInteger theX509SerialNumber; - theX509SerialNumber = this.getX509SerialNumber(); - currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "x509SerialNumber", theX509SerialNumber), currentHashCode, theX509SerialNumber); - } - return currentHashCode; - } - - public int hashCode() { - final HashCodeStrategy strategy = JAXBHashCodeStrategy.INSTANCE; - return this.hashCode(null, strategy); - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java deleted file mode 100644 index a1e54ed3c..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4 -// See http://java.sun.com/xml/jaxb -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.01.09 at 09:01:43 AM CET -// - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.buergerkarte.at/namespaces/moaconfig#", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package at.gv.egovernment.moa.id.commons.db.dao.config; -- cgit v1.2.3 From d659e473f755404ae40b045124460bdb1150c304 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 11:46:23 +0100 Subject: Revert "disable generation of java source files used for configuration, to avoid name conflict" This reverts commit ba58b44a840749a6a29638e5f858b2e106c9ef6e. --- id/server/moa-id-commons/pom.xml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index b3dc86f50..4fb2a67f7 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -203,7 +203,7 @@ - + @@ -236,6 +236,26 @@ + + org.jvnet.hyperjaxb3 + maven-hyperjaxb3-plugin + 0.5.6 + + + generate-sources + + generate + + + + + true + src/main/resources/config + src/main/resources/config + src/main/resources/config/persistence_template.xml + at.gv.egovernment.moa.id.commons.db.dao.config + + true maven-compiler-plugin -- cgit v1.2.3 From 893f6f7ffc1f5d17d03f5fcd47762b6e4699587a Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 11:56:52 +0100 Subject: use junit4 only in moa-id-commons --- id/server/moa-id-commons/pom.xml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 4fb2a67f7..ab9688991 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -142,6 +142,8 @@ junit junit + 4.11 + test @@ -250,9 +252,9 @@ true - src/main/resources/config - src/main/resources/config - src/main/resources/config/persistence_template.xml + src/main/resources + src/main/resources + src/main/resources/persistence_template.xml at.gv.egovernment.moa.id.commons.db.dao.config @@ -362,4 +364,4 @@ - \ No newline at end of file + -- cgit v1.2.3 From bf1c8cc094a3e2a4d0a53facfeecbf5eb282d9b9 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 13:34:07 +0100 Subject: add javadoc --- .../commons/db/ConfigurationFromDBExtractor.java | 88 ++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java index 78cd8a670..394c9cdeb 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -16,11 +16,28 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * This class is used to extract information from a legacy moa-id database. + */ public class ConfigurationFromDBExtractor { + /** + * This class should not be instantiated. + */ private ConfigurationFromDBExtractor() { } + /** + * Helper method, to query for a single value. NOTE: returns {@code null} if + * there is no result, more than one result or if an exception is thrown + * while querying the database. + * + * @param queryString + * a jpa query string. + * @param clazz + * the class type of the expected result. + * @return the result of the query or {@code null}. + */ private static T getSingleValue(String queryString, Class clazz) { T result = null; EntityManager session = ConfigurationDBUtils.getCurrentSession(); @@ -33,6 +50,16 @@ public class ConfigurationFromDBExtractor { return result; } + /** + * Helper method, to query for a a list of values. NOTE: the returned list + * may be empty but is never {@code null}. + * + * @param queryString + * a jpa query string. + * @param clazz + * the class type of the elements the expected result list. + * @return a list with the result of the query or an empty list. + */ private static List getListOfValues(String queryString, Class clazz) { List result = new ArrayList(); EntityManager session = ConfigurationDBUtils.getCurrentSession(); @@ -45,46 +72,107 @@ public class ConfigurationFromDBExtractor { return result; } + /** + * Extracts an {@link AuthComponentGeneral} from the database. NOTE: returns + * {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return an AuthComponentgeneral or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY) public static AuthComponentGeneral getAuthComponentGeneral() { return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); } + /** + * Extracts an {@link AuthComponentGeneral} from the database. NOTE: returns + * {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return an AuthComponentgeneral or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.CHAINING_MODES_KEY) public static ChainingModes getChainingModes() { return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); } + /** + * Extracts a list of {@link OnlineApplication} from the database. NOTE: the + * returned list may be empty but is never {@code null}. + * + * @return a list of {@link OnlineApplication}. + */ @JsonProperty(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY) public static List getOnlineApplications() { return getListOfValues("from OnlineApplication", OnlineApplication.class); } + /** + * Extracts a list of {@link GenericConfiguration} from the database. NOTE: + * the returned list may be empty but is never {@code null}. + * + * @return a list of {@link GenericConfiguration}. + */ @JsonProperty(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY) public static List getGenericConfigurations() { return getListOfValues("from GenericConfiguration", GenericConfiguration.class); } + /** + * Extracts the trusted CA-certificates from the database. NOTE: returns + * {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return the trusted CA-certificates or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY) public static String getTrustedCACertificates() { return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); } + /** + * Extracts a {@link DefaultBKUs} from the database. NOTE: returns + * {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return a DefaultBKUs or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY) public static DefaultBKUs getDefaultBKUs() { return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); } + /** + * Extracts a {@link SLRequestTemplates} from the database. NOTE: returns + * {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return a SLRequestTemplates or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY) public static SLRequestTemplates getSLRequestTemplates() { return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); } + /** + * Extracts the moa-id timestamp (last update) from the database. NOTE: + * returns {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return the moa-id timestamp (last update) or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY) public static Date getTimeStampItem() { return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); } + /** + * Extracts the date of the last pvp2refresh from the database. NOTE: + * returns {@code null} if there is no result, more than one result or if an + * exception is thrown while querying the database. + * + * @return the date of the last pvp2refresh or {@code null}. + */ @JsonProperty(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY) public static Date getPvp2RefreshItem() { return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); -- cgit v1.2.3 From b59207a8718709b7b27570bb02e7d8b942882cb4 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 13:51:44 +0100 Subject: small change to workings of delete, small bugfix --- .../moa/id/commons/db/NewConfigurationDBWrite.java | 44 ++++++---------------- 1 file changed, 12 insertions(+), 32 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java index d8ac55b4e..e1b51ee9b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java @@ -18,8 +18,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import com.datentechnik.moa.id.conf.persistence.Configuration; /** - * - * + * This class is used for writing to the key-value database. */ @Component public class NewConfigurationDBWrite { @@ -33,61 +32,45 @@ public class NewConfigurationDBWrite { } private static boolean saveAuthComponentGeneral(AuthComponentGeneral dbo) { - - conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); } private static boolean saveChainingModes(ChainingModes dbo) { - conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); } private static boolean saveOnlineApplication(OnlineApplication dbo) { List storedObjects = conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); storedObjects.add(dbo); - conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); - - return true; + return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); } private static boolean saveGenericConfiguration(GenericConfiguration dbo) { List storedObjects = conf.getList(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); storedObjects.add(dbo); - conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); - return true; + return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); } private static boolean saveTrustedCACertificates(String dbo) { - - conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); } private static boolean saveDefaultBKUs(DefaultBKUs dbo) { - - conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); } private static boolean saveSLRequestTemplates(SLRequestTemplates dbo) { - - conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); } private static boolean saveTimeStampItem(Date dbo) { - - conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); } private static boolean savePvp2RefreshItem(Date dbo) { - - conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); - return true; + return conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); } /** @@ -96,9 +79,7 @@ public class NewConfigurationDBWrite { * @return {@code true} on success; {@code false} otherwise. */ public static boolean saveOnlineApplications(List oas) { - - conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); - return true; + return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); } /** @@ -107,7 +88,6 @@ public class NewConfigurationDBWrite { * @return {@code true} on success; {@code false} otherwise. */ public static boolean saveGenericConfigurations(List gcs) { - return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, gcs); } @@ -151,7 +131,7 @@ public class NewConfigurationDBWrite { * @param key the key */ public static void delete(String key) { - conf.delete(key); + conf.set(key, null); } } -- cgit v1.2.3 From 24783cd40ebb9a91a6045afd9d3bf88ff52b5f5e Mon Sep 17 00:00:00 2001 From: Christian Wagner Date: Wed, 21 Jan 2015 14:57:37 +0100 Subject: add java doc add little logging minor fixes --- .../moa/id/conf/persistence/Configuration.java | 45 ++++++----- .../moa/id/conf/persistence/ConfigurationImpl.java | 86 +++++++++++----------- 2 files changed, 65 insertions(+), 66 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java index 43f7d9454..873208aaf 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java @@ -3,53 +3,52 @@ package com.datentechnik.moa.id.conf.persistence; import java.util.List; /** - * + * An interface for a key-value configuration. */ public interface Configuration { /** - * - * @param key - * @return + * Get the value associated with the given key as {@link Object}. + * @param key the key + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. */ Object get(String key); /** + * Get the object of type {@code T} associated with the given key. * - * @param key - * @param clazz - * @return + * @param key the key + * @param clazz the type of the requested object + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. */ T get(String key, Class clazz); /** + * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. * - * @param key - * @param value + * @param key the key under which the value is stored, respectively key determining the entry to be deleted. + * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. + * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. */ boolean set(String key, Object value); /** + * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default + * value is returned. * - * @param key - * @param clazz - * @param defaultValue - * @return + * @param key the key + * @param clazz the type of the requested object + * @param defaultValue the default value to return + * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value. */ T get(String key, Class clazz, Object defaultValue); /** - * - * @param key - * @param clazz - * @return + * Get a list of objects associated with the given key. The list may be empty or contain only a single object. + * @param key the key + * @param clazz the type of the requested object + * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key. */ List getList(String key, Class clazz); - /** - * - * @param key - * @return - */ - void delete(String key); } \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java index eebecf509..6d05af791 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; import org.springframework.stereotype.Component; @@ -21,12 +23,14 @@ import com.fasterxml.jackson.databind.type.CollectionType; import com.fasterxml.jackson.databind.type.TypeFactory; /** - * - * + * The implementation of a key-value configuration implementing the {@link Configuration} interface. + * It employs the {@link ConfigPropertyDao} to persist configuration data. */ @Component public class ConfigurationImpl implements Configuration { + private final Logger log = LoggerFactory.getLogger(getClass()); + ConfigPropertyDao configPropertyDao; private JsonMapper mapper = new JsonMapper(); @@ -42,10 +46,10 @@ public class ConfigurationImpl implements Configuration { @Override public Object get(String key) { // return null if key does not exist - try { - return mapper.deserialize(getPropertyValue(key), null); + return mapper.deserialize(configPropertyDao.getProperty(key).getValue(), null); } catch (Exception e) { + log.trace("Error while deserializing value of key '{}' to object.", key); return null; } } @@ -58,6 +62,7 @@ public class ConfigurationImpl implements Configuration { try { return clazz.cast(mapper.deserialize(property.getValue(), clazz)); } catch (IOException e) { + log.trace("Error while deserializing value of key '{}' to object of type {}.",key,clazz.getClass()); return null; } } else { @@ -68,24 +73,27 @@ public class ConfigurationImpl implements Configuration { @Override public boolean set(String key, Object value) { - ConfigProperty keyValue = new ConfigProperty(); - keyValue.setKey(key); - try { - keyValue.setValue(mapper.serialize(value)); - // System.out.println(">> key - value: " + keyValue.getKey() + " - " + keyValue.getValue() + "\n"); - configPropertyDao.saveProperty(keyValue); + if (value == null) { + configPropertyDao.delete(key); return true; - } catch (JsonProcessingException e) { - // TODO do proper error handling - e.printStackTrace(); - return false; - } + } else { + ConfigProperty keyValue = new ConfigProperty(); + keyValue.setKey(key); + try { + keyValue.setValue(mapper.serialize(value)); + configPropertyDao.saveProperty(keyValue); + return true; + } catch (JsonProcessingException e) { + log.trace("Error while serializing object for key '{}'.", key); + return false; + } + } } @Override public T get(String key, Class clazz, Object defaultValue) { - // TODO complete the method + T value = get(key, clazz); if (value != null) { return value; @@ -116,36 +124,30 @@ public class ConfigurationImpl implements Configuration { } return tmp; } catch (IOException e) { + log.trace("Error while deserializing value for key '{}' to List<{}>.", key,clazz.getClass()); return new ArrayList(); } } - private String getPropertyValue(String key) { - ConfigProperty property = configPropertyDao.getProperty(key); - return property.getValue(); - } - - @Override - public void delete(String key) { - configPropertyDao.delete(key); - } - /** - * + * Helper class to handle the JSON (de-)serialization. * */ private class JsonMapper { private ObjectMapper mapper = new ObjectMapper(); + /** + * The default constructor where the default pretty printer is disabled. + */ public JsonMapper() { this(false); } /** - * - * @param prettyPrint + * The constructor. + * @param prettyPrint enables or disables the default pretty printer */ public JsonMapper(boolean prettyPrint) { mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); @@ -157,25 +159,26 @@ public class ConfigurationImpl implements Configuration { } /** - * - * @param value - * @return - * @throws JsonProcessingException + * Serialize an object to a JSON string. + * @param value the object to serialize + * @return a JSON string + * @throws JsonProcessingException thrown when an error occurs during serialization */ public String serialize(Object value) throws JsonProcessingException { return mapper.writeValueAsString(value); } /** + * Deserialize a JSON string. * - * @param value - * @param clazz - * @return - * @throws JsonParseException - * @throws JsonMappingException - * @throws IOException + * @param value the JSON string to deserialize + * @param clazz optional parameter that determines the type of the returned object. If not set, an {@link Object} is returned. + * @return the deserialized JSON string as an object of type {@code clazz} or {@link Object} + * @throws JsonParseException if the JSON string contains invalid content. + * @throws JsonMappingException if the input JSON structure does not match structure expected for result type + * @throws IOException if an I/O problem occurs (e.g. unexpected end-of-input) */ - public Object deserialize(String value, Class clazz) throws JsonParseException, JsonMappingException, IOException { + public Object deserialize(String value, Class clazz) throws JsonParseException, JsonMappingException, IOException{ ObjectMapper mapper = new ObjectMapper(); if (clazz != null) { @@ -184,10 +187,7 @@ public class ConfigurationImpl implements Configuration { } else { return mapper.readValue(value, Object.class); } - } - }; - } -- cgit v1.2.3 From 54cb4518bd64dba0c1f373f262afb7a988f35e1a Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Wed, 21 Jan 2015 15:35:02 +0100 Subject: move 'cli' package from project 'moa-id-DTI', add additional input parameter --- .../moa/id/conf/MigrateConfiguration.java | 110 ++++++++++++++++++ .../datentechnik/moa/id/conf/cli/CLIConstants.java | 35 ++++++ .../datentechnik/moa/id/conf/cli/MOAIDConfCLI.java | 123 +++++++++++++++++++++ .../id/conf/cli/MigrateConfigurationParams.java | 95 ++++++++++++++++ 4 files changed, 363 insertions(+) create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java new file mode 100644 index 000000000..6197bbcae --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java @@ -0,0 +1,110 @@ +package com.datentechnik.moa.id.conf; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; + +import org.xml.sax.SAXException; + +import com.datentechnik.moa.id.conf.cli.MOAIDConfCLI; +import com.datentechnik.moa.id.conf.cli.MigrateConfigurationParams; + +public class MigrateConfiguration { + +// public static final String XML_APPLICATION_CONTEXT = ""; + + public static void main(String[] args) { + + MOAIDConfCLI cli = new MOAIDConfCLI(); + MigrateConfigurationParams parsedParameters = cli.parse(args); + + if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { + + //read from input file + File inFile = new File(parsedParameters.getInputTarget()); + try (FileInputStream inStream = new FileInputStream(inFile);) { + + if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { + // input from file and output to a file is desired + // parseToOutputFile(inStream, outFile); + + } else if (parsedParameters.getOutputDBConfig() != null) { + // input from file and output to a database is desired + // readFromFileWriteToDB(inStream,parsedParameters.getOutputDBConfig()); + } + } catch (FileNotFoundException e) { + System.out.println("Could not find the input file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not read from to the input file."); + System.exit(1); + } + } else if(parsedParameters.getInputDBConfig() != null){ + // read from input database + if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { + // input from database and output to a file is desired + // readFromDBWriteToFile(dbConfigFilePath, outFile); + + } else if (parsedParameters.getOutputDBConfig() != null) { + // input from database and output to a database is desired + // readFromDBWriteToDB(inDBConfigFilePath, outDBConfigFilePath); + + } + + } + else { + System.exit(1); + } + } + + /** + * Helper method to parse the input stream an write a output properties + * file. + * + * @param inStream + * the input stream to read from. + * @param outFile + * the output file to write to. + */ + private static void readFromFileWriteToFile(FileInputStream inStream, File outFile) throws ParserConfigurationException, + SAXException { + + try (FileOutputStream outStream = new FileOutputStream(outFile);) { + + //TODO: implement + + } catch (FileNotFoundException e) { + System.out.println("Could not find the output file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not write to the output file."); + System.exit(1); + } + } + + private static void readFromDBWriteToFile(String dbConfigFilePath, File outFile){ + //TODO: implement + } + + /** + * Helper method to parse the input stream an write the properties to a + * database. + * + * @param inStream + * the input stream to read from. + * @param dbConfigFilePath + * the path to the database configuration file. + */ + private static void readFromFileWriteToDB(FileInputStream inStream, String dbConfigFilePath) { + //TODO: implement + } + + private static void readFromDBWriteToDB(String inDBConfigFilePath, String outDBConfigFilePath){ + //TODO implement + } + +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java new file mode 100644 index 000000000..b5e0f242f --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java @@ -0,0 +1,35 @@ +package com.datentechnik.moa.id.conf.cli; + +/** + * Constants for the CLI. + * @author Christian Wagner + * + */ +public class CLIConstants { + private CLIConstants() { + } + + public static final String CMD_LINE_SYNTAX = "java -jar migrateMOAIDconfiguration.jar"; + + public static final String HELP_HEADER = "Convert a given MOAID 2.x config-file."; + public static final String HELP_FOOTER = ""; + // default width of a printed row + public static final int HELP_ROW_WIDTH = 80; + + public static final int HELP_SPACE_BEFORE_OPT = 2; + public static final int HELP_SPACE_BEFORE_DESC = 4; + + public static final String CLI_PARAM_IN = "in"; + public static final String CLI_PARAM_IN_LONG = "input-file"; + public static final String CLI_PARAM_OUT = "out"; + public static final String CLI_PARAM_OUT_LONG = "output-file"; + public static final String CLI_PARAM_INDB = "indb"; + public static final String CLI_PARAM_INDB_LONG = "input-dbconf"; + public static final String CLI_PARAM_OUTDB = "outdb"; + public static final String CLI_PARAM_OUTDB_LONG = "output-dbconf"; + + public static final String CLI_PARAM_HELP = "h"; + public static final String CLI_PARAM_HELP_LONG = "help"; + + +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java new file mode 100644 index 000000000..78b9450ce --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java @@ -0,0 +1,123 @@ +package com.datentechnik.moa.id.conf.cli; + +import java.io.OutputStream; +import java.io.PrintWriter; + +import org.apache.commons.cli.BasicParser; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionGroup; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The command-line interface for MOAID configuration migration + * @author Christian Wagner + * + */ +public class MOAIDConfCLI { + + // the default output to write usage information and help text to + private static final OutputStream OUTPUT_STREAM = System.out; + + private Logger log = LoggerFactory.getLogger(getClass()); + + /** + * Parses the given command-line arguments using a {@link BasicParser} with small modifications. + * @param commandLineArgs the command-line arguments. + */ + public MigrateConfigurationParams parse(String[] commandLineArgs) { + + CommandLineParser parser = new BasicParser(); + CommandLine cmd = null; + MigrateConfigurationParams result = null; + try { + + if (null == commandLineArgs || commandLineArgs.length == 0) { + printUsage(OUTPUT_STREAM, true); + System.exit(0); + } + + cmd = parser.parse(createOptions(), commandLineArgs, true); + + if( null != cmd && cmd.hasOption(CLIConstants.CLI_PARAM_HELP)){ + printUsage(OUTPUT_STREAM, true); + System.exit(0); + } + + result = new MigrateConfigurationParams(cmd); + + } catch (ParseException e) { + log.warn("Encountered exception while parsing: {}", e.getMessage()); + System.err.println(e.getMessage()); + printUsage(OUTPUT_STREAM, false); + System.exit(1); + } + return result; + } + + /** + * Prints information about the usage to the given output. + * @param out the {@link OutputStream} to write to + * @param printOptions determines whether the available options are printed + */ + private void printUsage(OutputStream out, boolean printOptions) { + + PrintWriter pOut = new PrintWriter(out); + + HelpFormatter formatter = new HelpFormatter(); + pOut.println(); + pOut.println("usage: " + CLIConstants.CMD_LINE_SYNTAX + " -" + CLIConstants.CLI_PARAM_IN + " | -" + CLIConstants.CLI_PARAM_INDB + " -" + CLIConstants.CLI_PARAM_OUT + + " | -" + CLIConstants.CLI_PARAM_OUTDB + " [-" + CLIConstants.CLI_PARAM_HELP + "]"); + pOut.println(); + pOut.println(CLIConstants.HELP_HEADER); + if(printOptions){ + pOut.println(); + formatter.printOptions(pOut, CLIConstants.HELP_ROW_WIDTH, createOptions(), CLIConstants.HELP_SPACE_BEFORE_OPT, CLIConstants.HELP_SPACE_BEFORE_DESC); + } + pOut.flush(); + + } + + /** + * Create all {@linkplain Option options} that should be available in the CLI. + * @return The {@linkplain Options options} + */ + private Options createOptions() { + + Options options = new Options(); + + OptionGroup inGroup = new OptionGroup(); + Option optionInput = new Option(CLIConstants.CLI_PARAM_IN, CLIConstants.CLI_PARAM_IN_LONG, true, "MOAID config-file to convert"); + optionInput.setArgName("inputfile"); + Option optionDBInput = new Option(CLIConstants.CLI_PARAM_INDB, CLIConstants.CLI_PARAM_INDB_LONG, true, "config for database to read from"); + optionDBInput.setArgName("dbconfig"); + + inGroup.addOption(optionDBInput); + inGroup.addOption(optionInput); + optionInput.setRequired(false); + + + OptionGroup outGroup = new OptionGroup(); + Option optionOutput = new Option(CLIConstants.CLI_PARAM_OUT, CLIConstants.CLI_PARAM_OUT_LONG, true, "target file to write to"); + optionOutput.setArgName("outputfile"); + Option optionDBOutput = new Option(CLIConstants.CLI_PARAM_OUTDB, CLIConstants.CLI_PARAM_OUTDB_LONG, true, "config for database to write to"); + optionDBOutput.setArgName("dbconfig"); + + outGroup.addOption(optionDBOutput); + outGroup.addOption(optionOutput); + outGroup.setRequired(false); + + options.addOptionGroup(inGroup); + options.addOptionGroup(outGroup); + + Option optHelp = new Option(CLIConstants.CLI_PARAM_HELP, CLIConstants.CLI_PARAM_HELP_LONG, false, "prints this message"); + options.addOption(optHelp); + return options; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java new file mode 100644 index 000000000..0a13d952b --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java @@ -0,0 +1,95 @@ +package com.datentechnik.moa.id.conf.cli; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.MissingOptionException; + +/** + * The result set for the parsed command line arguments + * @author Christian Wagner + * + */ +public class MigrateConfigurationParams { + + private String inputFile = null; + private String outputFile = null; + private String inputDbConfigFile = null; + private String outputDbConfigFile = null; + + /** + * Get the path to the input source which is MOAID 2.x config file in XML-format. + * @return the path to the input source or {@code null} if not set. + */ + public String getInputTarget() { + return this.inputFile; + } + + /** + * Get the path to the output file to write to. + * @return the path to the output file or {@code null} if not set. + */ + public String getOutputFile() { + return outputFile; + } + + /** + * Get the path to the configuration file for the input database. + * @return the path to the config file or {@code null} if not set. + */ + public String getInputDBConfig() { + return inputDbConfigFile; + } + + /** + * Get the path to the configuration file for the output database. + * @return the path to the config file or {@code null} if not set. + */ + public String getOutputDBConfig() { + return outputDbConfigFile; + } + + /** + * Returns whether the desired input is a config file for a database. + * @return true if the stored path points at a database config file; false otherwise. + */ + public boolean isInputDB() { + return inputDbConfigFile != null; + } + + /** + * Returns whether the desired output is a config file for a database. + * @return true if the stored path points at a database config file; false otherwise. + */ + public boolean isOutputDB() { + return outputDbConfigFile != null; + } + + /** + * + * @param cmdLine + * @throws MissingOptionException + */ + public MigrateConfigurationParams(CommandLine cmdLine) throws MissingOptionException { + inputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_IN); + inputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_INDB); + outputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUT); + outputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUTDB); + + if (null == inputFile && null == inputDbConfigFile) { + throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] required."); + } + + if (null == outputFile && null == outputDbConfigFile) { + throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_OUT + ", -" + CLIConstants.CLI_PARAM_OUTDB + "] required."); + } + + if (null != inputFile && null != inputDbConfigFile) { + throw new MissingOptionException("Only one of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] allowed."); + } + + if (null != outputFile && null != outputDbConfigFile) { + throw new MissingOptionException("Only one of [-" + CLIConstants.CLI_PARAM_OUT + ", -" + CLIConstants.CLI_PARAM_OUTDB + "] allowed."); + } + + } + +} \ No newline at end of file -- cgit v1.2.3 From d24179f90949ff6768f89eea0073f65990d0765a Mon Sep 17 00:00:00 2001 From: Martin Bonato Date: Wed, 21 Jan 2015 16:55:53 +0100 Subject: Add unit initial unit tests. --- id/server/idserverlib/pom.xml | 10 ++ .../id/config/auth/AuthConfigurationProvider.java | 15 ++- .../config/auth/NewAuthConfigurationProvider.java | 13 ++- ...nfigurationProviderLegacyCompatibilityTest.java | 110 +++++++++++++++++++++ .../auth/TestLegacyAuthConfigurationProvider.java | 31 ++++++ id/server/idserverlib/src/test/resources/log4j.xml | 16 +++ 6 files changed, 188 insertions(+), 7 deletions(-) create mode 100644 id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java create mode 100644 id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java create mode 100644 id/server/idserverlib/src/test/resources/log4j.xml (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index b224717c2..dd24f5d56 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -240,6 +240,16 @@ 1.7.6 --> + + org.easymock + easymock + test + + + org.unitils + unitils-core + test + commons-logging commons-logging diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index a143eb636..087b331b5 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -273,6 +273,12 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements load(fileName); } + /** + * Protected constructor. Used by unit tests. + */ + protected AuthConfigurationProvider() { + } + /** * Load the configuration data from XML file with the given name and build * the internal data structures representing the MOA ID configuration. @@ -493,12 +499,15 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements throw new ConfigurationException("config.02", null, t); } } - + + protected MOAIDConfiguration loadDataBaseConfig() { + return ConfigurationDBRead.getMOAIDConfiguration(); + } + public synchronized void reloadDataBaseConfig() throws ConfigurationException { Logger.info("Read MOA-ID 2.0 configuration from database."); - //moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); - moaidconfig = NewConfigurationDBRead.getMOAIDConfiguration(); + moaidconfig = loadDataBaseConfig(); Logger.info("MOA-ID 2.0 is loaded."); if (moaidconfig == null) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java index 77a9f032c..0ee143a1a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java @@ -54,10 +54,12 @@ import com.datentechnik.moa.id.conf.persistence.Configuration; */ public class NewAuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration { - @Autowired private Configuration configuration; private final Properties properties = new Properties(); + + public NewAuthConfigurationProvider() { + } public NewAuthConfigurationProvider(String fileName) throws ConfigurationException { File propertiesFile = new File(fileName); @@ -71,6 +73,11 @@ public class NewAuthConfigurationProvider extends ConfigurationProvider implemen throw new ConfigurationException("config.03", null, e); } } + + @Autowired + public void setConfiguration(Configuration configuration) { + this.configuration = configuration; + } private Properties getProperties() { return properties; @@ -105,11 +112,9 @@ public class NewAuthConfigurationProvider extends ConfigurationProvider implemen } catch (ConfigurationException e) { return null; } - ProtocolAllowed allowedProtcols = new ProtocolAllowed(); Protocols protocols = authComponentGeneral.getProtocols(); if (protocols != null) { - allowedProtcols = new ProtocolAllowed(); - + ProtocolAllowed allowedProtcols = new ProtocolAllowed(); if (protocols.getSAML1() != null) { allowedProtcols.setSAML1Active(protocols.getSAML1().isIsActive()); } diff --git a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java new file mode 100644 index 000000000..bd997303a --- /dev/null +++ b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java @@ -0,0 +1,110 @@ +package at.gv.egovnerment.moa.id.config.auth; + +import static org.easymock.EasyMock.createMock; +import static org.easymock.EasyMock.expect; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; + +import java.util.Collections; + +import org.junit.Test; +import org.unitils.reflectionassert.ReflectionAssert; + +import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; +import at.gv.egovernment.moa.id.commons.db.dao.config.OAuth; +import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; +import at.gv.egovernment.moa.id.commons.db.dao.config.SAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; +import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.auth.NewAuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; + +import com.datentechnik.moa.id.conf.persistence.Configuration; + +public class AuthConfigurationProviderLegacyCompatibilityTest { + + private MOAIDConfiguration getMinimalMoaidConfiguration() { + + MOAIDConfiguration moaidConfiguration = new MOAIDConfiguration(); + AuthComponentGeneral authComponentGeneral = new AuthComponentGeneral(); + MOASP moasp = new MOASP(); + VerifyAuthBlock verifyAuthBlock = new VerifyAuthBlock(); + moasp.setVerifyAuthBlock(verifyAuthBlock); + VerifyIdentityLink verifyIdentityLink = new VerifyIdentityLink(); + moasp.setVerifyIdentityLink(verifyIdentityLink); + authComponentGeneral.setMOASP(moasp); + SecurityLayer securityLayer = new SecurityLayer(); + TransformsInfoType transformsInfo = new TransformsInfoType(); + transformsInfo.setFilename("transforms/TransformsInfoAuthBlockTable_DE.xml"); + transformsInfo.setTransformation(new byte[] {}); + securityLayer.setTransformsInfo(Collections.singletonList(transformsInfo)); + authComponentGeneral.setSecurityLayer(securityLayer); + SLRequestTemplates slRequestTemplates = new SLRequestTemplates(); + moaidConfiguration.setSLRequestTemplates(slRequestTemplates); + GeneralConfiguration generalConfiguration = new GeneralConfiguration(); + generalConfiguration.setTrustManagerRevocationChecking(Boolean.FALSE); + generalConfiguration.setPublicURLPreFix("http://test.org"); + authComponentGeneral.setGeneralConfiguration(generalConfiguration); + moaidConfiguration.setAuthComponentGeneral(authComponentGeneral); + ChainingModes chainingModes = new ChainingModes(); + moaidConfiguration.setChainingModes(chainingModes); + + return moaidConfiguration; + } + + @Test + public void testGetAllowedProtocolls() throws ConfigurationException { + MOAIDConfiguration moaidConfiguration = getMinimalMoaidConfiguration(); + + testGetAllowedProtocolls(moaidConfiguration); + } + + @Test + public void testGetAllowedProtocollsAll() throws ConfigurationException { + MOAIDConfiguration moaidConfiguration = getMinimalMoaidConfiguration(); + Protocols protocols = new Protocols(); + SAML1 saml1 = new SAML1(); + saml1.setIsActive(Boolean.TRUE); + protocols.setSAML1(saml1); + PVP2 pvp2 = new PVP2(); + pvp2.setIsActive(Boolean.FALSE); + protocols.setPVP2(pvp2); + OAuth oAuth = new OAuth(); + oAuth.setIsActive(null); + protocols.setOAuth(oAuth); + moaidConfiguration.getAuthComponentGeneral().setProtocols(protocols); + + testGetAllowedProtocolls(moaidConfiguration); + } + + public void testGetAllowedProtocolls(MOAIDConfiguration moaidConfiguration) throws ConfigurationException { + + TestLegacyAuthConfigurationProvider legacyAuthConfigurationProvider = new TestLegacyAuthConfigurationProvider(moaidConfiguration); + ProtocolAllowed expectedAllowedProtocols = legacyAuthConfigurationProvider.getAllowedProtocols(); + + Configuration configuration = createMock(Configuration.class); + NewAuthConfigurationProvider newAuthConfigurationProvider = new NewAuthConfigurationProvider(); + newAuthConfigurationProvider.setConfiguration(configuration); + + expect(configuration.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, AuthComponentGeneral.class)).andReturn(moaidConfiguration.getAuthComponentGeneral()); + + replay(configuration); + + ProtocolAllowed actualAllowedProtocols = newAuthConfigurationProvider.getAllowedProtocols(); + + verify(configuration); + + ReflectionAssert.assertLenientEquals(expectedAllowedProtocols, actualAllowedProtocols); + } + +} diff --git a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java new file mode 100644 index 000000000..39c8ef310 --- /dev/null +++ b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java @@ -0,0 +1,31 @@ +package at.gv.egovnerment.moa.id.config.auth; + +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; + +public class TestLegacyAuthConfigurationProvider extends + AuthConfigurationProvider { + + private final MOAIDConfiguration moaidConfiguration; + + public TestLegacyAuthConfigurationProvider(MOAIDConfiguration moaidConfiguration) + throws ConfigurationException { + super(); + this.moaidConfiguration = moaidConfiguration; + reloadDataBaseConfig(); + } + + @SuppressWarnings("unused") + private TestLegacyAuthConfigurationProvider(String fileName) + throws ConfigurationException { + super(); + moaidConfiguration = new MOAIDConfiguration(); + } + + @Override + protected MOAIDConfiguration loadDataBaseConfig() { + return this.moaidConfiguration; + } + +} diff --git a/id/server/idserverlib/src/test/resources/log4j.xml b/id/server/idserverlib/src/test/resources/log4j.xml new file mode 100644 index 000000000..6685c1e82 --- /dev/null +++ b/id/server/idserverlib/src/test/resources/log4j.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + -- cgit v1.2.3 From cc7e339de3a905892be3afbd624509f3dd45b19e Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Thu, 22 Jan 2015 13:51:54 +0100 Subject: move dependencies to more appropriate pom files, testNG warning NOT fixed --- id/server/idserverlib/pom.xml | 6 ++++++ id/server/moa-id-commons/pom.xml | 2 -- id/server/pom.xml | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index dd24f5d56..eefa3761b 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -250,6 +250,12 @@ unitils-core test + + MOA + moa-common + test-jar + test + commons-logging commons-logging diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index ab9688991..dd33a9198 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -138,11 +138,9 @@ com.fasterxml.jackson.core jackson-databind - junit junit - 4.11 test diff --git a/id/server/pom.xml b/id/server/pom.xml index 2341552cc..802ba73f7 100644 --- a/id/server/pom.xml +++ b/id/server/pom.xml @@ -97,6 +97,27 @@ + + + + junit + junit + 4.11 + test + + + org.easymock + easymock + 3.3.1 + + + org.unitils + unitils-core + 3.4.2 + + + + + + + org.hibernate.ejb.HibernatePersistence + com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty + + + - + -- cgit v1.2.3 From caa4a3f833b2846ffc97b27b4fcc98dd74cdd51c Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Fri, 23 Jan 2015 11:40:11 +0100 Subject: restructure error propagation from hibernate, add force switch to CLI --- .../moa/id/conf/MigrateConfiguration.java | 31 ++++++--- .../datentechnik/moa/id/conf/cli/CLIConstants.java | 8 ++- .../datentechnik/moa/id/conf/cli/MOAIDConfCLI.java | 10 ++- .../id/conf/cli/MigrateConfigurationParams.java | 11 +++ .../moa/id/conf/persistence/Configuration.java | 10 +++ .../moa/id/conf/persistence/ConfigurationImpl.java | 79 ++++++++++++++-------- .../id/conf/persistence/dal/ConfigPropertyDao.java | 7 ++ .../persistence/dal/ConfigPropertyDaoImpl.java | 16 ++--- 8 files changed, 122 insertions(+), 50 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java index a313107ad..6110f41ea 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java @@ -33,10 +33,16 @@ import com.fasterxml.jackson.core.JsonProcessingException; */ public class MigrateConfiguration { + public static boolean isOverwriteData = false; + public static void main(String[] args) { MOAIDConfCLI cli = new MOAIDConfCLI(); MigrateConfigurationParams parsedParameters = cli.parse(args); + + // consider settings of force switch + isOverwriteData = parsedParameters.isOverwriteData(); + try { if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { // read input from file @@ -52,12 +58,6 @@ public class MigrateConfiguration { // input from file and output to a database is desired readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); } - } catch (FileNotFoundException e) { - System.out.println("Could not find the input file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not read from the input file."); - System.exit(1); } } else if (parsedParameters.getInputDBConfig() != null) { @@ -79,6 +79,12 @@ public class MigrateConfiguration { } catch (JAXBException e) { System.out.println("MOA-ID XML configuration can not be loaded from given file."); System.exit(1); + } catch (FileNotFoundException e) { + System.out.println("Could not find the input file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not read from the input file."); + System.exit(1); } } @@ -131,7 +137,7 @@ public class MigrateConfiguration { Properties result = new Properties(); boolean prettyPrint = true; - com.datentechnik.moa.id.conf.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); + JsonMapper mapper = new JsonMapper(prettyPrint); // serialize config to JSON String oaJson = mapper.serialize(config.getOnlineApplication()); @@ -195,6 +201,9 @@ public class MigrateConfiguration { // write to output stream result.store(outStream, null); + System.out.println("Old XML configuration written to:"); + System.out.println(outFile.getAbsolutePath()); + } catch (FileNotFoundException e) { System.out.println("Could not find the output file."); System.exit(1); @@ -237,7 +246,13 @@ public class MigrateConfiguration { Object value = mapper.deserialize(json, null); // add to database - dbConfiguration.set(key, value); + boolean result = dbConfiguration.set(key, value, isOverwriteData); + if (!result) { + System.out.println("Could NOT persist the configuration file's information in the database."); + System.out.println("The database already contains a configuration (see force switch if you want to override data.)"); + System.exit(1); + } + System.out.println("Data has been successfully written to the database."); } } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java index b5e0f242f..481b6d6f6 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java @@ -27,9 +27,11 @@ public class CLIConstants { public static final String CLI_PARAM_INDB_LONG = "input-dbconf"; public static final String CLI_PARAM_OUTDB = "outdb"; public static final String CLI_PARAM_OUTDB_LONG = "output-dbconf"; - + public static final String CLI_PARAM_HELP = "h"; public static final String CLI_PARAM_HELP_LONG = "help"; - - + + public static final String CLI_PARAM_FORCE = "f"; + public static final String CLI_PARAM_FORCE_LONG = "force"; + } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java index 78b9450ce..ac5ead171 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java @@ -71,8 +71,10 @@ public class MOAIDConfCLI { HelpFormatter formatter = new HelpFormatter(); pOut.println(); - pOut.println("usage: " + CLIConstants.CMD_LINE_SYNTAX + " -" + CLIConstants.CLI_PARAM_IN + " | -" + CLIConstants.CLI_PARAM_INDB + " -" + CLIConstants.CLI_PARAM_OUT - + " | -" + CLIConstants.CLI_PARAM_OUTDB + " [-" + CLIConstants.CLI_PARAM_HELP + "]"); + pOut.println("usage: " + CLIConstants.CMD_LINE_SYNTAX + " -" + CLIConstants.CLI_PARAM_FORCE + " -" + + CLIConstants.CLI_PARAM_IN + " | -" + CLIConstants.CLI_PARAM_INDB + " -" + + CLIConstants.CLI_PARAM_OUT + " | -" + CLIConstants.CLI_PARAM_OUTDB + " [-" + + CLIConstants.CLI_PARAM_HELP + "]"); pOut.println(); pOut.println(CLIConstants.HELP_HEADER); if(printOptions){ @@ -100,7 +102,6 @@ public class MOAIDConfCLI { inGroup.addOption(optionDBInput); inGroup.addOption(optionInput); optionInput.setRequired(false); - OptionGroup outGroup = new OptionGroup(); Option optionOutput = new Option(CLIConstants.CLI_PARAM_OUT, CLIConstants.CLI_PARAM_OUT_LONG, true, "target file to write to"); @@ -115,6 +116,9 @@ public class MOAIDConfCLI { options.addOptionGroup(inGroup); options.addOptionGroup(outGroup); + Option optForce = new Option(CLIConstants.CLI_PARAM_FORCE, CLIConstants.CLI_PARAM_FORCE_LONG, false, "overwrite existing data with imported data"); + options.addOption(optForce); + Option optHelp = new Option(CLIConstants.CLI_PARAM_HELP, CLIConstants.CLI_PARAM_HELP_LONG, false, "prints this message"); options.addOption(optHelp); return options; diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java index 0a13d952b..da2cac31b 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java @@ -15,6 +15,8 @@ public class MigrateConfigurationParams { private String inputDbConfigFile = null; private String outputDbConfigFile = null; + private boolean overwriteData = false; + /** * Get the path to the input source which is MOAID 2.x config file in XML-format. * @return the path to the input source or {@code null} if not set. @@ -63,6 +65,14 @@ public class MigrateConfigurationParams { return outputDbConfigFile != null; } + /** + * Returns whether existing data should be overwritten by the imported data or not. + * @return true if the existing data should be overwritten; false otherwise. + */ + public boolean isOverwriteData() { + return overwriteData; + } + /** * * @param cmdLine @@ -73,6 +83,7 @@ public class MigrateConfigurationParams { inputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_INDB); outputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUT); outputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUTDB); + overwriteData = cmdLine.hasOption(CLIConstants.CLI_PARAM_FORCE); if (null == inputFile && null == inputDbConfigFile) { throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] required."); diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java index 873208aaf..bc90208b6 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java @@ -32,6 +32,16 @@ public interface Configuration { */ boolean set(String key, Object value); + /** + * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. + * + * @param key the key under which the value is stored, respectively key determining the entry to be deleted. + * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. + * @param overwrite determines the data should be inserted, even if data is already present (insert or update). + * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. + */ + boolean set(String key, Object value, boolean overwrite); + /** * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default * value is returned. diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java index 5cab9a5ff..297a1db4c 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java @@ -42,9 +42,17 @@ public class ConfigurationImpl implements Configuration { public Object get(String key) { // return null if key does not exist try { - return mapper.deserialize(configPropertyDao.getProperty(key).getValue(), null); + ConfigProperty property = configPropertyDao.getProperty(key); + if (property != null && property.getValue() != null) { + return mapper.deserialize(property.getValue(), null); + } else { + return null; + } + } catch (IllegalArgumentException e) { + log.debug("Error while searching for key '{}' in the database.", key); + return null; } catch (Exception e) { - log.trace("Error while deserializing value of key '{}' to object.", key); + log.debug("Error while deserializing value of key '{}' to object.", key); return null; } } @@ -52,37 +60,49 @@ public class ConfigurationImpl implements Configuration { @Override public T get(String key, Class clazz) { // return null if key does not exist - ConfigProperty property = configPropertyDao.getProperty(key); - if (property != null && property.getValue() != null) { - try { + try { + ConfigProperty property = configPropertyDao.getProperty(key); + if (property != null && property.getValue() != null) { return clazz.cast(mapper.deserialize(property.getValue(), clazz)); - } catch (IOException e) { - log.trace("Error while deserializing value of key '{}' to object of type {}.",key,clazz.getClass()); + } else { return null; } - } else { + } catch (IllegalArgumentException e) { + log.debug("Error while searching for key '{}' in the database.", key); + return null; + } catch (Exception e) { + log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass()); return null; } } @Override public boolean set(String key, Object value) { + return this.set(key, value, false); + } - if (value == null) { - configPropertyDao.delete(key); - return true; - } else { + @Override + public boolean set(String key, Object value, boolean overwrite) { + + try { + if (value == null) { + configPropertyDao.delete(key); + return true; + } else { + + ConfigProperty keyValue = new ConfigProperty(); + keyValue.setKey(key); - ConfigProperty keyValue = new ConfigProperty(); - keyValue.setKey(key); - try { keyValue.setValue(mapper.serialize(value)); - configPropertyDao.saveProperty(keyValue); + configPropertyDao.saveProperty(keyValue, overwrite); return true; - } catch (JsonProcessingException e) { - log.trace("Error while serializing object for key '{}'.", key); - return false; } + } catch (JsonProcessingException e) { + log.debug("Error while serializing object for key '{}'.", key); + return false; + } catch (Exception e){ + log.debug("Error while setting value for key '{}' in the database.", key); + return false; } } @@ -102,24 +122,27 @@ public class ConfigurationImpl implements Configuration { public List getList(String key, Class clazz) { CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); - - if(configPropertyDao.getProperty(key)==null){ - return new ArrayList(); - } - String json = configPropertyDao.getProperty(key).getValue(); - ObjectMapper mapper = new ObjectMapper(); - try { + if ((configPropertyDao.getProperty(key) == null) + || (configPropertyDao.getProperty(key).getValue() == null)) { + return new ArrayList(); + } + String json = configPropertyDao.getProperty(key).getValue(); + ObjectMapper mapper = new ObjectMapper(); + return (List) mapper.readValue(json, listType); } catch (JsonMappingException e) { ArrayList tmp = new ArrayList(); T value = get(key, clazz); - if(value != null){ + if (value != null) { tmp.add(value); } return tmp; } catch (IOException e) { - log.trace("Error while deserializing value for key '{}' to List<{}>.", key,clazz.getClass()); + log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass()); + return new ArrayList(); + } catch (Exception e){ + log.debug("Error while searching key '{}' in the database.", key); return new ArrayList(); } } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java index 50dddd745..bfc3bc6cd 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java @@ -23,6 +23,13 @@ public interface ConfigPropertyDao { */ public void saveProperty(ConfigProperty property); + /** + * Persists a given {@link ConfigProperty}. + * @param property The property to be persisted. + * @param overwrite determines the data should be inserted, even if data is already present (insert or update). + */ + public void saveProperty(ConfigProperty property, boolean overwrite); + /** * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. * @return The list with the properties. diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java index 752c7dc09..dfb1f542f 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java @@ -16,7 +16,6 @@ import org.springframework.transaction.annotation.Transactional; * Database backed implementation of the DAO interface * */ - @Transactional("transactionManager") public class ConfigPropertyDaoImpl implements ConfigPropertyDao { @@ -27,14 +26,19 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { @Override public void saveProperty(ConfigProperty property) { + this.saveProperty(property, false); + } + + @Override + public void saveProperty(ConfigProperty property, boolean overwrite) { if (null == em) { log.error("No EntityManager set!"); return; } - if (em.find(ConfigProperty.class, property.getKey()) != null) { - log.trace("Property '{}' already exists!", property.toString()); - // em.merge(property); + log.debug("Storing '{}'.", property.toString()); + if (overwrite) { + em.merge(property); } else { log.debug("Storing '{}'.", property.toString()); em.persist(property); @@ -93,11 +97,7 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { @Override public void delete(String key) { log.debug("Deleting entry with key '{}'.", key); - try{ em.remove(em.find(ConfigProperty.class, key)); - }catch (IllegalArgumentException e){ - log.trace("Error while deleting entry with key '{}':" + e.getMessage(), key); - } } } -- cgit v1.2.3 From c9518b7d9772240b0d840f9175f8e576a5f6d3f6 Mon Sep 17 00:00:00 2001 From: Gerwin Gsenger Date: Mon, 26 Jan 2015 11:26:12 +0100 Subject: rework behaviour of force switch, add getAllKeys to configuration --- .../moa/id/conf/ConfigurationUtil.java | 227 ++++++++++++++++++ .../moa/id/conf/MigrateConfiguration.java | 263 ++++----------------- .../moa/id/conf/persistence/Configuration.java | 16 +- .../moa/id/conf/persistence/ConfigurationImpl.java | 24 +- .../id/conf/persistence/dal/ConfigPropertyDao.java | 25 +- .../persistence/dal/ConfigPropertyDaoImpl.java | 19 +- 6 files changed, 324 insertions(+), 250 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java new file mode 100644 index 000000000..e771b96a2 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java @@ -0,0 +1,227 @@ +package com.datentechnik.moa.id.conf; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Enumeration; +import java.util.List; +import java.util.Properties; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; + +import com.datentechnik.moa.id.conf.persistence.Configuration; +import com.datentechnik.moa.id.conf.persistence.JsonMapper; +import com.fasterxml.jackson.core.JsonProcessingException; + +public class ConfigurationUtil { + + final boolean isOverwriteData; + + public ConfigurationUtil(boolean isOverwriteData){ + this.isOverwriteData = isOverwriteData; + } + + /** + * Read an input MOAID 2 XML file, transfer it to properties and write the + * properties to a MOAID 3 property file. + * + * @param inStream + * the input stream to read from. + * @param outFile + * the output file to write to. + * @throws JAXBException + */ + public void readFromXMLFileConvertToPropertyFile(FileInputStream inStream, File outFile) throws JAXBException { + + try (FileOutputStream outStream = new FileOutputStream(outFile);) { + + // get config from xml file + JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); + Unmarshaller m = jc.createUnmarshaller(); + MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream); + + // serialize config to JSON properties + Properties result = moaIdConfigToJsonProperties(config); + + // write to output stream + result.store(outStream, null); + + } catch (FileNotFoundException e) { + System.out.println("Could not find the output file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not write to the output file."); + System.exit(1); + } + } + + /** + * Helper method to serialize a {@link MOAIDConfiguration} to Properties + * with JSON encoded values. + * + * @param config + * the MOAIDConfiguration to serialize + * @return {@link Properties} containing the database key and the serialized + * values + * @throws JsonProcessingException + * is thrown if problem occurred while serializing one of the + * database values + */ + private Properties moaIdConfigToJsonProperties(MOAIDConfiguration config) throws JsonProcessingException { + + Properties result = new Properties(); + boolean prettyPrint = true; + JsonMapper mapper = new JsonMapper(prettyPrint); + + // serialize config to JSON + String oaJson = mapper.serialize(config.getOnlineApplication()); + String authCompGeneralJson = mapper.serialize(config.getAuthComponentGeneral()); + String chainingModeJson = mapper.serialize(config.getChainingModes()); + String defaultBKUJson = mapper.serialize(config.getDefaultBKUs()); + String genericConfigJson = mapper.serialize(config.getGenericConfiguration()); + String pvp2RefreshJson = mapper.serialize(config.getPvp2RefreshItem()); + String slRequestTemplatesJson = mapper.serialize(config.getSLRequestTemplates()); + String timestampJson = mapper.serialize(config.getTimestampItem()); + String trustedCaCertJson = mapper.serialize(config.getTrustedCACertificates()); + + // add to properties + result.put(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oaJson); + result.put(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, authCompGeneralJson); + result.put(MOAIDConfigurationConstants.CHAINING_MODES_KEY, chainingModeJson); + result.put(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, defaultBKUJson); + result.put(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, genericConfigJson); + result.put(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, pvp2RefreshJson); + result.put(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, slRequestTemplatesJson); + result.put(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, timestampJson); + result.put(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, trustedCaCertJson); + + return result; + } + + /** + * Exports a key-value database to a property file, where keys are the same + * as in the database, and the values are serialized JSON objects. + * + * @param inputDBConfigFilePath + * the path to the database properties, for the db the data is + * read from. + * @param outFile + * the destination file for the exported data. + */ + public void readFromDBWriteToFile(String inputDBConfigFilePath, File outFile) { + + try (FileOutputStream outStream = new FileOutputStream(outFile);) { + + Properties result = new Properties(); + + System.getProperties().setProperty("location", "file:" + inputDBConfigFilePath); + ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); + Configuration dbConfiguration = (Configuration) context.getBean("config"); + boolean prettyPrint = true; + com.datentechnik.moa.id.conf.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); + + for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { + + // extract database value + Object value = dbConfiguration.get(key); + + // serialize value to JSON + String json = mapper.serialize(value); + + // add to properties + result.setProperty(key, json); + } + + // write to output stream + result.store(outStream, null); + + System.out.println("Property configuration written to:"); + System.out.println(outFile.getAbsolutePath()); + + } catch (FileNotFoundException e) { + System.out.println("Could not find the output file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not write to the output file."); + System.exit(1); + } + } + + /** + * Read an input property file, deserialize it's values and write them to + * the given database. + * + * @param inStream + * the FileInputStream to read from. + * @param outputDBConfigFilePath + * the path to the database properties, for the db which is + * written. + * @throws IOException + * is thrown in case the properties could not be loaded from the + * stream + */ + public void readFromFileWriteToDB(FileInputStream inStream, String outputDBConfigFilePath) throws IOException { + + Properties inProperties = new Properties(); + inProperties.load(inStream); + + System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); + ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); + Configuration dbConfiguration = (Configuration) context.getBean("config"); + boolean prettyPrint = true; + JsonMapper mapper = new JsonMapper(prettyPrint); + + List keys = dbConfiguration.getAllKeys(); + + if (keys == null) { + System.out.println("Database can not be read."); + System.exit(1); + } + + if (!keys.isEmpty() && !isOverwriteData) { + System.out.println("The database already contains configuration data."); + System.out.println("Use force switch if you want to override data)"); + System.exit(1); + } + + if (isOverwriteData) { + // remove existing entries + for (String key : keys) { + dbConfiguration.set(key, null); + } + } + + Enumeration propertyNames = inProperties.propertyNames(); + + while (propertyNames.hasMoreElements()) { + String key = (String) propertyNames.nextElement(); + // extract database value + String json = inProperties.getProperty(key); + + // deserialize value to object + Object value = mapper.deserialize(json, null); + + // add to database + boolean result = dbConfiguration.set(key, value); + if (!result) { + System.out.println("Could NOT persist the configuration file's information in the database."); + } + } + System.out.println("Data has been successfully written to the database."); + } + + private static void readFromDBWriteToDB(String inputDBConfigFilePath, String outputDBConfigFilePath) { + //TODO: implement + } + +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java index 6110f41ea..fefcf5028 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java @@ -3,260 +3,101 @@ package com.datentechnik.moa.id.conf; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; -import java.util.Properties; -import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import com.datentechnik.moa.id.conf.cli.MOAIDConfCLI; import com.datentechnik.moa.id.conf.cli.MigrateConfigurationParams; -import com.datentechnik.moa.id.conf.persistence.Configuration; -import com.datentechnik.moa.id.conf.persistence.JsonMapper; -import com.fasterxml.jackson.core.JsonProcessingException; /** * CLI tool which is able to perform the following tasks: *
    - *
  • transform a MoaID 2 XML configuration XML file to a MoaID 3 property file
  • + *
  • transform a MoaID 2 XML configuration XML file to a MoaID 3 property file + *
  • *
  • read a property file and transfer it's content to a database
  • *
  • write the content of a database to a property file
  • *
*/ public class MigrateConfiguration { - public static boolean isOverwriteData = false; - public static void main(String[] args) { MOAIDConfCLI cli = new MOAIDConfCLI(); MigrateConfigurationParams parsedParameters = cli.parse(args); // consider settings of force switch - isOverwriteData = parsedParameters.isOverwriteData(); - - try { - if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { - // read input from file - File inFile = new File(parsedParameters.getInputTarget()); - try (FileInputStream inStream = new FileInputStream(inFile);) { - - if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { - // input from file and output to a file is desired - File outFile = new File(parsedParameters.getOutputFile()); - readFromFileWriteToFile(inStream, outFile); - - } else if (parsedParameters.getOutputDBConfig() != null) { - // input from file and output to a database is desired - readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); - } - } - - } else if (parsedParameters.getInputDBConfig() != null) { - // read input from database - if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { - // input from database and output to a file is desired - File outFile = new File(parsedParameters.getOutputFile()); - String inputDBConfigFilePath = parsedParameters.getInputDBConfig(); - readFromDBWriteToFile(inputDBConfigFilePath, outFile); - - } else if (parsedParameters.getOutputDBConfig() != null) { - // input from database and output to a database is desired - // readFromDBWriteToDB(inDBConfigFilePath, outDBConfigFilePath); - } - - } else { - System.exit(1); - } - } catch (JAXBException e) { - System.out.println("MOA-ID XML configuration can not be loaded from given file."); - System.exit(1); - } catch (FileNotFoundException e) { - System.out.println("Could not find the input file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not read from the input file."); - System.exit(1); - } - } - - /** - * Read an input XML file, transfer it to properties and write the properties to a file. - * - * @param inStream - * the input stream to read from. - * @param outFile - * the output file to write to. - * @throws JAXBException - */ - private static void readFromFileWriteToFile(FileInputStream inStream, File outFile) throws JAXBException { - - try (FileOutputStream outStream = new FileOutputStream(outFile);) { + boolean isOverwriteData = parsedParameters.isOverwriteData(); + ConfigurationUtil configUtil = new ConfigurationUtil(isOverwriteData); - // get config from xml file - JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); - Unmarshaller m = jc.createUnmarshaller(); - MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream); + if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { + // read input from file + workWithInputFromFile(parsedParameters.getInputTarget(), parsedParameters, configUtil); - // serialize config to JSON properties - Properties result = moaIdConfigToJsonProperties(config); + } else if (parsedParameters.getInputDBConfig() != null) { + // read input from database + workWithImputFromDB(parsedParameters, configUtil); - // write to output stream - result.store(outStream, null); - - } catch (FileNotFoundException e) { - System.out.println("Could not find the output file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not write to the output file."); + } else { System.exit(1); } } /** - * Helper method to serialize a {@link MOAIDConfiguration} to Properties - * with JSON encoded values. + * Handle the case where input from a file is read. * - * @param config - * the MOAIDConfiguration to serialize - * @return {@link Properties} containing the database key and the serialized - * values - * @throws JsonProcessingException - * is thrown if problem occurred while serializing one of the - * database values + * @param inputFileUrl + * the url of the input file. + * @param parsedParameters + * the command line parameters. + * @param configUtil + * the class for working with the configuration. */ - private static Properties moaIdConfigToJsonProperties(MOAIDConfiguration config) throws JsonProcessingException { - - Properties result = new Properties(); - boolean prettyPrint = true; - JsonMapper mapper = new JsonMapper(prettyPrint); - - // serialize config to JSON - String oaJson = mapper.serialize(config.getOnlineApplication()); - String authCompGeneralJson = mapper.serialize(config.getAuthComponentGeneral()); - String chainingModeJson = mapper.serialize(config.getChainingModes()); - String defaultBKUJson = mapper.serialize(config.getDefaultBKUs()); - String genericConfigJson = mapper.serialize(config.getGenericConfiguration()); - String pvp2RefreshJson = mapper.serialize(config.getPvp2RefreshItem()); - String slRequestTemplatesJson = mapper.serialize(config.getSLRequestTemplates()); - String timestampJson = mapper.serialize(config.getTimestampItem()); - String trustedCaCertJson = mapper.serialize(config.getTrustedCACertificates()); - - // add to properties - result.put(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oaJson); - result.put(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, authCompGeneralJson); - result.put(MOAIDConfigurationConstants.CHAINING_MODES_KEY, chainingModeJson); - result.put(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, defaultBKUJson); - result.put(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, genericConfigJson); - result.put(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, pvp2RefreshJson); - result.put(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, slRequestTemplatesJson); - result.put(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, timestampJson); - result.put(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, trustedCaCertJson); - - return result; - } - - /** - * Exports a key-value database to a property file, where keys are the same - * as in the database, and the values are serialized JSON objects. - * - * @param inputDBConfigFilePath - * the path to the database properties, for the db the data is - * read from. - * @param outFile - * the destination file for the exported data. - */ - private static void readFromDBWriteToFile(String inputDBConfigFilePath, File outFile) { - - try (FileOutputStream outStream = new FileOutputStream(outFile);) { - - Properties result = new Properties(); - - System.getProperties().setProperty("location", "file:" + inputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - Configuration dbConfiguration = (Configuration) context.getBean("config"); - boolean prettyPrint = true; - com.datentechnik.moa.id.conf.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); - - for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { - - // extract database value - Object value = dbConfiguration.get(key); - - // serialize value to JSON - String json = mapper.serialize(value); - - // add to properties - result.setProperty(key, json); + private static void workWithInputFromFile(String inputFileUrl, MigrateConfigurationParams parsedParameters, + ConfigurationUtil configUtil) { + File inFile = new File(inputFileUrl); + try (FileInputStream inStream = new FileInputStream(inFile);) { + + if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { + // input from file and output to a file is desired + File outFile = new File(parsedParameters.getOutputFile()); + configUtil.readFromXMLFileConvertToPropertyFile(inStream, outFile); + + } else if (parsedParameters.getOutputDBConfig() != null) { + // input from file and output to a database is desired + configUtil.readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); } - - // write to output stream - result.store(outStream, null); - - System.out.println("Old XML configuration written to:"); - System.out.println(outFile.getAbsolutePath()); - + } catch (JAXBException e) { + System.out.println("MOA-ID XML configuration can not be loaded from given file."); + System.exit(1); } catch (FileNotFoundException e) { - System.out.println("Could not find the output file."); + System.out.println("Could not find the input file."); System.exit(1); } catch (IOException e) { - System.out.println("Could not write to the output file."); + System.out.println("Could not read from the input file."); System.exit(1); } } /** - * Read an input property file, deserialize it's values and write them to - * the given database. + * Handle the case where input is read from a database. * - * @param inStream - * the FileInputStream to read from. - * @param outputDBConfigFilePath - * the path to the database properties, for the db which is - * written. - * @throws IOException - * is thrown in case the properties could not be loaded from the - * stream + * @param parsedParameters + * the command line parameters. + * @param configUtil + * the class for working with the configuration. */ - private static void readFromFileWriteToDB(FileInputStream inStream, String outputDBConfigFilePath) throws IOException { - - Properties inProperties = new Properties(); - inProperties.load(inStream); - - System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - Configuration dbConfiguration = (Configuration) context.getBean("config"); - boolean prettyPrint = true; - com.datentechnik.moa.id.conf.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); - - for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { - - // extract database value - String json = inProperties.getProperty(key); - - // deserialize value to object - Object value = mapper.deserialize(json, null); - - // add to database - boolean result = dbConfiguration.set(key, value, isOverwriteData); - if (!result) { - System.out.println("Could NOT persist the configuration file's information in the database."); - System.out.println("The database already contains a configuration (see force switch if you want to override data.)"); - System.exit(1); - } - System.out.println("Data has been successfully written to the database."); + private static void workWithImputFromDB(MigrateConfigurationParams parsedParameters, ConfigurationUtil configUtil) { + if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { + // input from database and output to a file is desired + File outFile = new File(parsedParameters.getOutputFile()); + String inputDBConfigFilePath = parsedParameters.getInputDBConfig(); + configUtil.readFromDBWriteToFile(inputDBConfigFilePath, outFile); + + } else if (parsedParameters.getOutputDBConfig() != null) { + // input from database and output to a database is desired + // configUtil.readFromDBWriteToDB(inDBConfigFilePath, + // outDBConfigFilePath); } } - - private static void readFromDBWriteToDB(String inputDBConfigFilePath, String outputDBConfigFilePath) { - //TODO: implement - } } \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java index bc90208b6..406c21026 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java @@ -7,6 +7,12 @@ import java.util.List; */ public interface Configuration { + /** + * Gets all keys in the database. NOTE: may return an empty list or {@code null}. + * @return a List containing all keys in the database or {@code null}. + */ + List getAllKeys(); + /** * Get the value associated with the given key as {@link Object}. * @param key the key @@ -32,16 +38,6 @@ public interface Configuration { */ boolean set(String key, Object value); - /** - * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. - * - * @param key the key under which the value is stored, respectively key determining the entry to be deleted. - * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. - * @param overwrite determines the data should be inserted, even if data is already present (insert or update). - * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. - */ - boolean set(String key, Object value, boolean overwrite); - /** * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default * value is returned. diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java index 297a1db4c..43974de7a 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java @@ -4,6 +4,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import javax.persistence.EntityExistsException; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Required; @@ -38,6 +40,16 @@ public class ConfigurationImpl implements Configuration { this.configPropertyDao = configPropertyDao; } + @Override + public List getAllKeys(){ + try { + return this.configPropertyDao.getAllKeys(); + } catch (Exception e) { + log.debug("Error while retrieving a list of all keys in the database."); + return null; + } + } + @Override public Object get(String key) { // return null if key does not exist @@ -78,11 +90,6 @@ public class ConfigurationImpl implements Configuration { @Override public boolean set(String key, Object value) { - return this.set(key, value, false); - } - - @Override - public boolean set(String key, Object value, boolean overwrite) { try { if (value == null) { @@ -94,13 +101,16 @@ public class ConfigurationImpl implements Configuration { keyValue.setKey(key); keyValue.setValue(mapper.serialize(value)); - configPropertyDao.saveProperty(keyValue, overwrite); + configPropertyDao.saveProperty(keyValue); return true; } } catch (JsonProcessingException e) { log.debug("Error while serializing object for key '{}'.", key); return false; - } catch (Exception e){ + } catch (EntityExistsException e) { + log.debug("Property '{}' already exists!", key); + return false; + } catch (Exception e) { log.debug("Error while setting value for key '{}' in the database.", key); return false; } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java index bfc3bc6cd..8f00bd226 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java @@ -9,32 +9,31 @@ import java.util.Set; */ public interface ConfigPropertyDao { + /** + * Gets all keys in the database. + * @return a List containing all keys in the database. + */ + List getAllKeys(); + /** * Returns the {@link ConfigProperty} associated with {@code key} or {@code null} if the entry does not exist. * * @param key The configuration key. * @return The configuration property value or {@code null}. */ - public ConfigProperty getProperty(String key); - - /** - * Persists a given {@link ConfigProperty}. - * @param property The property to be persisted. - */ - public void saveProperty(ConfigProperty property); + ConfigProperty getProperty(String key); /** * Persists a given {@link ConfigProperty}. * @param property The property to be persisted. - * @param overwrite determines the data should be inserted, even if data is already present (insert or update). */ - public void saveProperty(ConfigProperty property, boolean overwrite); + void saveProperty(ConfigProperty property); /** * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. * @return The list with the properties. */ - public List getProperties(); + List getProperties(); /** * Returns the value for the configuration property associated with {@code key} or {@code null} if the entry does not exist or its value is {@code null}. @@ -42,18 +41,18 @@ public interface ConfigPropertyDao { * @param key The configuration key. * @return The configuration property value or {@code null}. */ - public String getPropertyValue(String key); + String getPropertyValue(String key); /** * Persists a {@link List} of {@linkplain ConfigProperty ConfigProperties}. * @param properties The list containing all the properties to be persisted. */ - public void saveProperties(Set properties); + void saveProperties(Set properties); /** * Deletes the object associated with the given key. * @param key the key */ - public void delete(String key); + void delete(String key); } diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java index dfb1f542f..6de10e9b9 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java @@ -25,24 +25,25 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { private EntityManager em; @Override - public void saveProperty(ConfigProperty property) { - this.saveProperty(property, false); + public List getAllKeys() { + if (null == em) { + log.error("No EntityManager set!"); + return null; + } + TypedQuery query = em.createQuery("select key from ConfigProperty", String.class); + List result = query.getResultList(); + return result; } @Override - public void saveProperty(ConfigProperty property, boolean overwrite) { + public void saveProperty(ConfigProperty property) { if (null == em) { log.error("No EntityManager set!"); return; } log.debug("Storing '{}'.", property.toString()); - if (overwrite) { - em.merge(property); - } else { - log.debug("Storing '{}'.", property.toString()); - em.persist(property); - } + em.persist(property); } @Override -- cgit v1.2.3 From cae3dae9af7192c041a2725dfa828e615344e3dc Mon Sep 17 00:00:00 2001 From: Martin Bonato Date: Thu, 9 Apr 2015 10:51:00 +0200 Subject: Add maven-build-helper-plugin to include moa-id-commons/target/generated-sources/xjc in build path in eclipse. --- id/server/moa-id-commons/pom.xml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index dd33a9198..e4a46238e 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -207,7 +207,26 @@ - + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + target/generated-sources/xjc + + + + + + org.apache.maven.plugins maven-compiler-plugin -- cgit v1.2.3 From dc2cefbb4565b11c0a34d9636b27d186cc5cdd0d Mon Sep 17 00:00:00 2001 From: Martin Bonato Date: Thu, 9 Apr 2015 11:40:03 +0200 Subject: Fix spring dependencies. --- id/server/moa-id-commons/pom.xml | 6 +++++- id/server/pom.xml | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index e4a46238e..677b5b62e 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -131,7 +131,11 @@ org.springframework - spring-orm + spring-context + + + org.springframework + spring-tx diff --git a/id/server/pom.xml b/id/server/pom.xml index 802ba73f7..9ce48bf60 100644 --- a/id/server/pom.xml +++ b/id/server/pom.xml @@ -82,6 +82,12 @@ ${org.springframework.version} + + org.springframework + spring-tx + ${org.springframework.version} + + org.springframework spring-webmvc -- cgit v1.2.3 From 6d1f99a50744de690afccc12568539c23d839f93 Mon Sep 17 00:00:00 2001 From: Martin Bonato Date: Thu, 9 Apr 2015 11:51:44 +0200 Subject: Fix build-helper-maven-plugin source path --- id/server/moa-id-commons/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 677b5b62e..7e520d96b 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -224,7 +224,7 @@ - target/generated-sources/xjc + ${project.build.directory}/generated-sources/xjc -- cgit v1.2.3 From 0fb4c31f049d71e917dfbfdab96553a807195d0c Mon Sep 17 00:00:00 2001 From: Martin Bonato Date: Thu, 9 Apr 2015 13:24:55 +0200 Subject: Rename java packages --- .../config/auth/ConfigurationToJSONConverter.java | 2 +- .../config/auth/NewAuthConfigurationProvider.java | 3 +- ...nfigurationProviderLegacyCompatibilityTest.java | 3 +- id/server/moa-id-commons/pom.xml | 2 +- .../moa/id/commons/config/ConfigurationUtil.java | 227 +++++++++++++++++++++ .../id/commons/config/MigrateConfiguration.java | 103 ++++++++++ .../moa/id/commons/config/cli/CLIConstants.java | 37 ++++ .../moa/id/commons/config/cli/MOAIDConfCLI.java | 127 ++++++++++++ .../config/cli/MigrateConfigurationParams.java | 106 ++++++++++ .../commons/config/persistence/Configuration.java | 60 ++++++ .../config/persistence/ConfigurationImpl.java | 161 +++++++++++++++ .../id/commons/config/persistence/JsonMapper.java | 73 +++++++ .../moa/id/commons/db/NewConfigurationDBRead.java | 3 +- .../moa/id/commons/db/NewConfigurationDBWrite.java | 3 +- .../commons/db/dao/config/ConfigPropertyDao.java | 58 ++++++ .../db/dao/config/ConfigPropertyDaoImpl.java | 104 ++++++++++ .../moa/id/conf/ConfigurationUtil.java | 227 --------------------- .../moa/id/conf/MigrateConfiguration.java | 103 ---------- .../datentechnik/moa/id/conf/cli/CLIConstants.java | 37 ---- .../datentechnik/moa/id/conf/cli/MOAIDConfCLI.java | 127 ------------ .../id/conf/cli/MigrateConfigurationParams.java | 106 ---------- .../moa/id/conf/persistence/Configuration.java | 60 ------ .../moa/id/conf/persistence/ConfigurationImpl.java | 160 --------------- .../moa/id/conf/persistence/JsonMapper.java | 73 ------- .../id/conf/persistence/dal/ConfigProperty.java | 95 --------- .../id/conf/persistence/dal/ConfigPropertyDao.java | 58 ------ .../persistence/dal/ConfigPropertyDaoImpl.java | 104 ---------- .../src/main/resources/META-INF/persistence.xml | 4 +- .../src/main/resources/configuration.beans.xml | 4 +- .../src/main/resources/persistence_template.xml | 2 +- .../moa/id/commons/db/ConfigurationDBReadTest.java | 2 +- .../moa/id/commons/db/configuration.beans-test.xml | 4 +- .../moa-id-commons/src/test/resources/log4j.xml | 16 ++ id/server/pom.xml | 2 +- 34 files changed, 1087 insertions(+), 1169 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/CLIConstants.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MOAIDConfCLI.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MigrateConfigurationParams.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/JsonMapper.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/JsonMapper.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java delete mode 100644 id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java create mode 100644 id/server/moa-id-commons/src/test/resources/log4j.xml (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 39225a5b0..6f2c771ec 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -13,11 +13,11 @@ import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import com.datentechnik.moa.id.conf.persistence.Configuration; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java index 0be1dc94b..d8d368a76 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java @@ -15,6 +15,7 @@ import java.util.Properties; import org.springframework.beans.factory.annotation.Autowired; import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; @@ -50,8 +51,6 @@ import at.gv.egovernment.moa.id.config.stork.STORKConfig; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; -import com.datentechnik.moa.id.conf.persistence.Configuration; - /** * A class providing access to the Auth Part of the MOA-ID configuration data. */ diff --git a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java index bd997303a..7606bc9bf 100644 --- a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java +++ b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java @@ -10,6 +10,7 @@ import java.util.Collections; import org.junit.Test; import org.unitils.reflectionassert.ReflectionAssert; +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; @@ -29,8 +30,6 @@ import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.NewAuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; -import com.datentechnik.moa.id.conf.persistence.Configuration; - public class AuthConfigurationProviderLegacyCompatibilityTest { private MOAIDConfiguration getMinimalMoaidConfiguration() { diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 7e520d96b..ee94fb49c 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -135,7 +135,7 @@ org.springframework - spring-tx + spring-orm diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java new file mode 100644 index 000000000..d8fde7eee --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java @@ -0,0 +1,227 @@ +package at.gv.egovernment.moa.id.commons.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Enumeration; +import java.util.List; +import java.util.Properties; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; +import at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper; +import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; + +import com.fasterxml.jackson.core.JsonProcessingException; + +public class ConfigurationUtil { + + final boolean isOverwriteData; + + public ConfigurationUtil(boolean isOverwriteData){ + this.isOverwriteData = isOverwriteData; + } + + /** + * Read an input MOAID 2 XML file, transfer it to properties and write the + * properties to a MOAID 3 property file. + * + * @param inStream + * the input stream to read from. + * @param outFile + * the output file to write to. + * @throws JAXBException + */ + public void readFromXMLFileConvertToPropertyFile(FileInputStream inStream, File outFile) throws JAXBException { + + try (FileOutputStream outStream = new FileOutputStream(outFile);) { + + // get config from xml file + JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); + Unmarshaller m = jc.createUnmarshaller(); + MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream); + + // serialize config to JSON properties + Properties result = moaIdConfigToJsonProperties(config); + + // write to output stream + result.store(outStream, null); + + } catch (FileNotFoundException e) { + System.out.println("Could not find the output file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not write to the output file."); + System.exit(1); + } + } + + /** + * Helper method to serialize a {@link MOAIDConfiguration} to Properties + * with JSON encoded values. + * + * @param config + * the MOAIDConfiguration to serialize + * @return {@link Properties} containing the database key and the serialized + * values + * @throws JsonProcessingException + * is thrown if problem occurred while serializing one of the + * database values + */ + private Properties moaIdConfigToJsonProperties(MOAIDConfiguration config) throws JsonProcessingException { + + Properties result = new Properties(); + boolean prettyPrint = true; + JsonMapper mapper = new JsonMapper(prettyPrint); + + // serialize config to JSON + String oaJson = mapper.serialize(config.getOnlineApplication()); + String authCompGeneralJson = mapper.serialize(config.getAuthComponentGeneral()); + String chainingModeJson = mapper.serialize(config.getChainingModes()); + String defaultBKUJson = mapper.serialize(config.getDefaultBKUs()); + String genericConfigJson = mapper.serialize(config.getGenericConfiguration()); + String pvp2RefreshJson = mapper.serialize(config.getPvp2RefreshItem()); + String slRequestTemplatesJson = mapper.serialize(config.getSLRequestTemplates()); + String timestampJson = mapper.serialize(config.getTimestampItem()); + String trustedCaCertJson = mapper.serialize(config.getTrustedCACertificates()); + + // add to properties + result.put(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oaJson); + result.put(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, authCompGeneralJson); + result.put(MOAIDConfigurationConstants.CHAINING_MODES_KEY, chainingModeJson); + result.put(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, defaultBKUJson); + result.put(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, genericConfigJson); + result.put(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, pvp2RefreshJson); + result.put(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, slRequestTemplatesJson); + result.put(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, timestampJson); + result.put(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, trustedCaCertJson); + + return result; + } + + /** + * Exports a key-value database to a property file, where keys are the same + * as in the database, and the values are serialized JSON objects. + * + * @param inputDBConfigFilePath + * the path to the database properties, for the db the data is + * read from. + * @param outFile + * the destination file for the exported data. + */ + public void readFromDBWriteToFile(String inputDBConfigFilePath, File outFile) { + + try (FileOutputStream outStream = new FileOutputStream(outFile);) { + + Properties result = new Properties(); + + System.getProperties().setProperty("location", "file:" + inputDBConfigFilePath); + ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); + Configuration dbConfiguration = (Configuration) context.getBean("config"); + boolean prettyPrint = true; + at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); + + for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { + + // extract database value + Object value = dbConfiguration.get(key); + + // serialize value to JSON + String json = mapper.serialize(value); + + // add to properties + result.setProperty(key, json); + } + + // write to output stream + result.store(outStream, null); + + System.out.println("Property configuration written to:"); + System.out.println(outFile.getAbsolutePath()); + + } catch (FileNotFoundException e) { + System.out.println("Could not find the output file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not write to the output file."); + System.exit(1); + } + } + + /** + * Read an input property file, deserialize it's values and write them to + * the given database. + * + * @param inStream + * the FileInputStream to read from. + * @param outputDBConfigFilePath + * the path to the database properties, for the db which is + * written. + * @throws IOException + * is thrown in case the properties could not be loaded from the + * stream + */ + public void readFromFileWriteToDB(FileInputStream inStream, String outputDBConfigFilePath) throws IOException { + + Properties inProperties = new Properties(); + inProperties.load(inStream); + + System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); + ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); + Configuration dbConfiguration = (Configuration) context.getBean("config"); + boolean prettyPrint = true; + JsonMapper mapper = new JsonMapper(prettyPrint); + + List keys = dbConfiguration.getAllKeys(); + + if (keys == null) { + System.out.println("Database can not be read."); + System.exit(1); + } + + if (!keys.isEmpty() && !isOverwriteData) { + System.out.println("The database already contains configuration data."); + System.out.println("Use force switch if you want to override data)"); + System.exit(1); + } + + if (isOverwriteData) { + // remove existing entries + for (String key : keys) { + dbConfiguration.set(key, null); + } + } + + Enumeration propertyNames = inProperties.propertyNames(); + + while (propertyNames.hasMoreElements()) { + String key = (String) propertyNames.nextElement(); + // extract database value + String json = inProperties.getProperty(key); + + // deserialize value to object + Object value = mapper.deserialize(json, null); + + // add to database + boolean result = dbConfiguration.set(key, value); + if (!result) { + System.out.println("Could NOT persist the configuration file's information in the database."); + } + } + System.out.println("Data has been successfully written to the database."); + } + + private static void readFromDBWriteToDB(String inputDBConfigFilePath, String outputDBConfigFilePath) { + //TODO: implement + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java new file mode 100644 index 000000000..4e8c7dffd --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java @@ -0,0 +1,103 @@ +package at.gv.egovernment.moa.id.commons.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; + +import javax.xml.bind.JAXBException; + +import at.gv.egovernment.moa.id.commons.config.cli.MOAIDConfCLI; +import at.gv.egovernment.moa.id.commons.config.cli.MigrateConfigurationParams; + +/** + * CLI tool which is able to perform the following tasks: + *
    + *
  • transform a MoaID 2 XML configuration XML file to a MoaID 3 property file + *
  • + *
  • read a property file and transfer it's content to a database
  • + *
  • write the content of a database to a property file
  • + *
+ */ +public class MigrateConfiguration { + + public static void main(String[] args) { + + MOAIDConfCLI cli = new MOAIDConfCLI(); + MigrateConfigurationParams parsedParameters = cli.parse(args); + + // consider settings of force switch + boolean isOverwriteData = parsedParameters.isOverwriteData(); + ConfigurationUtil configUtil = new ConfigurationUtil(isOverwriteData); + + if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { + // read input from file + workWithInputFromFile(parsedParameters.getInputTarget(), parsedParameters, configUtil); + + } else if (parsedParameters.getInputDBConfig() != null) { + // read input from database + workWithImputFromDB(parsedParameters, configUtil); + + } else { + System.exit(1); + } + } + + /** + * Handle the case where input from a file is read. + * + * @param inputFileUrl + * the url of the input file. + * @param parsedParameters + * the command line parameters. + * @param configUtil + * the class for working with the configuration. + */ + private static void workWithInputFromFile(String inputFileUrl, MigrateConfigurationParams parsedParameters, + ConfigurationUtil configUtil) { + File inFile = new File(inputFileUrl); + try (FileInputStream inStream = new FileInputStream(inFile);) { + + if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { + // input from file and output to a file is desired + File outFile = new File(parsedParameters.getOutputFile()); + configUtil.readFromXMLFileConvertToPropertyFile(inStream, outFile); + + } else if (parsedParameters.getOutputDBConfig() != null) { + // input from file and output to a database is desired + configUtil.readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); + } + } catch (JAXBException e) { + System.out.println("MOA-ID XML configuration can not be loaded from given file."); + System.exit(1); + } catch (FileNotFoundException e) { + System.out.println("Could not find the input file."); + System.exit(1); + } catch (IOException e) { + System.out.println("Could not read from the input file."); + System.exit(1); + } + } + + /** + * Handle the case where input is read from a database. + * + * @param parsedParameters + * the command line parameters. + * @param configUtil + * the class for working with the configuration. + */ + private static void workWithImputFromDB(MigrateConfigurationParams parsedParameters, ConfigurationUtil configUtil) { + if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { + // input from database and output to a file is desired + File outFile = new File(parsedParameters.getOutputFile()); + String inputDBConfigFilePath = parsedParameters.getInputDBConfig(); + configUtil.readFromDBWriteToFile(inputDBConfigFilePath, outFile); + + } else if (parsedParameters.getOutputDBConfig() != null) { + // input from database and output to a database is desired + // configUtil.readFromDBWriteToDB(inDBConfigFilePath, + // outDBConfigFilePath); + } + } +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/CLIConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/CLIConstants.java new file mode 100644 index 000000000..c652645fc --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/CLIConstants.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.id.commons.config.cli; + +/** + * Constants for the CLI. + * @author Christian Wagner + * + */ +public class CLIConstants { + private CLIConstants() { + } + + public static final String CMD_LINE_SYNTAX = "java -jar migrateMOAIDconfiguration.jar"; + + public static final String HELP_HEADER = "Convert a given MOAID 2.x config-file."; + public static final String HELP_FOOTER = ""; + // default width of a printed row + public static final int HELP_ROW_WIDTH = 80; + + public static final int HELP_SPACE_BEFORE_OPT = 2; + public static final int HELP_SPACE_BEFORE_DESC = 4; + + public static final String CLI_PARAM_IN = "in"; + public static final String CLI_PARAM_IN_LONG = "input-file"; + public static final String CLI_PARAM_OUT = "out"; + public static final String CLI_PARAM_OUT_LONG = "output-file"; + public static final String CLI_PARAM_INDB = "indb"; + public static final String CLI_PARAM_INDB_LONG = "input-dbconf"; + public static final String CLI_PARAM_OUTDB = "outdb"; + public static final String CLI_PARAM_OUTDB_LONG = "output-dbconf"; + + public static final String CLI_PARAM_HELP = "h"; + public static final String CLI_PARAM_HELP_LONG = "help"; + + public static final String CLI_PARAM_FORCE = "f"; + public static final String CLI_PARAM_FORCE_LONG = "force"; + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MOAIDConfCLI.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MOAIDConfCLI.java new file mode 100644 index 000000000..f2753c3d0 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MOAIDConfCLI.java @@ -0,0 +1,127 @@ +package at.gv.egovernment.moa.id.commons.config.cli; + +import java.io.OutputStream; +import java.io.PrintWriter; + +import org.apache.commons.cli.BasicParser; +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.HelpFormatter; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionGroup; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.ParseException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The command-line interface for MOAID configuration migration + * @author Christian Wagner + * + */ +public class MOAIDConfCLI { + + // the default output to write usage information and help text to + private static final OutputStream OUTPUT_STREAM = System.out; + + private Logger log = LoggerFactory.getLogger(getClass()); + + /** + * Parses the given command-line arguments using a {@link BasicParser} with small modifications. + * @param commandLineArgs the command-line arguments. + */ + public MigrateConfigurationParams parse(String[] commandLineArgs) { + + CommandLineParser parser = new BasicParser(); + CommandLine cmd = null; + MigrateConfigurationParams result = null; + try { + + if (null == commandLineArgs || commandLineArgs.length == 0) { + printUsage(OUTPUT_STREAM, true); + System.exit(0); + } + + cmd = parser.parse(createOptions(), commandLineArgs, true); + + if( null != cmd && cmd.hasOption(CLIConstants.CLI_PARAM_HELP)){ + printUsage(OUTPUT_STREAM, true); + System.exit(0); + } + + result = new MigrateConfigurationParams(cmd); + + } catch (ParseException e) { + log.warn("Encountered exception while parsing: {}", e.getMessage()); + System.err.println(e.getMessage()); + printUsage(OUTPUT_STREAM, false); + System.exit(1); + } + return result; + } + + /** + * Prints information about the usage to the given output. + * @param out the {@link OutputStream} to write to + * @param printOptions determines whether the available options are printed + */ + private void printUsage(OutputStream out, boolean printOptions) { + + PrintWriter pOut = new PrintWriter(out); + + HelpFormatter formatter = new HelpFormatter(); + pOut.println(); + pOut.println("usage: " + CLIConstants.CMD_LINE_SYNTAX + " -" + CLIConstants.CLI_PARAM_FORCE + " -" + + CLIConstants.CLI_PARAM_IN + " | -" + CLIConstants.CLI_PARAM_INDB + " -" + + CLIConstants.CLI_PARAM_OUT + " | -" + CLIConstants.CLI_PARAM_OUTDB + " [-" + + CLIConstants.CLI_PARAM_HELP + "]"); + pOut.println(); + pOut.println(CLIConstants.HELP_HEADER); + if(printOptions){ + pOut.println(); + formatter.printOptions(pOut, CLIConstants.HELP_ROW_WIDTH, createOptions(), CLIConstants.HELP_SPACE_BEFORE_OPT, CLIConstants.HELP_SPACE_BEFORE_DESC); + } + pOut.flush(); + + } + + /** + * Create all {@linkplain Option options} that should be available in the CLI. + * @return The {@linkplain Options options} + */ + private Options createOptions() { + + Options options = new Options(); + + OptionGroup inGroup = new OptionGroup(); + Option optionInput = new Option(CLIConstants.CLI_PARAM_IN, CLIConstants.CLI_PARAM_IN_LONG, true, "MOAID config-file to convert"); + optionInput.setArgName("inputfile"); + Option optionDBInput = new Option(CLIConstants.CLI_PARAM_INDB, CLIConstants.CLI_PARAM_INDB_LONG, true, "config for database to read from"); + optionDBInput.setArgName("dbconfig"); + + inGroup.addOption(optionDBInput); + inGroup.addOption(optionInput); + optionInput.setRequired(false); + + OptionGroup outGroup = new OptionGroup(); + Option optionOutput = new Option(CLIConstants.CLI_PARAM_OUT, CLIConstants.CLI_PARAM_OUT_LONG, true, "target file to write to"); + optionOutput.setArgName("outputfile"); + Option optionDBOutput = new Option(CLIConstants.CLI_PARAM_OUTDB, CLIConstants.CLI_PARAM_OUTDB_LONG, true, "config for database to write to"); + optionDBOutput.setArgName("dbconfig"); + + outGroup.addOption(optionDBOutput); + outGroup.addOption(optionOutput); + outGroup.setRequired(false); + + options.addOptionGroup(inGroup); + options.addOptionGroup(outGroup); + + Option optForce = new Option(CLIConstants.CLI_PARAM_FORCE, CLIConstants.CLI_PARAM_FORCE_LONG, false, "overwrite existing data with imported data"); + options.addOption(optForce); + + Option optHelp = new Option(CLIConstants.CLI_PARAM_HELP, CLIConstants.CLI_PARAM_HELP_LONG, false, "prints this message"); + options.addOption(optHelp); + return options; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MigrateConfigurationParams.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MigrateConfigurationParams.java new file mode 100644 index 000000000..86bde1310 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/cli/MigrateConfigurationParams.java @@ -0,0 +1,106 @@ +package at.gv.egovernment.moa.id.commons.config.cli; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.MissingOptionException; + +/** + * The result set for the parsed command line arguments + * @author Christian Wagner + * + */ +public class MigrateConfigurationParams { + + private String inputFile = null; + private String outputFile = null; + private String inputDbConfigFile = null; + private String outputDbConfigFile = null; + + private boolean overwriteData = false; + + /** + * Get the path to the input source which is MOAID 2.x config file in XML-format. + * @return the path to the input source or {@code null} if not set. + */ + public String getInputTarget() { + return this.inputFile; + } + + /** + * Get the path to the output file to write to. + * @return the path to the output file or {@code null} if not set. + */ + public String getOutputFile() { + return outputFile; + } + + /** + * Get the path to the configuration file for the input database. + * @return the path to the config file or {@code null} if not set. + */ + public String getInputDBConfig() { + return inputDbConfigFile; + } + + /** + * Get the path to the configuration file for the output database. + * @return the path to the config file or {@code null} if not set. + */ + public String getOutputDBConfig() { + return outputDbConfigFile; + } + + /** + * Returns whether the desired input is a config file for a database. + * @return true if the stored path points at a database config file; false otherwise. + */ + public boolean isInputDB() { + return inputDbConfigFile != null; + } + + /** + * Returns whether the desired output is a config file for a database. + * @return true if the stored path points at a database config file; false otherwise. + */ + public boolean isOutputDB() { + return outputDbConfigFile != null; + } + + /** + * Returns whether existing data should be overwritten by the imported data or not. + * @return true if the existing data should be overwritten; false otherwise. + */ + public boolean isOverwriteData() { + return overwriteData; + } + + /** + * + * @param cmdLine + * @throws MissingOptionException + */ + public MigrateConfigurationParams(CommandLine cmdLine) throws MissingOptionException { + inputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_IN); + inputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_INDB); + outputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUT); + outputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUTDB); + overwriteData = cmdLine.hasOption(CLIConstants.CLI_PARAM_FORCE); + + if (null == inputFile && null == inputDbConfigFile) { + throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] required."); + } + + if (null == outputFile && null == outputDbConfigFile) { + throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_OUT + ", -" + CLIConstants.CLI_PARAM_OUTDB + "] required."); + } + + if (null != inputFile && null != inputDbConfigFile) { + throw new MissingOptionException("Only one of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] allowed."); + } + + if (null != outputFile && null != outputDbConfigFile) { + throw new MissingOptionException("Only one of [-" + CLIConstants.CLI_PARAM_OUT + ", -" + CLIConstants.CLI_PARAM_OUTDB + "] allowed."); + } + + } + +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java new file mode 100644 index 000000000..f357fc570 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java @@ -0,0 +1,60 @@ +package at.gv.egovernment.moa.id.commons.config.persistence; + +import java.util.List; + +/** + * An interface for a key-value configuration. + */ +public interface Configuration { + + /** + * Gets all keys in the database. NOTE: may return an empty list or {@code null}. + * @return a List containing all keys in the database or {@code null}. + */ + List getAllKeys(); + + /** + * Get the value associated with the given key as {@link Object}. + * @param key the key + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. + */ + Object get(String key); + + /** + * Get the object of type {@code T} associated with the given key. + * + * @param key the key + * @param clazz the type of the requested object + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. + */ + T get(String key, Class clazz); + + /** + * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. + * + * @param key the key under which the value is stored, respectively key determining the entry to be deleted. + * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. + * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. + */ + boolean set(String key, Object value); + + /** + * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default + * value is returned. + * + * @param key the key + * @param clazz the type of the requested object + * @param defaultValue the default value to return + * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value. + */ + T get(String key, Class clazz, Object defaultValue); + + /** + * Get a list of objects associated with the given key. The list may be empty or contain only a single object. + * @param key the key + * @param clazz the type of the requested object + * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key. + */ + List getList(String key, Class clazz); + +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java new file mode 100644 index 000000000..c90b60440 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java @@ -0,0 +1,161 @@ +package at.gv.egovernment.moa.id.commons.config.persistence; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.EntityExistsException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Required; +import org.springframework.stereotype.Component; + +import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty; +import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigPropertyDao; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.CollectionType; +import com.fasterxml.jackson.databind.type.TypeFactory; + +/** + * The implementation of a key-value configuration implementing the {@link Configuration} interface. + * It employs the {@link ConfigPropertyDao} to persist configuration data. + */ +@Component +public class ConfigurationImpl implements Configuration { + + private final Logger log = LoggerFactory.getLogger(getClass()); + + ConfigPropertyDao configPropertyDao; + private JsonMapper mapper = new JsonMapper(); + + /** + * Sets the {@link ConfigPropertyDao}. + * @param configPropertyDao the ConfigPropertyDao + */ + @Required + public void setConfigPropertyDao(ConfigPropertyDao configPropertyDao) { + this.configPropertyDao = configPropertyDao; + } + + @Override + public List getAllKeys(){ + try { + return this.configPropertyDao.getAllKeys(); + } catch (Exception e) { + log.debug("Error while retrieving a list of all keys in the database."); + return null; + } + } + + @Override + public Object get(String key) { + // return null if key does not exist + try { + ConfigProperty property = configPropertyDao.getProperty(key); + if (property != null && property.getValue() != null) { + return mapper.deserialize(property.getValue(), null); + } else { + return null; + } + } catch (IllegalArgumentException e) { + log.debug("Error while searching for key '{}' in the database.", key); + return null; + } catch (Exception e) { + log.debug("Error while deserializing value of key '{}' to object.", key); + return null; + } + } + + @Override + public T get(String key, Class clazz) { + // return null if key does not exist + try { + ConfigProperty property = configPropertyDao.getProperty(key); + if (property != null && property.getValue() != null) { + return clazz.cast(mapper.deserialize(property.getValue(), clazz)); + } else { + return null; + } + } catch (IllegalArgumentException e) { + log.debug("Error while searching for key '{}' in the database.", key); + return null; + } catch (Exception e) { + log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass()); + return null; + } + } + + @Override + public boolean set(String key, Object value) { + + try { + if (value == null) { + configPropertyDao.delete(key); + return true; + } else { + + ConfigProperty keyValue = new ConfigProperty(); + keyValue.setKey(key); + + keyValue.setValue(mapper.serialize(value)); + configPropertyDao.saveProperty(keyValue); + return true; + } + } catch (JsonProcessingException e) { + log.debug("Error while serializing object for key '{}'.", key); + return false; + } catch (EntityExistsException e) { + log.debug("Property '{}' already exists!", key); + return false; + } catch (Exception e) { + log.debug("Error while setting value for key '{}' in the database.", key); + return false; + } + } + + @Override + public T get(String key, Class clazz, Object defaultValue) { + + T value = get(key, clazz); + if (value != null) { + return value; + } else { + return clazz.cast(defaultValue); + } + } + + @SuppressWarnings("unchecked") + @Override + public List getList(String key, Class clazz) { + + CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); + try { + if ((configPropertyDao.getProperty(key) == null) + || (configPropertyDao.getProperty(key).getValue() == null)) { + return new ArrayList(); + } + String json = configPropertyDao.getProperty(key).getValue(); + ObjectMapper mapper = new ObjectMapper(); + + return (List) mapper.readValue(json, listType); + } catch (JsonMappingException e) { + ArrayList tmp = new ArrayList(); + T value = get(key, clazz); + if (value != null) { + tmp.add(value); + } + return tmp; + } catch (IOException e) { + log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass()); + return new ArrayList(); + } catch (Exception e){ + log.debug("Error while searching key '{}' in the database.", key); + return new ArrayList(); + } + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/JsonMapper.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/JsonMapper.java new file mode 100644 index 000000000..6138d571b --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/JsonMapper.java @@ -0,0 +1,73 @@ +package at.gv.egovernment.moa.id.commons.config.persistence; + +import java.io.IOException; + +import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.type.TypeFactory; + +/** + * Helper class to handle the JSON (de-)serialization. + * + */ +public class JsonMapper { + + private ObjectMapper mapper = new ObjectMapper(); + + /** + * The default constructor where the default pretty printer is disabled. + */ + public JsonMapper() { + this(false); + } + + /** + * The constructor. + * @param prettyPrint enables or disables the default pretty printer + */ + public JsonMapper(boolean prettyPrint) { + mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); + mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); + mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); + if (prettyPrint) { + mapper.enable(SerializationFeature.INDENT_OUTPUT); + } + } + + /** + * Serialize an object to a JSON string. + * @param value the object to serialize + * @return a JSON string + * @throws JsonProcessingException thrown when an error occurs during serialization + */ + public String serialize(Object value) throws JsonProcessingException { + return mapper.writeValueAsString(value); + } + + /** + * Deserialize a JSON string. + * + * @param value the JSON string to deserialize + * @param clazz optional parameter that determines the type of the returned object. If not set, an {@link Object} is returned. + * @return the deserialized JSON string as an object of type {@code clazz} or {@link Object} + * @throws JsonParseException if the JSON string contains invalid content. + * @throws JsonMappingException if the input JSON structure does not match structure expected for result type + * @throws IOException if an I/O problem occurs (e.g. unexpected end-of-input) + */ + public Object deserialize(String value, Class clazz) throws JsonParseException, JsonMappingException, IOException{ + + ObjectMapper mapper = new ObjectMapper(); + if (clazz != null) { + JavaType javaType = TypeFactory.defaultInstance().constructType(clazz); + return mapper.readValue(value, javaType); + } else { + return mapper.readValue(value, Object.class); + } + } +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 0dd232773..28363a1eb 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -7,6 +7,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; @@ -17,8 +18,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.logging.Logger; -import com.datentechnik.moa.id.conf.persistence.Configuration; - /** * * diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java index e1b51ee9b..de4a1789e 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java @@ -6,6 +6,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; @@ -15,8 +16,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; -import com.datentechnik.moa.id.conf.persistence.Configuration; - /** * This class is used for writing to the key-value database. */ diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java new file mode 100644 index 000000000..db35ba1df --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java @@ -0,0 +1,58 @@ +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.util.List; +import java.util.Set; + +/** + * DAO interface providing means for accessing MOAID configuration properties. + * + */ +public interface ConfigPropertyDao { + + /** + * Gets all keys in the database. + * @return a List containing all keys in the database. + */ + List getAllKeys(); + + /** + * Returns the {@link ConfigProperty} associated with {@code key} or {@code null} if the entry does not exist. + * + * @param key The configuration key. + * @return The configuration property value or {@code null}. + */ + ConfigProperty getProperty(String key); + + /** + * Persists a given {@link ConfigProperty}. + * @param property The property to be persisted. + */ + void saveProperty(ConfigProperty property); + + /** + * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. + * @return The list with the properties. + */ + List getProperties(); + + /** + * Returns the value for the configuration property associated with {@code key} or {@code null} if the entry does not exist or its value is {@code null}. + * + * @param key The configuration key. + * @return The configuration property value or {@code null}. + */ + String getPropertyValue(String key); + + /** + * Persists a {@link List} of {@linkplain ConfigProperty ConfigProperties}. + * @param properties The list containing all the properties to be persisted. + */ + void saveProperties(Set properties); + + /** + * Deletes the object associated with the given key. + * @param key the key + */ + void delete(String key); + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java new file mode 100644 index 000000000..6a76c1d17 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java @@ -0,0 +1,104 @@ +package at.gv.egovernment.moa.id.commons.db.dao.config; + +import java.util.List; +import java.util.Set; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; +import javax.persistence.PersistenceContext; +import javax.persistence.TypedQuery; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.transaction.annotation.Transactional; + +/** + * Database backed implementation of the DAO interface + * + */ +@Transactional("transactionManager") +public class ConfigPropertyDaoImpl implements ConfigPropertyDao { + + private Logger log = LoggerFactory.getLogger(getClass()); + + @PersistenceContext(unitName = "moaidconf") + private EntityManager em; + + @Override + public List getAllKeys() { + if (null == em) { + log.error("No EntityManager set!"); + return null; + } + TypedQuery query = em.createQuery("select key from ConfigProperty", String.class); + List result = query.getResultList(); + return result; + } + + @Override + public void saveProperty(ConfigProperty property) { + if (null == em) { + log.error("No EntityManager set!"); + return; + } + + log.debug("Storing '{}'.", property.toString()); + em.persist(property); + } + + @Override + public ConfigProperty getProperty(String key) { + log.debug("Looking for configuration property for key '{}'.", key); + ConfigProperty result = em.find(ConfigProperty.class, key); + if (result != null) { + log.debug("Found configuration property {}.", result); + } else { + log.debug("Unable to find configuration property for key '{}'.", key); + } + return result; + } + + @Override + public String getPropertyValue(String key) { + ConfigProperty property = getProperty(key); + if (property == null) { + return null; + } + return property.getValue(); + } + + @Override + public List getProperties() { + + if (null == em) { + log.error("No EntityManager set!"); + return null; + } + + log.debug("Retrieving all properties from database."); + TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); + try { + List propertiesList = query.getResultList(); + return propertiesList; + } catch (NoResultException e) { + log.debug("No property found in database."); + return null; + } + } + + @Override + public void saveProperties(Set properties) { + log.debug("Storing {} properties to database.", properties.size()); + for (ConfigProperty cp : properties) { + saveProperty(cp); + } + em.flush(); + } + + @Override + public void delete(String key) { + log.debug("Deleting entry with key '{}'.", key); + em.remove(em.find(ConfigProperty.class, key)); + } + +} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java deleted file mode 100644 index e771b96a2..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/ConfigurationUtil.java +++ /dev/null @@ -1,227 +0,0 @@ -package com.datentechnik.moa.id.conf; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Enumeration; -import java.util.List; -import java.util.Properties; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; - -import com.datentechnik.moa.id.conf.persistence.Configuration; -import com.datentechnik.moa.id.conf.persistence.JsonMapper; -import com.fasterxml.jackson.core.JsonProcessingException; - -public class ConfigurationUtil { - - final boolean isOverwriteData; - - public ConfigurationUtil(boolean isOverwriteData){ - this.isOverwriteData = isOverwriteData; - } - - /** - * Read an input MOAID 2 XML file, transfer it to properties and write the - * properties to a MOAID 3 property file. - * - * @param inStream - * the input stream to read from. - * @param outFile - * the output file to write to. - * @throws JAXBException - */ - public void readFromXMLFileConvertToPropertyFile(FileInputStream inStream, File outFile) throws JAXBException { - - try (FileOutputStream outStream = new FileOutputStream(outFile);) { - - // get config from xml file - JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); - Unmarshaller m = jc.createUnmarshaller(); - MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream); - - // serialize config to JSON properties - Properties result = moaIdConfigToJsonProperties(config); - - // write to output stream - result.store(outStream, null); - - } catch (FileNotFoundException e) { - System.out.println("Could not find the output file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not write to the output file."); - System.exit(1); - } - } - - /** - * Helper method to serialize a {@link MOAIDConfiguration} to Properties - * with JSON encoded values. - * - * @param config - * the MOAIDConfiguration to serialize - * @return {@link Properties} containing the database key and the serialized - * values - * @throws JsonProcessingException - * is thrown if problem occurred while serializing one of the - * database values - */ - private Properties moaIdConfigToJsonProperties(MOAIDConfiguration config) throws JsonProcessingException { - - Properties result = new Properties(); - boolean prettyPrint = true; - JsonMapper mapper = new JsonMapper(prettyPrint); - - // serialize config to JSON - String oaJson = mapper.serialize(config.getOnlineApplication()); - String authCompGeneralJson = mapper.serialize(config.getAuthComponentGeneral()); - String chainingModeJson = mapper.serialize(config.getChainingModes()); - String defaultBKUJson = mapper.serialize(config.getDefaultBKUs()); - String genericConfigJson = mapper.serialize(config.getGenericConfiguration()); - String pvp2RefreshJson = mapper.serialize(config.getPvp2RefreshItem()); - String slRequestTemplatesJson = mapper.serialize(config.getSLRequestTemplates()); - String timestampJson = mapper.serialize(config.getTimestampItem()); - String trustedCaCertJson = mapper.serialize(config.getTrustedCACertificates()); - - // add to properties - result.put(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oaJson); - result.put(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, authCompGeneralJson); - result.put(MOAIDConfigurationConstants.CHAINING_MODES_KEY, chainingModeJson); - result.put(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, defaultBKUJson); - result.put(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, genericConfigJson); - result.put(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, pvp2RefreshJson); - result.put(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, slRequestTemplatesJson); - result.put(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, timestampJson); - result.put(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, trustedCaCertJson); - - return result; - } - - /** - * Exports a key-value database to a property file, where keys are the same - * as in the database, and the values are serialized JSON objects. - * - * @param inputDBConfigFilePath - * the path to the database properties, for the db the data is - * read from. - * @param outFile - * the destination file for the exported data. - */ - public void readFromDBWriteToFile(String inputDBConfigFilePath, File outFile) { - - try (FileOutputStream outStream = new FileOutputStream(outFile);) { - - Properties result = new Properties(); - - System.getProperties().setProperty("location", "file:" + inputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - Configuration dbConfiguration = (Configuration) context.getBean("config"); - boolean prettyPrint = true; - com.datentechnik.moa.id.conf.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); - - for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { - - // extract database value - Object value = dbConfiguration.get(key); - - // serialize value to JSON - String json = mapper.serialize(value); - - // add to properties - result.setProperty(key, json); - } - - // write to output stream - result.store(outStream, null); - - System.out.println("Property configuration written to:"); - System.out.println(outFile.getAbsolutePath()); - - } catch (FileNotFoundException e) { - System.out.println("Could not find the output file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not write to the output file."); - System.exit(1); - } - } - - /** - * Read an input property file, deserialize it's values and write them to - * the given database. - * - * @param inStream - * the FileInputStream to read from. - * @param outputDBConfigFilePath - * the path to the database properties, for the db which is - * written. - * @throws IOException - * is thrown in case the properties could not be loaded from the - * stream - */ - public void readFromFileWriteToDB(FileInputStream inStream, String outputDBConfigFilePath) throws IOException { - - Properties inProperties = new Properties(); - inProperties.load(inStream); - - System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - Configuration dbConfiguration = (Configuration) context.getBean("config"); - boolean prettyPrint = true; - JsonMapper mapper = new JsonMapper(prettyPrint); - - List keys = dbConfiguration.getAllKeys(); - - if (keys == null) { - System.out.println("Database can not be read."); - System.exit(1); - } - - if (!keys.isEmpty() && !isOverwriteData) { - System.out.println("The database already contains configuration data."); - System.out.println("Use force switch if you want to override data)"); - System.exit(1); - } - - if (isOverwriteData) { - // remove existing entries - for (String key : keys) { - dbConfiguration.set(key, null); - } - } - - Enumeration propertyNames = inProperties.propertyNames(); - - while (propertyNames.hasMoreElements()) { - String key = (String) propertyNames.nextElement(); - // extract database value - String json = inProperties.getProperty(key); - - // deserialize value to object - Object value = mapper.deserialize(json, null); - - // add to database - boolean result = dbConfiguration.set(key, value); - if (!result) { - System.out.println("Could NOT persist the configuration file's information in the database."); - } - } - System.out.println("Data has been successfully written to the database."); - } - - private static void readFromDBWriteToDB(String inputDBConfigFilePath, String outputDBConfigFilePath) { - //TODO: implement - } - -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java deleted file mode 100644 index fefcf5028..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/MigrateConfiguration.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.datentechnik.moa.id.conf; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - -import javax.xml.bind.JAXBException; - -import com.datentechnik.moa.id.conf.cli.MOAIDConfCLI; -import com.datentechnik.moa.id.conf.cli.MigrateConfigurationParams; - -/** - * CLI tool which is able to perform the following tasks: - *
    - *
  • transform a MoaID 2 XML configuration XML file to a MoaID 3 property file - *
  • - *
  • read a property file and transfer it's content to a database
  • - *
  • write the content of a database to a property file
  • - *
- */ -public class MigrateConfiguration { - - public static void main(String[] args) { - - MOAIDConfCLI cli = new MOAIDConfCLI(); - MigrateConfigurationParams parsedParameters = cli.parse(args); - - // consider settings of force switch - boolean isOverwriteData = parsedParameters.isOverwriteData(); - ConfigurationUtil configUtil = new ConfigurationUtil(isOverwriteData); - - if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { - // read input from file - workWithInputFromFile(parsedParameters.getInputTarget(), parsedParameters, configUtil); - - } else if (parsedParameters.getInputDBConfig() != null) { - // read input from database - workWithImputFromDB(parsedParameters, configUtil); - - } else { - System.exit(1); - } - } - - /** - * Handle the case where input from a file is read. - * - * @param inputFileUrl - * the url of the input file. - * @param parsedParameters - * the command line parameters. - * @param configUtil - * the class for working with the configuration. - */ - private static void workWithInputFromFile(String inputFileUrl, MigrateConfigurationParams parsedParameters, - ConfigurationUtil configUtil) { - File inFile = new File(inputFileUrl); - try (FileInputStream inStream = new FileInputStream(inFile);) { - - if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { - // input from file and output to a file is desired - File outFile = new File(parsedParameters.getOutputFile()); - configUtil.readFromXMLFileConvertToPropertyFile(inStream, outFile); - - } else if (parsedParameters.getOutputDBConfig() != null) { - // input from file and output to a database is desired - configUtil.readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); - } - } catch (JAXBException e) { - System.out.println("MOA-ID XML configuration can not be loaded from given file."); - System.exit(1); - } catch (FileNotFoundException e) { - System.out.println("Could not find the input file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not read from the input file."); - System.exit(1); - } - } - - /** - * Handle the case where input is read from a database. - * - * @param parsedParameters - * the command line parameters. - * @param configUtil - * the class for working with the configuration. - */ - private static void workWithImputFromDB(MigrateConfigurationParams parsedParameters, ConfigurationUtil configUtil) { - if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { - // input from database and output to a file is desired - File outFile = new File(parsedParameters.getOutputFile()); - String inputDBConfigFilePath = parsedParameters.getInputDBConfig(); - configUtil.readFromDBWriteToFile(inputDBConfigFilePath, outFile); - - } else if (parsedParameters.getOutputDBConfig() != null) { - // input from database and output to a database is desired - // configUtil.readFromDBWriteToDB(inDBConfigFilePath, - // outDBConfigFilePath); - } - } -} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java deleted file mode 100644 index 481b6d6f6..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/CLIConstants.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.datentechnik.moa.id.conf.cli; - -/** - * Constants for the CLI. - * @author Christian Wagner - * - */ -public class CLIConstants { - private CLIConstants() { - } - - public static final String CMD_LINE_SYNTAX = "java -jar migrateMOAIDconfiguration.jar"; - - public static final String HELP_HEADER = "Convert a given MOAID 2.x config-file."; - public static final String HELP_FOOTER = ""; - // default width of a printed row - public static final int HELP_ROW_WIDTH = 80; - - public static final int HELP_SPACE_BEFORE_OPT = 2; - public static final int HELP_SPACE_BEFORE_DESC = 4; - - public static final String CLI_PARAM_IN = "in"; - public static final String CLI_PARAM_IN_LONG = "input-file"; - public static final String CLI_PARAM_OUT = "out"; - public static final String CLI_PARAM_OUT_LONG = "output-file"; - public static final String CLI_PARAM_INDB = "indb"; - public static final String CLI_PARAM_INDB_LONG = "input-dbconf"; - public static final String CLI_PARAM_OUTDB = "outdb"; - public static final String CLI_PARAM_OUTDB_LONG = "output-dbconf"; - - public static final String CLI_PARAM_HELP = "h"; - public static final String CLI_PARAM_HELP_LONG = "help"; - - public static final String CLI_PARAM_FORCE = "f"; - public static final String CLI_PARAM_FORCE_LONG = "force"; - -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java deleted file mode 100644 index ac5ead171..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MOAIDConfCLI.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.datentechnik.moa.id.conf.cli; - -import java.io.OutputStream; -import java.io.PrintWriter; - -import org.apache.commons.cli.BasicParser; -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.CommandLineParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.OptionGroup; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The command-line interface for MOAID configuration migration - * @author Christian Wagner - * - */ -public class MOAIDConfCLI { - - // the default output to write usage information and help text to - private static final OutputStream OUTPUT_STREAM = System.out; - - private Logger log = LoggerFactory.getLogger(getClass()); - - /** - * Parses the given command-line arguments using a {@link BasicParser} with small modifications. - * @param commandLineArgs the command-line arguments. - */ - public MigrateConfigurationParams parse(String[] commandLineArgs) { - - CommandLineParser parser = new BasicParser(); - CommandLine cmd = null; - MigrateConfigurationParams result = null; - try { - - if (null == commandLineArgs || commandLineArgs.length == 0) { - printUsage(OUTPUT_STREAM, true); - System.exit(0); - } - - cmd = parser.parse(createOptions(), commandLineArgs, true); - - if( null != cmd && cmd.hasOption(CLIConstants.CLI_PARAM_HELP)){ - printUsage(OUTPUT_STREAM, true); - System.exit(0); - } - - result = new MigrateConfigurationParams(cmd); - - } catch (ParseException e) { - log.warn("Encountered exception while parsing: {}", e.getMessage()); - System.err.println(e.getMessage()); - printUsage(OUTPUT_STREAM, false); - System.exit(1); - } - return result; - } - - /** - * Prints information about the usage to the given output. - * @param out the {@link OutputStream} to write to - * @param printOptions determines whether the available options are printed - */ - private void printUsage(OutputStream out, boolean printOptions) { - - PrintWriter pOut = new PrintWriter(out); - - HelpFormatter formatter = new HelpFormatter(); - pOut.println(); - pOut.println("usage: " + CLIConstants.CMD_LINE_SYNTAX + " -" + CLIConstants.CLI_PARAM_FORCE + " -" - + CLIConstants.CLI_PARAM_IN + " | -" + CLIConstants.CLI_PARAM_INDB + " -" - + CLIConstants.CLI_PARAM_OUT + " | -" + CLIConstants.CLI_PARAM_OUTDB + " [-" - + CLIConstants.CLI_PARAM_HELP + "]"); - pOut.println(); - pOut.println(CLIConstants.HELP_HEADER); - if(printOptions){ - pOut.println(); - formatter.printOptions(pOut, CLIConstants.HELP_ROW_WIDTH, createOptions(), CLIConstants.HELP_SPACE_BEFORE_OPT, CLIConstants.HELP_SPACE_BEFORE_DESC); - } - pOut.flush(); - - } - - /** - * Create all {@linkplain Option options} that should be available in the CLI. - * @return The {@linkplain Options options} - */ - private Options createOptions() { - - Options options = new Options(); - - OptionGroup inGroup = new OptionGroup(); - Option optionInput = new Option(CLIConstants.CLI_PARAM_IN, CLIConstants.CLI_PARAM_IN_LONG, true, "MOAID config-file to convert"); - optionInput.setArgName("inputfile"); - Option optionDBInput = new Option(CLIConstants.CLI_PARAM_INDB, CLIConstants.CLI_PARAM_INDB_LONG, true, "config for database to read from"); - optionDBInput.setArgName("dbconfig"); - - inGroup.addOption(optionDBInput); - inGroup.addOption(optionInput); - optionInput.setRequired(false); - - OptionGroup outGroup = new OptionGroup(); - Option optionOutput = new Option(CLIConstants.CLI_PARAM_OUT, CLIConstants.CLI_PARAM_OUT_LONG, true, "target file to write to"); - optionOutput.setArgName("outputfile"); - Option optionDBOutput = new Option(CLIConstants.CLI_PARAM_OUTDB, CLIConstants.CLI_PARAM_OUTDB_LONG, true, "config for database to write to"); - optionDBOutput.setArgName("dbconfig"); - - outGroup.addOption(optionDBOutput); - outGroup.addOption(optionOutput); - outGroup.setRequired(false); - - options.addOptionGroup(inGroup); - options.addOptionGroup(outGroup); - - Option optForce = new Option(CLIConstants.CLI_PARAM_FORCE, CLIConstants.CLI_PARAM_FORCE_LONG, false, "overwrite existing data with imported data"); - options.addOption(optForce); - - Option optHelp = new Option(CLIConstants.CLI_PARAM_HELP, CLIConstants.CLI_PARAM_HELP_LONG, false, "prints this message"); - options.addOption(optHelp); - return options; - } - -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java deleted file mode 100644 index da2cac31b..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/cli/MigrateConfigurationParams.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.datentechnik.moa.id.conf.cli; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.MissingOptionException; - -/** - * The result set for the parsed command line arguments - * @author Christian Wagner - * - */ -public class MigrateConfigurationParams { - - private String inputFile = null; - private String outputFile = null; - private String inputDbConfigFile = null; - private String outputDbConfigFile = null; - - private boolean overwriteData = false; - - /** - * Get the path to the input source which is MOAID 2.x config file in XML-format. - * @return the path to the input source or {@code null} if not set. - */ - public String getInputTarget() { - return this.inputFile; - } - - /** - * Get the path to the output file to write to. - * @return the path to the output file or {@code null} if not set. - */ - public String getOutputFile() { - return outputFile; - } - - /** - * Get the path to the configuration file for the input database. - * @return the path to the config file or {@code null} if not set. - */ - public String getInputDBConfig() { - return inputDbConfigFile; - } - - /** - * Get the path to the configuration file for the output database. - * @return the path to the config file or {@code null} if not set. - */ - public String getOutputDBConfig() { - return outputDbConfigFile; - } - - /** - * Returns whether the desired input is a config file for a database. - * @return true if the stored path points at a database config file; false otherwise. - */ - public boolean isInputDB() { - return inputDbConfigFile != null; - } - - /** - * Returns whether the desired output is a config file for a database. - * @return true if the stored path points at a database config file; false otherwise. - */ - public boolean isOutputDB() { - return outputDbConfigFile != null; - } - - /** - * Returns whether existing data should be overwritten by the imported data or not. - * @return true if the existing data should be overwritten; false otherwise. - */ - public boolean isOverwriteData() { - return overwriteData; - } - - /** - * - * @param cmdLine - * @throws MissingOptionException - */ - public MigrateConfigurationParams(CommandLine cmdLine) throws MissingOptionException { - inputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_IN); - inputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_INDB); - outputFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUT); - outputDbConfigFile = cmdLine.getOptionValue(CLIConstants.CLI_PARAM_OUTDB); - overwriteData = cmdLine.hasOption(CLIConstants.CLI_PARAM_FORCE); - - if (null == inputFile && null == inputDbConfigFile) { - throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] required."); - } - - if (null == outputFile && null == outputDbConfigFile) { - throw new MissingOptionException("One of [-" + CLIConstants.CLI_PARAM_OUT + ", -" + CLIConstants.CLI_PARAM_OUTDB + "] required."); - } - - if (null != inputFile && null != inputDbConfigFile) { - throw new MissingOptionException("Only one of [-" + CLIConstants.CLI_PARAM_IN + ", -" + CLIConstants.CLI_PARAM_INDB + "] allowed."); - } - - if (null != outputFile && null != outputDbConfigFile) { - throw new MissingOptionException("Only one of [-" + CLIConstants.CLI_PARAM_OUT + ", -" + CLIConstants.CLI_PARAM_OUTDB + "] allowed."); - } - - } - -} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java deleted file mode 100644 index 406c21026..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.datentechnik.moa.id.conf.persistence; - -import java.util.List; - -/** - * An interface for a key-value configuration. - */ -public interface Configuration { - - /** - * Gets all keys in the database. NOTE: may return an empty list or {@code null}. - * @return a List containing all keys in the database or {@code null}. - */ - List getAllKeys(); - - /** - * Get the value associated with the given key as {@link Object}. - * @param key the key - * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. - */ - Object get(String key); - - /** - * Get the object of type {@code T} associated with the given key. - * - * @param key the key - * @param clazz the type of the requested object - * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. - */ - T get(String key, Class clazz); - - /** - * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. - * - * @param key the key under which the value is stored, respectively key determining the entry to be deleted. - * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. - * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. - */ - boolean set(String key, Object value); - - /** - * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default - * value is returned. - * - * @param key the key - * @param clazz the type of the requested object - * @param defaultValue the default value to return - * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value. - */ - T get(String key, Class clazz, Object defaultValue); - - /** - * Get a list of objects associated with the given key. The list may be empty or contain only a single object. - * @param key the key - * @param clazz the type of the requested object - * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key. - */ - List getList(String key, Class clazz); - -} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java deleted file mode 100644 index 43974de7a..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/ConfigurationImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.datentechnik.moa.id.conf.persistence; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.EntityExistsException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Required; -import org.springframework.stereotype.Component; - -import com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty; -import com.datentechnik.moa.id.conf.persistence.dal.ConfigPropertyDao; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.type.CollectionType; -import com.fasterxml.jackson.databind.type.TypeFactory; - -/** - * The implementation of a key-value configuration implementing the {@link Configuration} interface. - * It employs the {@link ConfigPropertyDao} to persist configuration data. - */ -@Component -public class ConfigurationImpl implements Configuration { - - private final Logger log = LoggerFactory.getLogger(getClass()); - - ConfigPropertyDao configPropertyDao; - private JsonMapper mapper = new JsonMapper(); - - /** - * Sets the {@link ConfigPropertyDao}. - * @param configPropertyDao the ConfigPropertyDao - */ - @Required - public void setConfigPropertyDao(ConfigPropertyDao configPropertyDao) { - this.configPropertyDao = configPropertyDao; - } - - @Override - public List getAllKeys(){ - try { - return this.configPropertyDao.getAllKeys(); - } catch (Exception e) { - log.debug("Error while retrieving a list of all keys in the database."); - return null; - } - } - - @Override - public Object get(String key) { - // return null if key does not exist - try { - ConfigProperty property = configPropertyDao.getProperty(key); - if (property != null && property.getValue() != null) { - return mapper.deserialize(property.getValue(), null); - } else { - return null; - } - } catch (IllegalArgumentException e) { - log.debug("Error while searching for key '{}' in the database.", key); - return null; - } catch (Exception e) { - log.debug("Error while deserializing value of key '{}' to object.", key); - return null; - } - } - - @Override - public T get(String key, Class clazz) { - // return null if key does not exist - try { - ConfigProperty property = configPropertyDao.getProperty(key); - if (property != null && property.getValue() != null) { - return clazz.cast(mapper.deserialize(property.getValue(), clazz)); - } else { - return null; - } - } catch (IllegalArgumentException e) { - log.debug("Error while searching for key '{}' in the database.", key); - return null; - } catch (Exception e) { - log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass()); - return null; - } - } - - @Override - public boolean set(String key, Object value) { - - try { - if (value == null) { - configPropertyDao.delete(key); - return true; - } else { - - ConfigProperty keyValue = new ConfigProperty(); - keyValue.setKey(key); - - keyValue.setValue(mapper.serialize(value)); - configPropertyDao.saveProperty(keyValue); - return true; - } - } catch (JsonProcessingException e) { - log.debug("Error while serializing object for key '{}'.", key); - return false; - } catch (EntityExistsException e) { - log.debug("Property '{}' already exists!", key); - return false; - } catch (Exception e) { - log.debug("Error while setting value for key '{}' in the database.", key); - return false; - } - } - - @Override - public T get(String key, Class clazz, Object defaultValue) { - - T value = get(key, clazz); - if (value != null) { - return value; - } else { - return clazz.cast(defaultValue); - } - } - - @SuppressWarnings("unchecked") - @Override - public List getList(String key, Class clazz) { - - CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); - try { - if ((configPropertyDao.getProperty(key) == null) - || (configPropertyDao.getProperty(key).getValue() == null)) { - return new ArrayList(); - } - String json = configPropertyDao.getProperty(key).getValue(); - ObjectMapper mapper = new ObjectMapper(); - - return (List) mapper.readValue(json, listType); - } catch (JsonMappingException e) { - ArrayList tmp = new ArrayList(); - T value = get(key, clazz); - if (value != null) { - tmp.add(value); - } - return tmp; - } catch (IOException e) { - log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass()); - return new ArrayList(); - } catch (Exception e){ - log.debug("Error while searching key '{}' in the database.", key); - return new ArrayList(); - } - } - -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/JsonMapper.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/JsonMapper.java deleted file mode 100644 index 8e5d2e7c4..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/JsonMapper.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.datentechnik.moa.id.conf.persistence; - -import java.io.IOException; - -import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JavaType; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.type.TypeFactory; - -/** - * Helper class to handle the JSON (de-)serialization. - * - */ -public class JsonMapper { - - private ObjectMapper mapper = new ObjectMapper(); - - /** - * The default constructor where the default pretty printer is disabled. - */ - public JsonMapper() { - this(false); - } - - /** - * The constructor. - * @param prettyPrint enables or disables the default pretty printer - */ - public JsonMapper(boolean prettyPrint) { - mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE); - mapper.setVisibility(PropertyAccessor.GETTER, Visibility.PUBLIC_ONLY); - mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.PUBLIC_ONLY); - if (prettyPrint) { - mapper.enable(SerializationFeature.INDENT_OUTPUT); - } - } - - /** - * Serialize an object to a JSON string. - * @param value the object to serialize - * @return a JSON string - * @throws JsonProcessingException thrown when an error occurs during serialization - */ - public String serialize(Object value) throws JsonProcessingException { - return mapper.writeValueAsString(value); - } - - /** - * Deserialize a JSON string. - * - * @param value the JSON string to deserialize - * @param clazz optional parameter that determines the type of the returned object. If not set, an {@link Object} is returned. - * @return the deserialized JSON string as an object of type {@code clazz} or {@link Object} - * @throws JsonParseException if the JSON string contains invalid content. - * @throws JsonMappingException if the input JSON structure does not match structure expected for result type - * @throws IOException if an I/O problem occurs (e.g. unexpected end-of-input) - */ - public Object deserialize(String value, Class clazz) throws JsonParseException, JsonMappingException, IOException{ - - ObjectMapper mapper = new ObjectMapper(); - if (clazz != null) { - JavaType javaType = TypeFactory.defaultInstance().constructType(clazz); - return mapper.readValue(value, javaType); - } else { - return mapper.readValue(value, Object.class); - } - } -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java deleted file mode 100644 index 7e4e217b0..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigProperty.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.datentechnik.moa.id.conf.persistence.dal; - -import java.io.Serializable; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Lob; -import javax.persistence.Table; - -/** - * Reflects a MOAID configuration entry. - * - */ -@Table(name = "moaid_configuration") -@Entity -public class ConfigProperty implements Serializable { - private static final long serialVersionUID = 1L; - - @Id - @Column(name = "propertyKey", unique = true) - private String key; - - @Lob - @Column(name = "propertyValue") - private String value; - - /** - * Returns the property's key. - * @return The key. - */ - public String getKey() { - return key; - } - - /** - * Sets the property's key. - * @param key The key - */ - public void setKey(String key) { - this.key = key; - } - - /** - * Returns the property's value (which might be {@code null}). - * @return The property's value (might be {@code null}). - */ - public String getValue() { - return value; - } - - /** - * Sets the property's value. - * @param value The value - */ - public void setValue(String value) { - this.value = value; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((key == null) ? 0 : key.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - ConfigProperty other = (ConfigProperty) obj; - if (key == null) { - if (other.key != null) - return false; - } else if (!key.equals(other.key)) - return false; - return true; - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("ConfigProperty [key="); - builder.append(key); - builder.append(", value="); - builder.append(value); - builder.append("]"); - return builder.toString(); - } -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java deleted file mode 100644 index 8f00bd226..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDao.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.datentechnik.moa.id.conf.persistence.dal; - -import java.util.List; -import java.util.Set; - -/** - * DAO interface providing means for accessing MOAID configuration properties. - * - */ -public interface ConfigPropertyDao { - - /** - * Gets all keys in the database. - * @return a List containing all keys in the database. - */ - List getAllKeys(); - - /** - * Returns the {@link ConfigProperty} associated with {@code key} or {@code null} if the entry does not exist. - * - * @param key The configuration key. - * @return The configuration property value or {@code null}. - */ - ConfigProperty getProperty(String key); - - /** - * Persists a given {@link ConfigProperty}. - * @param property The property to be persisted. - */ - void saveProperty(ConfigProperty property); - - /** - * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. - * @return The list with the properties. - */ - List getProperties(); - - /** - * Returns the value for the configuration property associated with {@code key} or {@code null} if the entry does not exist or its value is {@code null}. - * - * @param key The configuration key. - * @return The configuration property value or {@code null}. - */ - String getPropertyValue(String key); - - /** - * Persists a {@link List} of {@linkplain ConfigProperty ConfigProperties}. - * @param properties The list containing all the properties to be persisted. - */ - void saveProperties(Set properties); - - /** - * Deletes the object associated with the given key. - * @param key the key - */ - void delete(String key); - -} diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java deleted file mode 100644 index 6de10e9b9..000000000 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/dal/ConfigPropertyDaoImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.datentechnik.moa.id.conf.persistence.dal; - -import java.util.List; -import java.util.Set; - -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.transaction.annotation.Transactional; - -/** - * Database backed implementation of the DAO interface - * - */ -@Transactional("transactionManager") -public class ConfigPropertyDaoImpl implements ConfigPropertyDao { - - private Logger log = LoggerFactory.getLogger(getClass()); - - @PersistenceContext(unitName = "moaidconf") - private EntityManager em; - - @Override - public List getAllKeys() { - if (null == em) { - log.error("No EntityManager set!"); - return null; - } - TypedQuery query = em.createQuery("select key from ConfigProperty", String.class); - List result = query.getResultList(); - return result; - } - - @Override - public void saveProperty(ConfigProperty property) { - if (null == em) { - log.error("No EntityManager set!"); - return; - } - - log.debug("Storing '{}'.", property.toString()); - em.persist(property); - } - - @Override - public ConfigProperty getProperty(String key) { - log.debug("Looking for configuration property for key '{}'.", key); - ConfigProperty result = em.find(ConfigProperty.class, key); - if (result != null) { - log.debug("Found configuration property {}.", result); - } else { - log.debug("Unable to find configuration property for key '{}'.", key); - } - return result; - } - - @Override - public String getPropertyValue(String key) { - ConfigProperty property = getProperty(key); - if (property == null) { - return null; - } - return property.getValue(); - } - - @Override - public List getProperties() { - - if (null == em) { - log.error("No EntityManager set!"); - return null; - } - - log.debug("Retrieving all properties from database."); - TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); - try { - List propertiesList = query.getResultList(); - return propertiesList; - } catch (NoResultException e) { - log.debug("No property found in database."); - return null; - } - } - - @Override - public void saveProperties(Set properties) { - log.debug("Storing {} properties to database.", properties.size()); - for (ConfigProperty cp : properties) { - saveProperty(cp); - } - em.flush(); - } - - @Override - public void delete(String key) { - log.debug("Deleting entry with key '{}'.", key); - em.remove(em.find(ConfigProperty.class, key)); - } - -} diff --git a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml index 640c1504c..8ff384eb9 100644 --- a/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml +++ b/id/server/moa-id-commons/src/main/resources/META-INF/persistence.xml @@ -7,12 +7,12 @@ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" org.hibernate.ejb.HibernatePersistence - com.datentechnik.moa.id.conf.persistence.dal.SOME_CLASS + at.gv.egovernment.moa.id.commons.config.persistence.dal.SOME_CLASS org.hibernate.ejb.HibernatePersistence - com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty + at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index 444b01095..732c19721 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -16,8 +16,8 @@ - + class="at.gv.egovernment.moa.id.commons.db.dao.config.ConfigPropertyDaoImpl" /> + diff --git a/id/server/moa-id-commons/src/main/resources/persistence_template.xml b/id/server/moa-id-commons/src/main/resources/persistence_template.xml index f5bbe8555..06706e27a 100644 --- a/id/server/moa-id-commons/src/main/resources/persistence_template.xml +++ b/id/server/moa-id-commons/src/main/resources/persistence_template.xml @@ -5,7 +5,7 @@ http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistenc org.hibernate.ejb.HibernatePersistence - com.datentechnik.moa.id.conf.persistence.dal.ConfigProperty + at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty diff --git a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java index 7147cd5bc..cdfaf825f 100644 --- a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java +++ b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java @@ -19,11 +19,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import com.datentechnik.moa.id.conf.persistence.Configuration; import com.fasterxml.jackson.annotation.JsonProperty; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml index 4c7cd3ab1..cfe4db385 100644 --- a/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml +++ b/id/server/moa-id-commons/src/test/resources/at/gv/egovernment/moa/id/commons/db/configuration.beans-test.xml @@ -16,8 +16,8 @@ location="classpath:at/gv/egovernment/moa/id/commons/db/testDatabase.properties" /> - + class="at.gv.egovernment.moa.id.commons.db.dao.config.ConfigPropertyDaoImpl" /> + diff --git a/id/server/moa-id-commons/src/test/resources/log4j.xml b/id/server/moa-id-commons/src/test/resources/log4j.xml new file mode 100644 index 000000000..6685c1e82 --- /dev/null +++ b/id/server/moa-id-commons/src/test/resources/log4j.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/id/server/pom.xml b/id/server/pom.xml index 9ce48bf60..22d9536d6 100644 --- a/id/server/pom.xml +++ b/id/server/pom.xml @@ -84,7 +84,7 @@ org.springframework - spring-tx + spring-orm ${org.springframework.version} -- cgit v1.2.3 From 9290911f2ab924816fe90ee244d51f711cacfafc Mon Sep 17 00:00:00 2001 From: Martin Bonato Date: Thu, 9 Apr 2015 13:35:08 +0200 Subject: Set test to manual. --- .../at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java index cdfaf825f..7b596fab8 100644 --- a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java +++ b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java @@ -16,6 +16,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.IfProfileValue; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -28,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("configuration.beans-test.xml") +@IfProfileValue(name = "test-groups", values = { "manual" }) public class ConfigurationDBReadTest { @Autowired -- cgit v1.2.3 From 8ec83e5be6888c9e5aeb8d21a35eb4d7ec040f67 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 17 Jun 2015 11:55:42 +0200 Subject: New configuration implementation with full key/value functionality --- id/server/moa-id-commons/pom.xml | 20 + .../src/main/resources/config/moaid_config_3.0.xsd | 1057 ++++++++++++++++++++ 2 files changed, 1077 insertions(+) create mode 100644 id/server/moa-id-commons/src/main/resources/config/moaid_config_3.0.xsd (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index ee94fb49c..9260f8b22 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -37,12 +37,32 @@ true + + egiz-commons + https://demo.egiz.gv.at/int-repo/ + + true + + + + at.gv.egiz.components + egiz-configuration-api + 0.1 + sources + + + at.gv.egiz.components + egiz-configuration-file + 0.1 + sources + + org.hibernate hibernate-core diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_3.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_3.0.xsd new file mode 100644 index 000000000..d4686bd5e --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_3.0.xsd @@ -0,0 +1,1057 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + possibility to include common austrian primary + keys in human readable way, english translation not available + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter der + Authentisierungs-Komponente + + + + + + + + + + + enthält Parameter für die OA + + + + + + spezifiziert den Algorithmus ("pkix" oder + "chaining") für die Zertifikatspfadvalidierung + + + + + + + ein vom SystemDefaultMode abweichender + ChiningMode kann für jeden TrustAnchor gesetzt werden + + + + + + + + + + + + + + + + + verweist auf ein Verzeichnis, das + vertrauenswürdige CA (Zwischen-CA, Wurzel-CA) Zertifikate + enthält. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter für die Kommunikation mit dem + Security-Layer + + + + + + + + + + + enthaelt Konfiguratiosnparameter für die + Kommunikation mit dem MOA SP Modul + + + + + + + enthält Parameter für die SOAP-Verbindung von + der AUTH-Komponente zu MOA-SP; das Attribut URL enthält den + Endpunkt des Server; wird das Schema "https" verwendet müssen + die Kind-Elemente angegeben werden; wird das Schema "http" + verwendet dürfen keine Kind-Elemente angegeben werden; wird das + Element nicht verwendet dann wird MOA-SP über das API + aufgerufen + + + + + + enthält Parameter für die Überprüfung der + Personenbindung + + + + + + + + + + + enthält Parameter für die Überprüfung des + AUTH-Blocks + + + + + + + + + + + + + + + enthält Informationen über akzeptierte Signers + des IdentityLinks + + + + + + + akzeptierte Signer des IdentityLinks werden + per X509SubjectName (Kodierung nach RFC 2253) identifiziert + + + + + + + + + + + + Verbindungsparameter zum SZR-Gateway + (GetIdentityLink) + + + + + + Verbindungsparameter zu den Country-PEPS + (C-PEPS) + + + + + + + + + + + + Verbindungsparameter zum + Online-Vollmachten-Service + + + + + + + + + + + das Attribut filename verweist auf eine Datei mit + globalem Element TransformsInfo vom Typ sl10:TransformsInfo; diese + TransformsInfo werden in den CreateXMLSignatureRequest fuer die + Signatur des AUTH-Blocks inkludiert + + + + + + + + + + + + + + + + + + + das Attribut URL spezifiziert die Lage des + Templates + + + + + + + Verifikation zusaetzlicher Infoboxen + + + + + + Optionales DefaultTrustprofil für die + Überprüfung aller weiteren Infoboxen + + + + + + + + + + + + + Spezifiziert die Lage von XML Schemas + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + enthält Parameter über die OA, die die + Authentisierungs-Komponente betreffen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + URL zu einem Verzeichnis, das akzeptierte + Server-Zertifikate der TLS-Verbindung enthält (keine + CA-Zertifikate) + + + + + + + + + + + + + URL zu einem KeyStore, der den privaten + Schlüssel, der für die TLS-Client-Authentisierung verwendet + wird, enthält + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Soll nicht nur bei leerer oder standardisierter + Vollmacht mit unvollständigen Daten, sondern beispielsweise zu + Kontrollzwecken das Eingabeformular immer angezeigt werden, wenn ein + Einschreiten durch berufliche Parteienvertretung geschieht so kann + dies mittels dieses Schalters veranlasst werden + + + + + + + + + + + + Das Attribut spezifiziert die Lage des + Templates, welches der InputProcessor zur Darstellung des + Eingabeformulars nutzen soll + + + + + + + + + + + Default InputProcessor. Konfiguration eines vom + Standardprozess abweichenden Verarbeitungsvorgangs bei der + beruflichen Parteienvertretung. Der Wert dieses Elements ist der + vollständige Klassenname des InputProzessors + + + + + + Default Wert fuer Formularanzeige. Soll nicht nur + bei leerer oder standardisierter Vollmacht mit unvollstaendigen + Daten, sondern beispielsweise zu Kontrollzwecken das + Eingabeformular zur vervollstaendigung der Vertretenendaten immer + angezeigt werden, wenn ein Einschreiten durch berufliche + Parteienvertretung geschieht so kann dies mittels dieses Schalters + veranlasst werden + + + + + + Default Verbindungsparameter zum SZR-Gateway + (für den EGIZ-Demonstrator im internen Netzwerk: + https://129.27.142.5:8443/szr-gateway/services/MandateCreation) + + + + + + Falls keine speziellen beruflichen + ParteienvertreterInnen definiert sind (Element kommt nicht vor), + werden ausschließlich standardisierte Vollmachten mit einer + MandateID="*" akzeptiert + + + + + + + + + + Konfiguration eines vom Standardprozess + abweichenden Verarbeitungsvorgangs bei der beruflichen + Parteienvertretung. Der Wert dieses Elements ist der vollständige + Klassenname des InputProzessors + + + + + + + Optionale Verbindungsparameter zu speziellem + (SZR-)Gateway + + + + + + + OID der Parteienvertretung lt. "Object Identifier + der öffentlichen Verwaltung" - Konvention, Empfehlung. Diese ID + muss mit der MandateID der übermittelten standardisierten Vollmacht + übereinstimmen. Eine Parteienvertretung für standardisierte + Vollmachten mit der MandateID "*" muss nicht definiert werden und + erlaubt eine allgemeine berufliche Parteienvertretung mit + Standardtexten. In anderen Fällen ist eine erlaubte OID mitttels + dieses Attributs zu definieren + + + + + + Legt fest, ob berufliche Parteienvertretung für + natürliche Personen erlaubt ist + + + + + + + + + Legt fest, ob berufliche Parteienvertretung für + juristische Personen erlaubt ist (welche z.B. ein Organwalter nicht + vertreten darf und dieser Wert aus diesem Grund dort false sein + muss) + + + + + + + + + Beschreibender Text, der an Stelle des + Standardtexts bei der Signatur der Anmeldedaten im Falle einer + vorliegenden beruflichen Parteienvertretung zur Signatur vorgelegt + wird + + + + + + + Enthaelt Informationen zu einem KeyStore bzw. Key + zur STORK SAML AuthnRequest Signaturerstellung + + + + + + + + + + Enthaelt Informationen zur Verfikation von + Signaturen einer STORK SAML Response + + + + + + + + + Enthält Informationen zur Erstellung und + Verifikation von STORK SAML Messages + + + + + + + + + + + + URL zu einem KeyStore, der den privaten Schlüssel + zum Erstellen einer Signatur enthält + + + + + + + + + + + + + Name zum Key eines KeyStores, der den privaten + Schlüssel zum Erstellen einer Signatur darstellt + + + + + + + + + + + + + + Enthält Informationen zu einem Citizen Country + PEPS (C-PEPS) + + + + + + + + + + + + + + + Contains STORK related information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From c276e33e5ebdebc1c727dbd93ea1f876588a0dec Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jun 2015 10:59:09 +0200 Subject: refactor MOA-ID AuthConfiguration --- .../moa/id/advancedlogging/StatisticLogger.java | 7 +- .../moa/id/auth/AuthenticationServer.java | 49 +- .../moa/id/auth/MOAIDAuthInitializer.java | 6 +- .../AuthenticationBlockAssertionBuilder.java | 12 +- .../id/auth/builder/AuthenticationDataBuilder.java | 13 +- .../builder/DynamicOAAuthParameterBuilder.java | 4 +- .../moa/id/auth/builder/LoginFormBuilder.java | 6 +- .../moa/id/auth/builder/SAMLArtifactBuilder.java | 4 +- .../id/auth/builder/SendAssertionFormBuilder.java | 5 +- .../auth/builder/StartAuthenticationBuilder.java | 3 - .../auth/invoke/SignatureVerificationInvoker.java | 5 +- .../internal/tasks/GetMISSessionIDTask.java | 7 +- .../tasks/PrepareAuthBlockSignatureTask.java | 7 +- .../tasks/VerifyAuthenticationBlockTask.java | 7 +- .../StartAuthentificationParameterParser.java | 21 +- .../servlet/GenerateIFrameTemplateServlet.java | 10 +- .../id/auth/servlet/GetMISSessionIDServlet.java | 7 +- .../id/auth/servlet/IDPSingleLogOutServlet.java | 6 +- .../moa/id/auth/servlet/LogOutServlet.java | 6 +- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 10 +- .../PEPSConnectorWithLocalSigningServlet.java | 8 +- .../moa/id/auth/servlet/RedirectServlet.java | 4 +- .../servlet/VerifyAuthenticationBlockServlet.java | 7 +- .../id/auth/servlet/VerifyIdentityLinkServlet.java | 7 +- .../CreateXMLSignatureResponseValidator.java | 8 +- .../VerifyXMLSignatureResponseValidator.java | 4 +- .../gv/egovernment/moa/id/client/SZRGWClient.java | 4 +- .../moa/id/config/ConfigurationProvider.java | 173 ---- .../moa/id/config/ConfigurationProviderImpl.java | 173 ++++ .../moa/id/config/auth/AuthConfigLoader.java | 4 +- .../moa/id/config/auth/AuthConfiguration.java | 17 +- .../id/config/auth/AuthConfigurationProvider.java | 153 ++-- .../config/auth/ConfigurationToJSONConverter.java | 6 +- .../config/auth/NewAuthConfigurationProvider.java | 982 -------------------- .../PropertyBasedAuthConfigurationProvider.java | 983 +++++++++++++++++++++ .../moa/id/entrypoints/DispatcherServlet.java | 6 +- .../moa/id/moduls/AuthenticationManager.java | 18 +- .../gv/egovernment/moa/id/moduls/SSOManager.java | 10 +- .../id/protocols/oauth20/OAuth20Configuration.java | 6 +- .../oauth20/protocol/OAuth20AuthAction.java | 4 +- .../oauth20/protocol/OAuth20AuthRequest.java | 6 +- .../oauth20/protocol/OAuth20BaseRequest.java | 4 +- .../oauth20/protocol/OAuth20Protocol.java | 4 +- .../oauth20/protocol/OAuth20TokenRequest.java | 4 +- .../moa/id/protocols/pvp2x/PVP2XProtocol.java | 6 +- .../id/protocols/pvp2x/PVPTargetConfiguration.java | 4 +- .../moa/id/protocols/pvp2x/SingleLogOutAction.java | 6 +- .../pvp2x/builder/AuthResponseBuilder.java | 4 +- .../builder/assertion/PVP2AssertionBuilder.java | 4 +- .../protocols/pvp2x/config/PVPConfiguration.java | 20 +- .../pvp2x/metadata/MOAMetadataProvider.java | 10 +- .../protocols/pvp2x/utils/MOASAMLSOAPClient.java | 10 +- .../pvp2x/verification/SAMLVerifierMOASP.java | 4 +- .../metadata/SchemaValidationFilter.java | 4 +- .../moa/id/protocols/saml1/GetArtifactAction.java | 6 +- .../moa/id/protocols/saml1/SAML1Protocol.java | 10 +- .../moa/id/protocols/saml1/SAML1RequestImpl.java | 4 +- .../id/protocols/stork2/AttributeCollector.java | 6 +- .../id/protocols/stork2/AuthenticationRequest.java | 14 +- .../moa/id/protocols/stork2/ConsentEvaluator.java | 4 +- .../moa/id/protocols/stork2/MOASTORKRequest.java | 4 +- .../protocols/stork2/MandateRetrievalRequest.java | 4 +- .../moa/id/protocols/stork2/STORKProtocol.java | 4 +- .../SignedDocAttributeRequestProvider.java | 5 +- .../id/storage/AuthenticationSessionStoreage.java | 4 +- .../moa/id/util/AbstractEncrytionUtil.java | 1 - .../moa/id/util/ConfigurationEncrytionUtil.java | 4 +- .../moa/id/util/IdentityLinkReSigner.java | 2 +- .../moa/id/util/ParamValidatorUtils.java | 5 +- .../at/gv/egovernment/moa/id/util/SSLUtils.java | 6 +- .../moa/id/util/SessionEncrytionUtil.java | 4 +- ...nfigurationProviderLegacyCompatibilityTest.java | 2 +- .../auth/TestLegacyAuthConfigurationProvider.java | 4 +- .../VerifyXMLSignatureRequestBuilderTest.java | 6 +- .../id/auth/invoke/SignatureVerificationTest.java | 6 +- .../test/java/test/lasttest/LasttestClient.java | 4 +- .../src/test/java/test/tlenz/simpletest.java | 24 +- .../moa/id/commons/config/ConfigurationUtil.java | 1 - .../config/MOAIDConfigurationConstants.java | 246 ++++++ .../commons/config/persistence/Configuration.java | 60 -- .../config/persistence/ConfigurationImpl.java | 161 ---- .../config/persistence/MOAIDConfiguration.java | 62 ++ .../config/persistence/MOAIDConfigurationImpl.java | 136 +++ .../commons/db/ConfigurationFromDBExtractor.java | 1 + .../id/commons/db/MOAIDConfigurationConstants.java | 44 - .../moa/id/commons/db/NewConfigurationDBRead.java | 12 +- .../moa/id/commons/db/NewConfigurationDBWrite.java | 11 +- .../commons/db/dao/config/ConfigPropertyDao.java | 58 -- .../db/dao/config/ConfigPropertyDaoImpl.java | 169 +++- .../moa/id/commons/db/ConfigurationDBReadTest.java | 13 +- .../moa/id/auth/servlet/MonitoringServlet.java | 5 +- .../moa/id/monitoring/DatabaseTestModule.java | 5 +- .../moa/id/monitoring/IdentityLinkTestModule.java | 5 +- .../egovernment/moa/id/monitoring/TestManager.java | 5 +- .../AbstractPepsConnectorWithLocalSigningTask.java | 4 +- .../tasks/CreateStorkAuthRequestFormTask.java | 4 +- ...onnectorHandleResponseWithoutSignatureTask.java | 6 +- .../modules/stork/tasks/PepsConnectorTask.java | 8 +- 98 files changed, 2132 insertions(+), 1879 deletions(-) delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java index f45a16780..cd1acaa8c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/advancedlogging/StatisticLogger.java @@ -52,7 +52,8 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.statistic.StatisticLog; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.moduls.IRequest; @@ -91,7 +92,7 @@ public class StatisticLogger { private StatisticLogger() { try { - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); if (config != null) isAktive = config.isAdvancedLoggingActive(); @@ -373,7 +374,7 @@ public class StatisticLogger { Logger.trace("Staticic Log search BKUType from DefaultBKUs"); try { - AuthConfigurationProvider authconfig = AuthConfigurationProvider.getInstance(); + AuthConfiguration authconfig = AuthConfigurationProviderFactory.getInstance(); if (bkuURL.equals(authconfig.getDefaultBKUURL(IOAAuthParameters.ONLINEBKU))) return IOAAuthParameters.ONLINEBKU; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index eab7c511e..1db580530 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -85,7 +85,8 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.config.stork.CPEPS; import at.gv.egovernment.moa.id.config.stork.STORKConfig; @@ -216,7 +217,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { //load OnlineApplication configuration OAAuthParameter oaParam = - AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); + AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[]{session.getPublicOAURLPrefix()}); @@ -234,7 +235,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { String infoboxReadRequest = ""; - String domainIdentifier = AuthConfigurationProvider.getInstance().getSSOTagetIdentifier().trim(); + String domainIdentifier = AuthConfigurationProviderFactory.getInstance().getSSOTagetIdentifier().trim(); if (MiscUtil.isEmpty(domainIdentifier) && session.isSsoRequested()) { //do not use SSO if no Target is set Logger.warn("NO SSO-Target found in configuration. Single Sign-On is deaktivated!"); @@ -354,7 +355,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { throw new AuthenticationException("auth.10", new Object[]{ REQ_VERIFY_IDENTITY_LINK, PARAM_XMLRESPONSE}); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); // check if an identity link was found @@ -396,7 +397,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { VerifyXMLSignatureResponse verifyXMLSignatureResponse = new VerifyXMLSignatureResponseParser( domVerifyXMLSignatureResponse).parseData(); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); // validates the @@ -462,10 +463,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { session.setOW(false); } - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); String returnvalue = getCreateXMLSignatureRequestAuthBlockOrRedirect(session, @@ -499,7 +500,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { throw new AuthenticationException("auth.10", new Object[]{ GET_MIS_SESSIONID, PARAM_SESSIONID}); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); try { @@ -536,7 +537,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @throws ValidateException */ public String getCreateXMLSignatureRequestAuthBlockOrRedirect( - AuthenticationSession session, AuthConfigurationProvider authConf, + AuthenticationSession session, AuthConfiguration authConf, OAAuthParameter oaParam) throws ConfigurationException, BuildException, ValidateException { @@ -545,9 +546,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { // return "Redirect to Input Processor"; if (authConf == null) - authConf = AuthConfigurationProvider.getInstance(); + authConf = AuthConfigurationProviderFactory.getInstance(); if (oaParam == null) - oaParam = AuthConfigurationProvider.getInstance() + oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter( session.getPublicOAURLPrefix()); @@ -583,10 +584,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { throw new AuthenticationException("auth.10", new Object[]{ REQ_VERIFY_CERTIFICATE, PARAM_SESSIONID}); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); return getCreateXMLSignatureRequestForeigID(session, authConf, oaParam, @@ -594,7 +595,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { } public String getCreateXMLSignatureRequestForeigID( - AuthenticationSession session, AuthConfigurationProvider authConf, + AuthenticationSession session, AuthConfiguration authConf, OAAuthParameter oaParam, X509Certificate cert) throws ConfigurationException { @@ -603,9 +604,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { // return "Redirect to Input Processor"; if (authConf == null) - authConf = AuthConfigurationProvider.getInstance(); + authConf = AuthConfigurationProviderFactory.getInstance(); if (oaParam == null) - oaParam = AuthConfigurationProvider.getInstance() + oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter( session.getPublicOAURLPrefix()); @@ -648,7 +649,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { throw new AuthenticationException("auth.10", new Object[]{ REQ_GET_FOREIGN_ID, PARAM_XMLRESPONSE}); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); // parses the @@ -783,7 +784,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { if (session.isSsoRequested()) { String oaURL = new String(); try { - oaURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + oaURL = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); if (MiscUtil.isNotEmpty(oaURL)) oaURL = oaURL.replaceAll("&", "&"); @@ -1122,7 +1123,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { throw new AuthenticationException("auth.10", new Object[]{ REQ_VERIFY_AUTH_BLOCK, PARAM_XMLRESPONSE}); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); // parses CreateXMLSignatureResponse csresp = new CreateXMLSignatureResponseParser( @@ -1195,7 +1196,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { } } - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); // validates the @@ -1601,7 +1602,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { public CreateIdentityLinkResponse getIdentityLink(String PEPSIdentifier, String PEPSFirstname, String PEPSFamilyname, String PEPSDateOfBirth, String gender, String citizenSignature, String represented, String representative, String mandateContent, String organizationAddress, String organizationType, String targetType, String targetValue, String oaFriendlyName, List filters, String PEPSFiscalNumber) throws SZRGWClientException { try { - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConf = AuthConfigurationProviderFactory.getInstance(); ConnectionParameter connectionParameters = authConf.getForeignIDConnectionParameter(); SZRGWClient client = new SZRGWClient(connectionParameters); @@ -1695,12 +1696,12 @@ public class AuthenticationServer implements MOAIDAuthConstants { } //read configuration paramters of OA - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[]{moasession.getPublicOAURLPrefix()}); //Start of STORK Processing - STORKConfig storkConfig = AuthConfigurationProvider.getInstance().getStorkConfig(); + STORKConfig storkConfig = AuthConfigurationProviderFactory.getInstance().getStorkConfig(); CPEPS cpeps = storkConfig.getCPEPS(moasession.getCcc()); @@ -1709,7 +1710,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { Logger.debug("C-PEPS URL: " + destination); - String issuerValue = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + String issuerValue = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); // String acsURL = new DataURLBuilder().buildDataURL(issuerValue, // PEPSConnectorServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN, moasession.getSessionID()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java index 025c4c652..39ab28285 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java @@ -18,7 +18,9 @@ import javax.net.ssl.SSLSocketFactory; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConnectionParameter; import at.gv.egovernment.moa.id.config.auth.AuthConfigLoader; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; +import at.gv.egovernment.moa.id.config.auth.PropertyBasedAuthConfigurationProvider; import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; @@ -129,7 +131,7 @@ public class MOAIDAuthInitializer { Constants.nSMap.put(Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); // Loads the configuration - AuthConfigurationProvider authConf = AuthConfigurationProvider.reload(); + AuthConfiguration authConf = AuthConfigurationProviderFactory.reload(); ConnectionParameter moaSPConnParam = authConf .getMoaSpConnectionParameter(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java index a6c2cde05..6df0c4742 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java @@ -50,7 +50,7 @@ import at.gv.egovernment.moa.id.auth.exception.BuildException; import at.gv.egovernment.moa.id.auth.exception.ParseException; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.TargetToSectorNameMapper; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.util.Random; @@ -265,7 +265,7 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion String text = ""; try { - OAAuthParameter oaparam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); + OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); if (MiscUtil.isNotEmpty(text = oaparam.getAditionalAuthBlockText())) Logger.info("Use addional AuthBlock Text from OA=" + oaparam.getPublicURLPrefix()); } catch (ConfigurationException e) { @@ -352,7 +352,7 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion //BZ.., reading OA parameters OAAuthParameter oaParam; try { - oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter( session.getPublicOAURLPrefix()); } catch (ConfigurationException e) { Logger.error("Error on building AUTH-Block: " + e.getMessage()); @@ -417,7 +417,7 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion String text = ""; try { - OAAuthParameter oaparam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); + OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); if (MiscUtil.isNotEmpty(text = oaparam.getAditionalAuthBlockText())) Logger.info("Use addional AuthBlock Text from OA=" + oaparam.getPublicURLPrefix()); } catch (ConfigurationException e) { @@ -525,7 +525,7 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion //adding friendly name of OA String friendlyname; try { - friendlyname = AuthConfigurationProvider.getInstance().getSSOFriendlyName(); + friendlyname = AuthConfigurationProviderFactory.getInstance().getSSOFriendlyName(); ExtendedSAMLAttribute oaFriendlyNameAttribute = new ExtendedSAMLAttributeImpl("oaFriendlyName", friendlyname, Constants.MOA_NS_URI, ExtendedSAMLAttribute.ADD_TO_AUTHBLOCK_ONLY); @@ -533,7 +533,7 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion extendedSAMLAttributes.add(oaFriendlyNameAttribute); - String text = AuthConfigurationProvider.getInstance().getSSOSpecialText(); + String text = AuthConfigurationProviderFactory.getInstance().getSSOSpecialText(); if (MiscUtil.isEmpty(text)) text=""; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java index cd751ce7f..f646f200d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java @@ -75,7 +75,8 @@ import at.gv.egovernment.moa.id.commons.db.dao.session.InterfederationSessionSto import at.gv.egovernment.moa.id.commons.db.dao.session.OASessionStore; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.AuthenticationData; @@ -176,7 +177,7 @@ public class AuthenticationDataBuilder implements MOAIDAuthConstants { IOAAuthParameters oaParam = null; if (reqAttributes == null) { //get OnlineApplication from MOA-ID-Auth configuration - oaParam = AuthConfigurationProvider.getInstance() + oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(oaID); //build OA dynamically from STROK request if this OA is used as STORK<->PVP gateway @@ -199,7 +200,7 @@ public class AuthenticationDataBuilder implements MOAIDAuthConstants { } else { //get attributes from interfederated IDP - OAAuthParameter idp = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(interfIDP.getIdpurlprefix()); + OAAuthParameter idp = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(interfIDP.getIdpurlprefix()); getAuthDataFromInterfederation(authdata, session, oaParam, protocolRequest, interfIDP, idp, reqAttributes); //mark attribute request as used @@ -484,7 +485,7 @@ public class AuthenticationDataBuilder implements MOAIDAuthConstants { if (MiscUtil.isEmpty(authData.getIdentificationValue())) { Logger.info("No baseID found. Connect SZR to reveive baseID ..."); try { - EgovUtilPropertiesConfiguration eGovClientsConfig = AuthConfigurationProvider.getInstance().geteGovUtilsConfig(); + EgovUtilPropertiesConfiguration eGovClientsConfig = AuthConfigurationProviderFactory.getInstance().geteGovUtilsConfig(); if (eGovClientsConfig != null) { SZRClient szrclient = new SZRClient(eGovClientsConfig); @@ -929,7 +930,7 @@ public class AuthenticationDataBuilder implements MOAIDAuthConstants { //set max. SSO session time if (authData.isSsoSession()) { - long maxSSOSessionTime = AuthConfigurationProvider.getInstance().getTimeOuts().getMOASessionCreated().longValue() * 1000; + long maxSSOSessionTime = AuthConfigurationProviderFactory.getInstance().getTimeOuts().getMOASessionCreated().longValue() * 1000; Date ssoSessionValidTo = new Date(session.getSessionCreated().getTime() + maxSSOSessionTime); authData.setSsoSessionValidTo(ssoSessionValidTo); @@ -994,7 +995,7 @@ public class AuthenticationDataBuilder implements MOAIDAuthConstants { IdentityLinkReSigner identitylinkresigner = IdentityLinkReSigner.getInstance(); Element resignedilAssertion; - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); if (config.isIdentityLinkResigning()) { resignedilAssertion = identitylinkresigner.resignIdentityLink(businessServiceIdl.getSamlAssertion(), config.getIdentityLinkResigningKey()); } else { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DynamicOAAuthParameterBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DynamicOAAuthParameterBuilder.java index 49f87122d..bc3645e74 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DynamicOAAuthParameterBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DynamicOAAuthParameterBuilder.java @@ -29,7 +29,7 @@ import org.opensaml.saml2.core.Attribute; import at.gv.egovernment.moa.id.auth.exception.DynamicOABuildException; import at.gv.egovernment.moa.id.commons.db.dao.session.InterfederationSessionStore; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.config.auth.data.DynamicOAAuthParameters; @@ -77,7 +77,7 @@ public class DynamicOAAuthParameterBuilder { if (interfIDP != null) { //load interfederated IDP informations - OAAuthParameter idp = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(interfIDP.getIdpurlprefix()); + OAAuthParameter idp = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(interfIDP.getIdpurlprefix()); if (idp == null) { Logger.warn("Interfederated IDP configuration is not loadable."); throw new DynamicOABuildException("Interfederated IDP configuration is not loadable.", null); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java index 54196427e..a8e5a4253 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java @@ -25,12 +25,10 @@ package at.gv.egovernment.moa.id.auth.builder; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; import java.net.URI; -import java.net.URISyntaxException; import java.util.List; import org.apache.commons.io.IOUtils; @@ -39,7 +37,7 @@ import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.protocols.saml1.SAML1Protocol; @@ -70,7 +68,7 @@ public class LoginFormBuilder { InputStream input = null; try { - String rootconfigdir = AuthConfigurationProvider.getInstance().getRootConfigFileDir(); + String rootconfigdir = AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir(); pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL; File file = new File(new URI(pathLocation)); input = new FileInputStream(file); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java index 1e2a4700d..eeca78e60 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SAMLArtifactBuilder.java @@ -51,7 +51,7 @@ import java.security.MessageDigest; import at.gv.egovernment.moa.id.auth.exception.BuildException; import at.gv.egovernment.moa.id.auth.validator.parep.ParepUtils; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Base64Utils; @@ -94,7 +94,7 @@ public class SAMLArtifactBuilder { MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] sourceID; // alternative sourceId - String alternativeSourceID = AuthConfigurationProvider.getInstance().getAlternativeSourceID(); + String alternativeSourceID = AuthConfigurationProviderFactory.getInstance().getAlternativeSourceID(); // if sourceID is given in GET/POST param - use this as source id if (!ParepUtils.isEmpty(sourceIdParam)) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java index 24b848176..253125fe9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/SendAssertionFormBuilder.java @@ -33,12 +33,11 @@ import java.net.URI; import org.apache.commons.io.IOUtils; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.protocols.saml1.SAML1Protocol; import at.gv.egovernment.moa.id.util.FormBuildUtils; import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.MiscUtil; public class SendAssertionFormBuilder { @@ -63,7 +62,7 @@ public class SendAssertionFormBuilder { String pathLocation; InputStream input = null; try { - String rootconfigdir = AuthConfigurationProvider.getInstance().getRootConfigFileDir(); + String rootconfigdir = AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir(); pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL; try { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java index 9a8372a2d..5c1b12e0d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java @@ -30,10 +30,7 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; -import at.gv.egovernment.moa.id.config.stork.STORKConfig; import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.StringUtils; public class StartAuthenticationBuilder { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java index 479775dd5..8909564c3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationInvoker.java @@ -59,7 +59,8 @@ import org.w3c.dom.Element; import at.gv.egovernment.moa.id.auth.exception.ServiceException; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.spss.api.SignatureVerificationService; import at.gv.egovernment.moa.spss.api.xmlbind.VerifyXMLSignatureRequestParser; @@ -106,7 +107,7 @@ public class SignatureVerificationInvoker { SOAPBodyElement response; String endPoint; - AuthConfigurationProvider authConfigProvider = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConfigProvider = AuthConfigurationProviderFactory.getInstance(); authConnParam = authConfigProvider.getMoaSpConnectionParameter(); //If the ConnectionParameter do NOT exist, we try to get the api to work.... if (authConnParam != null) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/GetMISSessionIDTask.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/GetMISSessionIDTask.java index 4ff5672bd..d30dfd562 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/GetMISSessionIDTask.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/GetMISSessionIDTask.java @@ -24,7 +24,8 @@ import at.gv.egovernment.moa.id.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.process.api.ExecutionContext; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; @@ -89,12 +90,12 @@ public class GetMISSessionIDTask extends AbstractAuthServletTask { String misSessionID = session.getMISSessionID(); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); ConnectionParameter connectionParameters = authConf .getOnlineMandatesConnectionParameter(); SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory( - AuthConfigurationProvider.getInstance(), + AuthConfigurationProviderFactory.getInstance(), connectionParameters); List list = MISSimpleClient.sendGetMandatesRequest( diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java index 3ae35bc24..fc5fb6c58 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/PrepareAuthBlockSignatureTask.java @@ -14,7 +14,8 @@ import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.process.api.ExecutionContext; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -75,9 +76,9 @@ public class PrepareAuthBlockSignatureTask extends AbstractAuthServletTask { // TODO[branch]: Default behaviour; respond with CXSR for authblock signature, dataURL "/VerifyAuthBlock" - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter( session.getPublicOAURLPrefix()); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConf = AuthConfigurationProviderFactory.getInstance(); String createXMLSignatureRequest = AuthenticationServer.getInstance() .getCreateXMLSignatureRequestAuthBlockOrRedirect(session, authConf, oaParam); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/VerifyAuthenticationBlockTask.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/VerifyAuthenticationBlockTask.java index 64dcb0f41..d9c4c3c4e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/VerifyAuthenticationBlockTask.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/internal/tasks/VerifyAuthenticationBlockTask.java @@ -29,7 +29,8 @@ import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.process.api.ExecutionContext; @@ -122,9 +123,9 @@ public class VerifyAuthenticationBlockTask extends AbstractAuthServletTask { if (authenticatedMOASessionId == null) { //mandate Mode - AuthConfigurationProvider authConf= AuthConfigurationProvider.getInstance(); + AuthConfiguration authConf= AuthConfigurationProviderFactory.getInstance(); ConnectionParameter connectionParameters = authConf.getOnlineMandatesConnectionParameter(); - SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory(AuthConfigurationProvider.getInstance(), connectionParameters); + SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory(AuthConfigurationProviderFactory.getInstance(), connectionParameters); // get identitity link as byte[] Element elem = session.getIdentityLink().getSamlAssertion(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java index a123569d5..89e2eac14 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java @@ -22,12 +22,10 @@ ******************************************************************************/ package at.gv.egovernment.moa.id.auth.parser; -import java.io.UnsupportedEncodingException; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringEscapeUtils; @@ -37,18 +35,15 @@ import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IRequest; -import at.gv.egovernment.moa.id.moduls.RequestStorage; import at.gv.egovernment.moa.id.protocols.saml1.SAML1Protocol; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; -import at.gv.egovernment.moa.util.URLEncoder; public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ @@ -110,7 +105,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ OAAuthParameter oaParam; if (moasession.getPublicOAURLPrefix() != null) { Logger.debug("Loading OA parameters for PublicURLPrefix: " + moasession.getPublicOAURLPrefix()); - oaParam = AuthConfigurationProvider.getInstance() + oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter( moasession.getPublicOAURLPrefix()); @@ -119,7 +114,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ new Object[] { moasession.getPublicOAURLPrefix() }); } else { - oaParam = AuthConfigurationProvider.getInstance() + oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(oaURL); if (oaParam == null) @@ -170,7 +165,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ //Validate BKU URI List allowedbkus = oaParam.getBKUURL(); - allowedbkus.addAll(AuthConfigurationProvider.getInstance().getDefaultBKUURLs()); + allowedbkus.addAll(AuthConfigurationProviderFactory.getInstance().getDefaultBKUURLs()); if (!ParamValidatorUtils.isValidBKUURI(bkuURL, allowedbkus)) throw new WrongParametersException("StartAuthentication", PARAM_BKU, "auth.12"); @@ -218,7 +213,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ new Object[] { authURL + "*" }); //set Auth URL from configuration - moasession.setAuthURL(AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/"); + moasession.setAuthURL(AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/"); //check and set SourceID if (oaParam.getSAML1Parameter() != null) { @@ -231,19 +226,19 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ List templateURLList = oaParam.getTemplateURL(); List defaulTemplateURLList = - AuthConfigurationProvider.getInstance().getSLRequestTemplates(); + AuthConfigurationProviderFactory.getInstance().getSLRequestTemplates(); if ( templateURLList != null && templateURLList.size() > 0 && MiscUtil.isNotEmpty(templateURLList.get(0).getURL()) ) { templateURL = FileUtils.makeAbsoluteURL( oaParam.getTemplateURL().get(0).getURL(), - AuthConfigurationProvider.getInstance().getRootConfigFileDir()); + AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir()); Logger.info("No SL-Template in request, load SL-Template from OA configuration (URL: " + templateURL + ")"); } else if ( (defaulTemplateURLList.size() > 0) && MiscUtil.isNotEmpty(defaulTemplateURLList.get(0))) { templateURL = FileUtils.makeAbsoluteURL( defaulTemplateURLList.get(0), - AuthConfigurationProvider.getInstance().getRootConfigFileDir()); + AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir()); Logger.info("No SL-Template in request, load SL-Template from general configuration (URL: " + templateURL + ")"); } else { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java index ad4776a45..d0c7118ca 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java @@ -40,7 +40,7 @@ import at.gv.egovernment.moa.id.auth.parser.StartAuthentificationParameterParser import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IRequest; @@ -98,7 +98,7 @@ public class GenerateIFrameTemplateServlet extends AuthServlet { } //load OA Config - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(moasession.getOAURLRequested()); if (oaParam == null) @@ -118,7 +118,7 @@ public class GenerateIFrameTemplateServlet extends AuthServlet { String bkuURL = oaParam.getBKUURL(bkuid); if (MiscUtil.isEmpty(bkuURL)) { Logger.info("No OA specific BKU defined. Use BKU from default configuration"); - bkuURL = AuthConfigurationProvider.getInstance().getDefaultBKUURL(bkuid); + bkuURL = AuthConfigurationProviderFactory.getInstance().getDefaultBKUURL(bkuid); } //search for OA specific template @@ -129,13 +129,13 @@ public class GenerateIFrameTemplateServlet extends AuthServlet { templateURL = oaTemplateURLList.get(0).getURL(); } else { - templateURL = AuthConfigurationProvider.getInstance().getSLRequestTemplates(bkuid); + templateURL = AuthConfigurationProviderFactory.getInstance().getSLRequestTemplates(bkuid); } //make url absolut if it is a local url if (MiscUtil.isNotEmpty(templateURL)) templateURL = FileUtils.makeAbsoluteURL(templateURL, - AuthConfigurationProvider.getInstance().getRootConfigFileDir()); + AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir()); if (oaParam.isOnlyMandateAllowed()) useMandate = "true"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java index 043b660c1..f2b788e26 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetMISSessionIDServlet.java @@ -70,7 +70,8 @@ import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.modules.internal.tasks.GetMISSessionIDTask; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -181,12 +182,12 @@ public class GetMISSessionIDServlet extends AuthServlet { String misSessionID = session.getMISSessionID(); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); ConnectionParameter connectionParameters = authConf .getOnlineMandatesConnectionParameter(); SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory( - AuthConfigurationProvider.getInstance(), + AuthConfigurationProviderFactory.getInstance(), connectionParameters); List list = MISSimpleClient.sendGetMandatesRequest( diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java index c08d77f12..626c95b19 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java @@ -35,7 +35,7 @@ import org.opensaml.saml2.metadata.SingleLogoutService; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.data.SLOInformationContainer; import at.gv.egovernment.moa.id.moduls.AuthenticationManager; import at.gv.egovernment.moa.id.moduls.SSOManager; @@ -141,7 +141,7 @@ public class IDPSingleLogOutServlet extends AuthServlet { } else { //print SLO information directly - redirectURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/idpSingleLogout"; + redirectURL = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/idpSingleLogout"; String artifact = Random.nextRandom(); @@ -157,7 +157,7 @@ public class IDPSingleLogOutServlet extends AuthServlet { } //redirect to Redirect Servlet - String url = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/RedirectServlet"; + String url = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/RedirectServlet"; url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(redirectURL, "UTF-8")); url = resp.encodeRedirectURL(url); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java index d7de985a4..8981566eb 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java @@ -56,7 +56,7 @@ import javax.servlet.http.HttpServletResponse; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.moduls.AuthenticationManager; import at.gv.egovernment.moa.id.moduls.RequestStorage; import at.gv.egovernment.moa.id.moduls.SSOManager; @@ -86,14 +86,14 @@ public class LogOutServlet extends AuthServlet { if (MiscUtil.isEmpty(redirectUrl)) { //set default redirect Target Logger.debug("Set default RedirectURL back to MOA-ID-Auth"); - redirectUrl = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + redirectUrl = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); } else { //return an error if RedirectURL is not a active Online-Applikation OnlineApplication oa = ConfigurationDBRead.getActiveOnlineApplication(redirectUrl); if (oa == null) { Logger.info("RedirctURL does not match to OA configuration. Set default RedirectURL back to MOA-ID-Auth"); - redirectUrl = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + redirectUrl = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 24daa76a3..ed4ef1f5a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -64,7 +64,9 @@ import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; @@ -122,7 +124,7 @@ public class PEPSConnectorServlet extends AuthServlet { super(); try { - AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConfigurationProvider = AuthConfigurationProviderFactory.getInstance(); dtlUrl = authConfigurationProvider.getDocumentServiceUrl(); Logger.info ("PEPSConnectorServlet, using dtlUrl:"+dtlUrl); } catch (Exception e) { @@ -277,7 +279,7 @@ public class PEPSConnectorServlet extends AuthServlet { throw new MOAIDException("stork.07", null); } - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[] { moaSession.getPublicOAURLPrefix() }); //================== Check QAA level start ==================== @@ -456,7 +458,7 @@ public class PEPSConnectorServlet extends AuthServlet { IdentityLink identityLink = null; try { - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); if(config.isStorkFakeIdLActive() && config.getStorkFakeIdLCountries().contains(storkAuthnRequest.getCitizenCountryCode())) { // create fake IdL // - fetch IdL template from resources diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java index 337a9ed31..ff3330491 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorWithLocalSigningServlet.java @@ -72,7 +72,7 @@ import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; @@ -461,7 +461,7 @@ public class PEPSConnectorWithLocalSigningServlet extends AuthServlet { //set return url to PEPSConnectorWithLocalSigningServlet and add newMOASessionID //signRequest - String issuerValue = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + String issuerValue = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); String acsURL = issuerValue + PEPSConnectorWithLocalSigningServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN; String url = acsURL+"?moaSessionID="+newMOASessionID; @@ -469,7 +469,7 @@ public class PEPSConnectorWithLocalSigningServlet extends AuthServlet { boolean found = false; try{ - List aps = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()).getStorkAPs(); + List aps = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()).getStorkAPs(); Logger.info("Found AttributeProviderPlugins:"+aps.size()); for(AttributeProviderPlugin ap : aps) { @@ -667,7 +667,7 @@ public class PEPSConnectorWithLocalSigningServlet extends AuthServlet { Logger.debug("fetching OAParameters from database"); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[] { moaSession.getPublicOAURLPrefix() }); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java index 532ccb7ba..3609925a0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java @@ -33,7 +33,7 @@ import at.gv.egovernment.moa.id.auth.builder.RedirectFormBuilder; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.moduls.SSOManager; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; @@ -64,7 +64,7 @@ public class RedirectServlet extends AuthServlet{ String redirectTarget = DEFAULT_REDIRECTTARGET; try { oa = ConfigurationDBRead.getActiveOnlineApplication(url); - if (oa == null && !url.startsWith(AuthConfigurationProvider.getInstance().getPublicURLPrefix())) { + if (oa == null && !url.startsWith(AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix())) { resp.sendError(HttpServletResponse.SC_FORBIDDEN, "Parameters not valid"); return; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java index a8fe71485..28d3caba0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java @@ -75,7 +75,8 @@ import at.gv.egovernment.moa.id.auth.modules.internal.tasks.VerifyAuthentication import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -201,9 +202,9 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet { if (samlArtifactBase64 == null) { //mandate Mode - AuthConfigurationProvider authConf= AuthConfigurationProvider.getInstance(); + AuthConfiguration authConf= AuthConfigurationProviderFactory.getInstance(); ConnectionParameter connectionParameters = authConf.getOnlineMandatesConnectionParameter(); - SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory(AuthConfigurationProvider.getInstance(), connectionParameters); + SSLSocketFactory sslFactory = SSLUtils.getSSLSocketFactory(AuthConfigurationProviderFactory.getInstance(), connectionParameters); // get identitity link as byte[] Element elem = session.getIdentityLink().getSamlAssertion(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java index b8e57ed43..d2c63a8b3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java @@ -67,7 +67,8 @@ import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.modules.internal.tasks.VerifyIdentityLinkTask; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; @@ -239,9 +240,9 @@ public class VerifyIdentityLinkServlet extends AuthServlet { else { Logger.info("Normal"); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); - AuthConfigurationProvider authConf = AuthConfigurationProvider + AuthConfiguration authConf = AuthConfigurationProviderFactory .getInstance(); createXMLSignatureRequestOrRedirect = AuthenticationServer.getInstance() diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java index 547a86bd9..34613e658 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java @@ -65,7 +65,7 @@ import at.gv.egovernment.moa.id.auth.data.SAMLAttribute; import at.gv.egovernment.moa.id.auth.exception.ValidateException; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.TargetToSectorNameMapper; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Constants; @@ -292,7 +292,7 @@ public class CreateXMLSignatureResponseValidator { String text = ""; try { - OAAuthParameter oaparam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); + OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); if (MiscUtil.isNotEmpty(text = oaparam.getAditionalAuthBlockText())) Logger.info("Use addional AuthBlock Text from OA=" + oaparam.getPublicURLPrefix()); } catch (ConfigurationException e) { @@ -418,7 +418,7 @@ public class CreateXMLSignatureResponseValidator { String oaURL; try { - oaURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + oaURL = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); } catch (ConfigurationException e1) { oaURL = new String(); } @@ -521,7 +521,7 @@ public class CreateXMLSignatureResponseValidator { String text = ""; try { - if (MiscUtil.isNotEmpty(text = AuthConfigurationProvider.getInstance().getSSOSpecialText())) + if (MiscUtil.isNotEmpty(text = AuthConfigurationProviderFactory.getInstance().getSSOSpecialText())) Logger.info("Use addional AuthBlock Text from SSO=" +text); else text = new String(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java index 284a77126..ac528c89d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/VerifyXMLSignatureResponseValidator.java @@ -66,7 +66,7 @@ import at.gv.egovernment.moa.id.auth.data.IdentityLink; import at.gv.egovernment.moa.id.auth.data.VerifyXMLSignatureResponse; import at.gv.egovernment.moa.id.auth.exception.ValidateException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; import at.gv.egovernment.moa.logging.Logger; @@ -141,7 +141,7 @@ public class VerifyXMLSignatureResponseValidator { } //check QC - if (AuthConfigurationProvider.getInstance().isCertifiacteQCActive() && + if (AuthConfigurationProviderFactory.getInstance().isCertifiacteQCActive() && !whatToCheck.equals(CHECK_IDENTITY_LINK) && !verifyXMLSignatureResponse.isQualifiedCertificate()) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/client/SZRGWClient.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/client/SZRGWClient.java index 9e4f3fa36..672d2a35e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/client/SZRGWClient.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/client/SZRGWClient.java @@ -29,7 +29,7 @@ import javax.net.ssl.SSLSocketFactory; import javax.xml.namespace.QName; import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.util.SSLUtils; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; @@ -104,7 +104,7 @@ public class SZRGWClient { private void initial(ConnectionParameter szrgwconnection) throws at.gv.egovernment.moa.id.client.SZRGWClientException{ try { sslContext = SSLUtils.getSSLSocketFactory( - AuthConfigurationProvider.getInstance(), + AuthConfigurationProviderFactory.getInstance(), szrgwconnection); } catch (Exception e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java deleted file mode 100644 index f24f4e646..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java +++ /dev/null @@ -1,173 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.config; - -import java.util.Map; - -import at.gv.egovernment.moa.id.data.IssuerAndSerial; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Base class for AuthConfigurationProvider and ProxyConfigurationProvider, - * providing functions common to both of them. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConfigurationProvider { - - /** - * Constructor - */ - public ConfigurationProvider() { - super(); - } - - /** - * The name of the system property which contains the file name of the - * configuration file. - */ - public static final String CONFIG_PROPERTY_NAME = - "moa.id.configuration"; - - /** - * The name of the system property which contains the file name of the - * configuration file. - */ - public static final String PROXY_CONFIG_PROPERTY_NAME = - "moa.id.proxy.configuration"; - - /** - * The name of the generic configuration property giving the certstore directory path. - */ - public static final String DIRECTORY_CERTSTORE_PARAMETER_PROPERTY = - "DirectoryCertStoreParameters.RootDir"; - - /** - * The name of the generic configuration property switching the ssl revocation checking on/off - */ - public static final String TRUST_MANAGER_REVOCATION_CHECKING = - "TrustManager.RevocationChecking"; - - - /** - * A Map which contains generic configuration information. Maps a - * configuration name (a String) to a configuration value (also a - * String). - */ - protected Map genericConfiguration; - - /** The default chaining mode. */ - protected String defaultChainingMode; - - /** - * A Map which contains the IssuerAndSerial to - * chaining mode (a String) mapping. - */ - protected Map chainingModes; - - /** - * the URL for the trusted CA Certificates - */ - protected String trustedCACertificates; - - /** - * main configuration file directory name used to configure MOA-ID - */ - protected String rootConfigFileDir; - - protected String certstoreDirectory; - - protected boolean trustmanagerrevoationchecking = true; - - /** - * Returns the main configuration file directory used to configure MOA-ID - * - * @return the directory - */ - @JsonProperty("getRootConfigFileDir") - public String getRootConfigFileDir() { - return rootConfigFileDir; - } - - @JsonProperty("getDefaultChainingMode") - public String getDefaultChainingMode() { - return defaultChainingMode; - } - - - /** - * Returns the trustedCACertificates. - * @return String - */ - @JsonProperty("getTrustedCACertificates") - public String getTrustedCACertificates() { - - return trustedCACertificates; - } - -/** - * @return the certstoreDirectory - */ -@JsonProperty("getCertstoreDirectory") -public String getCertstoreDirectory() { - return certstoreDirectory; -} - -/** - * @return the trustmanagerrevoationchecking - */ -@JsonProperty("isTrustmanagerrevoationchecking") -public boolean isTrustmanagerrevoationchecking() { - return trustmanagerrevoationchecking; -} - - - - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java new file mode 100644 index 000000000..d7f503454 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProviderImpl.java @@ -0,0 +1,173 @@ +/******************************************************************************* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + ******************************************************************************/ +/* + * Copyright 2003 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ + + +package at.gv.egovernment.moa.id.config; + +import java.util.Map; + +import at.gv.egovernment.moa.id.data.IssuerAndSerial; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Base class for AuthConfigurationProvider and ProxyConfigurationProvider, + * providing functions common to both of them. + * + * @author Paul Ivancsics + * @version $Id$ + */ +public class ConfigurationProviderImpl implements ConfigurationProvider{ + + /** + * Constructor + */ + public ConfigurationProviderImpl() { + super(); + } + + /** + * The name of the system property which contains the file name of the + * configuration file. + */ + public static final String CONFIG_PROPERTY_NAME = + "moa.id.configuration"; + + /** + * The name of the system property which contains the file name of the + * configuration file. + */ + public static final String PROXY_CONFIG_PROPERTY_NAME = + "moa.id.proxy.configuration"; + + /** + * The name of the generic configuration property giving the certstore directory path. + */ + public static final String DIRECTORY_CERTSTORE_PARAMETER_PROPERTY = + "DirectoryCertStoreParameters.RootDir"; + + /** + * The name of the generic configuration property switching the ssl revocation checking on/off + */ + public static final String TRUST_MANAGER_REVOCATION_CHECKING = + "TrustManager.RevocationChecking"; + + + /** + * A Map which contains generic configuration information. Maps a + * configuration name (a String) to a configuration value (also a + * String). + */ + protected Map genericConfiguration; + + /** The default chaining mode. */ + protected String defaultChainingMode; + + /** + * A Map which contains the IssuerAndSerial to + * chaining mode (a String) mapping. + */ + protected Map chainingModes; + + /** + * the URL for the trusted CA Certificates + */ + protected String trustedCACertificates; + + /** + * main configuration file directory name used to configure MOA-ID + */ + protected String rootConfigFileDir; + + protected String certstoreDirectory; + + protected boolean trustmanagerrevoationchecking = true; + + /** + * Returns the main configuration file directory used to configure MOA-ID + * + * @return the directory + */ + @JsonProperty("getRootConfigFileDir") + public String getRootConfigFileDir() { + return rootConfigFileDir; + } + + @JsonProperty("getDefaultChainingMode") + public String getDefaultChainingMode() { + return defaultChainingMode; + } + + + /** + * Returns the trustedCACertificates. + * @return String + */ + @JsonProperty("getTrustedCACertificates") + public String getTrustedCACertificates() { + + return trustedCACertificates; + } + +/** + * @return the certstoreDirectory + */ +@JsonProperty("getCertstoreDirectory") +public String getCertstoreDirectory() { + return certstoreDirectory; +} + +/** + * @return the trustmanagerrevoationchecking + */ +@JsonProperty("isTrustmanagerrevoationchecking") +public boolean isTrustmanagerrevoationchecking() { + return trustmanagerrevoationchecking; +} + + + + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java index 828bf99ca..f5009f99f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java @@ -47,10 +47,10 @@ public class AuthConfigLoader implements Runnable { Date dbdate = moaidconfig.getTimestampItem(); Date pvprefresh = moaidconfig.getPvp2RefreshItem(); - Date date = AuthConfigurationProvider.getTimeStamp(); + Date date = AuthConfigurationProviderFactory.getInstance().getTimeStamp(); if (dbdate != null && dbdate.after(date)) { - AuthConfigurationProvider instance = AuthConfigurationProvider.getInstance(); + AuthConfiguration instance = AuthConfigurationProviderFactory.getInstance(); instance.reloadDataBaseConfig(); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java index 760b2cd0a..cba80d536 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java @@ -1,16 +1,19 @@ package at.gv.egovernment.moa.id.config.auth; +import java.util.Hashtable; import java.util.List; import java.util.Properties; import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; import at.gv.egovernment.moa.id.config.ConnectionParameter; import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; import at.gv.egovernment.moa.id.config.stork.STORKConfig; +import at.gv.util.config.EgovUtilPropertiesConfiguration; -public interface AuthConfiguration { +public interface AuthConfiguration extends ConfigurationProvider{ public Properties getGeneralPVP2ProperiesConfig(); @@ -82,4 +85,16 @@ public interface AuthConfiguration { public STORKConfig getStorkConfig() throws ConfigurationException; + public EgovUtilPropertiesConfiguration geteGovUtilsConfig(); + + public String getDocumentServiceUrl(); + + public boolean isStorkFakeIdLActive(); + + public List getStorkFakeIdLCountries(); + + public String getStorkFakeIdLResigningKey(); + + public boolean isPVPSchemaValidationActive(); + } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index 087b331b5..81a3dad8f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -67,10 +67,11 @@ import org.hibernate.cfg.Configuration; import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.auth.modules.internal.tasks.GetMISSessionIDTask; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBWrite; -import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils; @@ -105,6 +106,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.session.OldSSOSessionIDStore; import at.gv.egovernment.moa.id.commons.db.dao.statistic.StatisticLog; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConfigurationProviderImpl; import at.gv.egovernment.moa.id.config.ConfigurationUtils; import at.gv.egovernment.moa.id.config.ConnectionParameter; import at.gv.egovernment.moa.id.config.ConnectionParameterForeign; @@ -139,8 +141,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore; * @author Stefan Knirsch * * @version $Id$ + * + *@deprecated Use {@link AuthConfigProviderFactory} instead */ -public class AuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration { +public class AuthConfigurationProvider extends ConfigurationProviderImpl implements AuthConfiguration { // /** DEFAULT_ENCODING is "UTF-8" */ // private static final String DEFAULT_ENCODING="UTF-8"; @@ -419,78 +423,79 @@ public class AuthConfigurationProvider extends ConfigurationProvider implements } - //check if XML config should be used - if (MiscUtil.isNotEmpty(legacyconfig) || MiscUtil.isNotEmpty(xmlconfig)) { - Logger.warn("WARNING! MOA-ID 2.0 is started with XML configuration. This setup overstrike the actual configuration in the Database!"); - //moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); - moaidconfig = NewConfigurationDBRead.getMOAIDConfiguration(); - if (moaidconfig.getAuthComponentGeneral()!= null || moaidconfig.getChainingModes() != null || moaidconfig.getTrustedCACertificates() != null || moaidconfig.getDefaultBKUs() != null - || moaidconfig.getSLRequestTemplates() != null || moaidconfig.getTimestampItem() != null || moaidconfig.getPvp2RefreshItem() != null) { - - // ConfigurationDBUtils.delete(moaidconfig); - for(String key : MOAIDConfigurationConstants.getMOAIDConfigurationKeys()){ - NewConfigurationDBWrite.delete(key); - } - } - - - //List oas = ConfigurationDBRead.getAllOnlineApplications(); - List oas = NewConfigurationDBRead.getAllOnlineApplications(); - if (oas != null && oas.size() > 0) { - // for (OnlineApplication oa : oas) - // ConfigurationDBUtils.delete(oa); - NewConfigurationDBWrite.delete(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY); - } - } - - //load legacy config if it is configured - if (MiscUtil.isNotEmpty(legacyconfig)) { - Logger.warn("WARNING! MOA-ID 2.0 is started with legacy configuration. This setup is not recommended!"); - - MOAIDConfiguration moaconfig = BuildFromLegacyConfig.build(new File(legacyconfig), rootConfigFileDir, null); - - List oas = moaconfig.getOnlineApplication(); - // for (OnlineApplication oa : oas) - // ConfigurationDBUtils.save(oa); - NewConfigurationDBWrite.saveOnlineApplications(oas); - - moaconfig.setOnlineApplication(null); - // ConfigurationDBUtils.save(moaconfig); - NewConfigurationDBWrite.save(moaconfig); - - Logger.info("Legacy Configuration load is completed."); - - - } - - //load MOA-ID 2.x config from XML - if (MiscUtil.isNotEmpty(xmlconfig)) { - Logger.warn("Load configuration from MOA-ID 2.x XML configuration"); - - try { - JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); - Unmarshaller m = jc.createUnmarshaller(); - File file = new File(xmlconfig); - MOAIDConfiguration moaconfig = (MOAIDConfiguration) m.unmarshal(file); - //ConfigurationDBUtils.save(moaconfig); - - List importoas = moaconfig.getOnlineApplication(); - // for (OnlineApplication importoa : importoas) { - // ConfigurationDBUtils.saveOrUpdate(importoa); - // } - - NewConfigurationDBWrite.saveOnlineApplications(importoas); - - moaconfig.setOnlineApplication(null); - //ConfigurationDBUtils.saveOrUpdate(moaconfig); - NewConfigurationDBWrite.save(moaconfig); - - } catch (Exception e) { - Logger.warn("MOA-ID XML configuration can not be loaded from File.", e); - throw new ConfigurationException("config.02", null); - } - Logger.info("XML Configuration load is completed."); - } + //TODO: removed in MOA-ID 3.x +// //check if XML config should be used +// if (MiscUtil.isNotEmpty(legacyconfig) || MiscUtil.isNotEmpty(xmlconfig)) { +// Logger.warn("WARNING! MOA-ID 2.0 is started with XML configuration. This setup overstrike the actual configuration in the Database!"); +// //moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); +// moaidconfig = NewConfigurationDBRead.getMOAIDConfiguration(); +// if (moaidconfig.getAuthComponentGeneral()!= null || moaidconfig.getChainingModes() != null || moaidconfig.getTrustedCACertificates() != null || moaidconfig.getDefaultBKUs() != null +// || moaidconfig.getSLRequestTemplates() != null || moaidconfig.getTimestampItem() != null || moaidconfig.getPvp2RefreshItem() != null) { +// +// // ConfigurationDBUtils.delete(moaidconfig); +// for(String key : MOAIDConfigurationConstants.getMOAIDConfigurationKeys()){ +// NewConfigurationDBWrite.delete(key); +// } +// } +// +// +// //List oas = ConfigurationDBRead.getAllOnlineApplications(); +// List oas = NewConfigurationDBRead.getAllOnlineApplications(); +// if (oas != null && oas.size() > 0) { +// // for (OnlineApplication oa : oas) +// // ConfigurationDBUtils.delete(oa); +// NewConfigurationDBWrite.delete(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY); +// } +// } +// +// //load legacy config if it is configured +// if (MiscUtil.isNotEmpty(legacyconfig)) { +// Logger.warn("WARNING! MOA-ID 2.0 is started with legacy configuration. This setup is not recommended!"); +// +// MOAIDConfiguration moaconfig = BuildFromLegacyConfig.build(new File(legacyconfig), rootConfigFileDir, null); +// +// List oas = moaconfig.getOnlineApplication(); +// // for (OnlineApplication oa : oas) +// // ConfigurationDBUtils.save(oa); +// NewConfigurationDBWrite.saveOnlineApplications(oas); +// +// moaconfig.setOnlineApplication(null); +// // ConfigurationDBUtils.save(moaconfig); +// NewConfigurationDBWrite.save(moaconfig); +// +// Logger.info("Legacy Configuration load is completed."); +// +// +// } +// +// //load MOA-ID 2.x config from XML +// if (MiscUtil.isNotEmpty(xmlconfig)) { +// Logger.warn("Load configuration from MOA-ID 2.x XML configuration"); +// +// try { +// JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); +// Unmarshaller m = jc.createUnmarshaller(); +// File file = new File(xmlconfig); +// MOAIDConfiguration moaconfig = (MOAIDConfiguration) m.unmarshal(file); +// //ConfigurationDBUtils.save(moaconfig); +// +// List importoas = moaconfig.getOnlineApplication(); +// // for (OnlineApplication importoa : importoas) { +// // ConfigurationDBUtils.saveOrUpdate(importoa); +// // } +// +// NewConfigurationDBWrite.saveOnlineApplications(importoas); +// +// moaconfig.setOnlineApplication(null); +// //ConfigurationDBUtils.saveOrUpdate(moaconfig); +// NewConfigurationDBWrite.save(moaconfig); +// +// } catch (Exception e) { +// Logger.warn("MOA-ID XML configuration can not be loaded from File.", e); +// throw new ConfigurationException("config.02", null); +// } +// Logger.info("XML Configuration load is completed."); +// } reloadDataBaseConfig(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index 6f2c771ec..cdd112a43 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -13,7 +13,7 @@ import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; -import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; @@ -27,7 +27,7 @@ public class ConfigurationToJSONConverter { NewAuthConfigurationProvider configProvider; @Autowired - Configuration configDataBase; + MOAIDConfiguration configDataBase; public static void main(String[] args) { @@ -41,7 +41,7 @@ public class ConfigurationToJSONConverter { System.out.println("====================================="); // otherwise the database connection is not initialized - AuthConfigurationProvider.getInstance(); + JaxBAuthConfigurationProvider.getInstance(); List methodNames = Arrays.asList("getAllOnlineApplications", "getAllUsers", "getMOAIDConfiguration"); converter.extractDataViaConfigurationDBRead(methodNames); converter.readExtractedConfigurationDBReadData(methodNames); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java deleted file mode 100644 index d8d368a76..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/NewAuthConfigurationProvider.java +++ /dev/null @@ -1,982 +0,0 @@ -package at.gv.egovernment.moa.id.config.auth; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Properties; - -import org.springframework.beans.factory.annotation.Autowired; - -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; -import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; -import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; -import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; -import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; -import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; -import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; -import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; -import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; -import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; -import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; -import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; -import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; -import at.gv.egovernment.moa.id.commons.db.dao.config.SAML1; -import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; -import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; -import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; -import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; -import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; -import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.ConfigurationUtils; -import at.gv.egovernment.moa.id.config.ConnectionParameter; -import at.gv.egovernment.moa.id.config.ConnectionParameterForeign; -import at.gv.egovernment.moa.id.config.ConnectionParameterMOASP; -import at.gv.egovernment.moa.id.config.ConnectionParameterMandate; -import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; -import at.gv.egovernment.moa.id.config.stork.STORKConfig; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.MiscUtil; - -/** - * A class providing access to the Auth Part of the MOA-ID configuration data. - */ -public class NewAuthConfigurationProvider extends ConfigurationProvider implements AuthConfiguration { - - - private static final boolean TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT = true; - - private Configuration configuration; - - private final Properties properties = new Properties(); - - public NewAuthConfigurationProvider() { - } - - /** - * The constructor with path to a properties file as argument. - * - * @param fileName the path to the properties file - * @throws ConfigurationException if an error occurs during loading the properties file. - */ - public NewAuthConfigurationProvider(String fileName) throws ConfigurationException { - File propertiesFile = new File(fileName); - rootConfigFileDir = propertiesFile.getParent(); - - try (FileInputStream in = new FileInputStream(propertiesFile);) { - properties.load(in); - } catch (FileNotFoundException e) { - throw new ConfigurationException("config.03", null, e); - } catch (IOException e) { - throw new ConfigurationException("config.03", null, e); - } - } - - /** - * Set the {@link Configuration} for this class. - * @param configuration the configuration - */ - @Autowired - public void setConfiguration(Configuration configuration) { - this.configuration = configuration; - } - - /** - * Get the properties. - * @return the properties - */ - private Properties getProperties() { - return properties; - } - - /** - * Method that avoids iterating over a {@link Collection} of type {@code T} which is actual {@code null}. - * @param item the collection - * @return the given {@link Collection} {@code item} if it is not {@code null}, or an empty {@link List} otherwise. - */ - @SuppressWarnings("unchecked") - public static > T nullGuard(T item) { - if (item == null) { - return (T) Collections.emptyList(); - } else { - return item; - } - } - - /** - * Returns the general pvp2 properties config. NOTE: may be empty but never {@code null}. - * @return the general pvp2 properties config. - */ - public Properties getGeneralPVP2ProperiesConfig() { - return this.getGeneralProperiesConfig("protocols.pvp2."); - } - - /** - * Returns the general oauth20 properties config. NOTE: may be empty but never {@code null}. - * @return the general oauth20 properties config. - */ - public Properties getGeneralOAuth20ProperiesConfig() { - return this.getGeneralProperiesConfig("protocols.oauth20."); - } - - /** - * Returns the allowed protocols. NOTE: may return {@code null}. - * - * @return the allowed protocols or {@code null}. - */ - public ProtocolAllowed getAllowedProtocols() { - - AuthComponentGeneral authComponentGeneral; - try { - authComponentGeneral = getAuthComponentGeneral(); - } catch (ConfigurationException e) { - return null; - } - Protocols protocols = authComponentGeneral.getProtocols(); - if (protocols != null) { - ProtocolAllowed allowedProtcols = new ProtocolAllowed(); - if (protocols.getSAML1() != null) { - allowedProtcols.setSAML1Active(protocols.getSAML1().isIsActive()); - } - - if (protocols.getOAuth() != null) { - allowedProtcols.setOAUTHActive(protocols.getOAuth().isIsActive()); - } - - if (protocols.getPVP2() != null) { - allowedProtcols.setPVP21Active(protocols.getPVP2().isIsActive()); - } - return allowedProtcols; - } else { - Logger.warn("Error in MOA-ID Configuration. No general Protcol configuration found."); - return null; - } - } - - /** - * Returns the general PVP2 configuration. NOTE: may return {@code null}. - * - * @return the general PVP2 configuration or {@code null}. - */ - public PVP2 getGeneralPVP2DBConfig() { - - AuthComponentGeneral authComponentGeneral; - try { - authComponentGeneral = getAuthComponentGeneral(); - } catch (ConfigurationException e) { - return null; - } - Protocols protocols = authComponentGeneral.getProtocols(); - PVP2 result = null; - if (protocols != null) { - PVP2 pvp2 = protocols.getPVP2(); - if (pvp2 != null) { - result = new PVP2(); - result.setIssuerName(pvp2.getIssuerName()); - result.setPublicURLPrefix(pvp2.getPublicURLPrefix()); - - if (pvp2.getOrganization() != null) { - Organization org = new Organization(); - result.setOrganization(org); - org.setDisplayName(pvp2.getOrganization().getDisplayName()); - org.setName(pvp2.getOrganization().getName()); - org.setURL(pvp2.getOrganization().getURL()); - } - - if (pvp2.getContact() != null) { - List cont = new ArrayList(); - result.setContact(cont); - for (Contact e : pvp2.getContact()) { - Contact c = new Contact(); - c.setCompany(e.getCompany()); - c.setGivenName(e.getGivenName()); - c.getMail().addAll(e.getMail()); - c.getPhone().addAll(e.getPhone()); - c.setSurName(e.getSurName()); - c.setType(e.getType()); - cont.add(c); - } - } - } - - } else { - Logger.warn("Error in MOA-ID Configuration. No general Protcol configuration found."); - } - return result; - } - - /** - * Returns the configured timeouts, or a default timeout. - * - * @return the configured timeout, or the default (never {@code null}). - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. - */ - public TimeOuts getTimeOuts() throws ConfigurationException { - - TimeOuts timeouts = new TimeOuts(); - - // set default timeouts - timeouts.setAssertion(new BigInteger("300")); - timeouts.setMOASessionCreated(new BigInteger("2700")); - timeouts.setMOASessionUpdated(new BigInteger("1200")); - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - // search timeouts in config - GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); - if (generalConfiguration != null) { - if (generalConfiguration.getTimeOuts() != null) { - if (generalConfiguration.getTimeOuts().getAssertion() != null) { - timeouts.setAssertion(generalConfiguration.getTimeOuts().getAssertion()); - } - - if (generalConfiguration.getTimeOuts().getMOASessionCreated() != null) { - timeouts.setMOASessionCreated(generalConfiguration.getTimeOuts().getMOASessionCreated()); - } - - if (generalConfiguration.getTimeOuts().getMOASessionUpdated() != null) { - timeouts.setMOASessionUpdated(generalConfiguration.getTimeOuts().getMOASessionUpdated()); - } - - } else { - Logger.info("No TimeOuts defined. Use default values"); - } - } - return timeouts; - } - - /** - * Returns an alternative source ID. NOTE: may return {@code null}. - * - * @return an alternative source ID or {@code null}. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} - */ - public String getAlternativeSourceID() throws ConfigurationException { - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - String alternativeSourceId = null; - Protocols protocols = authComponentGeneral.getProtocols(); - if (protocols != null) { - SAML1 saml1 = protocols.getSAML1(); - if (saml1 != null && MiscUtil.isNotEmpty(saml1.getSourceID())) { - alternativeSourceId = saml1.getSourceID(); - } - } - GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); - if (generalConfiguration != null && MiscUtil.isEmpty(alternativeSourceId)) { - alternativeSourceId = generalConfiguration.getAlternativeSourceID(); - } - return alternativeSourceId; - } - - /** - * Returns a list of legacy allowed protocols. NOTE: may return an empty list but never {@code null}. - * - * @return the list of protocols. - */ - public List getLegacyAllowedProtocols() { - - try { - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - - if (authComponentGeneral.getProtocols() != null) { - Protocols procols = authComponentGeneral.getProtocols(); - if (procols.getLegacyAllowed() != null) { - LegacyAllowed legacy = procols.getLegacyAllowed(); - return legacy.getProtocolName(); - } - } - - return new ArrayList(); - - } catch (NullPointerException e) { - Logger.info("No protocols found with legacy allowed flag!"); - return new ArrayList(); - } catch (ConfigurationException e) { - return new ArrayList(); - } - - } - - /** - * Provides configuration information regarding the online application behind the given URL, relevant to the MOA-ID Auth component. - * - * @param oaURL URL requested for an online application - * @return an OAAuthParameter, or null if none is applicable - */ - public OAAuthParameter getOnlineApplicationParameter(String oaURL) { - - OnlineApplication oa = getActiveOnlineApplication(oaURL); - if (oa == null) { - Logger.warn("Online application with identifier " + oaURL + " is not found."); - return null; - } - - return new OAAuthParameter(oa); - } - - /** - * Returns a string with a url-reference to the VerifyAuthBlock trust profile id within the moa-sp part of the authentication component. - * - * @return a string with a url-reference to the VerifyAuthBlock trust profile ID. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. - */ - public String getMoaSpAuthBlockTrustProfileID() throws ConfigurationException { - return getVerifyAuthBlock().getTrustProfileID(); - } - - /** - * Returns a list of strings with references to all verify transform info IDs within the moa-sp part of the authentication component. - * - * @return a list of strings containing all urls to the verify transform info IDs. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. - */ - public List getMoaSpAuthBlockVerifyTransformsInfoIDs() throws ConfigurationException { - return getVerifyAuthBlock().getVerifyTransformsInfoProfileID(); - } - - /** - * Returns a ConnectionParameter bean containing all information of the authentication component moa-sp element. - * - * @return ConnectionParameter of the authentication component moa-sp element. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. - */ - public ConnectionParameter getMoaSpConnectionParameter() throws ConfigurationException { - ConnectionParameter result = null; - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - MOASP moasp = authComponentGeneral.getMOASP(); - if (moasp != null) { - ConnectionParameterClientAuthType connectionParameter = moasp.getConnectionParameter(); - if (connectionParameter != null) { - result = new ConnectionParameterMOASP(moasp.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); - } - } - return result; - } - - /** - * Returns the {@link ConnectionParameter} for the ForeignID. NOTE: may return {@code null}. - * - * @return the connection parameter. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. - */ - public ConnectionParameter getForeignIDConnectionParameter() throws ConfigurationException { - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - ForeignIdentities foreign = authComponentGeneral.getForeignIdentities(); - if (foreign != null) { - return new ConnectionParameterForeign(foreign.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); - } else { - Logger.warn("Error in MOA-ID Configuration. No Connectionconfiguration to SZRGW Service found"); - return null; - } - } - - /** - * Returns the {@link ConnectionParameter} for the OnlineMandates. NOTE: may return {@code null}. - * - * @return the connection parameter. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} - */ - public ConnectionParameter getOnlineMandatesConnectionParameter() throws ConfigurationException { - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - OnlineMandates ovs = authComponentGeneral.getOnlineMandates(); - if (ovs != null) { - return new ConnectionParameterMandate(ovs.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); - } - return null; - } - - /** - * Returns a string with a url-reference to the VerifyIdentityLink trust profile id within the moa-sp part of the authentication component - * - * @return String with a url-reference to the VerifyIdentityLink trust profile ID - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link VerifyIdentityLink}. - */ - public String getMoaSpIdentityLinkTrustProfileID() throws ConfigurationException { - - String result = null; - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - MOASP moasp = authComponentGeneral.getMOASP(); - if (moasp != null) { - VerifyIdentityLink verifyIdentityLink = moasp.getVerifyIdentityLink(); - if (verifyIdentityLink != null) { - result = verifyIdentityLink.getTrustProfileID(); - } else { - Logger.warn("Error in MOA-ID Configuration. No Trustprofile for IdentityLink validation."); - throw new ConfigurationException("config.02", null); - } - } - return result; - } - - /** - * Returns a non-empty list of transform infos. NOTE: list is never {@code empty} or {@code null}. - * - * @return a list of transform infos. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link SecurityLayer}. - */ - public List getTransformsInfos() throws ConfigurationException { - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - SecurityLayer securityLayer = authComponentGeneral.getSecurityLayer(); - if (securityLayer != null) { - - List result = ConfigurationUtils.getTransformInfos(securityLayer.getTransformsInfo()); - - if (result == null || result.isEmpty()) { - Logger.error("No Security-Layer Transformation found."); - throw new ConfigurationException("config.05", new Object[] { "Security-Layer Transformation" }); - } - return result; - - } else { - Logger.warn("Error in MOA-ID Configuration. No generalAuthConfiguration->SecurityLayer found"); - throw new ConfigurationException("config.02", null); - } - } - - /** - * Returns a list of IdentityLinkX509SubjectNames. NOTE: may return an empty list but never {@code null}. - * - * @return the list of IdentityLinkX509SubjectNames. - * - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} - */ - public List getIdentityLinkX509SubjectNames() throws ConfigurationException { - - ArrayList identityLinkX509SubjectNames = new ArrayList(); - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - - IdentityLinkSigners idlsigners = authComponentGeneral.getIdentityLinkSigners(); - if (idlsigners != null) { - Logger.debug("Load own IdentityLinkX509SubjectNames"); - identityLinkX509SubjectNames.addAll(new ArrayList(idlsigners.getX509SubjectName())); - } - - String[] identityLinkSignersWithoutOID = MOAIDAuthConstants.IDENTITY_LINK_SIGNERS_WITHOUT_OID; - for (int i = 0; i < identityLinkSignersWithoutOID.length; i++) { - String identityLinkSigner = identityLinkSignersWithoutOID[i]; - if (!identityLinkX509SubjectNames.contains(identityLinkSigner)) { - identityLinkX509SubjectNames.add(identityLinkSigner); - } - } - - return identityLinkX509SubjectNames; - } - - /** - * Returns a list of default SLRequestTemplates. NOTE: may return an empty list but never {@code null}. - * - * @return list of default SLRequestTemplates. - * @throws ConfigurationException is never thrown - */ - public List getSLRequestTemplates() throws ConfigurationException { - - SLRequestTemplates templates = configuration.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); - List templatesList = new ArrayList(); - - if (templates != null) { - templatesList.add(templates.getOnlineBKU()); - templatesList.add(templates.getLocalBKU()); - templatesList.add(templates.getHandyBKU()); - } - return templatesList; - } - - /** - * Returns the type's default SLRequestTemplate. NOTE: may return {@code null}. - * - * @param type the type of BKU. - * @return the default SLRequestTemplate for the given type. - * - * @throws ConfigurationException is never thrown - */ - public String getSLRequestTemplates(String type) throws ConfigurationException { - - SLRequestTemplates templates = configuration.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); - String slRequestTemplate = null; - - if (templates != null) { - switch (type) { - case IOAAuthParameters.ONLINEBKU: - slRequestTemplate = templates.getOnlineBKU(); - break; - case IOAAuthParameters.LOCALBKU: - slRequestTemplate = templates.getLocalBKU(); - break; - case IOAAuthParameters.HANDYBKU: - slRequestTemplate = templates.getHandyBKU(); - break; - default: - Logger.warn("getSLRequestTemplates: BKU Type does not match: " + IOAAuthParameters.ONLINEBKU + " or " + IOAAuthParameters.HANDYBKU + " or " - + IOAAuthParameters.LOCALBKU); - } - } - return slRequestTemplate; - } - - /** - * Returns a list of default BKUURLs. NOTE: may return an empty list but never {@code null}. - * - * @return list of default BKUURLs. - * @throws ConfigurationException is never thrown - */ - public List getDefaultBKUURLs() throws ConfigurationException { - - DefaultBKUs bkuurls = configuration.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); - List bkuurlsList = new ArrayList(); - - if (bkuurls != null) { - bkuurlsList.add(bkuurls.getOnlineBKU()); - bkuurlsList.add(bkuurls.getLocalBKU()); - bkuurlsList.add(bkuurls.getHandyBKU()); - } - return bkuurlsList; - } - - /** - * Returns the type's default BKUURL. NOTE: may return {@code null}. - * - * @param type the type of BKU. - * @return the default BKUURL for the given type. - * - * @throws ConfigurationException is never thrown - */ - public String getDefaultBKUURL(String type) throws ConfigurationException { - - DefaultBKUs bkuurls = configuration.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); - String defaultBKUUrl = null; - - if (bkuurls != null) { - switch (type) { - case IOAAuthParameters.ONLINEBKU: - defaultBKUUrl = bkuurls.getOnlineBKU(); - break; - case IOAAuthParameters.LOCALBKU: - defaultBKUUrl = bkuurls.getLocalBKU(); - break; - case IOAAuthParameters.HANDYBKU: - defaultBKUUrl = bkuurls.getHandyBKU(); - break; - default: - Logger.warn("getDefaultBKUURL: BKU Type does not match: " + IOAAuthParameters.ONLINEBKU + " or " + IOAAuthParameters.HANDYBKU + " or " - + IOAAuthParameters.LOCALBKU); - } - } - return defaultBKUUrl; - } - - /** - * Returns the SSOTagetIdentifier. NOTE: returns {@code null} if no SSOTargetIdentifier is set. - * - * @return the SSOTagetIdentifier or {@code null} - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} - */ - public String getSSOTagetIdentifier() throws ConfigurationException { - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - - SSO sso = authComponentGeneral.getSSO(); - if (sso != null) { - return sso.getTarget(); - } - return null; - } - - /** - * Returns the SSOFriendlyName. NOTE: never returns {@code null}, if no SSOFriendlyName is set, a default String is returned. - * - * @return the SSOFriendlyName or a default String - */ - public String getSSOFriendlyName() { - - AuthComponentGeneral authComponentGeneral; - String defaultValue = "Default MOA-ID friendly name for SSO"; - try { - authComponentGeneral = getAuthComponentGeneral(); - } catch (ConfigurationException e) { - return defaultValue; - } - - SSO sso = authComponentGeneral.getSSO(); - if (sso != null) { - if (MiscUtil.isEmpty(sso.getFriendlyName())) { - return sso.getFriendlyName(); - } - } - return defaultValue; - } - - /** - * Returns the SSOSpecialText. NOTE: never returns {@code null}, if no SSOSpecialText is set, an empty String is returned. - * - * @return the SSOSpecialText or an empty String - */ - public String getSSOSpecialText() { - - AuthComponentGeneral authComponentGeneral; - try { - authComponentGeneral = getAuthComponentGeneral(); - } catch (ConfigurationException e) { - return new String(); - } - - SSO sso = authComponentGeneral.getSSO(); - if (sso != null) { - String text = sso.getSpecialText(); - return MiscUtil.isEmpty(text) ? new String() : text; - } - return new String(); - } - - /** - * Returns the MOASessionEncryptionKey NOTE: returns {@code null} if no MOASessionEncryptionKey is set. - * - * @return the MOASessionEncryptionKey or {@code null} - */ - public String getMOASessionEncryptionKey() { - String prop = properties.getProperty("configuration.moasession.key"); - return MiscUtil.isNotEmpty(prop) ? prop : null; - } - - /** - * Returns the MOAConfigurationEncryptionKey NOTE: returns {@code null} if no MOAConfigurationEncryptionKey is set. - * - * @return the MOAConfigurationEncryptionKey or {@code null} - */ - public String getMOAConfigurationEncryptionKey() { - String prop = properties.getProperty("configuration.moaconfig.key"); - return MiscUtil.isNotEmpty(prop) ? prop : null; - } - - /** - * @return {@code true} if IdentityLinkResigning is set, {@code false} otherwise. - */ - public boolean isIdentityLinkResigning() { - String prop = properties.getProperty("configuration.resignidentitylink.active", "false"); - return Boolean.valueOf(prop); - } - - /** - * Returns the IdentityLinkResigningKey. NOTE: returns {@code null} if no IdentityLinkResigningKey is set. - * - * @return the IdentityLinkResigningKey or {@code null} - */ - public String getIdentityLinkResigningKey() { - String prop = properties.getProperty("configuration.resignidentitylink.keygroup"); - return MiscUtil.isNotEmpty(prop) ? prop : null; - } - - /** - * @return {@code true} if MonitoringActive is set, {@code false} otherwise. - */ - public boolean isMonitoringActive() { - String prop = properties.getProperty("configuration.monitoring.active", "false"); - return Boolean.valueOf(prop); - } - - /** - * Returns the MonitoringTestIdentityLinkURL. NOTE: returns {@code null} if no MonitoringTestIdentityLinkURL is set. - * - * @return the MonitoringTestIdentityLinkURL or {@code null} - */ - public String getMonitoringTestIdentityLinkURL() { - String prop = properties.getProperty("configuration.monitoring.test.identitylink.url"); - return MiscUtil.isNotEmpty(prop) ? prop : null; - } - - /** - * Returns the MonitoringMessageSuccess. NOTE: returns {@code null} if no MonitoringMessageSuccess is set. - * - * @return the MonitoringMessageSuccess or {@code null} - */ - public String getMonitoringMessageSuccess() { - String prop = properties.getProperty("configuration.monitoring.message.success"); - return MiscUtil.isNotEmpty(prop) ? prop : null; - } - - /** - * @return {@code true} if AdvancedLoggingActive is set, {@code false} otherwise. - */ - public boolean isAdvancedLoggingActive() { - String prop = properties.getProperty("configuration.advancedlogging.active", "false"); - return Boolean.valueOf(prop); - } - - /** - * Returns the PublicURLPrefix. NOTE: returns {@code null} if no PublicURLPrefix is set. - * - * @return the PublicURLPrefix or {@code null} - */ - public String getPublicURLPrefix() { - - AuthComponentGeneral authComponentGeneral; - try { - authComponentGeneral = getAuthComponentGeneral(); - } catch (ConfigurationException e) { - return null; - } - - String publicURLPreFix = null; - GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); - if (generalConfiguration != null && MiscUtil.isNotEmpty(generalConfiguration.getPublicURLPreFix())) { - publicURLPreFix = generalConfiguration.getPublicURLPreFix(); - } else { - Logger.warn("Error in MOA-ID Configuration. No GeneralConfig defined."); - } - return publicURLPreFix; - } - - /** - * @return {@code true} if PVP2AssertionEncryptionActive is set, {@code false} otherwise. - */ - public boolean isPVP2AssertionEncryptionActive() { - String prop = this.getProperties().getProperty("protocols.pvp2.assertion.encryption.active", "true"); - return Boolean.valueOf(prop); - } - - /** - * @return {@code true} if CertifiacteQCActive is set, {@code false} otherwise. - */ - public boolean isCertifiacteQCActive() { - String prop = this.getProperties().getProperty("configuration.validation.certificate.QC.ignore", "false"); - return !Boolean.valueOf(prop); - } - - /** - * Returns a STORK Configuration, NOTE: may return {@code null}. - * - * @return a new STORK Configuration or {@code null} - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} - */ - public STORKConfig getStorkConfig() throws ConfigurationException { - - STORKConfig result = null; - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - ForeignIdentities foreign = authComponentGeneral.getForeignIdentities(); - if (foreign == null) { - Logger.warn("Error in MOA-ID Configuration. No STORK configuration found."); - } else { - result = new STORKConfig(foreign.getSTORK(), this.getProperties(), this.getRootConfigFileDir()); - } - return result; - } - - /** - * Small helper method. - * - * @return the {@link AuthComponentGeneral} from the database - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} - */ - private AuthComponentGeneral getAuthComponentGeneral() throws ConfigurationException { - - AuthComponentGeneral authComponentGeneral = configuration.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, AuthComponentGeneral.class); - if (authComponentGeneral == null) { - Logger.warn("Error in MOA-ID Configuration. No generalAuthConfiguration found"); - throw new ConfigurationException("config.02", null); - } - return authComponentGeneral; - } - - /** - * Returns the {@link VerifyAuthBlock}. - * - * @return the {@link VerifyAuthBlock}. - * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. - */ - private VerifyAuthBlock getVerifyAuthBlock() throws ConfigurationException { - - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - MOASP moasp = authComponentGeneral.getMOASP(); - if (moasp != null) { - VerifyAuthBlock vab = moasp.getVerifyAuthBlock(); - if (vab != null) { - VerifyAuthBlock verifyIdl = new VerifyAuthBlock(); - verifyIdl.setTrustProfileID(vab.getTrustProfileID()); - verifyIdl.setVerifyTransformsInfoProfileID(new ArrayList(vab.getVerifyTransformsInfoProfileID())); - return verifyIdl; - } else { - Logger.warn("Error in MOA-ID Configuration. No Trustprofile for AuthBlock validation."); - throw new ConfigurationException("config.02", null); - } - } else { - Logger.warn("Error in MOA-ID Configuration. No MOASP configuration found"); - throw new ConfigurationException("config.02", null); - } - } - - /** - * Small helper method. NOTE: may return empty properties, but never {@code null}. - * @param propPrefix the prefix of the desired property. - * @return the {@link Properties} - */ - private Properties getGeneralProperiesConfig(final String propPrefix) { - - Properties configProp = new Properties(); - for (Object key : this.getProperties().keySet()) { - if (key.toString().startsWith(propPrefix)) { - String propertyName = key.toString().substring(propPrefix.length()); - configProp.put(propertyName, this.getProperties().get(key.toString())); - } - } - return configProp; - } - - /** - * Returns whether the trust-manager revocation checking is enabled or not. - * - * @return {@code true} if enable, {@code false} if disabled - */ - @Override - public boolean isTrustmanagerrevoationchecking() { - - try { - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); - if (generalConfiguration != null && generalConfiguration.isTrustManagerRevocationChecking() != null) { - - return generalConfiguration.isTrustManagerRevocationChecking(); - - } else { - Logger.warn("No TrustMangerRevoationChecking defined. Use default value = " - + String.valueOf(TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT).toUpperCase()); - return TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT; - } - - } catch (ConfigurationException e) { - return TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT; - } - } - - /** - * Returns the path to the certificate-store directory or {@code null} if there is no certificate-store directory defined. - * - * @return the path to the certstore directory or {@code null} - */ - @Override - public String getCertstoreDirectory() { - - try { - AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); - GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); - if (generalConfiguration != null) { - return (rootConfigFileDir + generalConfiguration.getCertStoreDirectory()); - } else { - Logger.warn("Error in MOA-ID Configuration. No CertStoreDirectory defined."); - return null; - } - - } catch (ConfigurationException e) { - return null; - } - } - - @Override - public String getTrustedCACertificates() { - return (String) configuration.get(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, String.class); - } - - /** - * Returns the default chaining mode or {@code null} if there is no chaining mode defined. - * - * @return the default chaining mode or {@code null} - */ - @Override - public String getDefaultChainingMode() { - - ChainingModes chainingModes = (ChainingModes) configuration.get(MOAIDConfigurationConstants.CHAINING_MODES_KEY, ChainingModes.class); - if (chainingModes != null) { - return chainingModes.getSystemDefaultMode().value(); - } - - Logger.warn("Error in MOA-ID Configuration. No ChainingMode configuration found."); - return null; - } - - /** - * Returns the current time. - * @return the time stamp - */ - public static Date getTimeStamp() { - - return new Date(); - } - - /** - * Returns a list of all {@link OnlineApplication}. - * - * @return list of all OnlineApplications - */ - public List getAllOnlineApplications() { - Logger.trace("Get all OnlineApplications from database."); - - return configuration.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); - } - - /** - * Returns a list of all active {@link OnlineApplication} or {@code null} if no active online application was found. - * - * @return list of all active OnlineApplications or {@code null}. - */ - public List getAllActiveOnlineApplications() { - Logger.debug("Get all new OnlineApplications from database."); - - List result = new ArrayList(); - List allOAs = getAllOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allOAs)) { - if (oa.isIsActive()) { - result.add(oa); - } - } - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } - - /** - * Returns the active {@link OnlineApplication} with the given ID or {@code null} if either no matching online application is found or if the {@code id} - * matches more than one entry. - * - * @param id the id of the requested online application - * @return the requested online application or {@code null} - */ - public OnlineApplication getActiveOnlineApplication(String id) { - Logger.trace("Get active OnlineApplication with ID " + id + " from database."); - - OnlineApplication result = null; - List allActiveOAs = getAllActiveOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allActiveOAs)) { - String publicUrlPrefix = oa.getPublicURLPrefix(); - if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { - if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { - if (result != null) { - Logger.warn("OAIdentifier matches more than one DB-entry!"); - return null; - } else { - result = oa; - } - } - } - } - return result; - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java new file mode 100644 index 000000000..38af90ade --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -0,0 +1,983 @@ +package at.gv.egovernment.moa.id.config.auth; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Properties; + +import org.springframework.beans.factory.annotation.Autowired; + +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; +import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; +import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; +import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; +import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; +import at.gv.egovernment.moa.id.commons.db.dao.config.SAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; +import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; +import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.id.config.ConfigurationProviderImpl; +import at.gv.egovernment.moa.id.config.ConfigurationUtils; +import at.gv.egovernment.moa.id.config.ConnectionParameter; +import at.gv.egovernment.moa.id.config.ConnectionParameterForeign; +import at.gv.egovernment.moa.id.config.ConnectionParameterMOASP; +import at.gv.egovernment.moa.id.config.ConnectionParameterMandate; +import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; +import at.gv.egovernment.moa.id.config.stork.STORKConfig; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.MiscUtil; + +/** + * A class providing access to the Auth Part of the MOA-ID configuration data. + */ +public class PropertyBasedAuthConfigurationProvider extends ConfigurationProviderImpl implements AuthConfiguration { + + + private static final boolean TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT = true; + + private MOAIDConfiguration configuration; + + private final Properties properties = new Properties(); + + public PropertyBasedAuthConfigurationProvider() { + } + + /** + * The constructor with path to a properties file as argument. + * + * @param fileName the path to the properties file + * @throws ConfigurationException if an error occurs during loading the properties file. + */ + public PropertyBasedAuthConfigurationProvider(String fileName) throws ConfigurationException { + File propertiesFile = new File(fileName); + rootConfigFileDir = propertiesFile.getParent(); + + try (FileInputStream in = new FileInputStream(propertiesFile);) { + properties.load(in); + } catch (FileNotFoundException e) { + throw new ConfigurationException("config.03", null, e); + } catch (IOException e) { + throw new ConfigurationException("config.03", null, e); + } + } + + /** + * Set the {@link Configuration} for this class. + * @param configuration the configuration + */ + @Autowired + public void setConfiguration(MOAIDConfiguration configuration) { + this.configuration = configuration; + } + + /** + * Get the properties. + * @return the properties + */ + private Properties getProperties() { + return properties; + } + + /** + * Method that avoids iterating over a {@link Collection} of type {@code T} which is actual {@code null}. + * @param item the collection + * @return the given {@link Collection} {@code item} if it is not {@code null}, or an empty {@link List} otherwise. + */ + @SuppressWarnings("unchecked") + public static > T nullGuard(T item) { + if (item == null) { + return (T) Collections.emptyList(); + } else { + return item; + } + } + + /** + * Returns the general pvp2 properties config. NOTE: may be empty but never {@code null}. + * @return the general pvp2 properties config. + */ + public Properties getGeneralPVP2ProperiesConfig() { + return this.getGeneralProperiesConfig("protocols.pvp2."); + } + + /** + * Returns the general oauth20 properties config. NOTE: may be empty but never {@code null}. + * @return the general oauth20 properties config. + */ + public Properties getGeneralOAuth20ProperiesConfig() { + return this.getGeneralProperiesConfig("protocols.oauth20."); + } + + /** + * Returns the allowed protocols. NOTE: may return {@code null}. + * + * @return the allowed protocols or {@code null}. + */ + public ProtocolAllowed getAllowedProtocols() { + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return null; + } + Protocols protocols = authComponentGeneral.getProtocols(); + if (protocols != null) { + ProtocolAllowed allowedProtcols = new ProtocolAllowed(); + if (protocols.getSAML1() != null) { + allowedProtcols.setSAML1Active(protocols.getSAML1().isIsActive()); + } + + if (protocols.getOAuth() != null) { + allowedProtcols.setOAUTHActive(protocols.getOAuth().isIsActive()); + } + + if (protocols.getPVP2() != null) { + allowedProtcols.setPVP21Active(protocols.getPVP2().isIsActive()); + } + return allowedProtcols; + } else { + Logger.warn("Error in MOA-ID Configuration. No general Protcol configuration found."); + return null; + } + } + + /** + * Returns the general PVP2 configuration. NOTE: may return {@code null}. + * + * @return the general PVP2 configuration or {@code null}. + */ + public PVP2 getGeneralPVP2DBConfig() { + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return null; + } + Protocols protocols = authComponentGeneral.getProtocols(); + PVP2 result = null; + if (protocols != null) { + PVP2 pvp2 = protocols.getPVP2(); + if (pvp2 != null) { + result = new PVP2(); + result.setIssuerName(pvp2.getIssuerName()); + result.setPublicURLPrefix(pvp2.getPublicURLPrefix()); + + if (pvp2.getOrganization() != null) { + Organization org = new Organization(); + result.setOrganization(org); + org.setDisplayName(pvp2.getOrganization().getDisplayName()); + org.setName(pvp2.getOrganization().getName()); + org.setURL(pvp2.getOrganization().getURL()); + } + + if (pvp2.getContact() != null) { + List cont = new ArrayList(); + result.setContact(cont); + for (Contact e : pvp2.getContact()) { + Contact c = new Contact(); + c.setCompany(e.getCompany()); + c.setGivenName(e.getGivenName()); + c.getMail().addAll(e.getMail()); + c.getPhone().addAll(e.getPhone()); + c.setSurName(e.getSurName()); + c.setType(e.getType()); + cont.add(c); + } + } + } + + } else { + Logger.warn("Error in MOA-ID Configuration. No general Protcol configuration found."); + } + return result; + } + + /** + * Returns the configured timeouts, or a default timeout. + * + * @return the configured timeout, or the default (never {@code null}). + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. + */ + public TimeOuts getTimeOuts() throws ConfigurationException { + + TimeOuts timeouts = new TimeOuts(); + + // set default timeouts + timeouts.setAssertion(new BigInteger("300")); + timeouts.setMOASessionCreated(new BigInteger("2700")); + timeouts.setMOASessionUpdated(new BigInteger("1200")); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + // search timeouts in config + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null) { + if (generalConfiguration.getTimeOuts() != null) { + if (generalConfiguration.getTimeOuts().getAssertion() != null) { + timeouts.setAssertion(generalConfiguration.getTimeOuts().getAssertion()); + } + + if (generalConfiguration.getTimeOuts().getMOASessionCreated() != null) { + timeouts.setMOASessionCreated(generalConfiguration.getTimeOuts().getMOASessionCreated()); + } + + if (generalConfiguration.getTimeOuts().getMOASessionUpdated() != null) { + timeouts.setMOASessionUpdated(generalConfiguration.getTimeOuts().getMOASessionUpdated()); + } + + } else { + Logger.info("No TimeOuts defined. Use default values"); + } + } + return timeouts; + } + + /** + * Returns an alternative source ID. NOTE: may return {@code null}. + * + * @return an alternative source ID or {@code null}. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ + public String getAlternativeSourceID() throws ConfigurationException { + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + String alternativeSourceId = null; + Protocols protocols = authComponentGeneral.getProtocols(); + if (protocols != null) { + SAML1 saml1 = protocols.getSAML1(); + if (saml1 != null && MiscUtil.isNotEmpty(saml1.getSourceID())) { + alternativeSourceId = saml1.getSourceID(); + } + } + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null && MiscUtil.isEmpty(alternativeSourceId)) { + alternativeSourceId = generalConfiguration.getAlternativeSourceID(); + } + return alternativeSourceId; + } + + /** + * Returns a list of legacy allowed protocols. NOTE: may return an empty list but never {@code null}. + * + * @return the list of protocols. + */ + public List getLegacyAllowedProtocols() { + + try { + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + + if (authComponentGeneral.getProtocols() != null) { + Protocols procols = authComponentGeneral.getProtocols(); + if (procols.getLegacyAllowed() != null) { + LegacyAllowed legacy = procols.getLegacyAllowed(); + return legacy.getProtocolName(); + } + } + + return new ArrayList(); + + } catch (NullPointerException e) { + Logger.info("No protocols found with legacy allowed flag!"); + return new ArrayList(); + } catch (ConfigurationException e) { + return new ArrayList(); + } + + } + + /** + * Provides configuration information regarding the online application behind the given URL, relevant to the MOA-ID Auth component. + * + * @param oaURL URL requested for an online application + * @return an OAAuthParameter, or null if none is applicable + */ + public OAAuthParameter getOnlineApplicationParameter(String oaURL) { + + OnlineApplication oa = getActiveOnlineApplication(oaURL); + if (oa == null) { + Logger.warn("Online application with identifier " + oaURL + " is not found."); + return null; + } + + return new OAAuthParameter(oa); + } + + /** + * Returns a string with a url-reference to the VerifyAuthBlock trust profile id within the moa-sp part of the authentication component. + * + * @return a string with a url-reference to the VerifyAuthBlock trust profile ID. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. + */ + public String getMoaSpAuthBlockTrustProfileID() throws ConfigurationException { + return getVerifyAuthBlock().getTrustProfileID(); + } + + /** + * Returns a list of strings with references to all verify transform info IDs within the moa-sp part of the authentication component. + * + * @return a list of strings containing all urls to the verify transform info IDs. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. + */ + public List getMoaSpAuthBlockVerifyTransformsInfoIDs() throws ConfigurationException { + return getVerifyAuthBlock().getVerifyTransformsInfoProfileID(); + } + + /** + * Returns a ConnectionParameter bean containing all information of the authentication component moa-sp element. + * + * @return ConnectionParameter of the authentication component moa-sp element. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. + */ + public ConnectionParameter getMoaSpConnectionParameter() throws ConfigurationException { + ConnectionParameter result = null; + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + MOASP moasp = authComponentGeneral.getMOASP(); + if (moasp != null) { + ConnectionParameterClientAuthType connectionParameter = moasp.getConnectionParameter(); + if (connectionParameter != null) { + result = new ConnectionParameterMOASP(moasp.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); + } + } + return result; + } + + /** + * Returns the {@link ConnectionParameter} for the ForeignID. NOTE: may return {@code null}. + * + * @return the connection parameter. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral}. + */ + public ConnectionParameter getForeignIDConnectionParameter() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + ForeignIdentities foreign = authComponentGeneral.getForeignIdentities(); + if (foreign != null) { + return new ConnectionParameterForeign(foreign.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); + } else { + Logger.warn("Error in MOA-ID Configuration. No Connectionconfiguration to SZRGW Service found"); + return null; + } + } + + /** + * Returns the {@link ConnectionParameter} for the OnlineMandates. NOTE: may return {@code null}. + * + * @return the connection parameter. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ + public ConnectionParameter getOnlineMandatesConnectionParameter() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + OnlineMandates ovs = authComponentGeneral.getOnlineMandates(); + if (ovs != null) { + return new ConnectionParameterMandate(ovs.getConnectionParameter(), this.getProperties(), this.getRootConfigFileDir()); + } + return null; + } + + /** + * Returns a string with a url-reference to the VerifyIdentityLink trust profile id within the moa-sp part of the authentication component + * + * @return String with a url-reference to the VerifyIdentityLink trust profile ID + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link VerifyIdentityLink}. + */ + public String getMoaSpIdentityLinkTrustProfileID() throws ConfigurationException { + + String result = null; + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + MOASP moasp = authComponentGeneral.getMOASP(); + if (moasp != null) { + VerifyIdentityLink verifyIdentityLink = moasp.getVerifyIdentityLink(); + if (verifyIdentityLink != null) { + result = verifyIdentityLink.getTrustProfileID(); + } else { + Logger.warn("Error in MOA-ID Configuration. No Trustprofile for IdentityLink validation."); + throw new ConfigurationException("config.02", null); + } + } + return result; + } + + /** + * Returns a non-empty list of transform infos. NOTE: list is never {@code empty} or {@code null}. + * + * @return a list of transform infos. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link SecurityLayer}. + */ + public List getTransformsInfos() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + SecurityLayer securityLayer = authComponentGeneral.getSecurityLayer(); + if (securityLayer != null) { + + List result = ConfigurationUtils.getTransformInfos(securityLayer.getTransformsInfo()); + + if (result == null || result.isEmpty()) { + Logger.error("No Security-Layer Transformation found."); + throw new ConfigurationException("config.05", new Object[] { "Security-Layer Transformation" }); + } + return result; + + } else { + Logger.warn("Error in MOA-ID Configuration. No generalAuthConfiguration->SecurityLayer found"); + throw new ConfigurationException("config.02", null); + } + } + + /** + * Returns a list of IdentityLinkX509SubjectNames. NOTE: may return an empty list but never {@code null}. + * + * @return the list of IdentityLinkX509SubjectNames. + * + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ + public List getIdentityLinkX509SubjectNames() throws ConfigurationException { + + ArrayList identityLinkX509SubjectNames = new ArrayList(); + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + + IdentityLinkSigners idlsigners = authComponentGeneral.getIdentityLinkSigners(); + if (idlsigners != null) { + Logger.debug("Load own IdentityLinkX509SubjectNames"); + identityLinkX509SubjectNames.addAll(new ArrayList(idlsigners.getX509SubjectName())); + } + + String[] identityLinkSignersWithoutOID = MOAIDAuthConstants.IDENTITY_LINK_SIGNERS_WITHOUT_OID; + for (int i = 0; i < identityLinkSignersWithoutOID.length; i++) { + String identityLinkSigner = identityLinkSignersWithoutOID[i]; + if (!identityLinkX509SubjectNames.contains(identityLinkSigner)) { + identityLinkX509SubjectNames.add(identityLinkSigner); + } + } + + return identityLinkX509SubjectNames; + } + + /** + * Returns a list of default SLRequestTemplates. NOTE: may return an empty list but never {@code null}. + * + * @return list of default SLRequestTemplates. + * @throws ConfigurationException is never thrown + */ + public List getSLRequestTemplates() throws ConfigurationException { + + SLRequestTemplates templates = configuration.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); + List templatesList = new ArrayList(); + + if (templates != null) { + templatesList.add(templates.getOnlineBKU()); + templatesList.add(templates.getLocalBKU()); + templatesList.add(templates.getHandyBKU()); + } + return templatesList; + } + + /** + * Returns the type's default SLRequestTemplate. NOTE: may return {@code null}. + * + * @param type the type of BKU. + * @return the default SLRequestTemplate for the given type. + * + * @throws ConfigurationException is never thrown + */ + public String getSLRequestTemplates(String type) throws ConfigurationException { + + SLRequestTemplates templates = configuration.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, SLRequestTemplates.class); + String slRequestTemplate = null; + + if (templates != null) { + switch (type) { + case IOAAuthParameters.ONLINEBKU: + slRequestTemplate = templates.getOnlineBKU(); + break; + case IOAAuthParameters.LOCALBKU: + slRequestTemplate = templates.getLocalBKU(); + break; + case IOAAuthParameters.HANDYBKU: + slRequestTemplate = templates.getHandyBKU(); + break; + default: + Logger.warn("getSLRequestTemplates: BKU Type does not match: " + IOAAuthParameters.ONLINEBKU + " or " + IOAAuthParameters.HANDYBKU + " or " + + IOAAuthParameters.LOCALBKU); + } + } + return slRequestTemplate; + } + + /** + * Returns a list of default BKUURLs. NOTE: may return an empty list but never {@code null}. + * + * @return list of default BKUURLs. + * @throws ConfigurationException is never thrown + */ + public List getDefaultBKUURLs() throws ConfigurationException { + + DefaultBKUs bkuurls = configuration.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); + List bkuurlsList = new ArrayList(); + + if (bkuurls != null) { + bkuurlsList.add(bkuurls.getOnlineBKU()); + bkuurlsList.add(bkuurls.getLocalBKU()); + bkuurlsList.add(bkuurls.getHandyBKU()); + } + return bkuurlsList; + } + + /** + * Returns the type's default BKUURL. NOTE: may return {@code null}. + * + * @param type the type of BKU. + * @return the default BKUURL for the given type. + * + * @throws ConfigurationException is never thrown + */ + public String getDefaultBKUURL(String type) throws ConfigurationException { + + DefaultBKUs bkuurls = configuration.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); + String defaultBKUUrl = null; + + if (bkuurls != null) { + switch (type) { + case IOAAuthParameters.ONLINEBKU: + defaultBKUUrl = bkuurls.getOnlineBKU(); + break; + case IOAAuthParameters.LOCALBKU: + defaultBKUUrl = bkuurls.getLocalBKU(); + break; + case IOAAuthParameters.HANDYBKU: + defaultBKUUrl = bkuurls.getHandyBKU(); + break; + default: + Logger.warn("getDefaultBKUURL: BKU Type does not match: " + IOAAuthParameters.ONLINEBKU + " or " + IOAAuthParameters.HANDYBKU + " or " + + IOAAuthParameters.LOCALBKU); + } + } + return defaultBKUUrl; + } + + /** + * Returns the SSOTagetIdentifier. NOTE: returns {@code null} if no SSOTargetIdentifier is set. + * + * @return the SSOTagetIdentifier or {@code null} + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ + public String getSSOTagetIdentifier() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + + SSO sso = authComponentGeneral.getSSO(); + if (sso != null) { + return sso.getTarget(); + } + return null; + } + + /** + * Returns the SSOFriendlyName. NOTE: never returns {@code null}, if no SSOFriendlyName is set, a default String is returned. + * + * @return the SSOFriendlyName or a default String + */ + public String getSSOFriendlyName() { + + AuthComponentGeneral authComponentGeneral; + String defaultValue = "Default MOA-ID friendly name for SSO"; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return defaultValue; + } + + SSO sso = authComponentGeneral.getSSO(); + if (sso != null) { + if (MiscUtil.isEmpty(sso.getFriendlyName())) { + return sso.getFriendlyName(); + } + } + return defaultValue; + } + + /** + * Returns the SSOSpecialText. NOTE: never returns {@code null}, if no SSOSpecialText is set, an empty String is returned. + * + * @return the SSOSpecialText or an empty String + */ + public String getSSOSpecialText() { + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return new String(); + } + + SSO sso = authComponentGeneral.getSSO(); + if (sso != null) { + String text = sso.getSpecialText(); + return MiscUtil.isEmpty(text) ? new String() : text; + } + return new String(); + } + + /** + * Returns the MOASessionEncryptionKey NOTE: returns {@code null} if no MOASessionEncryptionKey is set. + * + * @return the MOASessionEncryptionKey or {@code null} + */ + public String getMOASessionEncryptionKey() { + String prop = properties.getProperty("configuration.moasession.key"); + return MiscUtil.isNotEmpty(prop) ? prop : null; + } + + /** + * Returns the MOAConfigurationEncryptionKey NOTE: returns {@code null} if no MOAConfigurationEncryptionKey is set. + * + * @return the MOAConfigurationEncryptionKey or {@code null} + */ + public String getMOAConfigurationEncryptionKey() { + String prop = properties.getProperty("configuration.moaconfig.key"); + return MiscUtil.isNotEmpty(prop) ? prop : null; + } + + /** + * @return {@code true} if IdentityLinkResigning is set, {@code false} otherwise. + */ + public boolean isIdentityLinkResigning() { + String prop = properties.getProperty("configuration.resignidentitylink.active", "false"); + return Boolean.valueOf(prop); + } + + /** + * Returns the IdentityLinkResigningKey. NOTE: returns {@code null} if no IdentityLinkResigningKey is set. + * + * @return the IdentityLinkResigningKey or {@code null} + */ + public String getIdentityLinkResigningKey() { + String prop = properties.getProperty("configuration.resignidentitylink.keygroup"); + return MiscUtil.isNotEmpty(prop) ? prop : null; + } + + /** + * @return {@code true} if MonitoringActive is set, {@code false} otherwise. + */ + public boolean isMonitoringActive() { + String prop = properties.getProperty("configuration.monitoring.active", "false"); + return Boolean.valueOf(prop); + } + + /** + * Returns the MonitoringTestIdentityLinkURL. NOTE: returns {@code null} if no MonitoringTestIdentityLinkURL is set. + * + * @return the MonitoringTestIdentityLinkURL or {@code null} + */ + public String getMonitoringTestIdentityLinkURL() { + String prop = properties.getProperty("configuration.monitoring.test.identitylink.url"); + return MiscUtil.isNotEmpty(prop) ? prop : null; + } + + /** + * Returns the MonitoringMessageSuccess. NOTE: returns {@code null} if no MonitoringMessageSuccess is set. + * + * @return the MonitoringMessageSuccess or {@code null} + */ + public String getMonitoringMessageSuccess() { + String prop = properties.getProperty("configuration.monitoring.message.success"); + return MiscUtil.isNotEmpty(prop) ? prop : null; + } + + /** + * @return {@code true} if AdvancedLoggingActive is set, {@code false} otherwise. + */ + public boolean isAdvancedLoggingActive() { + String prop = properties.getProperty("configuration.advancedlogging.active", "false"); + return Boolean.valueOf(prop); + } + + /** + * Returns the PublicURLPrefix. NOTE: returns {@code null} if no PublicURLPrefix is set. + * + * @return the PublicURLPrefix or {@code null} + */ + public String getPublicURLPrefix() { + + AuthComponentGeneral authComponentGeneral; + try { + authComponentGeneral = getAuthComponentGeneral(); + } catch (ConfigurationException e) { + return null; + } + + String publicURLPreFix = null; + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null && MiscUtil.isNotEmpty(generalConfiguration.getPublicURLPreFix())) { + publicURLPreFix = generalConfiguration.getPublicURLPreFix(); + } else { + Logger.warn("Error in MOA-ID Configuration. No GeneralConfig defined."); + } + return publicURLPreFix; + } + + /** + * @return {@code true} if PVP2AssertionEncryptionActive is set, {@code false} otherwise. + */ + public boolean isPVP2AssertionEncryptionActive() { + String prop = this.getProperties().getProperty("protocols.pvp2.assertion.encryption.active", "true"); + return Boolean.valueOf(prop); + } + + /** + * @return {@code true} if CertifiacteQCActive is set, {@code false} otherwise. + */ + public boolean isCertifiacteQCActive() { + String prop = this.getProperties().getProperty("configuration.validation.certificate.QC.ignore", "false"); + return !Boolean.valueOf(prop); + } + + /** + * Returns a STORK Configuration, NOTE: may return {@code null}. + * + * @return a new STORK Configuration or {@code null} + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} + */ + public STORKConfig getStorkConfig() throws ConfigurationException { + + STORKConfig result = null; + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + ForeignIdentities foreign = authComponentGeneral.getForeignIdentities(); + if (foreign == null) { + Logger.warn("Error in MOA-ID Configuration. No STORK configuration found."); + } else { + result = new STORKConfig(foreign.getSTORK(), this.getProperties(), this.getRootConfigFileDir()); + } + return result; + } + +// /** +// * Small helper method. +// * +// * @return the {@link AuthComponentGeneral} from the database +// * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} +// */ +// private AuthComponentGeneral getAuthComponentGeneral() throws ConfigurationException { +// +// AuthComponentGeneral authComponentGeneral = configuration.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, AuthComponentGeneral.class); +// if (authComponentGeneral == null) { +// Logger.warn("Error in MOA-ID Configuration. No generalAuthConfiguration found"); +// throw new ConfigurationException("config.02", null); +// } +// return authComponentGeneral; +// } + + /** + * Returns the {@link VerifyAuthBlock}. + * + * @return the {@link VerifyAuthBlock}. + * @throws ConfigurationException is thrown in case of missing {@link AuthComponentGeneral} or in case of missing {@link MOASP}. + */ + private VerifyAuthBlock getVerifyAuthBlock() throws ConfigurationException { + + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + MOASP moasp = authComponentGeneral.getMOASP(); + if (moasp != null) { + VerifyAuthBlock vab = moasp.getVerifyAuthBlock(); + if (vab != null) { + VerifyAuthBlock verifyIdl = new VerifyAuthBlock(); + verifyIdl.setTrustProfileID(vab.getTrustProfileID()); + verifyIdl.setVerifyTransformsInfoProfileID(new ArrayList(vab.getVerifyTransformsInfoProfileID())); + return verifyIdl; + } else { + Logger.warn("Error in MOA-ID Configuration. No Trustprofile for AuthBlock validation."); + throw new ConfigurationException("config.02", null); + } + } else { + Logger.warn("Error in MOA-ID Configuration. No MOASP configuration found"); + throw new ConfigurationException("config.02", null); + } + } + + /** + * Small helper method. NOTE: may return empty properties, but never {@code null}. + * @param propPrefix the prefix of the desired property. + * @return the {@link Properties} + */ + private Properties getGeneralProperiesConfig(final String propPrefix) { + + Properties configProp = new Properties(); + for (Object key : this.getProperties().keySet()) { + if (key.toString().startsWith(propPrefix)) { + String propertyName = key.toString().substring(propPrefix.length()); + configProp.put(propertyName, this.getProperties().get(key.toString())); + } + } + return configProp; + } + + /** + * Returns whether the trust-manager revocation checking is enabled or not. + * + * @return {@code true} if enable, {@code false} if disabled + */ + @Override + public boolean isTrustmanagerrevoationchecking() { + + try { + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null && generalConfiguration.isTrustManagerRevocationChecking() != null) { + + return generalConfiguration.isTrustManagerRevocationChecking(); + + } else { + Logger.warn("No TrustMangerRevoationChecking defined. Use default value = " + + String.valueOf(TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT).toUpperCase()); + return TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT; + } + + } catch (ConfigurationException e) { + return TRUST_MANAGER_REVOCATION_CHECKING_DEFAULT; + } + } + + /** + * Returns the path to the certificate-store directory or {@code null} if there is no certificate-store directory defined. + * + * @return the path to the certstore directory or {@code null} + */ + @Override + public String getCertstoreDirectory() { + + try { + AuthComponentGeneral authComponentGeneral = getAuthComponentGeneral(); + GeneralConfiguration generalConfiguration = authComponentGeneral.getGeneralConfiguration(); + if (generalConfiguration != null) { + return (rootConfigFileDir + generalConfiguration.getCertStoreDirectory()); + } else { + Logger.warn("Error in MOA-ID Configuration. No CertStoreDirectory defined."); + return null; + } + + } catch (ConfigurationException e) { + return null; + } + } + + @Override + public String getTrustedCACertificates() { + return (String) configuration.get(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, String.class); + } + + /** + * Returns the default chaining mode or {@code null} if there is no chaining mode defined. + * + * @return the default chaining mode or {@code null} + */ + @Override + public String getDefaultChainingMode() { + + ChainingModes chainingModes = (ChainingModes) configuration.get(MOAIDConfigurationConstants.CHAINING_MODES_KEY, ChainingModes.class); + if (chainingModes != null) { + return chainingModes.getSystemDefaultMode().value(); + } + + Logger.warn("Error in MOA-ID Configuration. No ChainingMode configuration found."); + return null; + } + + /** + * Returns the current time. + * @return the time stamp + */ + public static Date getTimeStamp() { + + return new Date(); + } + + /** + * Returns a list of all {@link OnlineApplication}. + * + * @return list of all OnlineApplications + */ + public List getAllOnlineApplications() { + Logger.trace("Get all OnlineApplications from database."); + + return configuration.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); + } + + /** + * Returns a list of all active {@link OnlineApplication} or {@code null} if no active online application was found. + * + * @return list of all active OnlineApplications or {@code null}. + */ + public List getAllActiveOnlineApplications() { + Logger.debug("Get all new OnlineApplications from database."); + + List result = new ArrayList(); + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allOAs)) { + if (oa.isIsActive()) { + result.add(oa); + } + } + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } + + /** + * Returns the active {@link OnlineApplication} with the given ID or {@code null} if either no matching online application is found or if the {@code id} + * matches more than one entry. + * + * @param id the id of the requested online application + * @return the requested online application or {@code null} + */ + public OnlineApplication getActiveOnlineApplication(String id) { + Logger.trace("Get active OnlineApplication with ID " + id + " from database."); + + OnlineApplication result = null; + List allActiveOAs = getAllActiveOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allActiveOAs)) { + String publicUrlPrefix = oa.getPublicURLPrefix(); + if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { + if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { + if (result != null) { + Logger.warn("OAIdentifier matches more than one DB-entry!"); + return null; + } else { + result = oa; + } + } + } + } + return result; + } + +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java index e3b7524ae..2e0aa5486 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java @@ -41,7 +41,7 @@ import at.gv.egovernment.moa.id.auth.exception.ProtocolNotActiveException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationInterface; @@ -287,7 +287,7 @@ public class DispatcherServlet extends AuthServlet{ } else if (protocolRequest != null && MiscUtil.isNotEmpty(protocolRequest.getRequestID())) { - OAAuthParameter oaParams = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(protocolRequest.getOAURL()); + OAAuthParameter oaParams = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(protocolRequest.getOAURL()); if (oaParams.isSTORKPVPGateway() || !oaParams.isPerformLocalAuthenticationOnInterfederationError()) { // -> send end error to service provider Logger.info("Federated authentication for entity " + protocolRequest.getOAURL() @@ -397,7 +397,7 @@ public class DispatcherServlet extends AuthServlet{ } //load Parameters from OnlineApplicationConfiguration - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(protocolRequest.getOAURL()); if (oaParam == null) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java index 49f3df25c..e4a358cdb 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java @@ -73,7 +73,7 @@ import at.gv.egovernment.moa.id.auth.parser.StartAuthentificationParameterParser import at.gv.egovernment.moa.id.commons.db.dao.session.InterfederationSessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OASessionStore; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.SLOInformationContainer; import at.gv.egovernment.moa.id.data.SLOInformationImpl; @@ -191,7 +191,7 @@ public class AuthenticationManager implements MOAIDAuthConstants { } catch (MOADatabaseException e) { Logger.warn("Delete MOASession FAILED."); - sloContainer.putFailedOA(AuthConfigurationProvider.getInstance().getPublicURLPrefix()); + sloContainer.putFailedOA(AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix()); } @@ -254,7 +254,7 @@ public class AuthenticationManager implements MOAIDAuthConstants { AssertionStorage.getInstance().put(relayState, sloContainer); - String timeOutURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + String timeOutURL = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/idpSingleLogout" + "?restart=" + relayState; @@ -369,7 +369,7 @@ public class AuthenticationManager implements MOAIDAuthConstants { String form = SendAssertionFormBuilder.buildForm(target.requestedModule(), target.requestedAction(), target.getRequestID(), oaParam, - AuthConfigurationProvider.getInstance().getPublicURLPrefix()); + AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix()); response.setContentType("text/html;charset=UTF-8"); PrintWriter out = new PrintWriter(response.getOutputStream()); @@ -387,8 +387,8 @@ public class AuthenticationManager implements MOAIDAuthConstants { //get IDP metadata try { - OAAuthParameter idp = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(target.getRequestedIDP()); - OAAuthParameter sp = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(target.getOAURL()); + OAAuthParameter idp = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(target.getRequestedIDP()); + OAAuthParameter sp = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(target.getOAURL()); if (!idp.isInderfederationIDP() || !idp.isInboundSSOInterfederationAllowed()) { Logger.info("Requested interfederation IDP " + target.getRequestedIDP() + " is not valid for interfederation."); @@ -557,7 +557,7 @@ public class AuthenticationManager implements MOAIDAuthConstants { response.setHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL, MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL); response.addHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL, MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL_IE); - List legacyallowed_prot = AuthConfigurationProvider.getInstance().getLegacyAllowedProtocols(); + List legacyallowed_prot = AuthConfigurationProviderFactory.getInstance().getLegacyAllowedProtocols(); //is legacy allowed boolean legacyallowed = legacyallowed_prot.contains(target.requestedModule()); @@ -621,7 +621,7 @@ public class AuthenticationManager implements MOAIDAuthConstants { } else { //load Parameters from OnlineApplicationConfiguration - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(target.getOAURL()); if (oaParam == null) { @@ -642,7 +642,7 @@ public class AuthenticationManager implements MOAIDAuthConstants { //Build authentication form - String publicURLPreFix = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + String publicURLPreFix = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); String loginForm = LoginFormBuilder.buildLoginForm(target.requestedModule(), target.requestedAction(), oaParam, publicURLPreFix, moasession.getSessionID()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java index 68545e1c2..621426ff1 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java @@ -53,7 +53,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.session.AuthenticatedSessionStore import at.gv.egovernment.moa.id.commons.db.dao.session.InterfederationSessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OldSSOSessionIDStore; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.Random; @@ -81,7 +81,7 @@ public class SSOManager { instance = new SSOManager(); try { - sso_timeout = (int) AuthConfigurationProvider.getInstance().getTimeOuts().getMOASessionUpdated().longValue(); + sso_timeout = (int) AuthConfigurationProviderFactory.getInstance().getTimeOuts().getMOASessionUpdated().longValue(); } catch (ConfigurationException e) { @@ -151,7 +151,7 @@ public class SSOManager { //check if session is out of lifetime Date now = new Date(); - long maxSSOSessionTime = AuthConfigurationProvider.getInstance().getTimeOuts().getMOASessionCreated().longValue() * 1000; + long maxSSOSessionTime = AuthConfigurationProviderFactory.getInstance().getTimeOuts().getMOASessionCreated().longValue() * 1000; Date ssoSessionValidTo = new Date(storedSession.getCreated().getTime() + maxSSOSessionTime); if (now.after(ssoSessionValidTo)) { Logger.info("Found outdated SSO session information. Start reauthentication process ... "); @@ -305,7 +305,7 @@ public class SSOManager { InputStream is = null; String pathLocation = null; try { - String rootconfigdir = AuthConfigurationProvider.getInstance().getRootConfigFileDir(); + String rootconfigdir = AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir(); pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL; File file = new File(new URI(pathLocation)); is = new FileInputStream(file); @@ -347,7 +347,7 @@ public class SSOManager { BufferedReader reader = new BufferedReader(new InputStreamReader(is )); //set default elements to velocity context - context.put("contextpath", AuthConfigurationProvider.getInstance().getPublicURLPrefix()); + context.put("contextpath", AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix()); StringWriter writer = new StringWriter(); //velocityEngine.evaluate(context, writer, "SLO_Template", reader); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Configuration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Configuration.java index 93a2f7d6d..8eddd7833 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Configuration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Configuration.java @@ -25,7 +25,7 @@ package at.gv.egovernment.moa.id.protocols.oauth20; import java.util.Properties; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.util.FileUtils; public class OAuth20Configuration { @@ -49,8 +49,8 @@ public class OAuth20Configuration { private OAuth20Configuration() { try { - props = AuthConfigurationProvider.getInstance().getGeneralOAuth20ProperiesConfig(); - rootDir = AuthConfigurationProvider.getInstance().getRootConfigFileDir(); + props = AuthConfigurationProviderFactory.getInstance().getGeneralOAuth20ProperiesConfig(); + rootDir = AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir(); } catch (ConfigurationException e) { e.printStackTrace(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java index 4c70ce995..2a0d3b30f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationImpl; @@ -142,7 +142,7 @@ class OAuth20AuthAction implements IAction { private Pair buildIdToken(String scope, OAuth20AuthRequest oAuthRequest, IAuthData authData) throws MOAIDException, SignatureException { - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oAuthRequest.getOAURL()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(oAuthRequest.getOAURL()); OAuthSigner signer = OAuth20SignatureUtil.loadSigner(authData.getIssuer()); OAuthJsonToken token = new OAuthJsonToken(signer); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java index c47e366a1..4879942ae 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java @@ -32,7 +32,7 @@ import org.opensaml.saml2.core.Attribute; import at.gv.egovernment.moa.id.commons.db.dao.config.OAOAUTH20; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.protocols.oauth20.OAuth20Constants; import at.gv.egovernment.moa.id.protocols.oauth20.OAuth20Util; @@ -152,7 +152,7 @@ class OAuth20AuthRequest extends OAuth20BaseRequest { // check if client id and redirect uri are ok try { // OAOAUTH20 cannot be null at this point. check was done in base request - OAOAUTH20 oAuthConfig = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(this.getOAURL()) + OAOAUTH20 oAuthConfig = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(this.getOAURL()) .getoAuth20Config(); if (!this.getClientID().equals(oAuthConfig.getOAuthClientId()) @@ -176,7 +176,7 @@ class OAuth20AuthRequest extends OAuth20BaseRequest { reqAttr.put(el, ""); try { - OAAuthParameter oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(getOAURL()); + OAAuthParameter oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(getOAURL()); for (String s : scope.split(" ")) { if (s.equalsIgnoreCase("profile")) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20BaseRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20BaseRequest.java index d08bd593a..9a7e44f70 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20BaseRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20BaseRequest.java @@ -33,7 +33,7 @@ import org.apache.commons.lang.StringUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.OAOAUTH20; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.RequestImpl; import at.gv.egovernment.moa.id.protocols.oauth20.OAuth20Constants; @@ -77,7 +77,7 @@ abstract class OAuth20BaseRequest extends RequestImpl { throw new OAuth20WrongParameterException(OAuth20Constants.PARAM_CLIENT_ID); } this.setOAURL(oaURL); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(oaURL); if (oaParam == null) { throw new OAuth20WrongParameterException(OAuth20Constants.PARAM_CLIENT_ID); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20Protocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20Protocol.java index 182f07675..98d46d424 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20Protocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20Protocol.java @@ -11,7 +11,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.moduls.IAction; import at.gv.egovernment.moa.id.moduls.IModulInfo; import at.gv.egovernment.moa.id.moduls.IRequest; @@ -103,7 +103,7 @@ public class OAuth20Protocol implements IModulInfo { // get error code and description String errorCode; String errorDescription; - String errorUri = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + String errorUri = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() +"/" + OAuth20Constants.ERRORPAGE; String moaError = null; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20TokenRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20TokenRequest.java index 3c90a5773..5cb5108ed 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20TokenRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20TokenRequest.java @@ -30,7 +30,7 @@ import org.opensaml.saml2.core.Attribute; import at.gv.egovernment.moa.id.commons.db.dao.config.OAOAUTH20; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.protocols.oauth20.OAuth20Constants; import at.gv.egovernment.moa.id.protocols.oauth20.exceptions.OAuth20AccessDeniedException; import at.gv.egovernment.moa.id.protocols.oauth20.exceptions.OAuth20Exception; @@ -121,7 +121,7 @@ class OAuth20TokenRequest extends OAuth20BaseRequest { // check if client id and secret are ok try { // OAOAUTH20 cannot be null at this point. check was done in base request - OAOAUTH20 oAuthConfig = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(this.getOAURL()) + OAOAUTH20 oAuthConfig = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(this.getOAURL()) .getoAuth20Config(); if (!this.getClientID().equals(oAuthConfig.getOAuthClientId())) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java index cf20db7d9..6b5e6a0f3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java @@ -62,7 +62,7 @@ import at.gv.egovernment.moa.id.auth.exception.InvalidProtocolRequestException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.exception.ProtocolNotActiveException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IAction; import at.gv.egovernment.moa.id.moduls.IModulInfo; @@ -197,7 +197,7 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants { HttpServletResponse response, String action) throws MOAIDException { - if (!AuthConfigurationProvider.getInstance().getAllowedProtocols().isPVP21Active()) { + if (!AuthConfigurationProviderFactory.getInstance().getAllowedProtocols().isPVP21Active()) { Logger.info("PVP2.1 is deaktivated!"); throw new ProtocolNotActiveException("auth.22", new java.lang.Object[] { NAME }); @@ -524,7 +524,7 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants { throw new WrongParametersException("StartAuthentication", PARAM_OA, "auth.12"); - OAAuthParameter oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moaRequest.getEntityID()); + OAAuthParameter oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moaRequest.getEntityID()); if (!oa.isInderfederationIDP()) { Logger.warn("AttributeQuery requests are only allowed for interfederation IDPs."); throw new AttributQueryException("AttributeQuery requests are only allowed for interfederation IDPs.", null); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java index 65da23565..74b20356e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVPTargetConfiguration.java @@ -34,7 +34,7 @@ import org.opensaml.saml2.metadata.RequestedAttribute; import org.opensaml.saml2.metadata.SPSSODescriptor; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.RequestImpl; import at.gv.egovernment.moa.id.protocols.pvp2x.builder.AttributQueryBuilder; @@ -88,7 +88,7 @@ public class PVPTargetConfiguration extends RequestImpl { reqAttr.put(el, ""); try { - OAAuthParameter oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(getOAURL()); + OAAuthParameter oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(getOAURL()); SPSSODescriptor spSSODescriptor = getRequest().getEntityMetadata().getSPSSODescriptor(SAMLConstants.SAML20P_NS); if (spSSODescriptor.getAttributeConsumingServices() != null && diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java index aa154b84b..9884d2a8a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java @@ -69,7 +69,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.session.AssertionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.InterfederationSessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OASessionStore; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationContainer; import at.gv.egovernment.moa.id.data.SLOInformationImpl; @@ -258,7 +258,7 @@ public class SingleLogOutAction implements IAction { } else { //print SLO information directly - redirectURL = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/idpSingleLogout"; + redirectURL = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/idpSingleLogout"; String artifact = Random.nextRandom(); @@ -274,7 +274,7 @@ public class SingleLogOutAction implements IAction { } //redirect to Redirect Servlet - String url = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/RedirectServlet"; + String url = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/RedirectServlet"; url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(redirectURL, "UTF-8")); url = httpResp.encodeRedirectURL(url); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/AuthResponseBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/AuthResponseBuilder.java index 4ef09184d..4959df16c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/AuthResponseBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/AuthResponseBuilder.java @@ -52,7 +52,7 @@ import org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory; import org.opensaml.xml.security.x509.X509Credential; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; import at.gv.egovernment.moa.id.protocols.pvp2x.config.PVPConfiguration; import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.InvalidAssertionEncryptionException; @@ -106,7 +106,7 @@ public class AuthResponseBuilder { } - boolean isEncryptionActive = AuthConfigurationProvider.getInstance().isPVP2AssertionEncryptionActive(); + boolean isEncryptionActive = AuthConfigurationProviderFactory.getInstance().isPVP2AssertionEncryptionActive(); if (encryptionCredentials != null && isEncryptionActive) { //encrypt SAML2 assertion diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java index b301b6e5e..a1b4932d4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/assertion/PVP2AssertionBuilder.java @@ -64,7 +64,7 @@ import at.gv.egovernment.moa.id.auth.builder.BPKBuilder; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationImpl; @@ -153,7 +153,7 @@ public class PVP2AssertionBuilder implements PVPConstants { AuthnContextClassRef authnContextClassRef = SAML2Utils .createSAMLObject(AuthnContextClassRef.class); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter( peerEntity.getEntityID()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java index d3a9ad3e7..d6f6308fd 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java @@ -49,7 +49,7 @@ import org.opensaml.saml2.metadata.TelephoneNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.protocols.pvp2x.utils.SAML2Utils; @@ -57,6 +57,8 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.MiscUtil; +//TODO!!!!! + public class PVPConfiguration { private static PVPConfiguration instance; @@ -124,8 +126,8 @@ public class PVPConfiguration { private PVPConfiguration() { try { //generalpvpconfigdb = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig(); - props = AuthConfigurationProvider.getInstance().getGeneralPVP2ProperiesConfig(); - rootDir = AuthConfigurationProvider.getInstance().getRootConfigFileDir(); + props = AuthConfigurationProviderFactory.getInstance().getGeneralPVP2ProperiesConfig(); + rootDir = AuthConfigurationProviderFactory.getInstance().getRootConfigFileDir(); } catch (ConfigurationException e) { e.printStackTrace(); @@ -133,7 +135,7 @@ public class PVPConfiguration { } public String getIDPPublicPath() throws ConfigurationException { - String publicPath = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + String publicPath = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); if(publicPath != null) { if(publicPath.endsWith("/")) { int length = publicPath.length(); @@ -209,7 +211,7 @@ public class PVPConfiguration { moaIDVersion = parseMOAIDVersionFromManifest(); } - return AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getIssuerName() + moaIDVersion; + return AuthConfigurationProviderFactory.getInstance().getGeneralPVP2DBConfig().getIssuerName() + moaIDVersion; } public List getMetadataFiles() { @@ -237,7 +239,7 @@ public class PVPConfiguration { public String getTargetForSP(String sp) { try { - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(sp); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(sp); if (oaParam != null) return oaParam.getTarget(); @@ -256,7 +258,7 @@ public class PVPConfiguration { public iaik.x509.X509Certificate getTrustEntityCertificate(String entityID) { try { - IOAAuthParameters oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(entityID); + IOAAuthParameters oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(entityID); if (oaParam == null) { Logger.warn("Online Application with ID " + entityID + " not found!"); @@ -285,7 +287,7 @@ public class PVPConfiguration { public List getIDPContacts() throws ConfigurationException { List list = new ArrayList(); - List contacts = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getContact(); + List contacts = AuthConfigurationProviderFactory.getInstance().getGeneralPVP2DBConfig().getContact(); if (contacts != null) { @@ -379,7 +381,7 @@ public class PVPConfiguration { public Organization getIDPOrganisation() throws ConfigurationException { Organization org = SAML2Utils.createSAMLObject(Organization.class); - at.gv.egovernment.moa.id.commons.db.dao.config.Organization organisation = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getOrganization(); + at.gv.egovernment.moa.id.commons.db.dao.config.Organization organisation = AuthConfigurationProviderFactory.getInstance().getGeneralPVP2DBConfig().getOrganization(); String org_name = null; String org_dispname = null; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java index d493ef9e0..0ec79c79a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java @@ -53,7 +53,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.ex.MOAHttpProtocolSocketFactoryException; import at.gv.egovernment.moa.id.commons.utils.MOAHttpProtocolSocketFactory; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.filter.SchemaValidationException; import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.filter.SignatureValidationException; @@ -349,11 +349,11 @@ public class MOAMetadataProvider implements MetadataProvider { try { MOAHttpProtocolSocketFactory protoSocketFactory = new MOAHttpProtocolSocketFactory( PVPConstants.SSLSOCKETFACTORYNAME, - AuthConfigurationProvider.getInstance().getCertstoreDirectory(), - AuthConfigurationProvider.getInstance().getTrustedCACertificates(), + AuthConfigurationProviderFactory.getInstance().getCertstoreDirectory(), + AuthConfigurationProviderFactory.getInstance().getTrustedCACertificates(), null, - ChainingModeType.fromValue(AuthConfigurationProvider.getInstance().getDefaultChainingMode()), - AuthConfigurationProvider.getInstance().isTrustmanagerrevoationchecking()); + ChainingModeType.fromValue(AuthConfigurationProviderFactory.getInstance().getDefaultChainingMode()), + AuthConfigurationProviderFactory.getInstance().isTrustmanagerrevoationchecking()); httpClient.setCustomSSLTrustStore(metadataURL, protoSocketFactory); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/utils/MOASAMLSOAPClient.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/utils/MOASAMLSOAPClient.java index 12de97a3f..5dad3771d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/utils/MOASAMLSOAPClient.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/utils/MOASAMLSOAPClient.java @@ -39,7 +39,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModeType; import at.gv.egovernment.moa.id.commons.ex.MOAHttpProtocolSocketFactoryException; import at.gv.egovernment.moa.id.commons.utils.MOAHttpProtocolSocketFactory; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; import at.gv.egovernment.moa.logging.Logger; @@ -65,11 +65,11 @@ public class MOASAMLSOAPClient { SecureProtocolSocketFactory sslprotocolsocketfactory = new MOAHttpProtocolSocketFactory( PVPConstants.SSLSOCKETFACTORYNAME, - AuthConfigurationProvider.getInstance().getCertstoreDirectory(), - AuthConfigurationProvider.getInstance().getTrustedCACertificates(), + AuthConfigurationProviderFactory.getInstance().getCertstoreDirectory(), + AuthConfigurationProviderFactory.getInstance().getTrustedCACertificates(), null, - ChainingModeType.fromValue(AuthConfigurationProvider.getInstance().getDefaultChainingMode()), - AuthConfigurationProvider.getInstance().isTrustmanagerrevoationchecking()); + ChainingModeType.fromValue(AuthConfigurationProviderFactory.getInstance().getDefaultChainingMode()), + AuthConfigurationProviderFactory.getInstance().isTrustmanagerrevoationchecking()); clientBuilder.setHttpsProtocolSocketFactory(sslprotocolsocketfactory ); } catch (MOAHttpProtocolSocketFactoryException e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java index 885de6805..942fab4f3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/SAMLVerifierMOASP.java @@ -38,7 +38,7 @@ import at.gv.egovernment.moa.id.auth.exception.ServiceException; import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.util.XMLUtil; import at.gv.egovernment.moa.logging.Logger; @@ -52,7 +52,7 @@ public class SAMLVerifierMOASP implements ISAMLVerifier { try { if (request.isSigned()) { - String trustProfileID = AuthConfigurationProvider.getInstance() + String trustProfileID = AuthConfigurationProviderFactory.getInstance() .getStorkConfig().getSignatureVerificationParameter() .getTrustProfileID(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/metadata/SchemaValidationFilter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/metadata/SchemaValidationFilter.java index f73b541bf..1aca587c9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/metadata/SchemaValidationFilter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/verification/metadata/SchemaValidationFilter.java @@ -35,7 +35,7 @@ import org.opensaml.common.xml.SAMLSchemaBuilder; import org.xml.sax.SAXException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.protocols.pvp2x.exceptions.filter.SchemaValidationException; import at.gv.egovernment.moa.logging.Logger; @@ -49,7 +49,7 @@ public class SchemaValidationFilter implements MetadataFilter { public SchemaValidationFilter() { try { - isActive = AuthConfigurationProvider.getInstance().isPVPSchemaValidationActive(); + isActive = AuthConfigurationProviderFactory.getInstance().isPVPSchemaValidationActive(); } catch (ConfigurationException e) { e.printStackTrace(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java index 4cdd1db01..5b1f49411 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java @@ -31,7 +31,7 @@ import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.servlet.RedirectServlet; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationImpl; @@ -65,7 +65,7 @@ public class GetArtifactAction implements IAction { } try { - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(oaURL); SAML1AuthenticationServer saml1server = SAML1AuthenticationServer.getInstace(); @@ -80,7 +80,7 @@ public class GetArtifactAction implements IAction { String samlArtifactBase64 = saml1server.BuildSAMLArtifact(oaParam, authData, sourceID); if (authData.isSsoSession()) { - String url = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/RedirectServlet"; + String url = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/RedirectServlet"; url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(oaURL, "UTF-8")); if (!oaParam.getBusinessService()) url = addURLParameter(url, PARAM_TARGET, URLEncoder.encode(req.getTarget(), "UTF-8")); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java index 9934c339d..f86d5f769 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java @@ -39,7 +39,7 @@ import at.gv.egovernment.moa.id.auth.exception.ProtocolNotActiveException; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.servlet.RedirectServlet; import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IAction; import at.gv.egovernment.moa.id.moduls.IModulInfo; @@ -101,7 +101,7 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants { HttpServletResponse response, String action) throws MOAIDException { SAML1RequestImpl config = new SAML1RequestImpl(); - if (!AuthConfigurationProvider.getInstance().getAllowedProtocols().isSAML1Active()) { + if (!AuthConfigurationProviderFactory.getInstance().getAllowedProtocols().isSAML1Active()) { Logger.info("SAML1 is deaktivated!"); throw new ProtocolNotActiveException("auth.22", new Object[] { "SAML 1" }); @@ -142,7 +142,7 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants { //load Target only from OA config - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(oaURL); if (oaParam == null) @@ -172,7 +172,7 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants { IRequest protocolRequest) throws Throwable{ - OAAuthParameter oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(protocolRequest.getOAURL()); + OAAuthParameter oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(protocolRequest.getOAURL()); if (!oa.getSAML1Parameter().isProvideAllErrors()) return false; @@ -180,7 +180,7 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants { SAML1AuthenticationServer saml1authentication = SAML1AuthenticationServer.getInstace(); String samlArtifactBase64 = saml1authentication.BuildErrorAssertion(e, protocolRequest); - String url = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/RedirectServlet"; + String url = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/RedirectServlet"; url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(protocolRequest.getOAURL(), "UTF-8")); url = addURLParameter(url, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); url = response.encodeRedirectURL(url); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1RequestImpl.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1RequestImpl.java index 9bf88534f..f73726890 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1RequestImpl.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1RequestImpl.java @@ -29,7 +29,7 @@ import org.opensaml.saml2.core.Attribute; import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.RequestImpl; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; @@ -70,7 +70,7 @@ public class SAML1RequestImpl extends RequestImpl { reqAttr.addAll(SAML1Protocol.DEFAULTREQUESTEDATTRFORINTERFEDERATION); try { - OAAuthParameter oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(getOAURL()); + OAAuthParameter oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(getOAURL()); OASAML1 saml1 = oa.getSAML1Parameter(); if (saml1 != null) { if (saml1.isProvideAUTHBlock()) diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java index 1e6cf6910..27b9cd849 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeCollector.java @@ -33,7 +33,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute; import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationImpl; @@ -130,7 +130,7 @@ public class AttributeCollector implements IAction { // read configuration parameters of OA - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(container.getRequest().getAssertionConsumerServiceURL()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(container.getRequest().getAssertionConsumerServiceURL()); if (oaParam == null) throw new AuthenticationException("stork.12", new Object[]{container.getRequest().getAssertionConsumerServiceURL()}); @@ -278,7 +278,7 @@ public class AttributeCollector implements IAction { Logger.info(e.getAp().getClass().getSimpleName() + " is going to ask an external service provider for the requested attributes"); // add container-key to redirect embedded within the return URL - e.getAp().performRedirect(AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/ResumeAuthentication?" + ARTIFACT_ID + "=" + newArtifactId, request, response, oaParam); + e.getAp().performRedirect(AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/stork2/ResumeAuthentication?" + ARTIFACT_ID + "=" + newArtifactId, request, response, oaParam); } catch (Exception e1) { // TODO should we return the response as is to the PEPS? diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java index 859f4900b..48502e9e9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java @@ -25,7 +25,7 @@ package at.gv.egovernment.moa.id.protocols.stork2; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; @@ -81,7 +81,7 @@ public class AuthenticationRequest implements IAction { httpResp.reset(); //TODO: CHECK: req.getOAURL() should return the unique OA identifier - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(req.getOAURL()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(req.getOAURL()); if (oaParam == null) throw new AuthenticationException("stork.12", new Object[]{req.getOAURL()}); @@ -200,7 +200,7 @@ public class AuthenticationRequest implements IAction { //TODO: in case of Single LogOut -> SLO information has to be stored // check if citizen country is configured in the system - if (!(AuthConfigurationProvider.getInstance().getStorkConfig().getCpepsMap().containsKey(citizenCountryCode))) { + if (!(AuthConfigurationProviderFactory.getInstance().getStorkConfig().getCpepsMap().containsKey(citizenCountryCode))) { Logger.error("Citizen country PEPS not configured in MOA instance: " + citizenCountryCode); throw new MOAIDException("stork.05", null); // TODO } @@ -212,12 +212,12 @@ public class AuthenticationRequest implements IAction { String destinationURL = null; try { - issuer = new URL(AuthConfigurationProvider.getInstance().getPublicURLPrefix()).toString(); - destinationURL = AuthConfigurationProvider.getInstance().getStorkConfig().getCPEPS(citizenCountryCode).getPepsURL().toString(); - publicURLPrefix = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + issuer = new URL(AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix()).toString(); + destinationURL = AuthConfigurationProviderFactory.getInstance().getStorkConfig().getCPEPS(citizenCountryCode).getPepsURL().toString(); + publicURLPrefix = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); assertionConsumerURL = publicURLPrefix + "/stork2/SendPEPSAuthnRequest"; } catch (MalformedURLException ex) { - Logger.error("Wrong PublicURLPrefix setting of MOA instance: " + AuthConfigurationProvider.getInstance().getPublicURLPrefix(), ex); + Logger.error("Wrong PublicURLPrefix setting of MOA instance: " + AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(), ex); throw new MOAIDException("stork.05", null); // TODO } catch (Exception ex) { Logger.error("Problem with PEPS configuration of MOA instance.", ex); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java index 2c5728798..9377d045b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/ConsentEvaluator.java @@ -28,7 +28,7 @@ import java.util.HashMap; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationInterface; @@ -130,7 +130,7 @@ public class ConsentEvaluator implements IAction { Template template = velocityEngine.getTemplate("/resources/templates/stork2_consent.html"); VelocityContext context = new VelocityContext(); - context.put("action", AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/stork2/CompleteAuthentication?" + ARTIFACT_ID + "=" + newArtifactId); + context.put("action", AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/stork2/CompleteAuthentication?" + ARTIFACT_ID + "=" + newArtifactId); // assemble table String table = ""; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java index a92d02e08..e9a1c2f1d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MOASTORKRequest.java @@ -30,7 +30,7 @@ import org.opensaml.saml2.core.Attribute; import at.gv.egovernment.moa.id.auth.builder.DynamicOAAuthParameterBuilder; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.config.auth.data.DynamicOAAuthParameters; @@ -235,7 +235,7 @@ public class MOASTORKRequest extends RequestImpl { //TODO: only for testing with MOA-ID as PVP Stammportal IOAAuthParameters oa; try { - oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(getOAURL()); + oa = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(getOAURL()); oa = DynamicOAAuthParameterBuilder.buildFromAuthnRequest(oa, this); DynamicOAAuthParameters tmp = (DynamicOAAuthParameters) oa; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java index ed8480ccb..b48a5acef 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/MandateRetrievalRequest.java @@ -27,7 +27,7 @@ import at.gv.egovernment.moa.id.auth.data.IdentityLink; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.BuildException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationInterface; @@ -84,7 +84,7 @@ public class MandateRetrievalRequest implements IAction { Logger.debug("Removing personal identification value and type from original mandate "); originalContent = StringUtils.getBytesUtf8(originalMandate); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(req.getOAURL()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(req.getOAURL()); if (oaParam == null) throw new AuthenticationException("stork.12", new Object[]{req.getOAURL()}); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java index 57531992d..9eab99c52 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java @@ -25,7 +25,7 @@ package at.gv.egovernment.moa.id.protocols.stork2; import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IAction; import at.gv.egovernment.moa.id.moduls.IModulInfo; @@ -187,7 +187,7 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { STORK2Request.setSTORKAttrRequest(attrRequest); //check if OA is instance of VIDP or STORKPVPGateway - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(STORK2Request.getOAURL()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(STORK2Request.getOAURL()); if (oaParam == null) throw new AuthenticationException("stork.12", new Object[]{STORK2Request.getOAURL()}); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java index 2c77db94e..ea0062620 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java @@ -56,7 +56,8 @@ import org.apache.velocity.app.VelocityEngine; import org.bouncycastle.util.encoders.UrlBase64; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.protocols.stork2.ExternalAttributeRequestRequiredException; @@ -110,7 +111,7 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { this.oasisDssWebFormURL = oasisDssWebFormURL; try { - AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConfigurationProvider = AuthConfigurationProviderFactory.getInstance(); dtlUrl = authConfigurationProvider.getDocumentServiceUrl(); Logger.info ("SignedDocAttributeRequestProvider, using dtlUrl:"+dtlUrl); } catch (Exception e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java index 4288f48ad..1ca5dcce4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java @@ -43,7 +43,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.session.OASessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OldSSOSessionIDStore; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.EncryptedData; import at.gv.egovernment.moa.id.data.SLOInformationInterface; @@ -750,7 +750,7 @@ public class AuthenticationSessionStoreage { idp.setIdpurlprefix(req.getInterfederationResponse().getEntityID()); try { - OAAuthParameter oa = AuthConfigurationProvider.getInstance(). + OAAuthParameter oa = AuthConfigurationProviderFactory.getInstance(). getOnlineApplicationParameter(idp.getIdpurlprefix()); idp.setStoreSSOInformation(oa.isInterfederationSSOStorageAllowed()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AbstractEncrytionUtil.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AbstractEncrytionUtil.java index f246c55e1..b0d166951 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AbstractEncrytionUtil.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/AbstractEncrytionUtil.java @@ -42,7 +42,6 @@ import javax.crypto.spec.SecretKeySpec; import at.gv.egovernment.moa.id.auth.exception.BuildException; import at.gv.egovernment.moa.id.auth.exception.DatabaseEncryptionException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.data.EncryptedData; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ConfigurationEncrytionUtil.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ConfigurationEncrytionUtil.java index 10221604c..19da7ed9e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ConfigurationEncrytionUtil.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ConfigurationEncrytionUtil.java @@ -23,7 +23,7 @@ package at.gv.egovernment.moa.id.util; import at.gv.egovernment.moa.id.auth.exception.DatabaseEncryptionException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; public class ConfigurationEncrytionUtil extends AbstractEncrytionUtil { @@ -34,7 +34,7 @@ public class ConfigurationEncrytionUtil extends AbstractEncrytionUtil { public static ConfigurationEncrytionUtil getInstance() { if (instance == null) { try { - key = AuthConfigurationProvider.getInstance().getMOAConfigurationEncryptionKey(); + key = AuthConfigurationProviderFactory.getInstance().getMOAConfigurationEncryptionKey(); instance = new ConfigurationEncrytionUtil(); } catch (Exception e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/IdentityLinkReSigner.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/IdentityLinkReSigner.java index 520b81b17..0b517e783 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/IdentityLinkReSigner.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/IdentityLinkReSigner.java @@ -37,7 +37,7 @@ import org.w3c.dom.NodeList; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.spss.MOAException; import at.gv.egovernment.moa.spss.api.SPSSFactory; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java index 5eb55317a..b55dea250 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java @@ -66,7 +66,8 @@ import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.MiscUtil; @@ -289,7 +290,7 @@ public class ParamValidatorUtils implements MOAIDAuthConstants{ } else { //check against configured trustet template urls - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConf = AuthConfigurationProviderFactory.getInstance(); List trustedTemplateURLs = authConf.getSLRequestTemplates(); //get OA specific template URLs diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java index 81abe3f5a..af3424881 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SSLUtils.java @@ -70,7 +70,7 @@ import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; import at.gv.egovernment.moa.id.config.ConnectionParameter; import at.gv.egovernment.moa.id.config.ConnectionParameterInterface; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; /** @@ -132,8 +132,8 @@ public class SSLUtils { conf.getCertstoreDirectory(), trustStoreURL, acceptedServerCertURL, - AuthConfigurationProvider.getInstance().getDefaultChainingMode(), - AuthConfigurationProvider.getInstance().isTrustmanagerrevoationchecking(), + AuthConfigurationProviderFactory.getInstance().getDefaultChainingMode(), + AuthConfigurationProviderFactory.getInstance().isTrustmanagerrevoationchecking(), connParam.getClientKeyStore(), connParam.getClientKeyStorePassword(), "pkcs12"); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SessionEncrytionUtil.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SessionEncrytionUtil.java index 8660f7c09..498f8408b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SessionEncrytionUtil.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/SessionEncrytionUtil.java @@ -23,7 +23,7 @@ package at.gv.egovernment.moa.id.util; import at.gv.egovernment.moa.id.auth.exception.DatabaseEncryptionException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; public class SessionEncrytionUtil extends AbstractEncrytionUtil { @@ -34,7 +34,7 @@ public class SessionEncrytionUtil extends AbstractEncrytionUtil { public static SessionEncrytionUtil getInstance() { if (instance == null) { try { - key = AuthConfigurationProvider.getInstance().getMOASessionEncryptionKey(); + key = AuthConfigurationProviderFactory.getInstance().getMOASessionEncryptionKey(); instance = new SessionEncrytionUtil(); } catch (Exception e) { diff --git a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java index 7606bc9bf..313038e08 100644 --- a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java +++ b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/AuthConfigurationProviderLegacyCompatibilityTest.java @@ -10,8 +10,8 @@ import java.util.Collections; import org.junit.Test; import org.unitils.reflectionassert.ReflectionAssert; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; -import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; diff --git a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java index 39c8ef310..483731179 100644 --- a/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/test/java/at/gv/egovnerment/moa/id/config/auth/TestLegacyAuthConfigurationProvider.java @@ -2,10 +2,10 @@ package at.gv.egovnerment.moa.id.config.auth; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.JaxBAuthConfigurationProvider; public class TestLegacyAuthConfigurationProvider extends - AuthConfigurationProvider { + JaxBAuthConfigurationProvider { private final MOAIDConfiguration moaidConfiguration; diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java index 0aa1ffab9..df21e17bf 100644 --- a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/builder/VerifyXMLSignatureRequestBuilderTest.java @@ -59,7 +59,7 @@ import at.gv.egovernment.moa.id.auth.parser.CreateXMLSignatureResponseParser; import at.gv.egovernment.moa.id.auth.parser.InfoboxReadResponseParser; import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.JaxBAuthConfigurationProvider; @@ -107,7 +107,7 @@ public class VerifyXMLSignatureRequestBuilderTest extends MOASPSSTestCase { InfoboxReadResponseParser irrp = new InfoboxReadResponseParser(xmlInfoboxReadResponse); IdentityLink idl = irrp.parseIdentityLink(); VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + JaxBAuthConfigurationProvider authConf = JaxBAuthConfigurationProvider.getInstance(); Element requestBuild = vsrb.build(idl, authConf.getMoaSpIdentityLinkTrustProfileID()); @@ -128,7 +128,7 @@ public class VerifyXMLSignatureRequestBuilderTest extends MOASPSSTestCase { VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + JaxBAuthConfigurationProvider authConf = JaxBAuthConfigurationProvider.getInstance(); Element request = vsrb.build(csr, authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(), authConf.getMoaSpIdentityLinkTrustProfileID()); diff --git a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java index 0876cfac6..c5c17f623 100644 --- a/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java +++ b/id/server/idserverlib/src/test/java/test/at/gv/egovernment/moa/id/auth/invoke/SignatureVerificationTest.java @@ -60,7 +60,7 @@ import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; import at.gv.egovernment.moa.id.auth.invoke.SignatureVerificationInvoker; import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.JaxBAuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.data.DynamicOAAuthParameters; import at.gv.egovernment.moa.util.DOMUtils; @@ -118,7 +118,7 @@ System.setProperty( IdentityLink idl = irrp.parseIdentityLink(); VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + JaxBAuthConfigurationProvider authConf = JaxBAuthConfigurationProvider.getInstance(); Element request = vsrb.build(idl, authConf.getMoaSpIdentityLinkTrustProfileID()); s =new RandomAccessFile("D://PatricksVerifyXMLSignatureRequestWithInfoboxReadResponse.xml","rw"); @@ -159,7 +159,7 @@ System.setProperty( VerifyXMLSignatureRequestBuilder vsrb = new VerifyXMLSignatureRequestBuilder(); - AuthConfigurationProvider authConf = AuthConfigurationProvider.getInstance(); + JaxBAuthConfigurationProvider authConf = JaxBAuthConfigurationProvider.getInstance(); Element request = vsrb.build(csr, authConf.getMoaSpAuthBlockVerifyTransformsInfoIDs(), authConf.getMoaSpIdentityLinkTrustProfileID()); // Element request = DOMUtils.parseDocument(vsrb.build(xmlInfoboxReadResponse,"TrustProfile1"),false,null,null).getDocumentElement(); diff --git a/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java b/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java index 4a89f031e..74e89c833 100644 --- a/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java +++ b/id/server/idserverlib/src/test/java/test/lasttest/LasttestClient.java @@ -56,7 +56,7 @@ import org.w3c.dom.Element; import at.gv.egovernment.moa.id.auth.AuthenticationServer; import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.JaxBAuthConfigurationProvider; import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; import at.gv.egovernment.moa.util.DOMUtils; import at.gv.egovernment.moa.util.StreamUtils; @@ -108,7 +108,7 @@ public class LasttestClient { System.setProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME, TESTDATA_ROOT + "xmldata/L000/Configuration.xml"); - AuthConfigurationProvider.reload(); + JaxBAuthConfigurationProvider.reload(); this.turns = turns; diff --git a/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java b/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java index 549eb4f2b..6e1f612c8 100644 --- a/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java +++ b/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java @@ -1,5 +1,8 @@ package test.tlenz; +import iaik.asn1.structures.Name; +import iaik.utils.RFC2253NameParser; +import iaik.utils.RFC2253NameParserException; import at.gv.egovernment.moa.id.data.AuthenticationRole; import at.gv.egovernment.moa.id.data.AuthenticationRoleFactory; @@ -47,11 +50,24 @@ public class simpletest { // public static void main(String[] args) { - AuthenticationRole test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION(key=A\\,B)"); + String subjectName = "serialNumber=896929130327, givenName=OCSP, SN=Responder 03-1, CN=OCSP Responder 03-1, C=AT"; - test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION"); - test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION(key=A)"); - test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION(keyA=A,keyB=B)"); + try { + Name test = new RFC2253NameParser(subjectName).parse(); + + System.out.println(test.getRFC2253String()); + + } catch (RFC2253NameParserException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + +// AuthenticationRole test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION(key=A\\,B)"); +// +// test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION"); +// test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION(key=A)"); +// test = AuthenticationRoleFactory.buildFormPVPole("ecas-demo-EUROPEAN_COMMISSION(keyA=A,keyB=B)"); // // System.setProperty("mandates.configuration", "D:/Projekte/svn/moa-id/moa-id.properties"); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java index d8fde7eee..e794951d7 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java @@ -18,7 +18,6 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; import at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper; -import at.gv.egovernment.moa.id.commons.db.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java new file mode 100644 index 000000000..6217c6c68 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java @@ -0,0 +1,246 @@ +package at.gv.egovernment.moa.id.commons.config; + +/** + * + * + */ +public final class MOAIDConfigurationConstants { + + private MOAIDConfigurationConstants() { + // restrict instantiation + } + + //Basic key namespaces + public static final String PREFIX_MOAID = "moa.id"; + public static final String PREFIX_GENERAL = "general"; + public static final String PREFIX_SERVICES = "services"; + public static final String PREFIX_OA = "oa"; + public static final String PREFIX_VIDP = "vidp"; + public static final String PREFIX_IIDP = "iidp"; + public static final String PREFIX_GATEWAY = "gateway"; + + public static final String PREFIX_MOAID_GENERAL = PREFIX_MOAID + "." + PREFIX_GENERAL; + public static final String PREFIX_MOAID_SERVICES = PREFIX_MOAID + "." + PREFIX_SERVICES; + public static final String PREFIX_MOAID_SERVICES_OA = PREFIX_MOAID_SERVICES + "." + PREFIX_OA; + public static final String PREFIX_MOAID_SERVICES_VIDP = PREFIX_MOAID_SERVICES + "." + PREFIX_VIDP; + public static final String PREFIX_MOAID_SERVICES_IIDP = PREFIX_MOAID_SERVICES + "." + PREFIX_IIDP; + public static final String PREFIX_MOAID_SERVICES_GATEWAY = PREFIX_MOAID_SERVICES + "." + PREFIX_GATEWAY; + + //Namespaces for online applications + public static final String SERVICE_UNIQUEIDENTIFIER = "uniqueID"; //publicURLPrefix + public static final String SERVICE_FRIENDLYNAME = "friendlyName"; //friendlyName + public static final String SERVICE_TYPE = "type"; //type + public static final String SERVICE_ISACTIVE = "isActive"; //isActive + + //service authentication keys + private static final String AUTH = "auth"; + private static final String TARGET = "target"; + private static final String BKU = "bku"; + private static final String TESTCREDENTIALS = "testcredentials"; + private static final String MANDATES = "mandates"; + private static final String FOREIGNBPK = "foreignbPK"; + private static final String SSO = "sso"; + private static final String STORK = "stork"; + private static final String TEMPLATES = "templates"; + private static final String INTERFEDERATION = "interfederation"; + + private static final String PROTOCOLS = "protocols"; + private static final String SAML1 = "saml1"; + private static final String PVP2X = "pvp2x"; + private static final String OPENID = "openID"; + + public static final String SERVICE_AUTH_TARGET = AUTH + "." + TARGET; + public static final String SERVICE_AUTH_TARGET_TYPE = SERVICE_AUTH_TARGET + ".type"; //targetFriendlyName or IdentificationType + public static final String SERVICE_AUTH_TARGET_VALUE = SERVICE_AUTH_TARGET + ".value"; //target or IdentificationValue + + private static final String SERVICE_AUTH_BKU = AUTH + "." + BKU; + public static final String SERVICE_AUTH_BKU_ONLINE = SERVICE_AUTH_BKU + ".onlineBKU"; + public static final String SERVICE_AUTH_BKU_LOCAL = SERVICE_AUTH_BKU + ".localBKU"; + public static final String SERVICE_AUTH_BKU_HANDY = SERVICE_AUTH_BKU + ".handyBKU"; + public static final String SERVICE_AUTH_BKU_KEYBOXIDENTIFIER = SERVICE_AUTH_BKU + ".keyBoxIdentifier"; + public static final String SERVICE_AUTH_BKU_TEMPLATE_LIST = SERVICE_AUTH_BKU + ".template"; //SecurityLayer Templates + public static final String SERVICE_AUTH_BKU_TEMPLATE_LIST_VALUE = "url"; + public static final String SERVICE_AUTH_BKU_AUTHBLOCKTEXT = SERVICE_AUTH_BKU + "authblock.additionaltext"; + public static final String SERVICE_AUTH_BKU_AUTHBLOCK_REMOVEBPK = SERVICE_AUTH_BKU + "authblock.removebPK"; + + private static final String SERVICE_AUTH_TEMPLATES = AUTH + "." + TEMPLATES; + public static final String SERVICE_AUTH_TEMPLATES_BKUSELECTION = SERVICE_AUTH_TEMPLATES + ".bkuselection"; + public static final String SERVICE_AUTH_TEMPLATES_SENDASSERTION = SERVICE_AUTH_TEMPLATES + ".sendAssertion"; + private static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION = SERVICE_AUTH_TEMPLATES + ".customize"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FONTTYPE = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".fonttype"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BACKGROUNDCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".color.back"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FRONTCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".color.front"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERBACKGROUNDCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".header.color.back"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERFRONTCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".header.color.front"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERTEXT = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".header.text"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONBACKGROUNDCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".button.color.back"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONBACLGROUNDCOLORFOCUS = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".button.color.back.focus"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONFRONTCOLOR = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".button.color.front"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETREDIRECTTARGET = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".applet.redirecttarget"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETHEIGHT = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".applet.hight"; + public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETWIDTH = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".applet.width"; + + private static final String SERVICE_AUTH_TESTCREDENTIALS = AUTH + "." + TESTCREDENTIALS; + public static final String SERVICE_AUTH_TESTCREDENTIALS_ENABLED = SERVICE_AUTH_TESTCREDENTIALS + ".enabled"; + public static final String SERVICE_AUTH_TESTCREDENTIALS_OIDs = SERVICE_AUTH_TESTCREDENTIALS + ".oids"; + + private static final String SERVICE_AUTH_MANDATES = AUTH + "." + MANDATES; + public static final String SERVICE_AUTH_MANDATES_ONLY = SERVICE_AUTH_MANDATES + "only"; + public static final String SERVICE_AUTH_MANDATES_PROFILES = SERVICE_AUTH_MANDATES + "profiles"; + + public static final String SERVICE_AUTH_FOREIGNBPK = AUTH + "." + FOREIGNBPK; //complex attribute + + private static final String SERVICE_AUTH_SSO = AUTH + "." + SSO; + public static final String SERVICE_AUTH_SSO_ENABLED = SERVICE_AUTH_SSO + ".enabled"; + public static final String SERVICE_AUTH_SSO_USERREQUEST = SERVICE_AUTH_SSO + ".userRequest"; + + private static final String SERVICE_AUTH_STORK = AUTH + "." + STORK; + public static final String SERVICE_AUTH_STORK_ENABLED = SERVICE_AUTH_STORK + ".enabled"; + public static final String SERVICE_AUTH_STORK_COUNTRIES_LIST = SERVICE_AUTH_STORK + ".countries"; + public static final String SERVICE_AUTH_STORK_COUNTRIES_LIST_ENABLED = "enabled"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTES_LIST = SERVICE_AUTH_STORK + ".attributes"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTES_LIST_NAME = "name"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY = "mandatory"; + public static final String SERVICE_AUTH_STORK_REQUIRECONSENT = SERVICE_AUTH_STORK + ".requireConsent"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST = SERVICE_AUTH_STORK + ".attributeprovider"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_NAME = "name"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_URL = "url"; + public static final String SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_ATTRIBUTES = "attributes"; + + private static final String SERVICE_PROTOCOLS_SAML1 = PROTOCOLS + "." + SAML1; + public static final String SERVICE_PROTOCOLS_SAML1_ENABLED = SERVICE_PROTOCOLS_SAML1 + ".enabled"; + public static final String SERVICE_PROTOCOLS_SAML1_IDL = SERVICE_PROTOCOLS_SAML1 + ".idl"; + public static final String SERVICE_PROTOCOLS_SAML1_BASEID = SERVICE_PROTOCOLS_SAML1 + ".baseid"; + public static final String SERVICE_PROTOCOLS_SAML1_AUTHBLOCK = SERVICE_PROTOCOLS_SAML1 + ".authblock"; + public static final String SERVICE_PROTOCOLS_SAML1_CERTIFICATE = SERVICE_PROTOCOLS_SAML1 + ".certificate"; + public static final String SERVICE_PROTOCOLS_SAML1_MANDATE = SERVICE_PROTOCOLS_SAML1 + ".mandate"; + public static final String SERVICE_PROTOCOLS_SAML1_RETURNERROR = SERVICE_PROTOCOLS_SAML1 + ".returnError"; + + private static final String SERVICE_PROTOCOLS_PVP2X = PROTOCOLS + "." + PVP2X; + public static final String SERVICE_PROTOCOLS_PVP2X_RELOAD = SERVICE_PROTOCOLS_PVP2X + ".reload"; + public static final String SERVICE_PROTOCOLS_PVP2X_URL = SERVICE_PROTOCOLS_PVP2X + ".URL"; + public static final String SERVICE_PROTOCOLS_PVP2X_CERTIFICATE = SERVICE_PROTOCOLS_PVP2X + ".certificate"; + + private static final String SERVICE_PROTOCOLS_OPENID = PROTOCOLS + "." + OPENID; + public static final String SERVICE_PROTOCOLS_OPENID_CLIENTID = SERVICE_PROTOCOLS_OPENID + ".clientID"; + public static final String SERVICE_PROTOCOLS_OPENID_CLIENTSECRET = SERVICE_PROTOCOLS_OPENID + ".secret"; + public static final String SERVICE_PROTOCOLS_OPENID_REDIRECTURL = SERVICE_PROTOCOLS_OPENID + ".redirectURL"; + + public static final String SERVICE_INTERFEDERATION_SSO_INBOUND = INTERFEDERATION + ".SSO.inbound"; + public static final String SERVICE_INTERFEDERATION_SSO_OUTBOUND = INTERFEDERATION + ".SSO.outbound"; + public static final String SERVICE_INTERFEDERATION_SSO_STORE = INTERFEDERATION + ".SSO.store"; + public static final String SERVICE_INTERFEDERATION_ATTRIBUTQUERY_URL = INTERFEDERATION + ".attributequery.url"; + + public static final String SERVICE_INTERFEDERATION_PASSIVEREQUEST = INTERFEDERATION + ".passiveReqeust"; + public static final String SERVICE_INTERFEDERATION_LOCALAUTHONERROR = INTERFEDERATION + ".localAuthOnError"; + public static final String SERVICE_INTERFEDERATION_FORWARD_IDPIDENTIFIER = INTERFEDERATION + ".forward.IDP"; + public static final String SERVICE_INTERFEDERATION_FORWARD_PROTOCOL = INTERFEDERATION + ".forward.protocol"; + + + + //Namespaces for general MOA-ID config + public static final String GENERAL_PUBLICURLPREFIX = "publicURLPrefix"; + + private static final String GENERAL_DEFAULTS = "defaults"; + private static final String GENERAL_DEFAULTS_BKU = GENERAL_DEFAULTS + "." + BKU; + public static final String GENERAL_DEFAULTS_BKU_ONLINE = GENERAL_DEFAULTS_BKU + ".onlineBKU"; + public static final String GENERAL_DEFAULTS_BKU_HANDY = GENERAL_DEFAULTS_BKU + ".handyBKU"; + public static final String GENERAL_DEFAULTS_BKU_LOCAL = GENERAL_DEFAULTS_BKU + ".localBKU"; + private static final String GENERAL_DEFAULTS_TEMPLATES = GENERAL_DEFAULTS + "." + TEMPLATES; + public static final String GENERAL_DEFAULTS_TEMPLATES_LOCAL = GENERAL_DEFAULTS_TEMPLATES + ".localBKU"; + public static final String GENERAL_DEFAULTS_TEMPLATES_HANDY = GENERAL_DEFAULTS_TEMPLATES + ".handyBKU"; + public static final String GENERAL_DEFAULTS_TEMPLATES_ONLINE = GENERAL_DEFAULTS_TEMPLATES + ".onlineBKU"; + + private static final String GENERAL_AUTH = "auth"; + public static final String GENERAL_AUTH_CERTSTORE_URL = GENERAL_AUTH + ".certstore.url"; + public static final String GENERAL_AUTH_TRUSTSTORE_URL = GENERAL_AUTH + ".truststore.url"; + public static final String GENERAL_AUTH_REVOCATIONCHECKING = GENERAL_AUTH + ".revocationchecking"; + + public static final String GENERAL_AUTH_TIMEOUTS_TRANSACTION = GENERAL_AUTH + ".timeouts.transaction"; //Anmeldedaten + public static final String GENERAL_AUTH_TIMEOUS_SSO_CREATE = GENERAL_AUTH + ".timeouts.sso.create"; + public static final String GENERAL_AUTH_TIMEOUS_SSO_UPDATE = GENERAL_AUTH + ".timeouts.sso.update"; + + public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD = GENERAL_AUTH + ".moasp.trustprofile.idl.prod"; + public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_TEST = GENERAL_AUTH + ".moasp.trustprofile.idl.test"; + public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD = GENERAL_AUTH + ".moasp.trustprofile.authblock.prod"; + public static final String GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_TEST = GENERAL_AUTH + ".moasp.trustprofile.authblock.test"; + public static final String GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM = GENERAL_AUTH + ".moasp.authblock.transform"; + public static final String GENERAL_AUTH_MOASP_URL = GENERAL_AUTH + ".moasp.url"; + + public static final String GENERAL_AUTH_SERVICES_OVS_URL = GENERAL_AUTH + ".services.ovs.url"; + public static final String GENERAL_AUTH_SERVICES_SZRGW_URL = GENERAL_AUTH + ".services.szrgw.url"; + + + public static final String GENERAL_AUTH_SSO_SERVICENAME = GENERAL_AUTH + "." + SSO + ".servicename"; + public static final String GENERAL_AUTH_SSO_TARGET = GENERAL_AUTH + "." + SSO + ".target"; + public static final String GENERAL_AUTH_SSO_AUTHBLOCK_TEXT = GENERAL_AUTH + "." + SSO + ".authblock.text"; + + private static final String GENERAL_PROTOCOLS = PROTOCOLS; + private static final String GENERAL_PROTOCOLS_SAML1 = GENERAL_PROTOCOLS + "." + SAML1; + private static final String GENERAL_PROTOCOLS_PVP2X = GENERAL_PROTOCOLS + "." + PVP2X; + private static final String GENERAL_PROTOCOLS_OPENID = GENERAL_PROTOCOLS + "." + OPENID; + public static final String GENERAL_PROTOCOLS_SAML1_ENABLED = GENERAL_PROTOCOLS_SAML1 + ".enabled"; + public static final String GENERAL_PROTOCOLS_SAML1_LEGACY = GENERAL_PROTOCOLS_SAML1 + ".legacy"; + public static final String GENERAL_PROTOCOLS_SAML1_SOURCEID = GENERAL_PROTOCOLS_SAML1 + ".sourceID"; + public static final String GENERAL_PROTOCOLS_OPENID_ENABLED = GENERAL_PROTOCOLS_OPENID + ".enabled"; + public static final String GENERAL_PROTOCOLS_OPENID_LEGACY = GENERAL_PROTOCOLS_OPENID + ".legacy"; + + public static final String GENERAL_PROTOCOLS_PVP2X_ENABLED = GENERAL_PROTOCOLS_PVP2X + ".enabled"; + public static final String GENERAL_PROTOCOLS_PVP2X_LEGACY = GENERAL_PROTOCOLS_PVP2X + ".legacy"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME = GENERAL_PROTOCOLS_PVP2X + ".metadata.servicename"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.org.name.short"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.org.name.full"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL = GENERAL_PROTOCOLS_PVP2X + ".metadata.org.url"; + + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_FAMLIYNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.familyname"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_GIVENNAME = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.givenname"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_MAIL = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.mail"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_PHONE = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.phone"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_COMPANY = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.company"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE = GENERAL_PROTOCOLS_PVP2X + ".metadata.contact.type"; + + public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME = GENERAL_AUTH + ".authblock.transformation.name"; + public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64 = GENERAL_AUTH + ".authblock.transformation.base64"; + + public static final String GENERAL_AUTH_STORK = GENERAL_AUTH + "." + STORK; + public static final String GENERAL_AUTH_STORK_QAA = GENERAL_AUTH + "." + STORK + ".qaa"; + public static final String GENERAL_AUTH_STORK_CPEPS_LIST = GENERAL_AUTH + "." + STORK + ".cpeps"; + public static final String GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY = "countrycode"; + public static final String GENERAL_AUTH_STORK_CPEPS_LIST_URL = "url"; + public static final String GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG = "support.xmldsig"; + + public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST = GENERAL_AUTH + "." + STORK + ".attributes"; + public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME = "friendlyname"; + public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY = "mandatory"; + +// // old!!!!!!!!!!! // +// // keys for the object in the key-value database +// public static final String ONLINE_APPLICATIONS_KEY = "OnlineApplications"; +// public static final String AUTH_COMPONENT_GENERAL_KEY = "AuthComponentGeneral"; +// public static final String CHAINING_MODES_KEY = "ChainingModes"; +// public static final String TRUSTED_CERTIFICATES_KEY = "TruestedCertificates"; +// public static final String DEFAULT_BKUS_KEY = "DefaultBKUs"; +// public static final String SLREQUEST_TEMPLATES_KEY = "SLRequestTemplates"; +// public static final String TIMESTAMP_ITEM_KEY = "TimestampItem"; +// public static final String PVP2REFRESH_ITEM_KEY = "Pvp2RefreshItem"; +// public static final String GENERIC_CONFIGURATION_KEY = "GenericConfiguration"; +// +// /** +// * Returns all relevant (database-) keys that {@link MOAIDConfiguration} contains. +// * @return the keys as {@code String[]} +// */ +// public static final String[] getMOAIDConfigurationKeys() { +// return new String[] { AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, TRUSTED_CERTIFICATES_KEY, +// DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, PVP2REFRESH_ITEM_KEY }; +// } +// +// /** +// * Returns all (database-) keys that {@link MOAIDConfiguration} contains. +// * @return the keys as {@code String[]} +// */ +// public static final String[] getAllMOAIDConfigurationKeys() { +// return new String[] { ONLINE_APPLICATIONS_KEY, AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, +// TRUSTED_CERTIFICATES_KEY, DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, +// PVP2REFRESH_ITEM_KEY }; +// } +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java deleted file mode 100644 index f357fc570..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/Configuration.java +++ /dev/null @@ -1,60 +0,0 @@ -package at.gv.egovernment.moa.id.commons.config.persistence; - -import java.util.List; - -/** - * An interface for a key-value configuration. - */ -public interface Configuration { - - /** - * Gets all keys in the database. NOTE: may return an empty list or {@code null}. - * @return a List containing all keys in the database or {@code null}. - */ - List getAllKeys(); - - /** - * Get the value associated with the given key as {@link Object}. - * @param key the key - * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. - */ - Object get(String key); - - /** - * Get the object of type {@code T} associated with the given key. - * - * @param key the key - * @param clazz the type of the requested object - * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. - */ - T get(String key, Class clazz); - - /** - * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. - * - * @param key the key under which the value is stored, respectively key determining the entry to be deleted. - * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. - * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. - */ - boolean set(String key, Object value); - - /** - * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default - * value is returned. - * - * @param key the key - * @param clazz the type of the requested object - * @param defaultValue the default value to return - * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value. - */ - T get(String key, Class clazz, Object defaultValue); - - /** - * Get a list of objects associated with the given key. The list may be empty or contain only a single object. - * @param key the key - * @param clazz the type of the requested object - * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key. - */ - List getList(String key, Class clazz); - -} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java deleted file mode 100644 index c90b60440..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/ConfigurationImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -package at.gv.egovernment.moa.id.commons.config.persistence; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.persistence.EntityExistsException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Required; -import org.springframework.stereotype.Component; - -import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty; -import at.gv.egovernment.moa.id.commons.db.dao.config.ConfigPropertyDao; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.type.CollectionType; -import com.fasterxml.jackson.databind.type.TypeFactory; - -/** - * The implementation of a key-value configuration implementing the {@link Configuration} interface. - * It employs the {@link ConfigPropertyDao} to persist configuration data. - */ -@Component -public class ConfigurationImpl implements Configuration { - - private final Logger log = LoggerFactory.getLogger(getClass()); - - ConfigPropertyDao configPropertyDao; - private JsonMapper mapper = new JsonMapper(); - - /** - * Sets the {@link ConfigPropertyDao}. - * @param configPropertyDao the ConfigPropertyDao - */ - @Required - public void setConfigPropertyDao(ConfigPropertyDao configPropertyDao) { - this.configPropertyDao = configPropertyDao; - } - - @Override - public List getAllKeys(){ - try { - return this.configPropertyDao.getAllKeys(); - } catch (Exception e) { - log.debug("Error while retrieving a list of all keys in the database."); - return null; - } - } - - @Override - public Object get(String key) { - // return null if key does not exist - try { - ConfigProperty property = configPropertyDao.getProperty(key); - if (property != null && property.getValue() != null) { - return mapper.deserialize(property.getValue(), null); - } else { - return null; - } - } catch (IllegalArgumentException e) { - log.debug("Error while searching for key '{}' in the database.", key); - return null; - } catch (Exception e) { - log.debug("Error while deserializing value of key '{}' to object.", key); - return null; - } - } - - @Override - public T get(String key, Class clazz) { - // return null if key does not exist - try { - ConfigProperty property = configPropertyDao.getProperty(key); - if (property != null && property.getValue() != null) { - return clazz.cast(mapper.deserialize(property.getValue(), clazz)); - } else { - return null; - } - } catch (IllegalArgumentException e) { - log.debug("Error while searching for key '{}' in the database.", key); - return null; - } catch (Exception e) { - log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass()); - return null; - } - } - - @Override - public boolean set(String key, Object value) { - - try { - if (value == null) { - configPropertyDao.delete(key); - return true; - } else { - - ConfigProperty keyValue = new ConfigProperty(); - keyValue.setKey(key); - - keyValue.setValue(mapper.serialize(value)); - configPropertyDao.saveProperty(keyValue); - return true; - } - } catch (JsonProcessingException e) { - log.debug("Error while serializing object for key '{}'.", key); - return false; - } catch (EntityExistsException e) { - log.debug("Property '{}' already exists!", key); - return false; - } catch (Exception e) { - log.debug("Error while setting value for key '{}' in the database.", key); - return false; - } - } - - @Override - public T get(String key, Class clazz, Object defaultValue) { - - T value = get(key, clazz); - if (value != null) { - return value; - } else { - return clazz.cast(defaultValue); - } - } - - @SuppressWarnings("unchecked") - @Override - public List getList(String key, Class clazz) { - - CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); - try { - if ((configPropertyDao.getProperty(key) == null) - || (configPropertyDao.getProperty(key).getValue() == null)) { - return new ArrayList(); - } - String json = configPropertyDao.getProperty(key).getValue(); - ObjectMapper mapper = new ObjectMapper(); - - return (List) mapper.readValue(json, listType); - } catch (JsonMappingException e) { - ArrayList tmp = new ArrayList(); - T value = get(key, clazz); - if (value != null) { - tmp.add(value); - } - return tmp; - } catch (IOException e) { - log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass()); - return new ArrayList(); - } catch (Exception e){ - log.debug("Error while searching key '{}' in the database.", key); - return new ArrayList(); - } - } - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java new file mode 100644 index 000000000..45f37ef97 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfiguration.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.id.commons.config.persistence; + +import java.util.List; + +import at.gv.egiz.components.configuration.api.Configuration; + +/** + * An interface for a key-value configuration. + */ +public interface MOAIDConfiguration { + + /** + * Gets all keys in the database. NOTE: may return an empty list or {@code null}. + * @return a List containing all keys in the database or {@code null}. + */ + List getAllKeys(); + + /** + * Get the value associated with the given key as {@link Object}. + * @param key the key + * @return the String associated with the given key or {@code null} if the key does not exist or does not have a value. + */ + String get(String key); + + /** + * Get the object of type {@code T} associated with the given key. + * + * @param key the key + * @param clazz the type of the requested object + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. + */ + T get(String key, Class clazz); + + /** + * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. + * + * @param key the key under which the value is stored, respectively key determining the entry to be deleted. + * @param value the String to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. + * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. + */ + boolean set(String key, String value); +// +// /** +// * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default +// * value is returned. +// * +// * @param key the key +// * @param clazz the type of the requested object +// * @param defaultValue the default value to return +// * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value. +// */ +// T get(String key, Class clazz, Object defaultValue); +// +// /** +// * Get a list of objects associated with the given key. The list may be empty or contain only a single object. +// * @param key the key +// * @param clazz the type of the requested object +// * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key. +// */ +// List getList(String key, Class clazz); + +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java new file mode 100644 index 000000000..10ed19f83 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java @@ -0,0 +1,136 @@ +package at.gv.egovernment.moa.id.commons.config.persistence; + +import java.util.Arrays; +import java.util.List; + +import javax.persistence.EntityExistsException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Required; +import org.springframework.stereotype.Component; + +import at.gv.egiz.components.configuration.api.Configuration; + +/** + * The implementation of a key-value configuration implementing the {@link Configuration} interface. + * It employs the {@link ConfigPropertyDao} to persist configuration data. + */ +@Component +public class MOAIDConfigurationImpl implements MOAIDConfiguration { + + private final Logger log = LoggerFactory.getLogger(getClass()); + + Configuration configPropertyDao; +// private JsonMapper mapper = new JsonMapper(); + + /** + * Sets the {@link ConfigPropertyDao}. + * @param configPropertyDao the ConfigPropertyDao + */ + @Required + public void setConfigPropertyDao(Configuration configPropertyDao) { + this.configPropertyDao = configPropertyDao; + } + + @Override + public List getAllKeys(){ + try { + return Arrays.asList(this.configPropertyDao.getConfigurationIds()); + } catch (Exception e) { + log.debug("Error while retrieving a list of all keys in the database."); + return null; + } + } + + @Override + public String get(String key) { + // return null if key does not exist + try { + return configPropertyDao.getStringValue(key); + + } catch (Exception e) { + log.debug("Error while searching value of key '{}' to object.", key); + return null; + } + } + + @Override + public T get(String key, Class clazz) { + // return null if key does not exist + try { + T property = configPropertyDao.getObjectValue(key, clazz); + return property; + + } catch (IllegalArgumentException e) { + log.debug("Error while searching for key '{}' in the database.", key); + return null; + } catch (Exception e) { + log.debug("Error while deserializing value of key '{}' to object of type {}.", key, clazz.getClass()); + return null; + } + } + + @Override + public boolean set(String key, String value) { + + try { + //TODO: add delete + if (value == null) { + //configPropertyDao.delete(key); + return true; + } else { + configPropertyDao.setStringValue(key, value); + return true; + } + } catch (EntityExistsException e) { + log.debug("Property '{}' already exists!", key); + return false; + } catch (Exception e) { + log.debug("Error while setting value for key '{}' in the database.", key); + return false; + } + } + +// @Override +// public T get(String key, Class clazz, Object defaultValue) { +// +// T value = get(key, clazz); +// if (value != null) { +// return value; +// } else { +// return clazz.cast(defaultValue); +// } +// } +// +// @SuppressWarnings("unchecked") +// @Override +// public List getList(String key, Class clazz) { +// +// CollectionType listType = TypeFactory.defaultInstance().constructCollectionType(List.class, clazz); +// try { +// if ((configPropertyDao.getProperty(key) == null) +// || (configPropertyDao.getProperty(key).getValue() == null)) { +// return new ArrayList(); +// } +// String json = configPropertyDao.getProperty(key).getValue(); +// ObjectMapper mapper = new ObjectMapper(); +// +// return (List) mapper.readValue(json, listType); +// } catch (JsonMappingException e) { +// ArrayList tmp = new ArrayList(); +// T value = get(key, clazz); +// if (value != null) { +// tmp.add(value); +// } +// return tmp; +// } catch (IOException e) { +// log.debug("Error while deserializing value for key '{}' to List<{}>.", key, clazz.getClass()); +// return new ArrayList(); +// } catch (Exception e){ +// log.debug("Error while searching key '{}' in the database.", key); +// return new ArrayList(); +// } +// } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java index 394c9cdeb..f6066d68f 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -7,6 +7,7 @@ import java.util.List; import javax.persistence.EntityManager; import javax.persistence.TypedQuery; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java deleted file mode 100644 index 30897bc1d..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/MOAIDConfigurationConstants.java +++ /dev/null @@ -1,44 +0,0 @@ -package at.gv.egovernment.moa.id.commons.db; - -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; - -/** - * - * - */ -public final class MOAIDConfigurationConstants { - - private MOAIDConfigurationConstants() { - // restrict instantiation - } - - // keys for the object in the key-value database - public static final String ONLINE_APPLICATIONS_KEY = "OnlineApplications"; - public static final String AUTH_COMPONENT_GENERAL_KEY = "AuthComponentGeneral"; - public static final String CHAINING_MODES_KEY = "ChainingModes"; - public static final String TRUSTED_CERTIFICATES_KEY = "TruestedCertificates"; - public static final String DEFAULT_BKUS_KEY = "DefaultBKUs"; - public static final String SLREQUEST_TEMPLATES_KEY = "SLRequestTemplates"; - public static final String TIMESTAMP_ITEM_KEY = "TimestampItem"; - public static final String PVP2REFRESH_ITEM_KEY = "Pvp2RefreshItem"; - public static final String GENERIC_CONFIGURATION_KEY = "GenericConfiguration"; - - /** - * Returns all relevant (database-) keys that {@link MOAIDConfiguration} contains. - * @return the keys as {@code String[]} - */ - public static final String[] getMOAIDConfigurationKeys() { - return new String[] { AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, TRUSTED_CERTIFICATES_KEY, - DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, PVP2REFRESH_ITEM_KEY }; - } - - /** - * Returns all (database-) keys that {@link MOAIDConfiguration} contains. - * @return the keys as {@code String[]} - */ - public static final String[] getAllMOAIDConfigurationKeys() { - return new String[] { ONLINE_APPLICATIONS_KEY, AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, - TRUSTED_CERTIFICATES_KEY, DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, - PVP2REFRESH_ITEM_KEY }; - } -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 28363a1eb..64d8e9d80 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -7,12 +7,12 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; -import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; @@ -24,10 +24,10 @@ import at.gv.egovernment.moa.logging.Logger; */ public class NewConfigurationDBRead { - private static Configuration conf; + private static MOAIDConfiguration conf; @Autowired(required = true) - public void setConfiguration(Configuration conf) { + public void setConfiguration(MOAIDConfiguration conf) { // https://jira.spring.io/browse/SPR-3845 NewConfigurationDBRead.conf = conf; } @@ -100,7 +100,7 @@ public class NewConfigurationDBRead { * * @return */ - public static MOAIDConfiguration getMOAIDConfiguration() { + public static at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration getMOAIDConfiguration() { Logger.trace("Load MOAID Configuration from database."); AuthComponentGeneral authComponent = (AuthComponentGeneral) conf.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, @@ -126,7 +126,7 @@ public class NewConfigurationDBRead { // } // select moaidconfiguration from MOAIDConfiguration moaidconfiguration - MOAIDConfiguration result = new MOAIDConfiguration(); + at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration result = new at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration(); result.setAuthComponentGeneral(authComponent); result.setChainingModes(chainingModes); result.setGenericConfiguration(genericConfigurations); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java index de4a1789e..69e03db28 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java @@ -6,12 +6,12 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; @@ -22,10 +22,10 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; @Component public class NewConfigurationDBWrite { - private static Configuration conf; + private static MOAIDConfiguration conf; @Autowired(required = true) - public void setConfiguration(Configuration conf) { + public void setConfiguration(MOAIDConfiguration conf) { // https://jira.spring.io/browse/SPR-3845 NewConfigurationDBWrite.conf = conf; } @@ -106,7 +106,8 @@ public class NewConfigurationDBWrite { } else if (dbo instanceof MOAIDConfiguration) { - MOAIDConfiguration moaconfig = (MOAIDConfiguration) dbo; + at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration moaconfig = + (at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration) dbo; result = true; result &= saveAuthComponentGeneral(moaconfig.getAuthComponentGeneral()); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java deleted file mode 100644 index db35ba1df..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDao.java +++ /dev/null @@ -1,58 +0,0 @@ -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.util.List; -import java.util.Set; - -/** - * DAO interface providing means for accessing MOAID configuration properties. - * - */ -public interface ConfigPropertyDao { - - /** - * Gets all keys in the database. - * @return a List containing all keys in the database. - */ - List getAllKeys(); - - /** - * Returns the {@link ConfigProperty} associated with {@code key} or {@code null} if the entry does not exist. - * - * @param key The configuration key. - * @return The configuration property value or {@code null}. - */ - ConfigProperty getProperty(String key); - - /** - * Persists a given {@link ConfigProperty}. - * @param property The property to be persisted. - */ - void saveProperty(ConfigProperty property); - - /** - * Returns a {@link List} containing all stored {@linkplain ConfigProperty ConfigProperties}. - * @return The list with the properties. - */ - List getProperties(); - - /** - * Returns the value for the configuration property associated with {@code key} or {@code null} if the entry does not exist or its value is {@code null}. - * - * @param key The configuration key. - * @return The configuration property value or {@code null}. - */ - String getPropertyValue(String key); - - /** - * Persists a {@link List} of {@linkplain ConfigProperty ConfigProperties}. - * @param properties The list containing all the properties to be persisted. - */ - void saveProperties(Set properties); - - /** - * Deletes the object associated with the given key. - * @param key the key - */ - void delete(String key); - -} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java index 6a76c1d17..24195b0cf 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/ConfigPropertyDaoImpl.java @@ -1,10 +1,8 @@ package at.gv.egovernment.moa.id.commons.db.dao.config; import java.util.List; -import java.util.Set; import javax.persistence.EntityManager; -import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; @@ -12,20 +10,25 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.transaction.annotation.Transactional; +import at.gv.egiz.components.configuration.api.AbstractConfigurationImpl; +import at.gv.egiz.components.configuration.api.ConfigurationException; +import at.gv.egovernment.moa.util.MiscUtil; + /** * Database backed implementation of the DAO interface * */ @Transactional("transactionManager") -public class ConfigPropertyDaoImpl implements ConfigPropertyDao { +public class ConfigPropertyDaoImpl extends AbstractConfigurationImpl { private Logger log = LoggerFactory.getLogger(getClass()); @PersistenceContext(unitName = "moaidconf") private EntityManager em; + @Override - public List getAllKeys() { + protected List getAllKeys() { if (null == em) { log.error("No EntityManager set!"); return null; @@ -35,70 +38,150 @@ public class ConfigPropertyDaoImpl implements ConfigPropertyDao { return result; } + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#getValue(java.lang.String) + */ + @Override + protected String getValue(String key) throws ConfigurationException { + ConfigProperty property = getProperty(key); + if (property == null) + return null; + + else { + if (MiscUtil.isEmpty(property.getValue())) + return new String(); + else + return property.getValue(); + + } + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#containsKey(java.lang.String) + */ + @Override + protected boolean containsKey(String key) throws ConfigurationException { + ConfigProperty property = getProperty(key); + if (property == null) + return false; + else + return true; + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#storeKey(java.lang.String, java.lang.String) + */ @Override - public void saveProperty(ConfigProperty property) { + protected void storeKey(String key, String value) throws ConfigurationException { if (null == em) { log.error("No EntityManager set!"); return; + } - + ConfigProperty property = new ConfigProperty(); + property.setKey(key); + property.setValue(value); log.debug("Storing '{}'.", property.toString()); em.persist(property); + } - @Override - public ConfigProperty getProperty(String key) { - log.debug("Looking for configuration property for key '{}'.", key); - ConfigProperty result = em.find(ConfigProperty.class, key); - if (result != null) { - log.debug("Found configuration property {}.", result); - } else { - log.debug("Unable to find configuration property for key '{}'.", key); - } - return result; + protected void deleteKey(String key) { + log.debug("Deleting entry with key '{}'.", key); + em.remove(em.find(ConfigProperty.class, key)); } - + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#findConfigurationId(java.lang.String) + */ @Override - public String getPropertyValue(String key) { - ConfigProperty property = getProperty(key); - if (property == null) { + public String[] findConfigurationId(String searchString) + throws ConfigurationException { + if (null == em) { + log.error("No EntityManager set!"); return null; } - return property.getValue(); + + TypedQuery query = em.createQuery("select * from ConfigProperty dbconfig where dbconfig.key like :key", String.class); + query.setParameter("key", searchString.replace("*", "%")); + List result = query.getResultList(); + return result.toArray(new String[result.size()]); } + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#findByValue(java.lang.String) + */ @Override - public List getProperties() { - + public String[] findByValue(String searchString) + throws ConfigurationException { if (null == em) { log.error("No EntityManager set!"); return null; } - - log.debug("Retrieving all properties from database."); - TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); - try { - List propertiesList = query.getResultList(); - return propertiesList; - } catch (NoResultException e) { - log.debug("No property found in database."); - return null; - } + + TypedQuery query = em.createQuery("select * from ConfigProperty dbconfig where dbconfig.value like :value", String.class); + query.setParameter("value", searchString.replace("*", "%")); + List result = query.getResultList(); + return result.toArray(new String[result.size()]); } + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#synchronize() + */ @Override - public void saveProperties(Set properties) { - log.debug("Storing {} properties to database.", properties.size()); - for (ConfigProperty cp : properties) { - saveProperty(cp); - } - em.flush(); + public void synchronize() throws ConfigurationException { + //INFO: no implementation required + } + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#getName() + */ @Override - public void delete(String key) { - log.debug("Deleting entry with key '{}'.", key); - em.remove(em.find(ConfigProperty.class, key)); + public String getName() { + return "DatabaseConfiguration"; + } + + + private ConfigProperty getProperty(String key) { + log.debug("Looking for configuration property for key '{}'.", key); + ConfigProperty result = em.find(ConfigProperty.class, key); + if (result != null) { + log.debug("Found configuration property {}.", result); + } else { + log.debug("Unable to find configuration property for key '{}'.", key); + } + return result; } -} + +// @Override +// public String getPropertyValue(String key) { +// ConfigProperty property = getProperty(key); +// if (property == null) { +// return null; +// } +// return property.getValue(); +// } +// +// @Override +// public List getProperties() { +// +// if (null == em) { +// log.error("No EntityManager set!"); +// return null; +// } +// +// log.debug("Retrieving all properties from database."); +// TypedQuery query = em.createQuery("select mc from ConfigProperty mc", ConfigProperty.class); +// try { +// List propertiesList = query.getResultList(); +// return propertiesList; +// } catch (NoResultException e) { +// log.debug("No property found in database."); +// return null; +// } +// } + +} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java index 7b596fab8..c8a234565 100644 --- a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java +++ b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java @@ -20,9 +20,8 @@ import org.springframework.test.annotation.IfProfileValue; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import com.fasterxml.jackson.annotation.JsonProperty; @@ -33,7 +32,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class ConfigurationDBReadTest { @Autowired - Configuration configDataBase; + MOAIDConfiguration configDataBase; private Properties getHibernateProperties() throws FileNotFoundException, IOException { @@ -93,11 +92,11 @@ public class ConfigurationDBReadTest { SecurityException { // get the old moaid configuration - MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); + at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); // get the a new moaid configuration from the data in the key value // database - MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); + at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); // check if both configurations yield a similar MOAIDConfiguration // object @@ -111,14 +110,14 @@ public class ConfigurationDBReadTest { SecurityException { // get the old moaid configuration - MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); + at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); // delete part of the configuration oldConfig.setAuthComponentGeneral(new AuthComponentGeneral()); // get the a new moaid configuration from the data in the key value // database - MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); + at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); // check if both configurations yield a similar MOAIDConfiguration // object diff --git a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/auth/servlet/MonitoringServlet.java b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/auth/servlet/MonitoringServlet.java index 1c1cbb723..a7d7b9759 100644 --- a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/auth/servlet/MonitoringServlet.java +++ b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/auth/servlet/MonitoringServlet.java @@ -33,7 +33,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.monitoring.TestManager; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; @@ -53,7 +54,7 @@ public class MonitoringServlet extends AuthServlet { throws ServletException, IOException { try { - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); if (config.isMonitoringActive()) { Logger.debug("Monitoring Servlet received request"); diff --git a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java index a08ef5f0c..5f0ffd4e2 100644 --- a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java +++ b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java @@ -36,7 +36,8 @@ import at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.session.AssertionStore; import at.gv.egovernment.moa.id.commons.db.dao.statistic.StatisticLog; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; @@ -47,7 +48,7 @@ public class DatabaseTestModule implements TestModuleInterface{ List errors = new ArrayList(); - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); String error = testMOAConfigurationDatabase(); if (MiscUtil.isNotEmpty(error)) diff --git a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/IdentityLinkTestModule.java b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/IdentityLinkTestModule.java index b5220914c..de6c0fed0 100644 --- a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/IdentityLinkTestModule.java +++ b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/IdentityLinkTestModule.java @@ -37,7 +37,8 @@ import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; import at.gv.egovernment.moa.id.auth.parser.VerifyXMLSignatureResponseParser; import at.gv.egovernment.moa.id.auth.validator.IdentityLinkValidator; import at.gv.egovernment.moa.id.auth.validator.VerifyXMLSignatureResponseValidator; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.IOAAuthParameters; import at.gv.egovernment.moa.id.config.auth.data.DynamicOAAuthParameters; import at.gv.egovernment.moa.logging.Logger; @@ -61,7 +62,7 @@ public class IdentityLinkTestModule implements TestModuleInterface { public List performTests() throws Exception{ Logger.trace("Start MOA-ID IdentityLink Test"); - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); IdentityLinkValidator.getInstance().validate(identityLink); // builds a for a call of MOA-SP diff --git a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/TestManager.java b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/TestManager.java index 84581abe8..3c2b143b3 100644 --- a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/TestManager.java +++ b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/TestManager.java @@ -28,7 +28,8 @@ import java.util.List; import java.util.Map; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.FileUtils; @@ -47,7 +48,7 @@ public class TestManager { private TestManager() throws ConfigurationException { - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); //add Database test DatabaseTestModule test1 = new DatabaseTestModule(); diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java index 702e62fa0..6f5cf0700 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java @@ -32,7 +32,7 @@ import at.gv.egovernment.moa.id.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; import at.gv.egovernment.moa.logging.Logger; @@ -77,7 +77,7 @@ public abstract class AbstractPepsConnectorWithLocalSigningTask extends Abstract Logger.debug("fetching OAParameters from database"); - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter( + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter( moaSession.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[] { moaSession.getPublicOAURLPrefix() }); diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java index 021ee62cf..11051ceec 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java @@ -17,7 +17,7 @@ import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.stork.CPEPS; import at.gv.egovernment.moa.id.config.stork.STORKConfig; import at.gv.egovernment.moa.id.process.api.ExecutionContext; @@ -83,7 +83,7 @@ public class CreateStorkAuthRequestFormTask extends AbstractAuthServletTask { // illegal state; task should not have been executed without a selected country throw new AuthenticationException("stork.22", new Object[] { sessionID }); } - STORKConfig storkConfig = AuthConfigurationProvider.getInstance().getStorkConfig(); + STORKConfig storkConfig = AuthConfigurationProviderFactory.getInstance().getStorkConfig(); if (!storkConfig.isSTORKAuthentication(moasession.getCcc())) { throw new AuthenticationException("stork.23", new Object[] { moasession.getCcc(), sessionID }); } diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java index 08da21460..84570141e 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java @@ -31,7 +31,7 @@ import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.process.api.ExecutionContext; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -288,7 +288,7 @@ public class PepsConnectorHandleResponseWithoutSignatureTask extends AbstractPep // set return url to PEPSConnectorWithLocalSigningServlet and add newMOASessionID // signRequest - String issuerValue = AuthConfigurationProvider.getInstance().getPublicURLPrefix(); + String issuerValue = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); String acsURL = issuerValue + PEPSConnectorWithLocalSigningServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN; @@ -297,7 +297,7 @@ public class PepsConnectorHandleResponseWithoutSignatureTask extends AbstractPep boolean found = false; try { - List aps = AuthConfigurationProvider.getInstance() + List aps = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()).getStorkAPs(); Logger.info("Found AttributeProviderPlugins:" + aps.size()); for (AttributeProviderPlugin ap : aps) { diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java index 81c7c3a7b..748b7df5d 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java @@ -47,7 +47,8 @@ import at.gv.egovernment.moa.id.auth.servlet.PEPSConnectorServlet; import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; -import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; +import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; +import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.process.api.ExecutionContext; @@ -245,7 +246,7 @@ public class PepsConnectorTask extends AbstractAuthServletTask { throw new MOAIDException("stork.07", null); } - OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()); + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()); if (oaParam == null) throw new AuthenticationException("auth.00", new Object[] { moaSession.getPublicOAURLPrefix() }); @@ -455,6 +456,7 @@ public class PepsConnectorTask extends AbstractAuthServletTask { IdentityLink identityLink = null; executionContext.put("identityLinkAvailable", false); try { + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); if(config.isStorkFakeIdLActive() && config.getStorkFakeIdLCountries().contains(storkAuthnRequest.getCitizenCountryCode())) { // create fake IdL // - fetch IdL template from resources @@ -734,7 +736,7 @@ public class PepsConnectorTask extends AbstractAuthServletTask { private String getdtlUrl() { String dtlUrl; try { - AuthConfigurationProvider authConfigurationProvider = AuthConfigurationProvider.getInstance(); + AuthConfiguration authConfigurationProvider = AuthConfigurationProviderFactory.getInstance(); dtlUrl = authConfigurationProvider.getDocumentServiceUrl(); Logger.info ("PEPSConnectorServlet, using dtlUrl:"+dtlUrl); -- cgit v1.2.3 From ae11753fc0165ee3e724af6f7c3c3cdf2faab1f0 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jun 2015 11:00:12 +0200 Subject: remove MOA-ID-Proxy project (MOA-ID >= 3.x is not supported any more) --- .../moa/id/config/proxy/OAConfiguration.java | 219 ----- .../moa/id/config/proxy/OAProxyParameter.java | 248 ----- .../id/config/proxy/ProxyConfigurationBuilder.java | 290 ------ .../config/proxy/ProxyConfigurationProvider.java | 260 ----- .../moa/id/proxy/ConnectionBuilder.java | 110 --- .../moa/id/proxy/ConnectionBuilderFactory.java | 114 --- .../moa/id/proxy/DefaultConnectionBuilder.java | 229 ----- .../id/proxy/DefaultLoginParameterResolver.java | 187 ---- .../moa/id/proxy/ElakConnectionBuilder.java | 303 ------ .../moa/id/proxy/EnhancedConnectionBuilder.java | 266 ------ .../moa/id/proxy/LoginParameterResolver.java | 133 --- .../id/proxy/LoginParameterResolverException.java | 88 -- .../id/proxy/LoginParameterResolverFactory.java | 128 --- .../moa/id/proxy/MOAIDProxyInitializer.java | 141 --- .../moa/id/proxy/NotAllowedException.java | 90 -- .../XMLLoginParameterResolverEncryptedData.java | 727 -------------- .../proxy/XMLLoginParameterResolverPlainData.java | 472 --------- .../moa/id/proxy/builder/SAMLRequestBuilder.java | 101 -- .../proxy/invoke/GetAuthenticationDataInvoker.java | 206 ---- .../parser/AuthenticationDataAssertionParser.java | 210 ---- .../moa/id/proxy/parser/SAMLResponseParser.java | 147 --- .../moa/id/proxy/servlet/ConfigurationServlet.java | 122 --- .../moa/id/proxy/servlet/ProxyException.java | 86 -- .../moa/id/proxy/servlet/ProxyServlet.java | 1008 -------------------- id/server/pom.xml | 2 +- 25 files changed, 1 insertion(+), 5886 deletions(-) delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolver.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java delete mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java deleted file mode 100644 index e077e096f..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAConfiguration.java +++ /dev/null @@ -1,219 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.config.proxy; - -import java.util.HashMap; -import java.util.Map; - -/** - * Holds configuration data concerning an online application for use by the MOA-ID Proxy component. - * These include the login type (stateful or stateless), the HTTP authentication type, - * and information needed to add authentication parameters or headers for a URL connection - * to the remote online application. - * @see MOAIDConfiguration-1.1.xsd, element Configuration - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class OAConfiguration { - - /** Constant for an login method */ - public static final String LOGINTYPE_STATEFUL = "stateful"; - /** Constant for an login method */ - public static final String LOGINTYPE_STATELESS = "stateless"; - - /** Constant for an auth method */ - public static final String BASIC_AUTH = "basic"; - /** Constant for an auth method */ - public static final String HEADER_AUTH = "header"; - /** Constant for an auth method */ - public static final String PARAM_AUTH = "param"; - - - /** Constant for binding */ - public static final String BINDUNG_USERNAME = "userName"; - /** Constant for binding */ - public static final String BINDUNG_FULL = "full"; - /** Constant for binding */ - public static final String BINDUNG_NONE = "none"; - /** Constant for binding */ - public static final String BINDUNG_NOMATCH = "noMatch"; - - /** login type: stateful or stateless */ - String loginType; - /** authentication type: basic, header, or param */ - String authType; - /** - * mapping of parameter names to AuthenticationData field names - * in case of authentication type "header-auth" - */ - Map paramAuthMapping; - /** - * mapping of parameter names to AuthenticationData field names - * in case of authentication type "param-auth" - */ - Map headerAuthMapping; - /** mapping for user ID to be used in case of authentication type "basic-auth" */ - String basicAuthUserIDMapping; - /** mapping for password to be used in case of authentication type "basic-auth" */ - String basicAuthPasswordMapping; - /** Binding for basic authentication */ - String binding; - - /** - * Returns the basicAuthPasswordMapping. - * @return String - */ - public String getBasicAuthPasswordMapping() { - return basicAuthPasswordMapping; - } - - /** - * Returns the basicAuthUserIDMapping. - * @return String - */ - public String getBasicAuthUserIDMapping() { - return basicAuthUserIDMapping; - } - - /** - * Returns the headerAuthMapping. - * @return HashMap - */ - public Map getHeaderAuthMapping() { - return headerAuthMapping; - } - - /** - * Returns the loginType. - * @return String - */ - public String getLoginType() { - return loginType; - } - - /** - * Returns the paramAuthMapping. - * @return HashMap - */ - public Map getParamAuthMapping() { - return paramAuthMapping; - } - - /** - * Returns the binding. - * @return String - */ - public String getBinding() { - return binding; - } - - /** - * Sets the basicAuthPasswordMapping. - * @param basicAuthPassword The basicAuthPasswordMapping to set - */ - public void setBasicAuthPasswordMapping(String basicAuthPassword) { - this.basicAuthPasswordMapping = basicAuthPassword; - } - - /** - * Sets the basicAuthUserIDMapping. - * @param basicAuthUserID The basicAuthUserIDMapping to set - */ - public void setBasicAuthUserIDMapping(String basicAuthUserID) { - this.basicAuthUserIDMapping = basicAuthUserID; - } - - /** - * Sets the headerAuthMapping. - * @param headerAuth The headerAuthMapping to set - */ - public void setHeaderAuthMapping(HashMap headerAuth) { - this.headerAuthMapping = headerAuth; - } - - /** - * Sets the loginType. - * @param loginType The loginType to set - */ - public void setLoginType(String loginType) { - this.loginType = loginType; - } - - /** - * Sets the paramAuthMapping. - * @param paramAuth The paramAuthMapping to set - */ - public void setParamAuthMapping(HashMap paramAuth) { - this.paramAuthMapping = paramAuth; - } - - /** - * Returns the authType. - * @return String - */ - public String getAuthType() { - return authType; - } - - /** - * Sets the authType. - * @param authLoginType The authType to set - */ - public void setAuthType(String authLoginType) { - this.authType = authLoginType; - } - - /** - * Sets the binding. - * @param binding The binding to be set. - */ - public void setBinding (String binding) { - this.binding = binding; - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java deleted file mode 100644 index 00ca5ad57..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/OAProxyParameter.java +++ /dev/null @@ -1,248 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.config.proxy; - -import at.gv.egovernment.moa.id.config.legacy.ConnectionParameter; -import at.gv.egovernment.moa.id.config.legacy.OAParameter; - -/** - * Configuration parameters belonging to an online application, - * to use with the MOA ID Proxy component. - * - * @author Stefan Knirsch - * @version $Id$ - */ -public class OAProxyParameter extends OAParameter { - -// /** -// * public URL prefix of the online application -// */ -// private String publicURLPrefix; - /** - * URL of online application configuration file; - * defaults to relative URL /moaconfig.xml - */ - private String configFileURL; - /** - * implementation of {@link at.gv.egovernment.moa.id.proxy.LoginParameterResolver} interface - * to be used for authenticating the online application; - * defaults to {@link at.gv.egovernment.moa.id.proxy.DefaultLoginParameterResolver} - */ - private String loginParameterResolverImpl; - - /** - * Configuration Parameter of LoginParameterResolver - */ - private String loginParameterResolverConfiguration; - - /** - * implementation of {@link at.gv.egovernment.moa.id.proxy.ConnectionBuilder} interface - * to be used for connecting to the online application; - * defaults to {@link at.gv.egovernment.moa.id.proxy.DefaultConnectionBuilder} - */ - private String connectionBuilderImpl; - /** - * session time out to be used in case of a stateless online application - */ - private int sessionTimeOut; - /** - * parameters regarding the connection from the proxy to the online application - */ - private ConnectionParameter connectionParameter; - /** - * parameters for logging into the online application - */ - private OAConfiguration oaConfiguration; - - private String errorRedirctURL; - - - /** - * Returns the configFileURL. - * @return String - */ - public String getConfigFileURL() { - return configFileURL; - } - - /** - * Returns the sessionTimeOut. - * @return int - */ - public int getSessionTimeOut() { - return sessionTimeOut; - } - - /** - * Returns the connectionParameter. - * @return ConnectionParameter - */ - public ConnectionParameter getConnectionParameter() { - return connectionParameter; - } - - /** - * Sets the configFileURL for the proxy. - * @param oaProxyConfigFileURL The configFileURL to set - */ - public void setConfigFileURL(String oaProxyConfigFileURL) { - this.configFileURL = oaProxyConfigFileURL; - } - - /** - * Sets the sessionTimeOut for the proxy. - * @param oaProxySessionTimeOut The sessionTimeOut to set - */ - public void setSessionTimeOut(int oaProxySessionTimeOut) { - this.sessionTimeOut = oaProxySessionTimeOut; - } - - /** - * Sets the connectionParameter for the proxy. - * @param proxyConnectionParameter The connectionParameter to set - */ - public void setConnectionParameter(ConnectionParameter proxyConnectionParameter) { - this.connectionParameter = proxyConnectionParameter; - } - -// /** -// * Returns the publicURLPrefix. -// * @return String -// */ -// public String getPublicURLPrefix() { -// return publicURLPrefix; -// } -// -// /** -// * Sets the publicURLPrefix. -// * @param publicURLPrefix The publicURLPrefix to set -// */ -// public void setPublicURLPrefix(String url) { -// this.publicURLPrefix = url; -// } - - /** - * Returns the connectionBuilderImpl. - * @return String - */ - public String getConnectionBuilderImpl() { - return connectionBuilderImpl; - } - - /** - * Returns the loginParameterResolverImpl. - * @return String - */ - public String getLoginParameterResolverImpl() { - return loginParameterResolverImpl; - } - - /** - * Returns the loginParameterResolverConfiguration. - * @return String - */ - public String getLoginParameterResolverConfiguration() { - return loginParameterResolverConfiguration; - } - - /** - * Sets the connectionBuilderImpl for the proxy. - * @param connectionBuilderImpl The connectionBuilderImpl to set - */ - public void setConnectionBuilderImpl(String connectionBuilderImpl) { - this.connectionBuilderImpl = connectionBuilderImpl; - } - - /** - * Sets the loginParameterResolverImpl for the proxy. - * @param loginParameterResolverImpl The loginParameterResolverImpl to set - */ - public void setLoginParameterResolverImpl(String loginParameterResolverImpl) { - this.loginParameterResolverImpl = loginParameterResolverImpl; - } - - /** - * Sets the loginParameterResolverConfiguration for the proxy. - * @param loginParameterResolverConfiguration The loginParameterResolverImpl to set - */ - public void setLoginParameterResolverConfiguration(String loginParameterResolverConfiguration) { - this.loginParameterResolverConfiguration = loginParameterResolverConfiguration; - } - - /** - * Returns the oaConfiguration. - * @return OAConfiguration - */ - public OAConfiguration getOaConfiguration() { - return oaConfiguration; - } - - /** - * Sets the oaConfiguration. - * @param oaConfiguration The oaConfiguration to set - */ - public void setOaConfiguration(OAConfiguration oaConfiguration) { - this.oaConfiguration = oaConfiguration; - } - -/** - * @return the errorRedirctURL - */ -public String getErrorRedirctURL() { - return errorRedirctURL; -} - -/** - * @param errorRedirctURL the errorRedirctURL to set - */ -public void setErrorRedirctURL(String errorRedirctURL) { - this.errorRedirctURL = errorRedirctURL; -} - - - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java deleted file mode 100644 index 3220dc90c..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationBuilder.java +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.config.proxy; - -import java.io.ByteArrayInputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.w3c.dom.traversal.NodeIterator; - -import at.gv.egovernment.moa.id.config.legacy.ConfigurationBuilder; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.legacy.ConnectionParameter; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Builds the configuration for MOA-ID Proxy. - */ -public class ProxyConfigurationBuilder extends ConfigurationBuilder { - - /** - * Default online application configuration file name - * (used when /OnlineApplication/ProxyComponent@configFileURL is null). - */ - public static final String DEFAULT_OA_CONFIG_FILENAME = "MOAConfig.xml"; - - /** an XPATH-Expression */ - private static final String PROXY_AUTH_XPATH = - ROOT + CONF + "ProxyComponent/" + CONF + "AuthComponent"; - /** an XPATH-Expression */ - protected static final String ROOTOA = "/" + CONF + "Configuration/"; - /** an XPATH-Expression */ - private static final String OA_PROXY_COMPONENT_XPATH = CONF + "ProxyComponent"; - /** an XPATH-Expression */ - private static final String OA_PROXY_COMPONENT_ABSOLUTE_XPATH = ROOT + CONF + "OnlineApplication/" + CONF + "ProxyComponent"; - /** an XPATH-Expression */ - private static final String OA_PROXY_URL_XPATH = CONF + "ProxyComponent/@configFileURL"; - /** an XPATH-Expression */ - private static final String OA_PROXY_SESSION_TIMEOUT_XPATH = CONF + "ProxyComponent/@sessionTimeOut"; - /** an XPATH-Expression */ - private static final String OA_PROXY_LOGIN_PARA_XPATH = CONF + "ProxyComponent/@loginParameterResolverImpl"; - /** an XPATH-Expression */ - private static final String OA_PROXY_LOGIN_PARA_CONF_XPATH = CONF + "ProxyComponent/@loginParameterResolverConfiguration"; - - private static final String OA_PROXY_CONNECTION_BUILDER_XPATH = CONF + "ProxyComponent/@connectionBuilderImpl"; - /** an XPATH-Expression */ - private static final String OA_PROXY_ERROR_REDIRECT_URL_XPATH = CONF + "ProxyComponent/@errorRedirectURL"; - /** an XPATH-Expression */ - protected static final String OACONF_LOGIN_TYPE_XPATH = - ROOTOA + CONF + "LoginType"; - /** an XPATH-Expression */ - protected static final String OACONF_BINDING_TYPE_XPATH = - ROOTOA + CONF + "Binding"; - /** an XPATH-Expression */ - protected static final String OACONF_PARAM_AUTH_PARAMETER_XPATH = - ROOTOA + CONF + "ParamAuth/" + CONF + "Parameter"; - /** an XPATH-Expression */ - protected static final String OACONF_USER_ID_XPATH = - ROOTOA + CONF + "BasicAuth/" + CONF + "UserID"; - /** an XPATH-Expression */ - protected static final String OACONF_PASSWORD_XPATH = - ROOTOA + CONF + "BasicAuth/" + CONF + "Password"; - /** an XPATH-Expression */ - protected static final String OACONF_HEADER_AUTH_HEADER_XPATH = - ROOTOA + CONF + "HeaderAuth/" + CONF + "Header"; - - /** - * Creates a new MOAConfigurationProvider. - * - * @param configElem The root element of the MOA-ID configuration. - */ - public ProxyConfigurationBuilder(Element configElem, String rootConfigDir) { - super(configElem, rootConfigDir); - } - - /** - * Method buildOAConfiguration. - * - * Build an {@link OAConfiguration} Object from the given configuration DOM element - * - * @param root - * @return OAConfiguration - * @throws ConfigurationException - */ - public OAConfiguration buildOAConfiguration(Element root) throws ConfigurationException{ - - OAConfiguration oaConfiguration = new OAConfiguration(); - - //The LoginType hast to be "stateless" or "stateful" to be valid - - oaConfiguration.setLoginType( - XPathUtils.getElementValue(root, OACONF_LOGIN_TYPE_XPATH, null)); - - oaConfiguration.setBinding( - XPathUtils.getElementValue(root, OACONF_BINDING_TYPE_XPATH, OAConfiguration.BINDUNG_FULL)); - - //Try to build the Parameter Auth Parameters - NodeIterator paramAuthIter = - XPathUtils.selectNodeIterator( - root, - OACONF_PARAM_AUTH_PARAMETER_XPATH); - Element paramAuthElem; - HashMap paramAuthMap = new HashMap(); - while ((paramAuthElem = (Element) paramAuthIter.nextNode()) != null) { - String name = XPathUtils.getAttributeValue(paramAuthElem, "@Name", null); - String value = XPathUtils.getAttributeValue(paramAuthElem, "@Value", null); - if (paramAuthMap.containsKey(name)) - throw new ConfigurationException("config.06", new Object[]{"Doppelter Wert für Parameter per HeaderAuthentication"}); - paramAuthMap.put(name, value); - } - oaConfiguration.setParamAuthMapping(paramAuthMap); - // Try to build the BasicAuthParameters - oaConfiguration.setBasicAuthUserIDMapping( - XPathUtils.getElementValue(root, OACONF_USER_ID_XPATH, null)); - oaConfiguration.setBasicAuthPasswordMapping( - XPathUtils.getElementValue(root, OACONF_PASSWORD_XPATH, null)); - - //Try to build the Parameter Auth Parameters - NodeIterator headerAuthIter = XPathUtils.selectNodeIterator(root,OACONF_HEADER_AUTH_HEADER_XPATH); - - Element headerAuthElem; - HashMap headerAuthMap = new HashMap(); - while ((headerAuthElem = (Element) headerAuthIter.nextNode()) != null) { - String name = - XPathUtils.getAttributeValue(headerAuthElem, "@Name", null); - String value = - XPathUtils.getAttributeValue(headerAuthElem, "@Value", null); - // Contains Key (Neue Config-Exception: doppelte werte) - if (headerAuthMap.containsKey(name)) - throw new ConfigurationException("config.06", new Object[]{"Doppelter Wert für Parameter per HeaderAuthentication"}); - headerAuthMap.put(name, value); - } - oaConfiguration.setHeaderAuthMapping(headerAuthMap); - - if (paramAuthMap.size() == 0) { - if (oaConfiguration.getBasicAuthUserIDMapping() == null) { - oaConfiguration.setAuthType(OAConfiguration.HEADER_AUTH); - } - else - oaConfiguration.setAuthType(OAConfiguration.BASIC_AUTH); - } - else - oaConfiguration.setAuthType(OAConfiguration.PARAM_AUTH); - - return oaConfiguration; - } - - - /** - * Build an array of OnlineApplication Parameter Beans containing information - * about the proxy component - * @return An OAProxyParameter array containing beans - * with all relevant information for the proxy component of the online - * application - */ - public OAProxyParameter[] buildOnlineApplicationProxyParameters() throws ConfigurationException{ - - List oA_list = new ArrayList(); - NodeList OAIter = XPathUtils.selectNodeList(configElem_, OA_XPATH); - - for (int i = 0; i < OAIter.getLength(); i++) { - Element oAElem = (Element) OAIter.item(i); - - Element proxyComponentElem = (Element) XPathUtils.selectSingleNode(oAElem,OA_PROXY_COMPONENT_XPATH); - if (proxyComponentElem != null) { - OAProxyParameter oap = new OAProxyParameter(); - - oap.setPublicURLPrefix(oAElem.getAttribute("publicURLPrefix")); - oap.setOaType(oAElem.getAttribute("type")); - oap.setConfigFileURL(XPathUtils.getAttributeValue(oAElem, OA_PROXY_URL_XPATH, null)); - oap.setConfigFileURL(FileUtils.makeAbsoluteURL(oap.getConfigFileURL(), rootConfigFileDir_)); - // default session time out: 3600 sec = 1 h - oap.setSessionTimeOut(new Integer(XPathUtils.getAttributeValue(oAElem,OA_PROXY_SESSION_TIMEOUT_XPATH,"3600")).intValue()); - oap.setLoginParameterResolverImpl(XPathUtils.getAttributeValue(oAElem, OA_PROXY_LOGIN_PARA_XPATH, null)); - oap.setLoginParameterResolverConfiguration(XPathUtils.getAttributeValue(oAElem, OA_PROXY_LOGIN_PARA_CONF_XPATH, null)); - oap.setLoginParameterResolverConfiguration(FileUtils.makeAbsoluteURL(oap.getLoginParameterResolverConfiguration(), rootConfigFileDir_)); - oap.setConnectionBuilderImpl(XPathUtils.getAttributeValue(oAElem,OA_PROXY_CONNECTION_BUILDER_XPATH, null)); - oap.setErrorRedirctURL(XPathUtils.getAttributeValue(oAElem,OA_PROXY_ERROR_REDIRECT_URL_XPATH, null)); - - ConnectionParameter conPara = buildConnectionParameter(proxyComponentElem); - oap.setConnectionParameter(conPara); - - OAConfiguration oaConf = buildOAConfiguration(getOAConfigElement(oap)); - oap.setOaConfiguration(oaConf); - - oA_list.add(oap); - } - } - OAProxyParameter[] result = - new OAProxyParameter[oA_list.size()]; - oA_list.toArray(result); - - return result; - - } - - /** - * Reads the configuration file of the online application, and creates a DOM tree from it. - * If /OnlineApplication/ProxyComponent@configFileURL is not given, - * uses default configuration file location. - * - * @param oap configuration data of online application, meant for use by MOA-ID-PROXY - * @return Element DOM tree root element - * @throws ConfigurationException on any exception thrown - */ - private Element getOAConfigElement(OAProxyParameter oap) throws ConfigurationException - { - try { - String configFileURL = oap.getConfigFileURL(); - if (configFileURL == null) { - // use default config file URL, when config file URL is not given - configFileURL = oap.getConnectionParameter().getUrl(); - if (configFileURL.charAt(configFileURL.length() - 1) != '/') - configFileURL += "/"; - configFileURL += DEFAULT_OA_CONFIG_FILENAME; - } - Logger.info("Loading MOA-OA configuration " + configFileURL); - Element configElem = DOMUtils.parseXmlValidating( - new ByteArrayInputStream(FileUtils.readURL(configFileURL))); - return configElem; - } - catch (Throwable t) { - throw new ConfigurationException("config.03", new Object[] {"OAConfiguration"} , t); - } - } - - /** - * Build a bean containing all information about the ProxyComponent - * @return The ConnectionParameter for the Proxy Component - */ - public ConnectionParameter buildAuthComponentConnectionParameter() - { - - Element connectionParameter = (Element) XPathUtils.selectSingleNode(configElem_, PROXY_AUTH_XPATH); - if (connectionParameter==null) return null; - return buildConnectionParameter(connectionParameter); - - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java deleted file mode 100644 index 66d330d20..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java +++ /dev/null @@ -1,260 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.config.proxy; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.MalformedURLException; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.legacy.ConnectionParameter; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; - -/** - * A class providing access to the Proxy Part of the MOA-ID configuration data. - * - *

Configuration data is read from an XML file, whose location is given by - * the moa.id.configuration system property.

- *

This class implements the Singleton pattern. The reload() - * method can be used to update the configuration data. Therefore, it is not - * guaranteed that consecutive calls to getInstance() will return - * the same ProxyConfigurationProvider all the time. During the - * processing of a web service request, the current - * TransactionContext should be used to obtain the - * ProxyConfigurationProvider local to that request.

- * - * @author Stefan Knirsch - */ -public class ProxyConfigurationProvider extends ConfigurationProvider { - - /** Singleton instance. null, if none has been created. */ - private static ProxyConfigurationProvider instance; - - - // - // configuration data - // - /** - * connection parameters for connection to MOA ID Auth component - */ - private ConnectionParameter authComponentConnectionParameter; - /** - * configuration parameters for online applications - */ - private OAProxyParameter[] onlineApplicationProxyParameter; - - /** - * Return the single instance of configuration data. - * - * @return ProxyConfigurationProvider The current configuration data. - * @throws ConfigurationException - */ - public static synchronized ProxyConfigurationProvider getInstance() - throws ConfigurationException { - - if (instance == null) { - reload(); - } - return instance; - } - - /** - * Reload the configuration data and set it if successful. - * - * @return ProxyConfigurationProvider The loaded configuration data. - * @throws ConfigurationException Failure to load the configuration data. - */ - public static synchronized ProxyConfigurationProvider reload() - throws ConfigurationException { - String fileName = System.getProperty(PROXY_CONFIG_PROPERTY_NAME); - if (fileName == null) { - throw new ConfigurationException("config.20", null); - } - Logger.info("Loading MOA-ID-PROXY configuration " + fileName); - - instance = new ProxyConfigurationProvider(fileName); - return instance; - } - - /** - * Constructor for ProxyConfigurationProvider. - */ - public ProxyConfigurationProvider(String fileName) - throws ConfigurationException { - - load(fileName); - } - - /** - * Load the configuration data from XML file with the given name and build - * the internal data structures representing the MOA configuration. - * - * @param fileName The name of the XML file to load. - * @throws ConfigurationException The MOA configuration could not be - * read/built. - */ - private void load(String fileName) throws ConfigurationException { - FileInputStream stream = null; - Element configElem; - ProxyConfigurationBuilder builder; - - try { - // load the main config file - stream = new FileInputStream(fileName); - configElem = DOMUtils.parseXmlValidating(stream); - } - catch (Throwable t) { - throw new ConfigurationException("config.03", null, t); - } - finally { - try { - if (stream != null) { - stream.close(); - } - } - catch (IOException e) { - } - } - try { - // determine the directory of the root config file - rootConfigFileDir = new File(fileName).getParent(); - try { - rootConfigFileDir = new File(rootConfigFileDir).toURL().toString(); - } catch (MalformedURLException t) { - throw new ConfigurationException("config.03", null, t); - } - - // build the internal datastructures - builder = new ProxyConfigurationBuilder(configElem, rootConfigFileDir); - authComponentConnectionParameter = builder.buildAuthComponentConnectionParameter(); - - onlineApplicationProxyParameter = builder.buildOnlineApplicationProxyParameters(); - for(int i = 0; i < onlineApplicationProxyParameter.length; i++) { - onlineApplicationProxyParameter[i].setConfigFileURL(FileUtils.makeAbsoluteURL(onlineApplicationProxyParameter[i].getConfigFileURL(), rootConfigFileDir)); - } - - genericConfiguration = builder.buildGenericConfiguration(); - defaultChainingMode = builder.getDefaultChainingMode(); - chainingModes = builder.buildChainingModes(); - trustedCACertificates = builder.getTrustedCACertificates(); - trustedCACertificates = FileUtils.makeAbsoluteURL(trustedCACertificates, rootConfigFileDir); - - } - catch (Throwable t) { - throw new ConfigurationException("config.02", null, t); - } - } - - public String getTrustedCACertificates() { - - return trustedCACertificates; - } - - /** - * @return the certstoreDirectory - */ - public String getCertstoreDirectory() { - if (genericConfiguration.containsKey(ConfigurationProvider.DIRECTORY_CERTSTORE_PARAMETER_PROPERTY)) - return (String)genericConfiguration.get(ConfigurationProvider.DIRECTORY_CERTSTORE_PARAMETER_PROPERTY); - else - return null; - } - - /** - * @return the trustmanagerrevoationchecking - */ - public boolean isTrustmanagerrevoationchecking() { - if (genericConfiguration.containsKey(ConfigurationProvider.TRUST_MANAGER_REVOCATION_CHECKING)) - return Boolean.valueOf((String)genericConfiguration.get(ConfigurationProvider.TRUST_MANAGER_REVOCATION_CHECKING)); - else - return true; - } - - - /** - * Return a bean containing all information about the ProxyComponent - * @return The ConnectionParameter for the Proxy Component - */ - public ConnectionParameter getAuthComponentConnectionParameter() { - return authComponentConnectionParameter; - } - - /** - * Build an array of OnlineApplication Parameter Beans containing all - * information about the proxy component of the online application - * @return An OAProxyParameter array containing beans - * with all relevant information for the proxy component of the online - * application - */ - public OAProxyParameter[] getOnlineApplicationParameters() { - return onlineApplicationProxyParameter; - } - /** - * Provides configuration information regarding the online application behind - * the given URL, relevant to the MOA-ID Proxy component. - * - * @param oaURL URL requested for an online application - * @return an OAProxyParameter, or null - * if none is applicable - */ - public OAProxyParameter getOnlineApplicationParameter(String oaURL) { - OAProxyParameter[] oaParams = getOnlineApplicationParameters(); - for (int i = 0; i < oaParams.length; i++) { - OAProxyParameter oaParam = oaParams[i]; - if (oaURL.startsWith(oaParam.getPublicURLPrefix())) - return oaParam; - } - return null; - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java deleted file mode 100644 index 708eb3f2c..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.net.HttpURLConnection; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -/** - * Builder for {@link java.net.URLConnection} objects used to forward requests - * to the remote online application. - * - * @author Paul Ivancsics - * @version $Id$ - */ - -public interface ConnectionBuilder { - - /** - * Builds an HttpURLConnection to a {@link java.net.URL} which is derived - * from an {@link HttpServletRequest} URL, by substitution of a - * public URL prefix for the real URL prefix.
- * The HttpURLConnection has been created by {@link java.net.URL#openConnection}, but - * it has not yet been connected to by {@link java.net.URLConnection#connect}.
- * The field settings of the HttpURLConnection are: - *
    - *
  • allowUserInteraction = false
  • - *
  • doInput = true
  • - *
  • doOutput = true
  • - *
  • requestMethod = request.getMethod()
  • - *
  • useCaches = false
  • - *
- * - * @param request the incoming request which shall be forwarded - * @param publicURLPrefix the public URL prefix to be substituted by the real URL prefix - * @param realURLPrefix the URL prefix to substitute the public URL prefix - * @param sslSocketFactory factory to be used for creating an SSL socket in case - * of a URL for scheme "https:"; - *
if null, the default SSL socket factory would be used - * @param parameters parameters to be forwarded - * @return a URLConnection created by {@link java.net.URL#openConnection}, connecting to - * the requested URL with publicURLPrefix substituted by realURLPrefix - * @throws IOException if an I/O exception occurs during opening the connection - * @see java.net.URL#openConnection() - * @see com.sun.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory() - */ - public HttpURLConnection buildConnection( - HttpServletRequest request, - String publicURLPrefix, - String realURLPrefix, - SSLSocketFactory sslSocketFactory, - Vector parameters) throws IOException; - - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param con the HttpURLConnection which is normaly to be closed - */ - public void disconnect(HttpURLConnection con); -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java deleted file mode 100644 index 6a268b061..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ConnectionBuilderFactory.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; - -/** - * Factory delivering a {@link ConnectionBuilder} implementation for - * an online application, initialized from configuration data. - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConnectionBuilderFactory { - - /** default connection builder to be used for online application - * where no special implementation of the ConnectionBuilder - * interface is configured - */ - private static ConnectionBuilder defaultConnectionBuilder; - /** mapping from online application public URL prefix to an implementation - * of the ConnectionBuilder interface to be used; - * if no mapping is given for an online application, the - * DefaultConnectionBuilder will be used */ - private static Map connectionBuilderMap; - - /** - * Initializes the ConnectionBuilder map from the configuration data. - * @throws ConfigurationException when the configuration cannot be read, - * or when a class name configured cannot be instantiated - */ - public static void initialize() throws ConfigurationException { - defaultConnectionBuilder = new DefaultConnectionBuilder(); - connectionBuilderMap = new HashMap(); - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - for (int i = 0; i < proxyConf.getOnlineApplicationParameters().length; i++) { - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameters()[i]; - String publicURLPrefix = oaParam.getPublicURLPrefix(); - String className = oaParam.getConnectionBuilderImpl(); - if (className != null) { - try { - ConnectionBuilder cb = (ConnectionBuilder)Class.forName(className).newInstance(); - connectionBuilderMap.put(publicURLPrefix, cb); - } - catch (Throwable ex) { - throw new ConfigurationException("config.07", new Object[] {publicURLPrefix}, ex); - } - } - } - } - - /** - * Gets the ConnectionBuilder implementation to be used for the given - * online application. - * @param publicURLPrefix public URL prefix of the online application - * @return ConnectionBuilder implementation - */ - public static ConnectionBuilder getConnectionBuilder(String publicURLPrefix) { - ConnectionBuilder cb = (ConnectionBuilder) connectionBuilderMap.get(publicURLPrefix); - if (cb == null) - return defaultConnectionBuilder; - else - return cb; - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java deleted file mode 100644 index 59ef64357..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultConnectionBuilder.java +++ /dev/null @@ -1,229 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Iterator; -import java.util.Vector; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.URLEncoder; - - - -/** - * Defaultimplementierung von ConnectionBuilder. - * @author Paul Ivancsics - * @version $Id$ - */ -public class DefaultConnectionBuilder implements ConnectionBuilder { - - /** a boolean to disable the HostnameVerification (default = false)*/ - private static boolean cbDisableHostnameVerification = false; - - /** - * Constructor for DefaultConnectionBuilder. - * @throws ConfigurationException on any config error - */ - public DefaultConnectionBuilder() throws ConfigurationException { - //INFO: removed from MOA-ID 2.0 config - cbDisableHostnameVerification = false; -// cbDisableHostnameVerification = BoolUtils.valueOf( -// ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( -// "ProxyComponent.DisableHostnameVerification")); - //TODO MOA-ID BRZ undocumented feature - if (cbDisableHostnameVerification) - Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); - } - - /** - * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection - */ - public HttpURLConnection buildConnection( - HttpServletRequest req, - String publicURLPrefix, - String realURLPrefix, - SSLSocketFactory sslSocketFactory, - Vector parameters) - throws IOException { - - // Bug [#540] - //String requestedURL = req.getRequestURL().toString(); - String requestedURL = escapeUrl(req.getRequestURL().toString()); - - // check whether requested URL starts with publicURLPrefix - - //Temporary allow http:// urls instead of the https:// in publicURLPrefix - //if (req.getSession().getAttribute("authorizationkey")==null) { - // if (! requestedURL.startsWith(publicURLPrefix)) - // throw new IOException(MOAIDMessageProvider.getInstance().getMessage( - // "proxy.01", new Object[] {requestedURL, publicURLPrefix})); - //} - - // in case of GET request, append query string to requested URL; - // otherwise, HttpURLConnection would perform a POST request - if ("get".equalsIgnoreCase(req.getMethod()) && ! parameters.isEmpty()) { - requestedURL = appendQueryString(requestedURL, parameters); - } - // build real URL in online application - String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); - URL url = new URL(realURLString); - Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); - - HttpURLConnection conn = (HttpURLConnection)url.openConnection(); - conn.setRequestMethod(req.getMethod()); - conn.setDoInput(true); - conn.setDoOutput(true); - //conn.setUseCaches(false); - //conn.setAllowUserInteraction(true); - conn.setInstanceFollowRedirects(false); - - // JSSE Abhängigkeit - if (conn instanceof HttpsURLConnection && sslSocketFactory != null) { - HttpsURLConnection httpsConn = (HttpsURLConnection) conn; - httpsConn.setSSLSocketFactory(sslSocketFactory); - if (cbDisableHostnameVerification) - httpsConn.setHostnameVerifier(new HostnameNonVerifier()); - } - - return conn; - } - - private static String escapeUrl(String unescapedUrlString) throws RuntimeException { - try { - URL unescapedUrl = new URL(unescapedUrlString); - String protocol = unescapedUrl.getProtocol(); - String fragment = unescapedUrl.getRef(); - String ssp = unescapedUrlString.substring(protocol.length() + 1, unescapedUrlString.length() - ((fragment == null) ? 0 : fragment.length() + 1)); - - URL url2 = new URI(protocol, ssp, fragment).toURL(); - return url2.toExternalForm(); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - } - - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param conn the HttpURLConnection which is normaly to be closed - */ - public void disconnect(HttpURLConnection conn) { - conn.disconnect(); - } - - - /** - * @param requestedURL - * @param parameters - * @return - */ - private String appendQueryString(String requestedURL, Vector parameters) { - String newURL = requestedURL; - String parameter[] = new String[2]; - String paramValue =""; - String paramName =""; - String paramString =""; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - try { - parameter = (String[]) iter.next(); - //next two lines work not with OWA-SSL-Login-form - paramName = URLEncoder.encode((String) parameter[0], "UTF-8"); - paramValue = URLEncoder.encode((String) parameter[1], "UTF-8"); - - } catch (UnsupportedEncodingException e) { - //UTF-8 should be supported - } - paramString = "&" + paramName + "=" + paramValue + paramString; - } - if (paramString.length()>0) newURL = newURL + "?" + paramString.substring(1); - return newURL; - } - - /** - * @author Stefan Knirsch - * @version $Id$ - * A private class to change the standard HostName verifier to disable the - * Hostname Verification Check - */ - - // JSSE Abhängigkeit - private class HostnameNonVerifier implements HostnameVerifier { - - public boolean verify(String hostname, SSLSession session) { - return true; - } - - /** - * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) - */ - /*public boolean verify(String arg0, String arg1) { - return true; - }*/ - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java deleted file mode 100644 index f094dfabf..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/DefaultLoginParameterResolver.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.URLEncoder; - -/** - * Implementation of interface LoginParameterResolver - * @author Paul Ivancsics - * @version $Id$ - */ -public class DefaultLoginParameterResolver implements LoginParameterResolver { - - - - /** - * Configuration mehtod (not used) - */ - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { - } - - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationHeaders(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationHeaders( - OAConfiguration oaConf, - SAML1AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) { - - Map result = new HashMap(); - - if (oaConf.getAuthType().equals(OAConfiguration.BASIC_AUTH)) { - String useridPredicate = oaConf.getBasicAuthUserIDMapping(); - String userid = resolveValue(useridPredicate, authData, clientIPAddress); - String passwordPredicate = oaConf.getBasicAuthPasswordMapping(); - String password = resolveValue(passwordPredicate, authData, clientIPAddress); - - try { - String userIDPassword = userid + ":" + password; - String credentials = Base64Utils.encode(userIDPassword.getBytes()); - result.put("Authorization", "Basic " + credentials); - } - catch (IOException ignore) { - } - } - else if (oaConf.getAuthType().equals(OAConfiguration.HEADER_AUTH)) { - for (Iterator iter = oaConf.getHeaderAuthMapping().keySet().iterator(); iter.hasNext();) { - String key = (String) iter.next(); - String predicate = (String) oaConf.getHeaderAuthMapping().get(key); - String resolvedValue = resolveValue(predicate, authData, clientIPAddress); - result.put(key, resolvedValue); - } - } - - return result; - } - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationParameters(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationParameters( - OAConfiguration oaConf, - SAML1AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) { - - Map result = new HashMap(); - - if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { - for (Iterator iter = oaConf.getParamAuthMapping().keySet().iterator(); iter.hasNext();) { - String key = (String) iter.next(); - String predicate = (String) oaConf.getParamAuthMapping().get(key); - String resolvedValue; - try { - resolvedValue = - URLEncoder.encode(resolveValue(predicate, authData, clientIPAddress), "ISO-8859-1"); - } catch (UnsupportedEncodingException e) { - //ISO-8859-1 is supported - resolvedValue = null; - } - result.put(key, resolvedValue); - } - } - - return result; - } - - /** - * Resolves a login header or parameter value. - * @param predicate header or parameter predicate name from online application configuration - * @param authData authentication data for current login - * @param clientIPAddress client IP address - * @return header or parameter value resolved; null if unknown name is given - */ - private static String resolveValue(String predicate, SAML1AuthenticationData authData, String clientIPAddress) { - if (predicate.equals(MOAGivenName)) - return authData.getGivenName(); - if (predicate.equals(MOAFamilyName)) - return authData.getFamilyName(); - if (predicate.equals(MOADateOfBirth)) - return authData.getFormatedDateOfBirth(); - if (predicate.equals(MOABPK)) - return authData.getBPK(); - - //AuthData holdes the correct BPK/WBPK - if (predicate.equals(MOAWBPK)) - return authData.getBPK(); - if (predicate.equals(MOAPublicAuthority)) - if (authData.isPublicAuthority()) - return "true"; - else - return "false"; - if (predicate.equals(MOABKZ)) - return authData.getPublicAuthorityCode(); - if (predicate.equals(MOAQualifiedCertificate)) - if (authData.isQualifiedCertificate()) - return "true"; - else - return "false"; - if (predicate.equals(MOAStammzahl)) - return authData.getIdentificationValue(); - if (predicate.equals(MOAIdentificationValueType)) - return authData.getIdentificationType(); - if (predicate.equals(MOAIPAddress)) - return clientIPAddress; - else return null; - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java deleted file mode 100644 index 4d5511ef8..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/ElakConnectionBuilder.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLStreamHandler; -import java.util.Iterator; -import java.util.StringTokenizer; -import java.util.Vector; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.URLEncoder; - -import com.ibm.webdav.protocol.http.WebDAVURLConnection; - - -/** - * Defaultimplementierung von ConnectionBuilder. - * @author Paul Ivancsics - * @version $Id$ - */ -public class ElakConnectionBuilder implements ConnectionBuilder { - - /** a boolean to disable the HostnameVerification (default = false)*/ - private static boolean cbDisableHostnameVerification = false; - - /** a boolean to indicat if webdav protocol handler was already set */ - private static boolean webdavPHSet = false; - - /** - * The system property name used to register a protocol handler. - */ - public final static String PROTOCOL_HANDLER_PROPERTY_NAME = "java.protocol.handler.pkgs"; - - /** - * The package providing the ldap protocol handler. - */ - public final static String WEBDAV_PROTOCOL_HANDLER = "com.ibm.webdav.protocol"; - - /** - * The pipe character used to sepearte different protocol handlers. - */ - public final static char PIPE_CHAR = '|'; - - - - - - /** - * Constructor for ElakConnectionBuilder. - * @throws ConfigurationException on any config error - */ - public ElakConnectionBuilder() throws ConfigurationException { - - //INFO: removed from MOA-ID 2.0 config - cbDisableHostnameVerification = false; -// cbDisableHostnameVerification = BoolUtils.valueOf( -// ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( -// "ProxyComponent.DisableHostnameVerification")); - //TODO MOA-ID BRZ undocumented feature - if (cbDisableHostnameVerification) - Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); - } - - /** - * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection - */ - public HttpURLConnection buildConnection( - HttpServletRequest req, - String publicURLPrefix, - String realURLPrefix, - SSLSocketFactory sslSocketFactory, - Vector parameters) - throws IOException { - - String requestedURL = req.getRequestURL().toString(); - // check whether requested URL starts with publicURLPrefix - if (! requestedURL.startsWith(publicURLPrefix)) - throw new IOException(MOAIDMessageProvider.getInstance().getMessage( - "proxy.01", new Object[] {requestedURL, publicURLPrefix})); - - - - // in case of GET request, append query string to requested URL; - // otherwise, HttpURLConnection would perform a POST request - //FIXME right parameters - /* - if ("get".equalsIgnoreCase(req.getMethod()) && ! parameters.isEmpty()) { - requestedURL = appendQueryString(requestedURL, parameters); - } - */ - //TODO RSCH check functionality - if (null != req.getQueryString() && 0 != req.getQueryString().length() ) { - String query = req.getQueryString(); - requestedURL = requestedURL + "?" + query; - - String parameter[] = new String[2]; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - parameter = (String[]) iter.next(); - - if(query.indexOf(parameter[0]) >= 0) iter.remove(); - } - } - - // build real URL in online application - String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); - - - Logger.info("Registering WebDAV protocol handler"); - String protocolHandlers = System.getProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME); - if (protocolHandlers == null) { - protocolHandlers = ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER; - System.setProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME, protocolHandlers); - } else { - // check, if WEBDAV protocol handler is already configured - boolean isConfigured = false; - StringTokenizer tokenizer = new StringTokenizer(protocolHandlers, "| "); - while (tokenizer.hasMoreTokens()) { - String protocolHandler = tokenizer.nextToken(); - if (protocolHandler.equals(ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER)) { - isConfigured = true; - break; - } - } - // if it has not been configured yet, configure it - if (!isConfigured) { - protocolHandlers = ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER + ElakConnectionBuilder.PIPE_CHAR + protocolHandlers; - System.setProperty(ElakConnectionBuilder.PROTOCOL_HANDLER_PROPERTY_NAME, protocolHandlers); - } - } - Logger.info("Registered protocol handlers: " + protocolHandlers); - Class webdavSH = null; - try - { - webdavSH = Class.forName(ElakConnectionBuilder.WEBDAV_PROTOCOL_HANDLER + ".http.Handler"); - } - catch (ClassNotFoundException e) - { - e.printStackTrace(); - } - URLStreamHandler urlStreamHandler = null; - try - { - urlStreamHandler = (URLStreamHandler) webdavSH.newInstance(); - } - catch (InstantiationException e1) - { - e1.printStackTrace(); - } - catch (IllegalAccessException e1) - { - e1.printStackTrace(); - } - //URL testURL = new URL("http", realURLString.substring("http://localhost:82".length()), 82, "", urlStreamHandler); - //WebDAVURLConnection webDavTest = (WebDAVURLConnection) testURL.openConnection(); - - - URL testURL = new URL(realURLString); - Logger.debug("TEST URL ist von der Klasse: " + testURL.getClass().getName()); - - //URL url = new URL(realURLString); - URL testURL2 = new URL(realURLString); - - URL url = new URL("http", "localhost", 82, realURLString.substring("http://localhost:82".length()), urlStreamHandler); - - Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); - WebDAVURLConnection webDavConn = (WebDAVURLConnection) url.openConnection(); - HttpURLConnection conn = (HttpURLConnection)webDavConn; - webDavConn.setRequestMethod(req.getMethod()); - webDavConn.setDoInput(true); - webDavConn.setDoOutput(true); - //conn.setUseCaches(false); - webDavConn.setAllowUserInteraction(true); - webDavConn.setInstanceFollowRedirects(false); - // JSSE Abhängigkeit - if (conn instanceof HttpsURLConnection && sslSocketFactory != null) { - HttpsURLConnection httpsConn = (HttpsURLConnection) conn; - httpsConn.setSSLSocketFactory(sslSocketFactory); - if (cbDisableHostnameVerification) - httpsConn.setHostnameVerifier(new HostnameNonVerifier()); - } - return conn; - } - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param conn the HttpURLConnection which is normaly to be closed - */ - public void disconnect(HttpURLConnection conn) { - conn.disconnect(); - } - - /** - * @param requestedURL - * @param parameters - * @return - */ - private String appendQueryString(String requestedURL, Vector parameters) { - String newURL = requestedURL; - String parameter[] = new String[2]; - String paramValue =""; - String paramName =""; - String paramString =""; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - try { - parameter = (String[]) iter.next(); - //Following two lines do not work with OWA-SSL-Login-form - paramName = URLEncoder.encode((String) parameter[0], "UTF-8"); - paramValue = URLEncoder.encode((String) parameter[1], "UTF-8"); - - } catch (UnsupportedEncodingException e) { - //UTF-8 should be supported - } - paramString = "&" + paramName + "=" + paramValue + paramString; - } - if (paramString.length()>0) newURL = newURL + "?" + paramString.substring(1); - return newURL; - } - - /** - * @author Stefan Knirsch - * @version $Id$ - * A private class to change the standard HostName verifier to disable the - * Hostname Verification Check - */ -//JSSE Abhängigkeit - private class HostnameNonVerifier implements HostnameVerifier { - - - public boolean verify(String hostname, SSLSession session) { - return true; - } - /** - * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) - */ -// public boolean verify(String arg0, String arg1) { -// return true; -// } - - - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java deleted file mode 100644 index 2bc0fe131..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/EnhancedConnectionBuilder.java +++ /dev/null @@ -1,266 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.io.IOException; -import java.net.URL; -import java.net.URLStreamHandler; -import java.util.Iterator; -import java.util.Vector; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.http.HttpServletRequest; - -import HTTPClient.HTTPConnection; -import HTTPClient.HttpURLConnection; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.BoolUtils; - - -/** - * Outlook Web Access (OWA) Implementierung von ConnectionBuilder. - * uses the HTTP(s)Client from Ronald Tschalär. - * origin version (without https support) is available at http://www.innovation.ch/java/HTTPClient/ - * - * @author pdanner - */ -public class EnhancedConnectionBuilder implements ConnectionBuilder { - - /** a boolean to disable the HostnameVerification (default = false)*/ - private static boolean cbDisableHostnameVerification = false; - /** Name of the Parameter for the Target */ - private static final String PARAM_TARGET = "Target"; - /** Name of the Parameter for the SAMLArtifact */ - private static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; - /** Name of the Attribute for marking the session as authenticated*/ - private static final String ATT_AUTHDATAFETCHED = "AuthDataFetched"; - - static { - HTTPConnection.setDefaultTimeout(0); - try { - HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.AuthorizationModule")); - HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.RedirectionModule")); - HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.CookieModule")); - //HTTPConnection.removeDefaultModule(Class.forName("HTTPClient.RetryModule")); - } catch (ClassNotFoundException e) { - - } - } - - /** - * Constructor for OWAConnectionBuilder. - * @throws ConfigurationException on any config error - */ - public EnhancedConnectionBuilder() throws ConfigurationException { - - //INFO: removed from MOA-ID 2.0 config - cbDisableHostnameVerification = false; -// cbDisableHostnameVerification = BoolUtils.valueOf( -// ProxyConfigurationProvider.getInstance().getGenericConfigurationParameter( -// "ProxyComponent.DisableHostnameVerification")); - //TODO MOA-ID BRZ undocumented feature - if (cbDisableHostnameVerification) - Logger.warn("ProxyComponent.DisableHostnameVerification: " + cbDisableHostnameVerification); - } - - /** - * @see at.gv.egovernment.moa.id.proxy.ConnectionBuilder#buildConnection - */ - public java.net.HttpURLConnection buildConnection(HttpServletRequest req, String publicURLPrefix, String realURLPrefix, SSLSocketFactory sslSocketFactory, Vector parameters) throws IOException { - - String requestedURL = req.getRequestURL().toString(); - // check whether requested URL starts with publicURLPrefix - - if (! requestedURL.startsWith(publicURLPrefix.substring(0,5))) - throw new IOException(MOAIDMessageProvider.getInstance().getMessage( - "proxy.01", new Object[] {requestedURL, publicURLPrefix})); - - String query = req.getQueryString(); - if (req.getSession().getAttribute(ATT_AUTHDATAFETCHED)!=null) { - query = removeParameter(query, PARAM_SAMLARTIFACT); - query = removeParameter(query, PARAM_TARGET); - req.getSession().removeAttribute(ATT_AUTHDATAFETCHED); - } - if (null != query && 0 != query.length() ) { - requestedURL = requestedURL + "?" + query; - - String parameter[] = new String[2]; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - parameter = (String[]) iter.next(); - if(query.indexOf(parameter[0]) >= 0) iter.remove(); - } - } - - // build real URL in online application - String realURLString = realURLPrefix + requestedURL.substring(publicURLPrefix.length()); - - // build real URL in online application - URLStreamHandler urlStreamHandler = null; - - //URL url = new URL(realURLString); - if (realURLString.startsWith("https")) { - urlStreamHandler = new HTTPClient.https.Handler(); - } else{ - urlStreamHandler = new HTTPClient.http.Handler(); - } - URL url = new URL(null, realURLString, urlStreamHandler); - Logger.debug("OA Request: " + req.getMethod() + " " + url.toString()); - - HttpURLConnection conn = (HttpURLConnection)url.openConnection(); - - conn.setRequestMethod(req.getMethod()); - conn.setDoInput(true); - conn.setDoOutput(true); - //conn.setUseCaches(false); - //conn.setAllowUserInteraction(true); - conn.setInstanceFollowRedirects(false); - - if (realURLString.startsWith("https") && sslSocketFactory != null) { - conn.setSSLSocketFactory(sslSocketFactory); - //Not available in HTTPClient - //if (cbDisableHostnameVerification) - // conn.setHostnameVerifier(new HostnameNonVerifier()); - } - - return conn; - - } - - /** - * Disconnects the HttpURLConnection if necessary. - * The implementation of the Connectionbuilder decides wether - * if this should be happen or not. - * - * @param conn the HttpURLConnection which is normaly to be closed - */ - public void disconnect(java.net.HttpURLConnection conn) { - // In HTTPClient there must not be an diconnect! - // conn.disconnect(); - } - - /** - * @author Stefan Knirsch - * @version $Id$ - * A private class to change the standard HostName verifier to disable the - * Hostname Verification Check - */ - // JSSE Abhängigkeit - private class HostnameNonVerifier implements HostnameVerifier { - - - public boolean verify(String hostname, SSLSession session) { - return true; - } - - /** - * @see com.sun.net.ssl.HostnameVerifier#verify(String, String) - */ -// public boolean verify(String arg0, String arg1) { -// return true; -// } - - } - - /** - * Removes parameters from the query-URL recursively - * - * @param query the query from which the parameter is to be removed - * @param parameter the parameter to be removed - * @return the parameterclean query - */ - private String removeParameter(String query, String parameter) { - return removeParameter(query, parameter, true); - } - - /** - * Removes one parameter from the query-URL recursively - * - * @param query the query from which the parameter is to be removed - * @param parameter the parameter to be removed - * @param remove. Boolean value wether a parameter was removed in last call or not. In initial call set to true to check for new occurrences - * @return the parameterclean query - */ - private String removeParameter(String query, String parameter, boolean remove) { - String result = query; - if (remove && query!=null && !query.equals("") && parameter!=null && !parameter.equals("")) { - String param = parameter; - int capEnd=0; - if (!param.endsWith("=")) param=param+"="; - if (query.startsWith(param)) { - //remove leading - result=""; - } else { - if (!param.startsWith("&")) param="&"+param; - capEnd = query.indexOf(param); - if (capEnd!=-1) { - //leading part - result=query.substring(0, capEnd); - } - } - if (capEnd!=-1) { - //trailing part - capEnd += param.length(); - int capBegin = -1; - if (capEnd MOAIDConfiguration-1.2.xsd, type MOAAuthDataType, - * naming predicates used by the LoginParameterResolver. */ - public static final String MOAGivenName = "MOAGivenName"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAFamilyName = "MOAFamilyName"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOADateOfBirth = "MOADateOfBirth"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOABPK = "MOABPK"; - /** Constant used in MOAIDConfiguration-1.3.xsd, type MOAAuthDataType */ - public static final String MOAWBPK = "MOAWBPK"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAPublicAuthority = "MOAPublicAuthority"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOABKZ = "MOABKZ"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAQualifiedCertificate = "MOAQualifiedCertificate"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAStammzahl = "MOAStammzahl"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAIdentificationValueType = "MOAIdentificationValueType"; - /** Constant used in MOAIDConfiguration-1.2.xsd, type MOAAuthDataType */ - public static final String MOAIPAddress = "MOAIPAddress"; - - /** - * Returns authentication headers to be added to a URLConnection. - * - * @param oaConf configuration data - * @param authData authentication data - * @param clientIPAddress client IP address - * @param businessService boolean value for recognizing (w)bPK-mode - * @param publicURLPrefix to distinguish different online applications - * @return A map, the keys being header names and values being corresponding header values. - *
In case of authentication type "basic-auth", header fields - * username and password. - *
In case of authentication type "header-auth", header fields - * derived from parameter mapping and authentication data provided. - *
Otherwise, an empty map. - */ - public Map getAuthenticationHeaders( - OAConfiguration oaConf, - SAML1AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException; - - /** - * Returns request parameters to be added to a URLConnection. - * - * @param oaConf configuration data - * @param authData authentication data - * @param clientIPAddress client IP address - * @param businessService boolean value for recognizing (w)bPK-mode - * @param publicURLPrefix to distinguish different online applications - * @return A map, the keys being parameter names and values being corresponding parameter values. - *
In case of authentication type "param-auth", parameters - * derived from parameter mapping and authentication data provided. - *
Otherwise, an empty map. - */ - public Map getAuthenticationParameters( - OAConfiguration oaConf, - SAML1AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException; - - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException; - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java deleted file mode 100644 index 1767185c8..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverException.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import at.gv.egovernment.moa.id.auth.exception.MOAIDException; - -/** - * Exception thrown while proxying a request to the online application - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class LoginParameterResolverException extends MOAIDException { - - /** - * - */ - private static final long serialVersionUID = 3924645289077681081L; - - /** - * Constructor for LoginParameterResolverException. - * @param messageId - * @param parameters - */ - public LoginParameterResolverException( - String messageId, - Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for LoginParameterResolverException. - * @param messageId - * @param parameters - * @param wrapped - */ - public LoginParameterResolverException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java deleted file mode 100644 index 0b43630ee..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/LoginParameterResolverFactory.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; - -/** - * Factory delivering a {@link LoginParameterResolver} implementation for - * an online application, initialized from configuration data. - * @author Paul Ivancsics - * @version $Id$ - */ -public class LoginParameterResolverFactory { - - /** default login parameter resolver to be used for online application - * where no special implementation of the LoginParameterResolver - * interface is configured - */ - private static LoginParameterResolver defaultLoginParameterResolver; - /** mapping from online application public URL prefix to an implementation - * of the LoginParameterResolver interface to be used; - * if no mapping is given for an online application, the - * DefaultLoginParameterResolver will be used */ - private static Map loginParameterResolverMap; - - /** - * Initializes the LoginParameterResolver map from the configuration data. - * @throws ConfigurationException when the configuration cannot be read, - * or when a class name configured cannot be instantiated - */ - public static void initialize() throws ConfigurationException { - defaultLoginParameterResolver = new DefaultLoginParameterResolver(); - loginParameterResolverMap = new HashMap(); - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - for (int i = 0; i < proxyConf.getOnlineApplicationParameters().length; i++) { - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameters()[i]; - String publicURLPrefix = oaParam.getPublicURLPrefix(); - String className = oaParam.getLoginParameterResolverImpl(); - String configuration = oaParam.getLoginParameterResolverConfiguration(); - if (className != null) { - try { - Class lprClass = Class.forName(className); - LoginParameterResolver lpr = (LoginParameterResolver)Class.forName(className).newInstance(); - - Class[] argumentTypes = { String.class, Boolean.class }; - Method confMethod = lprClass.getMethod( "configure", argumentTypes ); - - Object[] arguments = { new String(configuration), new Boolean(oaParam.getBusinessService()) }; - confMethod.invoke( lpr, arguments ); - - loginParameterResolverMap.put(publicURLPrefix, lpr); - } - catch (InvocationTargetException lpex) { - throw new ConfigurationException("config.11", new Object[] {className}, lpex); - } - catch (Throwable ex) { - throw new ConfigurationException("config.07", new Object[] {publicURLPrefix}, ex); - } - } - } - } - - /** - * Gets the LoginParameterResolver implementation to be used for the given - * online application. - * @param publicURLPrefix public URL prefix of the online application - * @return LoginParameterResolver implementation - */ - public static LoginParameterResolver getLoginParameterResolver(String publicURLPrefix) { - LoginParameterResolver lpr = (LoginParameterResolver) loginParameterResolverMap.get(publicURLPrefix); - if (lpr == null) - return defaultLoginParameterResolver; - else - return lpr; - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java deleted file mode 100644 index 91df96027..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/MOAIDProxyInitializer.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import iaik.pki.PKIException; -import iaik.pki.jsse.IAIKX509TrustManager; - -import java.io.IOException; -import java.security.GeneralSecurityException; - -import javax.net.ssl.SSLSocketFactory; - -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.legacy.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.iaik.config.LoggerConfigImpl; -import at.gv.egovernment.moa.id.util.AxisSecureSocketFactory; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Web application initializer - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class MOAIDProxyInitializer { - - /** - * Initializes the web application components which need initialization: - * logging, JSSE, MOA-ID Auth configuration, Axis, session cleaner. - */ - public static void initialize() - throws ConfigurationException, IOException, GeneralSecurityException, PKIException { - - Logger.setHierarchy("moa.id.proxy"); - - // Restricts TLS cipher suites - System.setProperty("https.cipherSuites", "SSL_RSA_WITH_RC4_128_SHA,SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_3DES_EDE_CBC_SHA"); - - // load some jsse classes so that the integrity of the jars can be verified - // before the iaik jce is installed as the security provider - // this workaround is only needed when sun jsse is used in conjunction with - // iaik-jce (on jdk1.3) - ClassLoader cl = MOAIDProxyInitializer.class.getClassLoader(); - try { - cl.loadClass("javax.security.cert.Certificate"); // from jcert.jar - } - catch (ClassNotFoundException e) { - Logger.warn(MOAIDMessageProvider.getInstance().getMessage("init.01", null), e); - } - - // Initializes the SSLSocketFactory store - SSLUtils.initialize(); - - // Initializes IAIKX509TrustManager logging - String log4jConfigURL = System.getProperty("log4j.configuration"); - if (log4jConfigURL != null) { - IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); - } - - // Loads the configuration - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.reload(); - - // Initializes the Axis secure socket factory for use in calling the MOA-Auth web service, - // using configuration data - ConnectionParameter connParamAuth = proxyConf.getAuthComponentConnectionParameter(); - if (connParamAuth!=null) { - if (connParamAuth.isHTTPSURL()) { - SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(proxyConf, connParamAuth); - AxisSecureSocketFactory.initialize(ssf); - } - } else { - throw new ConfigurationException("config.16", null); - } - - // Initializes the Axis secure socket factories for use in calling the online applications, - // using configuration data - OAProxyParameter[] oaParams = proxyConf.getOnlineApplicationParameters(); - for (int i = 0; i < oaParams.length; i++) { - OAProxyParameter oaParam = oaParams[i]; - ConnectionParameter oaConnParam = oaParam.getConnectionParameter(); - if (oaConnParam.isHTTPSURL()); - SSLUtils.getSSLSocketFactory(proxyConf, oaConnParam); - } - - // Initializes the ConnectionBuilderFactory from configuration data - ConnectionBuilderFactory.initialize(); - - // Initializes the LoginParameterResolverFactory from configuration data - LoginParameterResolverFactory.initialize(); - - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java deleted file mode 100644 index df8a9bd4e..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/NotAllowedException.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import at.gv.egovernment.moa.id.auth.exception.MOAIDException; - -/** - * Exception thrown while proxying a request to the online application - * Reason for this exception: the dedicated LoginParameterResolver does - * not allow access to the desired ressource. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class NotAllowedException extends MOAIDException { - - /** - * - */ - private static final long serialVersionUID = -265024674370936886L; - - /** - * Constructor for NotAllowedException. - * @param messageId - * @param parameters - */ - public NotAllowedException( - String messageId, - Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for NotAllowedException. - * @param messageId - * @param parameters - * @param wrapped - */ - public NotAllowedException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java deleted file mode 100644 index a5c632077..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java +++ /dev/null @@ -1,727 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import iaik.security.provider.IAIK; - -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.Key; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.Security; -import java.util.HashMap; -import java.util.Map; - -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.spec.IvParameterSpec; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import at.gv.egovernment.moa.id.config.ConfigurationProvider; -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.FileUtils; -import at.gv.egovernment.moa.util.URLEncoder; - -/** - * XMLLoginParameterResolver an implementation of implementation of interface - * LoginParameterResolver - * This implementation used to map identities stored in an XML file to parameters - * which are given to OAs. - * - * @author Rudolf Schamberger - * @version $Id$ - */ -public class XMLLoginParameterResolverEncryptedData implements LoginParameterResolver { - - //file which is parsed and interpreted for paremeter resolving. - private String identityFile; - - private Cipher blowfishCipher; - private Key key; - /** - * inner class used to store mapped parameters - */ - class LPRParams { - - /** - * getter method for parameter Enabled. - * Parameter Enabled decides if mapped parameters should be used by XMLLoginParameterResolver - */ - public boolean getEnabled() { - return enabled.booleanValue(); - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - public String getUN() { - return UN; - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - //TODO XMLLPR decrypt - public String getPlainUN() { - //Security.addProvider(); - - - return UN; - } - - - /** - * getter method for parameter PW (password) - * @return Parameter PW or null not set. - */ - public String getPW() { - return PW; - } - - /** - * getter method for generic parameter Param1 - * @return Parameter Param1 or null not set. - */ - public String getParam1() { - return Param1; - } - - /** - * getter method for generic parameter Param2 - * @return Parameter Param2 or null not set. - */ - public String getParam2() { - return Param2; - } - - /** - * getter method for generic parameter Param3 - * @return Parameter Param3 or null not set. - */ - public String getParam3() { - return Param3; - } - - /** - * Returns a string representation of LPRParams - * - * @return a String representation of this object. - * @see XMLLoginParameterResolver.LPRParams - */ - public String toString() { - return "Enabled: " - + enabled.toString() - + "UN: '" - + UN - + "' PW: '" - + PW - + "' Param1: '" - + Param1 - + "' Param2: '" - + Param2 - + "' Param3: '" - + Param3 - + "'\n"; - } - - //private member variables used to store the parameters - private Boolean enabled = null; - private String UN = null; - private String PW = null; - private String Param1 = null; - private String Param2 = null; - private String Param3 = null; - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - * @param Param1 generic parameter1 used in HeaderAuthentication and ParameterAuthentication - * @param Param2 generic parameter2 used in HeaderAuthentication and ParameterAuthentication - * @param Param3 generic parameter3 used in HeaderAuthentication and ParameterAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW, String Param1, String Param2, String Param3) { - this.enabled = new Boolean(enabled); - this.UN = UN; - this.PW = PW; - this.Param1 = Param1; - this.Param2 = Param2; - this.Param3 = Param3; - } - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW) { - this(enabled, UN, PW, null, null, null); - } - } - - /** - * Constructs a newly allocated XMLLoginParameterResolver object. - **/ - public XMLLoginParameterResolverEncryptedData() { - bPKMap = new HashMap(); - namedMap = new HashMap(); - } - - /** - * configuration method - * @param configuration enabled enable user mapping to parameter set for the parameter set. - */ - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { - File idFile; - Element rootElement; - - Security.addProvider(new IAIK()); - try { - blowfishCipher = Cipher.getInstance("Blowfish/CBC/PKCS5Padding", "IAIK"); - - } catch (NoSuchPaddingException e) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: NoSuchPaddingException \n" + e.toString()}); - } catch (NoSuchProviderException e) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: NoSuchProviderException \n" + e.toString()}); - } catch (NoSuchAlgorithmException e) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: NoSuchAlgorithmException \n" + e.toString()}); - } - - String plaintext = "start"; - String encrypted = encryptData(plaintext, "1234567890123456", "123hochgeheim"); - String decrypted = decryptData(encrypted, "1234567890123456", "123hochgeheim"); - Logger.debug("plaintext: " + plaintext); - Logger.debug("encrypted: " + encrypted); - Logger.debug("decrypted: " + decrypted); - - //make file name absolut (if it is relative to main config file) - //TODO MOAID XMLLPR check - String moaIDConfigFileName = System.getProperty(ConfigurationProvider.PROXY_CONFIG_PROPERTY_NAME); - String rootConfigFileDir = new File(moaIDConfigFileName).getParent(); - this.identityFile = FileUtils.makeAbsoluteURL(configuration, rootConfigFileDir); - - if (null == identityFile || false == (idFile = new File(identityFile)).canRead()) { - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: could not read '" + identityFile + "' " }); - } - try { - rootElement = readXMLFile(identityFile); - } catch (IOException lex) { - Logger.error(lex.toString()); - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: could not read '" + identityFile + "' " }); - - } catch (SAXException sex) { - Logger.error(sex.toString()); - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: parsing problem in file:'" + identityFile + "' ", sex.toString() }); - } catch (ParserConfigurationException e) { - // TODO XMLPR Auto-generated catch block - Logger.error(e.toString()); - throw new LoginParameterResolverException("config.11", - new Object[] { "XMLLoginParameterResolver: parsing problem in file:'" + identityFile + "' ", e.toString() }); - } - buildInfo(rootElement, businessService.booleanValue()); - isConfigured = true; - } - - /** - * encryptData method uses parameters masterSecret and bPK as key information to encrypt plaintext - * @param plaintext - * @param bPK - * @param masterSecret - * @return encrypted data (blowfish encrypted, base64 encoded) - * @throws LoginParameterResolverException - */ - public String encryptData(String plaintext, String bPK, String masterSecret) throws LoginParameterResolverException - { - try { - String keyString = bPK + masterSecret; - key = new iaik.security.cipher.SecretKey(keyString.getBytes("UTF-8"), "Blowfish"); - IvParameterSpec param = new IvParameterSpec(new byte [] {0,0,0,0,0,0,0,0}); - - blowfishCipher.init(Cipher.ENCRYPT_MODE, key, param); - byte [] cipherText = blowfishCipher.doFinal(plaintext.getBytes("UTF-8")); - return Base64Utils.encode(cipherText); - } catch (UnsupportedEncodingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidKeyException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (BadPaddingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalBlockSizeException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalStateException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidAlgorithmParameterException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IOException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } - } - - - /** - * encryptData method uses parameters masterSecret and bPK as key information to decrypt ciphertext - * @param ciphertext (blowfish encrypted, base64encoded) - * @param bPK - * @param masterSecret - * @return decrypted Data (plaintext) - * @throws LoginParameterResolverException - */ - public String decryptData(String ciphertext, String bPK, String masterSecret) throws LoginParameterResolverException - { - try { - String keyString = bPK + masterSecret; - key = new iaik.security.cipher.SecretKey(keyString.getBytes("UTF-8"), "Blowfish"); - IvParameterSpec param = new IvParameterSpec(new byte [] {0,0,0,0,0,0,0,0}); - blowfishCipher.init(Cipher.DECRYPT_MODE, key, param); - byte [] plaintext = blowfishCipher.doFinal(Base64Utils.decode(ciphertext, true)); - return new String(plaintext); - } catch (UnsupportedEncodingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidKeyException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (BadPaddingException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalBlockSizeException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IllegalStateException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (InvalidAlgorithmParameterException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } catch (IOException e) { - throw new LoginParameterResolverException("config.14", new Object [] {"Blowfish: " + e.toString()}); - } - } - - - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationHeaders(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationHeaders( - OAConfiguration oaConf, - SAML1AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException { - Map result = new HashMap(); - - if (!isConfigured) { - //TODO XMLLPR - throw new LoginParameterResolverException("XMLLoginParameterResolver with configuration '" + - identityFile + "' is not configured!", null); - } - - //get the Identity of the user - String famName = resolveValue("MOAFamilyName", authData, clientIPAddress); - String givenName = resolveValue("MOAGivenName", authData, clientIPAddress); - String dateOfBirth = resolveValue("MOADateOfBirth", authData, clientIPAddress); - String bPK =""; - String wType= ""; - if (businessService) { - bPK = resolveValue(MOAWBPK, authData, clientIPAddress); - wType = "w"; - } else { - bPK = resolveValue(MOABPK, authData, clientIPAddress); - } - String userid = ""; - String password = ""; - LPRParams params = null; - boolean userFound = false; - - //try (w)bPK and named search - params = bPKIdentitySearch(bPK, wType); - - if (null == params) - params = namedIdentitySearch(famName, givenName, dateOfBirth); - - //if both searches failed, report error. - if(null == params) - throw new NotAllowedException("User:_" + wType + "bPK:'" +bPK+ ", " + famName + ", " + givenName + "' not authorized.", null); - - //HTTP 401 - Basic Authentication - if (oaConf.getAuthType().equals("basic")) { - userid = (null != params.getUN()) ? params.getUN() : ""; - password = (null != params.getPW()) ? params.getPW() : ""; - - try { - String userIDPassword = userid + ":" + password; - String credentials = Base64Utils.encode(userIDPassword.getBytes("UTF-8")); - Logger.debug("XMLLoginParameterResolver: calculated credentials: " + credentials); - result.put("Authorization", "Basic " + credentials); - } catch (IOException ignore) { - throw new LoginParameterResolverException("config.14", new Object[] {"internal error while encoding in Base64"}); - } - } else if (oaConf.getAuthType().equals("header")) { //HTTP Authentication - String key; - String resolvedValue; - //TODO MOAID XMLLPR select value through OA-ConfigFile; - if(null != params.getUN()) result.put("UN", params.getUN()); - if(null != params.getPW()) result.put("UN", params.getPW()); - if(null != params.getParam1()) result.put("UN", params.getParam1()); - if(null != params.getParam2()) result.put("UN", params.getParam2()); - if(null != params.getParam3()) result.put("UN", params.getParam3()); - - } else { - throw new LoginParameterResolverException("config.14", new Object[] {"AuthType not supported"}); - } - - return result; - } - - /** - * @see at.gv.egovernment.moa.id.proxy.LoginParameterResolver#getAuthenticationParameters(OAConfiguration, AuthenticationData, String, boolean, String) - */ - public Map getAuthenticationParameters( - OAConfiguration oaConf, - SAML1AuthenticationData authData, - String clientIPAddress, - boolean businessService, - String publicURLPrefix) throws LoginParameterResolverException, NotAllowedException { - - Map result = new HashMap(); - - if (!isConfigured) { - Logger.warn("XMLLoginParameterResolver with configuration '" + identityFile + " is not configured"); - return result; - } - - String famName = resolveValue("MOAFamilyName", authData, clientIPAddress); - String givenName = resolveValue("MOAGivenName", authData, clientIPAddress); - String dateOfBirth = resolveValue("MOADateOfBirth", authData, clientIPAddress); - String bPK =""; - String wType= ""; - if (businessService) { - bPK = resolveValue(MOAWBPK, authData, clientIPAddress); - wType = "w"; - } else { - bPK = resolveValue(MOABPK, authData, clientIPAddress); - } - String userid = ""; - String password = ""; - LPRParams params = null; - - //try (w)bPK and named search - params = bPKIdentitySearch(bPK, wType); - - if (null == params) - params = namedIdentitySearch(famName, givenName, dateOfBirth); - - //if both searches failed, report error. - if(null == params) - throw new NotAllowedException("User:_" + wType + "bPK:'" +bPK+ ", " + famName + ", " + givenName + "' not authorized.", null); - - //TODO MOAID XMLLPR URLEncoder.encode - if (oaConf.getAuthType().equals("param")) { - try { - if(null != params.getUN()) result.put(XSD_UNATTR, URLEncoder.encode(params.getUN(),"ISO-8859-1")); - if(null != params.getPW()) result.put(XSD_PWATTR, URLEncoder.encode(params.getPW(),"ISO-8859-1")); - if(null != params.getParam1()) result.put(XSD_PARAM1ATTR, URLEncoder.encode(params.getParam1(),"ISO-8859-1")); - if(null != params.getParam2()) result.put(XSD_PARAM2ATTR, URLEncoder.encode(params.getParam2(),"ISO-8859-1")); - if(null != params.getParam3()) result.put(XSD_PARAM3ATTR, URLEncoder.encode(params.getParam3(),"ISO-8859-1")); - } catch (UnsupportedEncodingException e) { - // ISO-8859-1 is supported - throw new LoginParameterResolverException("URLEncoder error", null); - } - } else { - throw new LoginParameterResolverException("AuthType not supported", null); - } - return result; - } - - /** - * Resolves a login header or parameter value. - * @param predicate header or parameter predicate name from online application configuration - * @param authData authentication data for current login - * @param clientIPAddress client IP address - * @return header or parameter value resolved; null if unknown name is given - */ - private static String resolveValue( - String predicate, - SAML1AuthenticationData authData, - String clientIPAddress) { - if (predicate.equals("MOAGivenName")) - return authData.getGivenName(); - if (predicate.equals("MOAFamilyName")) - return authData.getFamilyName(); - if (predicate.equals("MOADateOfBirth")) - return authData.getFormatedDateOfBirth(); - if (predicate.equals("MOABPK")) - return authData.getBPK(); - - //AuthData holdes the correct BPK/WBPK - if (predicate.equals("MOAWBPK")) - return authData.getBPK(); - if (predicate.equals("MOAPublicAuthority")) - if (authData.isPublicAuthority()) - return "true"; - else - return "false"; - if (predicate.equals("MOABKZ")) - return authData.getPublicAuthorityCode(); - if (predicate.equals("MOAQualifiedCertificate")) - if (authData.isQualifiedCertificate()) - return "true"; - else - return "false"; - if (predicate.equals("MOAStammzahl")) - return authData.getIdentificationValue(); - if (predicate.equals(MOAIdentificationValueType)) - return authData.getIdentificationType(); - if (predicate.equals("MOAIPAddress")) - return clientIPAddress; - else - return null; - } - - /** - * reads, parses the configuration file of XMLLoginParameterResolver and returns the document element. - * @param fileName of the configuration file. - */ - private Element readXMLFile(String fileName) throws ParserConfigurationException, SAXException, IOException { - Logger.info("XMLLoginParameterResolver: Loading and parsing XMLPLoginParameterConfiguration configuration: " + fileName); - - InputStream stream = null; - Element configElem; - - stream = new BufferedInputStream(new FileInputStream(fileName)); - configElem = DOMUtils.parseDocument(stream, true, Constants.ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - return configElem; - } - - /** - * buildInfo builds up the internal data mapping between the "Identities" and the "Parameters" from the parsed XML file. - * @param root document root element. - */ - private void buildInfo(Element root, boolean businessService) { - NodeList idList = root.getElementsByTagName(XSD_IDELEM); - NodeList paramList = root.getElementsByTagName(XSD_PARAMELEM); - String wType =""; - if (businessService) wType = "w"; - for (int i = 0; i < idList.getLength(); i++) - Logger.debug("XMLLoginParameterResolver: LocalName idList: " + idList.item(i).getLocalName()); - - for (int i = 0; i < paramList.getLength(); i++) - Logger.debug("XMLLoginParameterResolver: LocalName paramList: " + paramList.item(i).getLocalName()); - - for (int i = 0; i < idList.getLength(); i++) { - Element tmpElem = (Element) idList.item(i); - NodeList tmpList = tmpElem.getElementsByTagName(XSD_NAMEDIDELEM); - for (int j = 0; j < tmpList.getLength(); j++) - Logger.debug("XMLLoginParameterResolver: LocalName tmp: " + tmpList.item(j).getLocalName()); - - //Search for NamedIdentity Elements - if (1 == tmpList.getLength()) { - tmpElem = (Element) tmpList.item(0); - String tmpStr = tmpElem.getAttribute(XSD_SURNAMEATTR) + "," + - tmpElem.getAttribute(XSD_GIVENNAMEATTR) + "," + - tmpElem.getAttribute(XSD_BIRTHDATEATTR); - boolean tmpBool = false; - if (tmpElem.getFirstChild() != null - && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - //TODO XMLLPR remove - Logger.debug("XMLLoginParameterResolver: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element) paramList.item(i); - Logger.debug("XMLLoginParameterResolver: attribute UN: " + tmpElem.getAttribute(XSD_UNATTR) + - " attribute PW: " + tmpElem.getAttribute(XSD_PWATTR) + - " attribute Param1: " + tmpElem.getAttribute(XSD_PARAM1ATTR) + - " attribute Param2: " + tmpElem.getAttribute(XSD_PARAM2ATTR) + - " attribute Param3: " + tmpElem.getAttribute(XSD_PARAM3ATTR) ); - namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute(XSD_UNATTR), tmpElem.getAttribute(XSD_PWATTR), - tmpElem.getAttribute(XSD_PARAM1ATTR), tmpElem.getAttribute(XSD_PARAM2ATTR), - tmpElem.getAttribute(XSD_PARAM3ATTR)) ); - } else { - - //(w)bPKIdentity Elements - if (businessService) { - tmpList = tmpElem.getElementsByTagName(XSD_WBPKIDELEM); - } else { - tmpList = tmpElem.getElementsByTagName(XSD_BPKIDELEM); - } - if (1 == tmpList.getLength()) { - tmpElem = (Element) tmpList.item(0); - String tmpStr = ""; - if (businessService) { - tmpStr = tmpElem.getAttribute(XSD_WBPKATTR); - } else { - tmpStr = tmpElem.getAttribute(XSD_BPKATTR); - } - boolean tmpBool = false; - if (tmpElem.getFirstChild() != null - && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - Logger.debug("XMLLoginParameterResolver: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element) paramList.item(i); - Logger.debug("XMLLoginParameterResolver: attribute UN: " + tmpElem.getAttribute(XSD_UNATTR) + - " attribute PW: " + tmpElem.getAttribute(XSD_PWATTR) + - " attribute Param1: " + tmpElem.getAttribute(XSD_PARAM1ATTR) + - " attribute Param2: " + tmpElem.getAttribute(XSD_PARAM2ATTR) + - " attribute Param3: " + tmpElem.getAttribute(XSD_PARAM3ATTR) ); - namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute(XSD_UNATTR), tmpElem.getAttribute(XSD_PWATTR), - tmpElem.getAttribute(XSD_PARAM1ATTR), tmpElem.getAttribute(XSD_PARAM2ATTR), - tmpElem.getAttribute(XSD_PARAM3ATTR)) ); - } else { - if (businessService) { - Logger.warn("XMLLoginParameterResolver: wrong format no Elements " + XSD_NAMEDIDELEM + " or " + XSD_WBPKIDELEM + " found"); - } else { - Logger.warn("XMLLoginParameterResolver: wrong format no Elements " + XSD_NAMEDIDELEM + " or " + XSD_BPKIDELEM + " found"); - } - } - } - } - - Logger.debug("namedMap:" + namedMap.toString()); - Logger.debug(wType + "bPKMap:" + bPKMap.toString()); - } - - - - - /** - * searches for a given bPK and returns the appropriate LPRParams structure - * @param bPK search argument - * @return LPRParams if bPK could be found in internal mappings or null otherwise. - */ - LPRParams bPKIdentitySearch(String bPK, String wType) { - //search for mapping with (w)bPK of the user - Logger.info("XMLLoginParameterResolver: search for login data mapped to " + wType + "bPK:" + bPK); - LPRParams params = (LPRParams) bPKMap.get(bPK); - if (null == params) { - Logger.info("XMLLoginParameterResolver: params for " + wType + "bPK: " + bPK + " not found!"); - return null; - } else if (params.getEnabled()) { - Logger.info("XMLLoginParameterResolver: " + wType + "bPK: " + bPK + "found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolver: using: " + params.toString()); - return params; - } - Logger.info("XMLLoginParameterResolver: " + wType + "bPK: " + bPK + "found in list but user is NOT enabled"); - return null; - } - - /** - * searches for a given namedIdentity and returns the appropriate LPRParams structure - * @param surName surname search argument - * @param givenName givenname search argument - * @param dateOfBirth dateofbirth search argument - * @return LPRParams if (w)bPK could be found in internal mappings or null otherwise. - */ - LPRParams namedIdentitySearch(String surName, String givenName, String dateOfBirth) { - Logger.info("XMLLoginParameterResolver: search for login data for SurName:" + surName + " GivenName: " + givenName + " DateOfBirth" + dateOfBirth); - //try first a search with surname, givenname and birthdate - LPRParams params = (LPRParams) namedMap.get(surName + "," + givenName + "," + dateOfBirth); - if (null == params) { - Logger.debug("XMLLoginParameterResolver: params for Surname: " + surName + " GivenName: " + givenName + "BirthDate: " + dateOfBirth + " not found!"); - //try a search with surname, givenname only - params = (LPRParams) namedMap.get(surName + "," + givenName + "," + XSD_BIRTHDATEBLANKATTR); - if(null == params) { - Logger.debug("XMLLoginParameterResolver: params for Surname: " + surName + " GivenName: " + givenName + " not found!"); - return null; - } - } - - if (params.getEnabled()) { - Logger.info("XMLLoginParameterResolver: Surname:" + surName + " GivenName: " + givenName + " found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolver: using: " + params.toString()); - return params; - } - Logger.info("XMLLoginParameterResolver: SurName:" + surName + " GivenName: " + givenName + "found in list; user is NOT enabled"); - return null; - } - - //public static final String XSD_MAPPING = "Mapping"; - //public static final String XSD_DOCELEM = "MOAIdentities"; - public static final String XSD_IDELEM = "Identity"; - public static final String XSD_NAMEDIDELEM = "NamedIdentity"; - public static final String XSD_BPKIDELEM = "bPKIdentity"; - public static final String XSD_WBPKIDELEM = "wbPKIdentity"; - public static final String XSD_PARAMELEM = "Parameters"; - public static final String XSD_SURNAMEATTR = "SurName"; - public static final String XSD_GIVENNAMEATTR = "GivenName"; - public static final String XSD_BIRTHDATEATTR = "BirthDate"; - public static final String XSD_BIRTHDATEBLANKATTR = "any"; - public static final String XSD_BPKATTR = "bPK"; - public static final String XSD_WBPKATTR = "wbPK"; - public static final String XSD_UNATTR = "UN"; - public static final String XSD_PWATTR = "PW"; - public static final String XSD_PARAM1ATTR = "Param1"; - public static final String XSD_PARAM2ATTR = "Param2"; - public static final String XSD_PARAM3ATTR = "Param3"; - private Map bPKMap; - private Map namedMap; - private boolean isConfigured = false; -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java deleted file mode 100644 index 740421024..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverPlainData.java +++ /dev/null @@ -1,472 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy; - -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; -import java.io.IOException; -import java.util.*; - -import org.apache.xerces.parsers.DOMParser; -import org.w3c.dom.*; - -// Referenced classes of package at.gv.egovernment.moa.id.proxy: -// -// TODO MOA-ID test full functionality - -public class XMLLoginParameterResolverPlainData - implements LoginParameterResolver -{ - private String configuration; - - /** - * inner class used to store mapped parameters - */ - class LPRParams { - - /** - * getter method for parameter Enabled. - * Parameter Enabled decides if mapped parameters should be used by XMLLoginParameterResolver - */ - public boolean getEnabled() { - return enabled.booleanValue(); - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - public String getUN() { - return UN; - } - - /** - * getter method for parameter UN (username) - * @return Parameter UN or null not set. - */ - public String getPlainUN() { - return UN; - } - - - /** - * getter method for parameter PW (password) - * @return Parameter PW or null not set. - */ - public String getPW() { - return PW; - } - - /** - * getter method for generic parameter Param1 - * @return Parameter Param1 or null not set. - */ - public String getParam1() { - return Param1; - } - - /** - * getter method for generic parameter Param2 - * @return Parameter Param2 or null not set. - */ - public String getParam2() { - return Param2; - } - - /** - * getter method for generic parameter Param3 - * @return Parameter Param3 or null not set. - */ - public String getParam3() { - return Param3; - } - - /** - * Returns a string representation of LPRParams - * - * @return a String representation of this object. - * @see XMLLoginParameterResolver.LPRParams - */ - public String toString() { - return "Enabled: " - + enabled.toString() - + "UN: '" - + UN - + "' PW: '" - + PW - + "' Param1: '" - + Param1 - + "' Param2: '" - + Param2 - + "' Param3: '" - + Param3 - + "'\n"; - } - - //private member variables used to store the parameters - private Boolean enabled = null; - private String UN = null; - private String PW = null; - private String Param1 = null; - private String Param2 = null; - private String Param3 = null; - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - * @param Param1 generic parameter1 used in HeaderAuthentication and ParameterAuthentication - * @param Param2 generic parameter2 used in HeaderAuthentication and ParameterAuthentication - * @param Param3 generic parameter3 used in HeaderAuthentication and ParameterAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW, String Param1, String Param2, String Param3) { - this.enabled = new Boolean(enabled); - this.UN = UN; - this.PW = PW; - this.Param1 = Param1; - this.Param2 = Param2; - this.Param3 = Param3; - } - - /** - * Constructs a newly allocated XMLLoginParameterResolver.LPRParams object. - * - * @param enabled enable user mapping to parameter set for the parameter set. - * @param UN username used in HTTP 401 - BasicAuthentication - * @param PW password used in HTTP 401 - BasicAuthentication - **/ - LPRParams(boolean enabled, String UN, String PW) { - this(enabled, UN, PW, null, null, null); - } - } - - //TODO document - public XMLLoginParameterResolverPlainData() - { - bPKMap = new HashMap(); - namedMap = new HashMap(); - - } - - //TODO document - public Map getAuthenticationHeaders(OAConfiguration oaConf, SAML1AuthenticationData authData, String clientIPAddress, boolean businessService, String publicURLPrefix) throws NotAllowedException - { - Map result = new HashMap(); - if(oaConf.getAuthType().equals("basic")) - { - String famName = resolveValue(MOAFamilyName, authData, clientIPAddress); - String givenName = resolveValue(MOAGivenName, authData, clientIPAddress); - String dateOfBirth = resolveValue(MOADateOfBirth, authData, clientIPAddress); - String bPK =""; - String wType= ""; - if (businessService) { - bPK = resolveValue(MOAWBPK, authData, clientIPAddress); - wType = "w"; - } else { - bPK = resolveValue(MOABPK, authData, clientIPAddress); - } - String userid = ""; - String password = ""; - String param1 = ""; - String param2 = ""; - String param3 = ""; - - LPRParams params = null; - boolean userFound = false; - - //first step: search for (w)bPK entry in user list - Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for "+ wType + "bPK:" + bPK); - params = (LPRParams)bPKMap.get(bPK); - if(params == null) - Logger.debug("XMLLoginParameterResolverPlainData: params for "+ wType + "bPK: " + bPK + " not found in file!"); - else - if(params.getEnabled()) - { //if user is enabled: get related parameters - Logger.debug("XMLLoginParameterResolverPlainData: "+ wType + "bPK: " + bPK + " found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); - userid = params.getUN(); - password = params.getPW(); - param1 = params.getParam1(); - param2 = params.getParam2(); - param3 = params.getParam3(); - userFound = true; - } else - { - Logger.info("XMLLoginParameterResolverPlainData: "+ wType + "bPK: " + bPK + " found in list; user is NOT enabled"); - } - if(!userFound) //secound step: search for name entry in user list - { - Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for SurName:" + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth); - params = (LPRParams)namedMap.get(famName + "," + givenName + "," + dateOfBirth); - if(params == null) { - Logger.debug("XMLLoginParameterResolverPlainData: params for Surname: " + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth + " not found in file!"); - //try also with wildcard ("*") birthdate - params = (LPRParams)namedMap.get(famName + "," + givenName + "," + "*"); - if(params != null) Logger.debug("XMLLoginParameterResolverPlainData: params for Surname: " + famName + " GivenName: " + givenName + " DateOfBirth: " + "*" + " found!"); - } - - if(null != params && params.getEnabled()) - { - Logger.debug("XMLLoginParameterResolverPlainData: SurName:" + famName + " GivenName: " + givenName + " DateOfBirth: " + dateOfBirth + " found in file; user is enabled"); - Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); - userid = params.getUN(); - password = params.getPW(); - param1 = params.getParam1(); - param2 = params.getParam2(); - param3 = params.getParam3(); - userFound = true; - } - } - if(!userFound) //third step: search for default user in user list - { - //third step: search for (w)bPK for the default user entry in user list - Logger.debug("XMLLoginParameterResolverPlainData: search for automatic login data for default user"); - params = (LPRParams)bPKMap.get("default"); - if(params == null) - Logger.debug("XMLLoginParameterResolverPlainData: params for default user not found in file!"); - else - if(params.getEnabled()) - { //if user is enabled: get related parameters - Logger.debug("XMLLoginParameterResolverPlainData: default user found in list; user is enabled"); - Logger.debug("XMLLoginParameterResolverPlainData: using: " + params.toString()); - userid = params.getUN(); - password = params.getPW(); - param1 = params.getParam1(); - param2 = params.getParam2(); - param3 = params.getParam3(); - userFound = true; - } else - { - Logger.info("XMLLoginParameterResolverPlainData: default user found in list; user is NOT enabled"); - } - } - - if(!userFound) //if user is not found then throw NotAllowedException exception - { - //TODO MOA-ID proove this with testcases! - Logger.info("XMLLoginParameterResolverPlainData: Person is not allowed No automatic login"); - throw new NotAllowedException("XMLLoginParameterResolverPlainData: Person is not allowed No automatic login ", new Object[] { }); - } - try //if user was found: generate Authorization header entry with associated credemtials - { - String userIDPassword = userid + ":" + password; - String credentials = Base64Utils.encode(userIDPassword.getBytes()); - Logger.debug("XMLLoginParameterResolverPlainData: calculated credentials: " + credentials); - result.put("Authorization", "Basic " + credentials); - } - catch(IOException ignore) { } - } else - if(oaConf.getAuthType().equals("header")) - { - String key; - String resolvedValue; - for(Iterator iter = oaConf.getHeaderAuthMapping().keySet().iterator(); iter.hasNext(); result.put(key, resolvedValue)) - { - key = (String)iter.next(); - String predicate = (String)oaConf.getHeaderAuthMapping().get(key); - resolvedValue = resolveValue(predicate, authData, clientIPAddress); - } - - } - return result; - } - - public Map getAuthenticationParameters(OAConfiguration oaConf, SAML1AuthenticationData authData, String clientIPAddress, boolean businessService, String publicURLPrefix) - { - Map result = new HashMap(); - if(oaConf.getAuthType().equals("param")) - { - String key; - String resolvedValue; - for(Iterator iter = oaConf.getParamAuthMapping().keySet().iterator(); iter.hasNext(); result.put(key, resolvedValue)) - { - key = (String)iter.next(); - String predicate = (String)oaConf.getParamAuthMapping().get(key); - resolvedValue = resolveValue(predicate, authData, clientIPAddress); - } - - } - return result; - } - - private static String resolveValue(String predicate, SAML1AuthenticationData authData, String clientIPAddress) - { - if(predicate.equals(MOAGivenName)) - return authData.getGivenName(); - if(predicate.equals(MOAFamilyName)) - return authData.getFamilyName(); - if(predicate.equals(MOADateOfBirth)) - return authData.getFormatedDateOfBirth(); - if(predicate.equals(MOABPK)) - return authData.getBPK(); - - //AuthData holds the correct BPK/WBPK - if(predicate.equals(MOAWBPK)) - return authData.getBPK(); - if(predicate.equals(MOAPublicAuthority)) - if(authData.isPublicAuthority()) - return "true"; - else - return "false"; - if(predicate.equals(MOABKZ)) - return authData.getPublicAuthorityCode(); - if(predicate.equals(MOAQualifiedCertificate)) - if(authData.isQualifiedCertificate()) - return "true"; - else - return "false"; - if(predicate.equals(MOAStammzahl)) - return authData.getIdentificationValue(); - if (predicate.equals(MOAIdentificationValueType)) - return authData.getIdentificationType(); - if(predicate.equals(MOAIPAddress)) - return clientIPAddress; - else - return null; - } - - private Document readXMLFile(String fileName) throws LoginParameterResolverException - { - Logger.info("XMLLoginParameterResolverPlainData: Loading MOA-OA configuration " + fileName); - DOMParser parser = new DOMParser(); - try - { - parser.setFeature("http://xml.org/sax/features/validation", true); - parser.setFeature("http://apache.org/xml/features/validation/schema", true); - parser.parse(fileName); - return parser.getDocument(); - } - catch(Exception e) - { - String msg = e.toString(); - throw new LoginParameterResolverException("proxy.13", new Object[] {": XMLLoginParameterResolverPlainData: Error parsing file " + fileName, "detail problem: " + msg}); - } - } - - private void buildInfo(Document doc, boolean businessService) - { - Element root = doc.getDocumentElement(); - NodeList idList = root.getElementsByTagName("Identity"); - NodeList paramList = root.getElementsByTagName("Parameters"); - String wType =""; - if (businessService) wType = "w"; - for(int i = 0; i < idList.getLength(); i++) - Logger.debug("XMLLoginParameterResolverPlainData: LocalName idList: " + idList.item(i).getLocalName()); - - for(int i = 0; i < paramList.getLength(); i++) - Logger.debug("XMLLoginParameterResolverPlainData: LocalName paramList: " + paramList.item(i).getLocalName()); - - for(int i = 0; i < idList.getLength(); i++) - { - Element tmpElem = (Element)idList.item(i); - NodeList tmpList = tmpElem.getElementsByTagName("NamedIdentity"); - for(int j = 0; j < tmpList.getLength(); j++) - Logger.debug("XMLLoginParameterResolverPlainData: LocalName tmp: " + tmpList.item(j).getLocalName()); - - if(1 == tmpList.getLength()) - { - tmpElem = (Element)tmpList.item(0); - String tmpStr = tmpElem.getAttribute("SurName") + "," + tmpElem.getAttribute("GivenName") + "," + tmpElem.getAttribute("BirthDate"); - boolean tmpBool = false; - if(tmpElem.getFirstChild() != null && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - Logger.debug("XMLLoginParameterResolverPlainData: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element)paramList.item(i); - Logger.debug("XMLLoginParameterResolverPlainData: attribute UN: " + tmpElem.getAttribute("UN") + " attribute PW: " + tmpElem.getAttribute("PW")); - namedMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute("UN"), tmpElem.getAttribute("PW"))); - } else - { - tmpList = tmpElem.getElementsByTagName(wType + "bPKIdentity"); - if(1 == tmpList.getLength()) - { - tmpElem = (Element)tmpList.item(0); - String tmpStr = tmpElem.getAttribute(wType + "bPK"); - boolean tmpBool = false; - if(tmpElem.getFirstChild() != null && "1".compareTo(tmpElem.getFirstChild().getNodeValue()) == 0) - tmpBool = true; - Logger.debug("XMLLoginParameterResolverPlainData: tmpStr: " + tmpStr + " value: " + (new Boolean(tmpBool)).toString()); - tmpElem = (Element)paramList.item(i); - Logger.debug("XMLLoginParameterResolverPlainData: attribute UN: " + tmpElem.getAttribute("UN") + " attribute PW: " + tmpElem.getAttribute("PW") + " attribute Param1: " + tmpElem.getAttribute("Param1")); - bPKMap.put(tmpStr, new LPRParams(tmpBool, tmpElem.getAttribute("UN"), tmpElem.getAttribute("PW"))); - } else - { - Logger.warn("XMLLoginParameterResolverPlainData: wrong format or incorrect mode; no NamedIdentity or " + wType + "bPKIdentity found"); - } - } - } - - Logger.debug("namedMap:" + namedMap.toString()); - Logger.debug(wType + "bPKMap:" + bPKMap.toString()); - } - - //public static final String XSD_DOCELEM = "MOAIdentities"; - //public static final String XSD_IDELEM = "Identity"; - //public static final String XSD_NAMEDIDELEM = "NamedIdentity"; - //public static final String XSD_BPKIDELEM = "bPKIdentity"; - //public static final String XSD_PARAMELEM = "Parameters"; - //public static final String XML_LPR_CONFIG_PROPERTY_NAME1 = "moa.id.xmllpr1.configuration"; - private Map bPKMap; - private Map namedMap; - - - public void configure(String configuration, Boolean businessService) throws LoginParameterResolverException { - Logger.info("XMLLoginParameterResolverPlainData: initialization string: " + configuration); - this.configuration = configuration; - String fileName = configuration; - if(fileName == null) { - fileName = "file:conf/moa-id/Identities.xml"; - Logger.info("XMLLoginParameterResolverPlainData: used file name string: " + fileName); - } - Document doc = readXMLFile(fileName); - buildInfo(doc, businessService.booleanValue() ); - } -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java deleted file mode 100644 index 73f4d1f1f..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/builder/SAMLRequestBuilder.java +++ /dev/null @@ -1,101 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.builder; - -import java.text.MessageFormat; -import java.util.Calendar; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.exception.BuildException; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.DateTimeUtils; - -/** - * Builder for the <samlp:Request> used for querying - * the authentication data <saml:Assertion>. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLRequestBuilder implements Constants { - /** samlp-Request template */ - private static final String REQUEST = - "" + - "{2}" + - ""; - - /** - * Constructor for SAMLRequestBuilder. - */ - public SAMLRequestBuilder() { - super(); - } - - /** - * Builds the <samlp:Request>. - * @param requestID request ID - * @param samlArtifactBase64 SAML artifact, encoded BASE64 - * @return the DOM element - */ - public Element build(String requestID, String samlArtifactBase64) throws BuildException { - try { - String issueInstant = DateTimeUtils.buildDateTimeUTC(Calendar.getInstance()); - String request = MessageFormat.format(REQUEST, new Object[] {requestID, issueInstant, samlArtifactBase64}); - Element requestElem = DOMUtils.parseDocument(request, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); - return requestElem; - } - catch (Throwable ex) { - throw new BuildException( - "builder.00", - new Object[] {"samlp:Request", ex.toString()}, - ex); - } - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java deleted file mode 100644 index 26da33e34..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/invoke/GetAuthenticationDataInvoker.java +++ /dev/null @@ -1,206 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.invoke; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Vector; - -import javax.xml.namespace.QName; -import javax.xml.rpc.Call; -import javax.xml.rpc.Service; -import javax.xml.rpc.ServiceFactory; - -import org.apache.axis.message.SOAPBodyElement; -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; -import at.gv.egovernment.moa.id.auth.exception.BuildException; -import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.auth.exception.ParseException; -import at.gv.egovernment.moa.id.auth.exception.ServiceException; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.legacy.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.data.SAMLStatus; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.id.proxy.builder.SAMLRequestBuilder; -import at.gv.egovernment.moa.id.proxy.parser.SAMLResponseParser; -import at.gv.egovernment.moa.id.proxy.servlet.ProxyException; -import at.gv.egovernment.moa.id.util.Random; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Invoker of - *
    - *
  • either the GetAuthenticationData web service of MOA-ID Auth
  • - *
  • or the API call {@link at.gv.egovernment.moa.id.auth.AuthenticationServer#getAuthenticationData},
  • - *
- * depending of the configuration. - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class GetAuthenticationDataInvoker { - /** Create a new QName object for the webservice endpoint */ - private static final QName SERVICE_QNAME = new QName("GetAuthenticationData"); - - /** invoked object for API call of MOA-ID Auth */ - private static Object apiServer = null; - /** invoked method for API call of MOA-ID Auth */ - private static Method apiMethod = null; - - /** - * Invokes the service passing domain model objects. - * @param samlArtifact SAML artifact - * @return AuthenticationData object - * @throws ServiceException on any exception thrown - */ - /** - * Get authentication data from the MOA-ID Auth component, - * either via API call or via web service call. - * @param samlArtifact SAML artifact to be used as a parameter - * @return AuthenticationData - * @throws MOAIDException - */ - public SAML1AuthenticationData getAuthenticationData(String samlArtifact) - throws MOAIDException { - - ConnectionParameter authConnParam = - ProxyConfigurationProvider.getInstance().getAuthComponentConnectionParameter(); - - //Removed for MOA-ID 2.x -// if (authConnParam == null) { -// try { -// if (apiServer == null) { -// Class serverClass = Class.forName("at.gv.egovernment.moa.id.auth.AuthenticationServer"); -// Method getInstanceMethod = serverClass.getMethod("getInstance", (Class[]) null); -// apiServer = getInstanceMethod.invoke(null, (Object[]) null); -// apiMethod = serverClass.getMethod( -// "getAuthenticationData", new Class[] {String.class}); -// } -// AuthenticationData authData = (AuthenticationData)apiMethod.invoke(apiServer, new Object[] {samlArtifact}); -// return authData; -// } -// catch (InvocationTargetException ex) { -// Throwable targetEx = ex.getTargetException(); -// if (targetEx instanceof AuthenticationException) -// throw (AuthenticationException) targetEx; -// else -// throw new ProxyException("proxy.09", new Object[] {targetEx.toString()}); -// } -// catch (Throwable ex) { -// throw new ProxyException("proxy.09", new Object[] {ex.toString()}); -// } -// } -// else { - Element samlpRequest = new SAMLRequestBuilder().build(Random.nextRandom(), samlArtifact); - Element samlpResponse = getAuthenticationData(samlpRequest); - SAMLResponseParser srp = new SAMLResponseParser(samlpResponse); - SAMLStatus status = srp.parseStatusCode(); - if (! "samlp:Success".equals(status.getStatusCode())) { - if ("samlp:Responder".equals(status.getStatusCode())) { - Logger.info("MOA-ID authentication process failed."); - String code = status.getStatusCode(); - if (status.getSubStatusCode() != null && status.getSubStatusCode().length() > 0) - code += "(" + status.getSubStatusCode() + ")"; - - throw new MOAIDException("proxy.17", new Object[] {status.getStatusMessage()}); - - } else { - // on error status throw exception - String code = status.getStatusCode(); - if (status.getSubStatusCode() != null && status.getSubStatusCode().length() > 0) - code += "(" + status.getSubStatusCode() + ")"; - - throw new ServiceException("service.02", new Object[] {code, status.getStatusMessage()}); - } - } - return srp.parseAuthenticationData(); -// } - } - - /** - * Invokes the service passing DOM elements. - * @param request request DOM element - * @return response DOM element - * @throws ServiceException on any exception thrown - */ - public Element getAuthenticationData(Element request) throws ServiceException { - try { - Service service = ServiceFactory.newInstance().createService(SERVICE_QNAME); - Call call = service.createCall(); - SOAPBodyElement body = - new SOAPBodyElement(request); - SOAPBodyElement[] params = new SOAPBodyElement[] {body}; - Vector responses; - SOAPBodyElement response; - - String endPoint; - ConnectionParameter authConnParam = - ProxyConfigurationProvider.getInstance().getAuthComponentConnectionParameter(); - - //If the ConnectionParameter do NOT exist, we throw an exception .... - if (authConnParam!=null) { - endPoint = authConnParam.getUrl(); - call.setTargetEndpointAddress(endPoint); - responses = (Vector) call.invoke(SERVICE_QNAME, params); - response = (SOAPBodyElement) responses.get(0); - return response.getAsDOM(); - } - else - { - throw new ServiceException("service.01", null); - } - } - catch (Exception ex) { - throw new ServiceException("service.00", new Object[] {ex.toString()}, ex); - } - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java deleted file mode 100644 index ebda8dae0..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/AuthenticationDataAssertionParser.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.parser; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.exception.ParseException; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.util.BoolUtils; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.DOMUtils; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parser for the <saml:Assertion> returned by the - * GetAuthenticationData web service. - * @author Paul Ivancsics - * @version $Id$ - */ -public class AuthenticationDataAssertionParser implements Constants { - - /** Prefix for SAML-Xpath-expressions */ - private static String SAML = SAML_PREFIX + ":"; - /** Prefix for PersonData-Xpath-expressions */ - private static String PR = PD_PREFIX + ":"; - /** Prefix for Attribute MajorVersion in an Xpath-expression */ - private static String MAJOR_VERSION_XPATH = - "@MajorVersion"; - /** Prefix for Attribute MinorVersion in an Xpath-expression */ - private static String MINOR_VERSION_XPATH = - "@MinorVersion"; - /** Prefix for Attribute AssertionID in an Xpath-expression */ - private static String ASSERTION_ID_XPATH = - "@AssertionID"; - /** Prefix for Attribute Issuer in an Xpath-expression */ - private static String ISSUER_XPATH = - "@Issuer"; - /** Prefix for Attribute IssueInstant in an Xpath-expression */ - private static String ISSUE_INSTANT_XPATH = - "@IssueInstant"; - /** Prefix for Element AttributeStatement in an Xpath-expression */ - private static String ATTRIBUTESTATEMENT_XPATH = - SAML + "AttributeStatement/"; - /** Prefix for Element NameIdentifier in an Xpath-expression */ - private static String PK_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Subject/" + - SAML + "NameIdentifier"; - private static String NAME_QUALIFIER_XPATH = - PK_XPATH + "/@NameQualifier"; - /** Prefix for Element Person in an Xpath-expression */ - private static String PERSONDATA_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Attribute[@AttributeName=\"PersonData\"]/" + - SAML + "AttributeValue/" + - PR + "Person/"; - /** Prefix for Element Value in an Xpath-expression */ - private static String IDENTIFICATION_VALUE_XPATH = - PERSONDATA_XPATH + - PR + "Identification/" + - PR + "Value"; - private static String IDENTIFICATION_TYPE_XPATH = - PERSONDATA_XPATH + - PR + "Identification/" + - PR + "Type"; - /** Prefix for Element GivenName in an Xpath-expression */ - private static String GIVEN_NAME_XPATH = - PERSONDATA_XPATH + - PR + "Name/" + - PR + "GivenName"; - /** Prefix for Element FamilyName in an Xpath-expression */ - private static String FAMILY_NAME_XPATH = - PERSONDATA_XPATH + - PR + "Name/" + - PR + "FamilyName"; - /** Prefix for Element DateOfBirth in an Xpath-expression */ - private static String DATE_OF_BIRTH_XPATH = - PERSONDATA_XPATH + - PR + "DateOfBirth"; - /** Prefix for Element AttributeValue in an Xpath-expression */ - private static String IS_QUALIFIED_CERT_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Attribute[@AttributeName=\"isQualifiedCertificate\"]/" + - SAML + "AttributeValue"; - /** Prefix for Element AttributeValue in an Xpath-expression */ - private static String PUBLIC_AUTHORITY_XPATH = - ATTRIBUTESTATEMENT_XPATH + - SAML + "Attribute[@AttributeName=\"isPublicAuthority\"]/" + - SAML + "AttributeValue"; - /** Element samlAssertion represents the SAML:Assertion */ - private Element samlAssertion; - - /** - * Constructor - * @param samlAssertion samlpResponse the <samlp:Response> as a DOM element - */ - public AuthenticationDataAssertionParser(Element samlAssertion) { - this.samlAssertion = samlAssertion; - } - - /** - * Parses the <saml:Assertion>. - * @return AuthenticationData object - * @throws ParseException on any error - */ - public SAML1AuthenticationData parseAuthenticationData() - throws ParseException { - - try { - SAML1AuthenticationData authData = new SAML1AuthenticationData(); - //ÄNDERN: NUR der Identification-Teil - authData.setSamlAssertion(DOMUtils.serializeNode(samlAssertion)); - authData.setMajorVersion(new Integer( - XPathUtils.getAttributeValue(samlAssertion, MAJOR_VERSION_XPATH, "-1")).intValue()); - authData.setMinorVersion(new Integer( - XPathUtils.getAttributeValue(samlAssertion, MINOR_VERSION_XPATH, "-1")).intValue()); - authData.setAssertionID( - XPathUtils.getAttributeValue(samlAssertion, ASSERTION_ID_XPATH, "")); - authData.setIssuer( - XPathUtils.getAttributeValue(samlAssertion, ISSUER_XPATH, "")); - authData.setIssueInstant( - XPathUtils.getAttributeValue(samlAssertion, ISSUE_INSTANT_XPATH, "")); - String pkValue = XPathUtils.getElementValue(samlAssertion, PK_XPATH, ""); - - if (XPathUtils.getAttributeValue(samlAssertion, NAME_QUALIFIER_XPATH, "").equalsIgnoreCase(URN_PREFIX_BPK)) { - //bPK - authData.setBPK(pkValue); - authData.setBPKType(Constants.URN_PREFIX_BPK); - - } else { - //wbPK - authData.setBPK(pkValue); - authData.setBPKType(XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_TYPE_XPATH, "")); - } - authData.setIdentificationValue( - XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_VALUE_XPATH, "")); - authData.setIdentificationType( - XPathUtils.getElementValue(samlAssertion, IDENTIFICATION_TYPE_XPATH, "")); - authData.setGivenName( - XPathUtils.getElementValue(samlAssertion, GIVEN_NAME_XPATH, "")); - authData.setFamilyName( - XPathUtils.getElementValue(samlAssertion, FAMILY_NAME_XPATH, "")); - authData.setDateOfBirth( - XPathUtils.getElementValue(samlAssertion, DATE_OF_BIRTH_XPATH, "")); - authData.setQualifiedCertificate(BoolUtils.valueOf( - XPathUtils.getElementValue(samlAssertion, IS_QUALIFIED_CERT_XPATH, ""))); - String publicAuthority = - XPathUtils.getElementValue(samlAssertion, PUBLIC_AUTHORITY_XPATH, null); - if (publicAuthority == null) { - authData.setPublicAuthority(false); - authData.setPublicAuthorityCode(""); - } - else { - authData.setPublicAuthority(true); - if (! publicAuthority.equalsIgnoreCase("true")) - authData.setPublicAuthorityCode(publicAuthority); - } - return authData; - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java deleted file mode 100644 index cec8dbe6c..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/parser/SAMLResponseParser.java +++ /dev/null @@ -1,147 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.parser; - -import org.w3c.dom.Element; - -import at.gv.egovernment.moa.id.auth.exception.ParseException; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.data.SAMLStatus; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.util.Constants; -import at.gv.egovernment.moa.util.XPathUtils; - -/** - * Parser for the <samlp:Response> returned by the - * GetAuthenticationData web service. - * @author Paul Ivancsics - * @version $Id$ - */ -public class SAMLResponseParser implements Constants { - /** Element containing the samlResponse */ - private Element samlResponse; - /** Xpath prefix for reaching SAMLP Namespaces */ - private static String SAMLP = SAMLP_PREFIX + ":"; - /** Xpath prefix for reaching SAML Namespaces */ - private static String SAML = SAML_PREFIX + ":"; - /** Xpath prefix for reaching PersonData Namespaces */ - private static String PR = PD_PREFIX + ":"; - /** Xpath expression for reaching the SAMLP:Response element */ - private static final String ROOT = - "/" + SAMLP + "Response/"; - /** Xpath expression for reaching the SAMLP:Status element */ - private static final String STATUS_XPATH = - ROOT + - SAMLP + "Status/"; - /** Xpath expression for reaching the SAMLP:StatusCode_Value attribute */ - private static final String STATUSCODE_XPATH = - STATUS_XPATH + - SAMLP + "StatusCode/@Value"; - /** Xpath expression for reaching the SAMLP:SubStatusCode_Value attribute */ - private static final String SUBSTATUSCODE_XPATH = - STATUS_XPATH + - SAMLP + "StatusCode/" + - SAMLP + "StatusCode/@Value"; - /** Xpath expression for reaching the SAMLP:StatusMessage element */ - private static final String STATUSMESSAGE_XPATH = - STATUS_XPATH + - SAMLP + "StatusMessage"; - /** Xpath expression for reaching the SAML:Assertion element */ - private static String ASSERTION_XPATH = - ROOT + - SAML + "Assertion"; - - /** - * Constructor - * @param samlResponse the <samlp:Response> as a DOM element - */ - public SAMLResponseParser(Element samlResponse) { - this.samlResponse = samlResponse; - } - - /** - * Parses the <samlp:StatusCode> from the <samlp:Response>. - * @return AuthenticationData object - * @throws ParseException on any parsing error - */ - public SAMLStatus parseStatusCode() - throws ParseException { - - SAMLStatus status = new SAMLStatus(); - try { - status.setStatusCode( - XPathUtils.getAttributeValue(samlResponse, STATUSCODE_XPATH, "")); - status.setSubStatusCode( - XPathUtils.getAttributeValue(samlResponse, SUBSTATUSCODE_XPATH, "")); - status.setStatusMessage( - XPathUtils.getElementValue(samlResponse, STATUSMESSAGE_XPATH, "")); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - return status; - } - - /** - * Parses the <saml:Assertion> from the <samlp:Response>. - * @return AuthenticationData object - * @throws ParseException on any parsing error - */ - public SAML1AuthenticationData parseAuthenticationData() - throws ParseException { - - Element samlAssertion; - try { - samlAssertion = (Element)XPathUtils.selectSingleNode(samlResponse, ASSERTION_XPATH); - } - catch (Throwable t) { - throw new ParseException("parser.01", new Object[] { t.toString() }, t); - } - return new AuthenticationDataAssertionParser(samlAssertion).parseAuthenticationData(); - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java deleted file mode 100644 index e7340850c..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ConfigurationServlet.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.servlet; - -import java.io.IOException; -import java.text.DateFormat; -import java.util.Date; -import java.util.Locale; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import at.gv.egovernment.moa.id.proxy.MOAIDProxyInitializer; -import at.gv.egovernment.moa.id.util.HTTPRequestJSPForwarder; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.logging.Logger; - -/** - * Servlet requested for updating the MOA-ID Auth configuration from configuration file - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ConfigurationServlet extends HttpServlet { - - /** - * - */ - private static final long serialVersionUID = -886733697373217942L; - -/** - * Handle a HTTP GET request, used to indicated that the MOA - * configuration needs to be updated (reloaded). - * - * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest, HttpServletResponse) - */ - public void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - - MOAIDMessageProvider msg = MOAIDMessageProvider.getInstance(); - try { - MOAIDProxyInitializer.initialize(); - - String message = msg.getMessage("config.00", new Object[] - { DateFormat.getTimeInstance(DateFormat.MEDIUM, Locale.GERMAN).format(new Date())} ); - Logger.info(message); - - HTTPRequestJSPForwarder.forwardNamed(message, "/message-proxy.jsp", getServletContext(), request, response); - } catch (Throwable t) { - String errorMessage = msg.getMessage("config.04", null); - Logger.error(errorMessage, t); - HTTPRequestJSPForwarder.forwardNamed(errorMessage, "/message-proxy.jsp", getServletContext(), request, response); - } - } - - /** - * Do the same as doGet. - * - * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest, HttpServletResponse) - */ - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - doGet(request, response); - } - -/** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ -public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); -} - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java deleted file mode 100644 index d4d4fa7a1..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyException.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.servlet; - -import at.gv.egovernment.moa.id.auth.exception.MOAIDException; - -/** - * Exception thrown while proxying a request to the online application - * - * @author Paul Ivancsics - * @version $Id$ - */ -public class ProxyException extends MOAIDException { - - /** - * - */ - private static final long serialVersionUID = -2498996404868930153L; - -/** - * Constructor for ProxyException. - * @param messageId - * @param parameters - */ - public ProxyException(String messageId, Object[] parameters) { - super(messageId, parameters); - } - - /** - * Constructor for ProxyException. - * @param messageId - * @param parameters - * @param wrapped - */ - public ProxyException( - String messageId, - Object[] parameters, - Throwable wrapped) { - super(messageId, parameters, wrapped); - } - -} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java deleted file mode 100644 index 9447f2e35..000000000 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/servlet/ProxyServlet.java +++ /dev/null @@ -1,1008 +0,0 @@ -/******************************************************************************* - * Copyright 2014 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - ******************************************************************************/ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.id.proxy.servlet; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.StringWriter; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Vector; - -import javax.net.ssl.SSLSocketFactory; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.commons.lang.StringEscapeUtils; - -import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; -import at.gv.egovernment.moa.id.auth.exception.BuildException; -import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.auth.exception.ParseException; -import at.gv.egovernment.moa.id.auth.exception.ServiceException; -import at.gv.egovernment.moa.id.auth.servlet.RedirectServlet; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.legacy.ConnectionParameter; -import at.gv.egovernment.moa.id.config.proxy.OAConfiguration; -import at.gv.egovernment.moa.id.config.proxy.OAProxyParameter; -import at.gv.egovernment.moa.id.config.proxy.ProxyConfigurationProvider; -import at.gv.egovernment.moa.id.data.AuthenticationData; -import at.gv.egovernment.moa.id.protocols.saml1.SAML1AuthenticationData; -import at.gv.egovernment.moa.id.proxy.ConnectionBuilder; -import at.gv.egovernment.moa.id.proxy.ConnectionBuilderFactory; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolver; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolverException; -import at.gv.egovernment.moa.id.proxy.LoginParameterResolverFactory; -import at.gv.egovernment.moa.id.proxy.MOAIDProxyInitializer; -import at.gv.egovernment.moa.id.proxy.NotAllowedException; -import at.gv.egovernment.moa.id.proxy.invoke.GetAuthenticationDataInvoker; -import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; -import at.gv.egovernment.moa.id.util.SSLUtils; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.Base64Utils; -import at.gv.egovernment.moa.util.MiscUtil; -import at.gv.egovernment.moa.util.URLEncoder; - -/** - * Servlet requested for logging in at an online application, - * and then for proxying requests to the online application. - * @author Paul Ivancsics - * @version $Id$ - */ -public class ProxyServlet extends HttpServlet { - /** - * - */ - private static final long serialVersionUID = 6838184868735988125L; -/** Name of the Parameter for the Target */ - private static final String PARAM_TARGET = "Target"; - /** Name of the Parameter for the SAMLArtifact */ - private static final String PARAM_SAMLARTIFACT = "SAMLArtifact"; - /** Name of the Parameter for the ErrorMessage */ - private static final String PARAM_ERRORMASSAGE = "error"; - - /** Name of the Attribute for marking the session as authenticated*/ - private static final String ATT_AUTHDATAFETCHED = "AuthDataFetched"; - /** Name of the Attribute for the PublicURLPrefix */ - private static final String ATT_PUBLIC_URLPREFIX = "PublicURLPrefix"; - /** Name of the Attribute for the RealURLPrefix */ - private static final String ATT_REAL_URLPREFIX = "RealURLPrefix"; - /** Name of the Attribute for the SSLSocketFactory */ - private static final String ATT_SSL_SOCKET_FACTORY = "SSLSocketFactory"; - /** Name of the Attribute for the LoginHeaders */ - private static final String ATT_LOGIN_HEADERS = "LoginHeaders"; - /** Name of the Attribute for the LoginParameters */ - private static final String ATT_LOGIN_PARAMETERS = "LoginParameters"; - /** Name of the Attribute for the SAMLARTIFACT */ - private static final String ATT_SAML_ARTIFACT = "SamlArtifact"; - /** Name of the Attribute for the state of the browser request for login dialog*/ - private static final String ATT_BROWSERREQU = "BrowserLoginRequest"; - /** Name of the Attribute for the state of the browser request for login dialog*/ - private static final String ATT_OA_CONF = "oaConf"; - /** Name of the Attribute for the Logintype of the OnlineApplication*/ - private static final String ATT_OA_LOGINTYPE = "LoginType"; - /** Name of the Attribute for the number of the try to login into the OnlineApplication*/ - private static final String ATT_OA_LOGINTRY = "LoginTry"; - /** Maximum permitted login tries */ - private static final int MAX_OA_LOGINTRY = 3; - /** Name of the Attribute for authorization value for further connections*/ - private static final String ATT_OA_AUTHORIZATION_HEADER = "authorizationkey"; - /** Name of the Attribute for user binding */ - private static final String ATT_OA_USER_BINDING = "UserBinding"; - /** For extended internal debug messages */ - private static final boolean INTERNAL_DEBUG = false; - /** Message to be given if browser login failed */ - private static final String RET_401_MSG = "Ein Fehler ist aufgetreten

Fehler bei der Anmeldung

Bei der Anmeldung ist ein Fehler aufgetreten.

Fehler bei der Anmeldung.
Prüfen Sie bitte ihre Berechtigung.
Abbruch durch den Benutzer.

"; - - /** - * @see javax.servlet.http.HttpServlet#service(HttpServletRequest, HttpServletResponse) - */ - protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - Logger.debug("getRequestURL:" + req.getRequestURL().toString()); - - String artifact = req.getParameter(PARAM_SAMLARTIFACT); - artifact = StringEscapeUtils.escapeHtml(artifact); - - try { - if (artifact != null) { - // check if SAML Artifact was already used in this session (in case of page reload) - HttpSession session = req.getSession(); - if (null != session && artifact.equals(session.getAttribute(ATT_SAML_ARTIFACT))) { - if (session.getAttribute(ATT_BROWSERREQU)==null) { - tunnelRequest(req, resp); - }else{ - login(req, resp); //login after browser login dialog - } - } else - // it is the first time that the SAML Artifact was used - login(req, resp); - } - else - tunnelRequest(req, resp); - } - catch (MOAIDException ex) { - handleError(ex.getMessage(), ex, req, resp); - } - catch (Throwable ex) { - handleError(ex.getMessage(), ex, req, resp); - } - } - - /** - * Login to online application at first call of servlet for a user session.
- *
    - *
  • Acquires authentication data from the MOA-ID Auth component.
  • - *
  • Reads configuration data for the online application.
  • - *
  • Resolves login parameters.
  • - *
  • Sets up an SSLSocketFactory in case of a secure connection to the online application.
  • - *
  • For a stateless online application, stores data in the HttpSession.
  • - *
  • Tunnels the request to the online application.
  • - *
- * @param req - * @param resp - * @throws ConfigurationException when wrong configuration is encountered - * @throws ProxyException when wrong configuration is encountered - * @throws BuildException while building the request for MOA-ID Auth - * @throws ServiceException while invoking MOA-ID Auth - * @throws ParseException while parsing the response from MOA-ID Auth - */ - private void login(HttpServletRequest req, HttpServletResponse resp) throws ConfigurationException, ProxyException, BuildException, ServiceException, ParseException, AuthenticationException { - - HttpSession session = req.getSession(); - String samlArtifact = ""; - Map loginHeaders = null; - Map loginParameters = null; - String publicURLPrefix = ""; - String realURLPrefix = ""; - SSLSocketFactory ssf = null; - String urlRequested = req.getRequestURL().toString(); - OAConfiguration oaConf = null; - String loginType = ""; - String binding = ""; - - if (session.getAttribute(ATT_BROWSERREQU)==null) { - - // read configuration data - ProxyConfigurationProvider proxyConf = ProxyConfigurationProvider.getInstance(); - OAProxyParameter oaParam = proxyConf.getOnlineApplicationParameter(urlRequested); - if (oaParam == null) { - throw new ProxyException("proxy.02", new Object[] { urlRequested }); - } - - samlArtifact = req.getParameter(PARAM_SAMLARTIFACT); - Logger.debug("moa-id-proxy login " + PARAM_SAMLARTIFACT + ": " + samlArtifact); - // String target = req.getParameter(PARAM_TARGET); parameter given but not processed - // boolean targetprovided = req.getParameter(PARAM_TARGET) != null; - - // get authentication data from the MOA-ID Auth component - SAML1AuthenticationData authData; - try { - authData = new GetAuthenticationDataInvoker().getAuthenticationData(samlArtifact); - - } catch (ServiceException ex) { - throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); - - } catch (ProxyException ex) { - throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); - - } catch (MOAIDException ex) { - String errorURL = oaParam.getErrorRedirctURL(); - if (MiscUtil.isNotEmpty(errorURL)) { - generateErrorAndRedirct(resp, errorURL, ex.getMessage()); - return; - - } else { - Logger.info("No ErrorRedirectURL defined. The error is shown on MOA-ID Proxy errorpage."); - throw new ProxyException("proxy.14", new Object[] {ex.getMessage()}, ex); - } - } - session.setAttribute(ATT_AUTHDATAFETCHED, "true"); - - publicURLPrefix = oaParam.getPublicURLPrefix(); - Logger.debug("OA: " + publicURLPrefix); - oaConf = oaParam.getOaConfiguration(); - ConnectionParameter oaConnParam = oaParam.getConnectionParameter(); - realURLPrefix = oaConnParam.getUrl(); - - // resolve login parameters to be forwarded to online application - LoginParameterResolver lpr = LoginParameterResolverFactory.getLoginParameterResolver(publicURLPrefix); - String clientIPAddress = req.getRemoteAddr(); - boolean businessService = oaParam.getBusinessService(); - try { - if (oaConf.getAuthType().equals(OAConfiguration.PARAM_AUTH)) { - loginParameters = lpr.getAuthenticationParameters(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); - } else { - loginHeaders = lpr.getAuthenticationHeaders(oaConf, authData, clientIPAddress, businessService, publicURLPrefix); - for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { - //extract user-defined bindingValue - String headerKey = (String) iter.next(); - String headerKeyValue = (String) loginHeaders.get(headerKey); - if (headerKey.equalsIgnoreCase("binding")) { - binding = (String) loginHeaders.get(headerKey); - } - for (int i = 1; i <= 3; i++) { - if (headerKey.equalsIgnoreCase("param" + i)) { - int sep = headerKeyValue.indexOf("="); - if (sep>-1) { - if (sep>0) { - String value = ""; - if (headerKeyValue.length()>sep+1) value = headerKeyValue.substring(sep+1); - if (loginParameters == null) loginParameters = new HashMap(); - loginParameters.put(headerKeyValue.substring(0,sep) , value); - } - } else { - loginParameters.put(headerKey, ""); - } - } - } - } - loginHeaders.remove("binding"); - loginHeaders.remove("param1"); - loginHeaders.remove("param2"); - loginHeaders.remove("param3"); - } - } catch (LoginParameterResolverException ex) { - String errorURL = oaParam.getErrorRedirctURL(); - if (MiscUtil.isNotEmpty(errorURL)) { - generateErrorAndRedirct(resp, errorURL, - MOAIDMessageProvider.getInstance().getMessage("proxy.13", - new Object[] { publicURLPrefix })); - return; - - } else - throw new ProxyException("proxy.13", new Object[] { publicURLPrefix }); - - } catch (NotAllowedException e) { - String errorURL = oaParam.getErrorRedirctURL(); - if (MiscUtil.isNotEmpty(errorURL)) { - generateErrorAndRedirct(resp, errorURL, - MOAIDMessageProvider.getInstance().getMessage("proxy.15", - new Object[] { })); - return; - - } else - throw new ProxyException("proxy.15", new Object[] { }); - } - - // setup SSLSocketFactory for communication with the online application - if (oaConnParam.isHTTPSURL()) { - try { - ssf = SSLUtils.getSSLSocketFactory(proxyConf, oaConnParam); - } catch (Throwable ex) { - throw new ProxyException( - "proxy.05", - new Object[] { oaConnParam.getUrl(), ex.toString()}, - ex); - } - } - - // for stateless online application, store data in HttpSession - loginType = oaConf.getLoginType(); - if ("".equalsIgnoreCase(binding)) { - binding = oaConf.getBinding(); - if ("".equalsIgnoreCase(binding)) binding = "full"; - } - Logger.debug("Login type: " + loginType); - if (loginType.equals(OAConfiguration.LOGINTYPE_STATELESS)) { - int sessionTimeOut = oaParam.getSessionTimeOut(); - if (sessionTimeOut == 0) - sessionTimeOut = 60 * 60; // default 1 h - - session.setMaxInactiveInterval(sessionTimeOut); - session.setAttribute(ATT_PUBLIC_URLPREFIX, publicURLPrefix); - session.setAttribute(ATT_REAL_URLPREFIX, realURLPrefix); - session.setAttribute(ATT_SSL_SOCKET_FACTORY, ssf); - session.setAttribute(ATT_LOGIN_HEADERS, loginHeaders); - session.setAttribute(ATT_LOGIN_PARAMETERS, loginParameters); - session.setAttribute(ATT_SAML_ARTIFACT, samlArtifact); - session.setAttribute(ATT_OA_CONF, oaConf); - session.setAttribute(ATT_OA_LOGINTYPE, loginType); - session.setAttribute(ATT_OA_USER_BINDING, binding); - session.removeAttribute(ATT_BROWSERREQU); - session.removeAttribute(ATT_OA_AUTHORIZATION_HEADER); - session.removeAttribute(ATT_OA_LOGINTRY); - Logger.debug("moa-id-proxy: HTTPSession " + session.getId() + " angelegt"); - } - - } else { - loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); - publicURLPrefix = (String) session.getAttribute(ATT_PUBLIC_URLPREFIX); - realURLPrefix = (String) session.getAttribute(ATT_REAL_URLPREFIX); - ssf = (SSLSocketFactory) session.getAttribute(ATT_SSL_SOCKET_FACTORY); - loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); - loginParameters = (Map) session.getAttribute(ATT_LOGIN_PARAMETERS); - samlArtifact = (String) session.getAttribute(ATT_SAML_ARTIFACT); - oaConf = (OAConfiguration) session.getAttribute(ATT_OA_CONF); - loginType = (String) session.getAttribute(ATT_OA_LOGINTYPE); - binding = (String) session.getAttribute(ATT_OA_USER_BINDING); - session.removeAttribute(ATT_BROWSERREQU); - Logger.debug("moa-id-proxy: HTTPSession " + session.getId() + " aufgenommen"); - } - - try { - int respcode = 0; - - // tunnel request to the online application - respcode = tunnelRequest(req, resp, loginHeaders, loginParameters, publicURLPrefix, realURLPrefix, ssf, binding); - if (respcode == 401) { - if (OAConfiguration.BINDUNG_FULL.equals(binding) && oaConf.getLoginType().equals(OAConfiguration.LOGINTYPE_STATELESS)) { - throw new ProxyException("proxy.12", new Object[] { realURLPrefix }); - } - } - } catch (ProxyException ex) { - throw new ProxyException("proxy.12", new Object[] { realURLPrefix }); - } catch (Throwable ex) { - throw new ProxyException("proxy.04", new Object[] { urlRequested, ex.toString()}, ex); - } - } - - /** - * Tunnels a request to the stateless online application using data stored in the HTTP session. - * @param req HTTP request - * @param resp HTTP response - * @throws IOException if an I/O error occurs - */ - private void tunnelRequest(HttpServletRequest req, HttpServletResponse resp) throws ProxyException, IOException { - - //Logger.debug("Tunnel request (stateless)"); - HttpSession session = req.getSession(false); - - if (session == null) - throw new ProxyException("proxy.07", null); - String publicURLPrefix = (String) session.getAttribute(ATT_PUBLIC_URLPREFIX); - //A session is automatically created when forwarded 1st time to errorpage-proxy.jsp (with the handleError method) - //additional check if publicURLPrefix is OK, if not throw an Exception - if (publicURLPrefix == null) - throw new ProxyException("proxy.07", null); - - String realURLPrefix = (String) session.getAttribute(ATT_REAL_URLPREFIX); - SSLSocketFactory ssf = (SSLSocketFactory) session.getAttribute(ATT_SSL_SOCKET_FACTORY); - Map loginHeaders = (Map) session.getAttribute(ATT_LOGIN_HEADERS); - Map loginParameters = (Map) session.getAttribute(ATT_LOGIN_PARAMETERS); - String binding = (String) session.getAttribute(ATT_OA_USER_BINDING); - if (publicURLPrefix == null || realURLPrefix == null) - throw new ProxyException("proxy.08", new Object[] { req.getRequestURL().toString()}); - - int respcode = tunnelRequest(req, resp, loginHeaders, loginParameters, publicURLPrefix, realURLPrefix, ssf, binding); - if (respcode == -401) // #tries to login exceeded - throw new ProxyException("proxy.16", new Object[] {realURLPrefix, Integer.toString(MAX_OA_LOGINTRY)}); - } - -/** - * Tunnels a request to the online application using given URL mapping and SSLSocketFactory. - * This method returns the ResponseCode of the request to the online application. - * @param req HTTP request - * @param resp HTTP response - * @param loginHeaders header field/values to be inserted for purposes of authentication; - * may be null - * @param loginParameters parameter name/values to be inserted for purposes of authentication; - * may be null - * @param publicURLPrefix prefix of request URL to be substituted for the realURLPrefix - * @param realURLPrefix prefix of online application URL to substitute the publicURLPrefix - * @param ssf SSLSocketFactory to use - * @throws IOException if an I/O error occurs - */ -private int tunnelRequest(HttpServletRequest req, HttpServletResponse resp, Map loginHeaders, Map loginParameters, String publicURLPrefix, String realURLPrefix, SSLSocketFactory ssf, String binding) - throws IOException { - - String originBinding = binding; - String browserUserID = ""; - String browserPassword = ""; - //URL url = new URL(realURLPrefix); - //String realURLHost = url.getHost(); - if (INTERNAL_DEBUG && !binding.equals("")) Logger.debug("Binding: " + binding); - - // collect headers from request - Map headers = new HashMap(); - for (Enumeration enu = req.getHeaderNames(); enu.hasMoreElements();) { - String headerKey = (String) enu.nextElement(); - String headerKeyValue = req.getHeader(headerKey); - if (INTERNAL_DEBUG) Logger.debug("Incoming:" + headerKey + "=" + headerKeyValue); - //Analyze Basic-Auth-Headers from the client - if (headerKey.equalsIgnoreCase("Authorization")) { - if (headerKeyValue.substring(0,6).equalsIgnoreCase("Basic ")) { - String credentials = headerKeyValue.substring(6); - byte [] bplaintextcredentials = Base64Utils. decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - browserUserID = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); - browserPassword = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - //deactivate following line for security - //if (INTERNAL_DEBUG) Logger.debug("Analyzing authorization-header from browser: " + headerKeyValue + "gives UN:PW=" + browserUserID + ":" + browserPassword ); - } - if (headerKeyValue.substring(0,9).equalsIgnoreCase("Negotiate")) { - //deactivate following line for security - //if (INTERNAL_DEBUG) Logger.debug("Analyzing authorization-header from browser: Found NTLM Aut.: " + headerKeyValue + "gives UN:PW=" + browserUserID + ":" + browserPassword ); - } - } - else - { - /* Headers MUST NOT be repaced according to our Spec. - if (headerKey.equalsIgnoreCase("Host")) { - headerKeyValue = realURLHost; - //headerKeyValue= realURLPrefix.substring(hoststartpos); - if (INTERNAL_DEBUG) Logger.debug("replaced:" + headerKey + "=" + headerKeyValue); - } - */ - headers.put(headerKey, headerKeyValue); - } - } - - - // collect login headers, possibly overwriting headers from request - String authorizationvalue=""; - if (req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER)==null) { - - if (OAConfiguration.BINDUNG_NOMATCH.equals(binding)) { - int loginTry = getLoginTry(req); - Logger.debug("Binding: mode = " + OAConfiguration.BINDUNG_NOMATCH + "(try #" + Integer.toString(loginTry) + ")"); - if (loginTry==1) { - binding = OAConfiguration.BINDUNG_FULL; - } else { - binding = OAConfiguration.BINDUNG_USERNAME; - } - } - - /* Soll auch bei anderen bindings zuerst ein passwort probiert werden k�nnen: - //if we have the first Login-Try and we have Binding to Username and a predefined Password we try this one first - // full binding will be covered by next block - if (loginTry==1 && !OAConfiguration.BINDUNG_FULL.equals(binding)) { - //1st try: if we have a password, try this one first - for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { - String headerKey = (String) iter.next(); - String headerKeyValue = (String) loginHeaders.get(headerKey); - if (isBasicAuthenticationHeader(headerKey, headerKeyValue)) { - String credentials = headerKeyValue.substring(6); - byte [] bplaintextcredentials = Base64Utils.decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - String password = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - if (password!=null && !password.equals("")) { - Logger.debug("Binding: found predefined password. Trying full binding first"); - binding = OAConfiguration.BINDUNG_FULL; - break; - } - } - } - } - */ - - - - //we have a connection with not having logged on - if (loginHeaders != null && (browserPassword.length()!=0 || browserUserID.length()!=0 || OAConfiguration.BINDUNG_FULL.equals(binding))) { - for (Iterator iter = loginHeaders.keySet().iterator(); iter.hasNext();) { - String headerKey = (String) iter.next(); - String headerKeyValue = (String) loginHeaders.get(headerKey); - //customize loginheaders if necessary - if (isBasicAuthenticationHeader(headerKey, headerKeyValue)) - { - if (OAConfiguration.BINDUNG_FULL.equals(binding)) { - authorizationvalue = headerKeyValue; - Logger.debug("Binding: full binding to user established"); - } else { - String credentials = headerKeyValue.substring(6); - byte [] bplaintextcredentials = Base64Utils.decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - String userID = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); - String password = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - String userIDPassword = ":"; - if (OAConfiguration.BINDUNG_USERNAME.equals(binding)) { - Logger.debug("Binding: Access with necessary binding to user"); - userIDPassword = userID + ":" + browserPassword; - } else if (OAConfiguration.BINDUNG_NONE.equals(binding)) { - Logger.debug("Binding: Access without binding to user"); - //If first time - if (browserUserID.length()==0) browserUserID = userID; - if (browserPassword.length()==0) browserPassword = password; - userIDPassword = browserUserID + ":" + browserPassword; - } else { - userIDPassword = userID + ":" + password; - } - credentials = Base64Utils.encode(userIDPassword.getBytes()); - authorizationvalue = "Basic " + credentials; - headerKeyValue = authorizationvalue; - } - } - headers.put(headerKey, headerKeyValue); - } - } - }else{ - //if OA needs Authorization header in each further request - authorizationvalue = (String) req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER); - if (loginHeaders != null) headers.put("Authorization", authorizationvalue); - } - - - Vector parameters = new Vector(); - for (Enumeration enu = req.getParameterNames(); enu.hasMoreElements();) { - String paramName = (String) enu.nextElement(); - if (!(paramName.equals(PARAM_SAMLARTIFACT) || paramName.equals(PARAM_TARGET))) { - if (INTERNAL_DEBUG) Logger.debug("Req Parameter-put: " + paramName + ":" + req.getParameter(paramName)); - String parameter[] = new String[2]; - parameter[0]= paramName; - parameter[1]= req.getParameter(paramName); - parameters.add(parameter); - } - } - // collect login parameters, possibly overwriting parameters from request - if (loginParameters != null) { - for (Iterator iter = loginParameters.keySet().iterator(); iter.hasNext();) { - String paramName = (String) iter.next(); - if (!(paramName.equals(PARAM_SAMLARTIFACT) || paramName.equals(PARAM_TARGET))) { - if (INTERNAL_DEBUG) Logger.debug("Req Login-Parameter-put: " + paramName + ":" + loginParameters.get(paramName)); - String parameter[] = new String[2]; - parameter[0]= paramName; - parameter[1]= (String) loginParameters.get(paramName); - parameters.add(parameter); - } - } - } - - ConnectionBuilder cb = ConnectionBuilderFactory.getConnectionBuilder(publicURLPrefix); - HttpURLConnection conn = cb.buildConnection(req, publicURLPrefix, realURLPrefix, ssf, parameters); - - // set headers as request properties of URLConnection - for (Iterator iter = headers.keySet().iterator(); iter.hasNext();) { - String headerKey = (String) iter.next(); - String headerValue = (String) headers.get(headerKey); - String LogStr = "Req header " + headerKey + ": " + headers.get(headerKey); - if (isBasicAuthenticationHeader(headerKey, headerValue)) { - String credentials = headerValue.substring(6); - byte [] bplaintextcredentials = Base64Utils. decode(credentials, true); - String plaintextcredentials = new String(bplaintextcredentials); - String uid = plaintextcredentials.substring(0,plaintextcredentials.indexOf(":")); - String pwd = plaintextcredentials.substring(plaintextcredentials.indexOf(":")+1); - //Sollte AuthorizationInfo vom HTTPClient benutzt werden: cb.addBasicAuthorization(publicURLPrefix, uid, pwd); - //deactivate following line for security - //if (INTERNAL_DEBUG && Logger.isDebugEnabled()) LogStr = LogStr + " >UserID:Password< >" + uid + ":" + pwd + "<"; - } - conn.setRequestProperty(headerKey, headerValue); - if (INTERNAL_DEBUG) Logger.debug(LogStr); - } - - StringWriter sb = new StringWriter(); - - // Write out parameters into output stream of URLConnection. - // On GET request, do not send parameters in any case, - // otherwise HttpURLConnection would send a POST. - if (!"get".equalsIgnoreCase(req.getMethod()) && !parameters.isEmpty()) { - boolean firstParam = true; - String parameter[] = new String[2]; - for (Iterator iter = parameters.iterator(); iter.hasNext();) { - parameter = (String[]) iter.next(); - String paramName = parameter[0]; - String paramValue = parameter[1]; - if (firstParam) - firstParam = false; - else - sb.write("&"); - sb.write(paramName); - sb.write("="); - sb.write(paramValue); - if (INTERNAL_DEBUG) Logger.debug("Req param " + paramName + ": " + paramValue); - } - } - - // For WebDAV and POST: copy content - if (!"get".equalsIgnoreCase(req.getMethod())) { - if (INTERNAL_DEBUG && !"post".equalsIgnoreCase(req.getMethod())) Logger.debug("---- WEBDAV ---- copying content"); - try { - OutputStream out = conn.getOutputStream(); - InputStream in = req.getInputStream(); - if (!parameters.isEmpty()) out.write(sb.toString().getBytes()); //Parameter nicht mehr mittels Printwriter schreiben - copyStream(in, out, null, req.getMethod()); - out.flush(); - out.close(); - } catch (IOException e) { - if (!"post".equalsIgnoreCase(req.getMethod())) - Logger.debug("---- WEBDAV ---- streamcopy problem"); - else - Logger.debug("---- POST ---- streamcopy problem"); - } - } - - // connect - if (INTERNAL_DEBUG) Logger.debug("Connect Request"); - conn.connect(); - if (INTERNAL_DEBUG) Logger.debug("Connect Response"); - - // check login tries - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { - int loginTry = getLoginTry(req); - req.getSession().setAttribute(ATT_OA_LOGINTRY, Integer.toString(loginTry)); - if (loginTry > MAX_OA_LOGINTRY) { - Logger.debug("Found 401 UNAUTHORIZED, maximum tries exceeded; leaving..."); - cb.disconnect(conn); - return -401; - } - } - - - - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED && OAConfiguration.BINDUNG_FULL.equals(originBinding)) { - Logger.debug("Found 401 UNAUTHORIZED, leaving..."); - cb.disconnect(conn); - return conn.getResponseCode(); - } - - - resp.setStatus(conn.getResponseCode()); - //Issue by Gregor Karlinger - content type was annotated twice - //resp.setContentType(conn.getContentType()); - - if (loginHeaders != null && (conn.getResponseCode()==HttpURLConnection.HTTP_OK || conn.getResponseCode()==HttpURLConnection.HTTP_MOVED_TEMP) && req.getSession().getAttribute(ATT_OA_AUTHORIZATION_HEADER)==null) { - req.getSession().setAttribute(ATT_OA_AUTHORIZATION_HEADER, authorizationvalue); - Logger.debug("Login OK. Saving authorization header to remember in further requests"); - } - - // Read response headers - // Omit response header "content-length" if response header "Transfer-encoding: chunked" is set. - // Otherwise, the connection will not be kept alive, resulting in subsequent missing requests. - // See JavaDoc of javax.servlet.http.HttpServlet: - // When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. - Vector respHeaders = new Vector(); - - boolean chunked = false; - String contentLengthKey = null; - String transferEncodingKey = null; - int i = 1; - String headerKey; - String loginType = (String) req.getSession().getAttribute(ATT_OA_LOGINTYPE); - while ((headerKey = conn.getHeaderFieldKey(i)) != null) { - String headerValue = conn.getHeaderField(i); - - if (headerKey.equalsIgnoreCase("WWW-Authenticate")) { - int start = headerValue.indexOf("Basic realm=\""); - boolean requestsBasicAuth = headerValue.substring(start).startsWith("Basic realm=\""); - if (requestsBasicAuth) { - headerValue = "Basic realm=\"" + publicURLPrefix + "\""; - - if ( OAConfiguration.BINDUNG_USERNAME.equals(originBinding) || OAConfiguration.BINDUNG_NOMATCH.equals(originBinding)) - headerValue = "Basic realm=\"Bitte Passwort eingeben\""; - else if ("none".equals(originBinding)) { - headerValue = "Basic realm=\"Bitte Benutzername und Passwort eingeben\""; - } - } - } - -// // Überschrift im Browser-Passworteingabedialog setzen (sonst ist der reale host eingetragen) -// if (headerKey.equalsIgnoreCase("WWW-Authenticate") && headerValue.startsWith("Basic realm=\"")) { -// headerValue = "Basic realm=\"" + publicURLPrefix + "\""; -// if (OAConfiguration.BINDUNG_USERNAME.equals(originBinding) || OAConfiguration.BINDUNG_NOMATCH.equals(originBinding)) { -// headerValue = "Basic realm=\"Bitte Passwort eingeben\""; -// } else if (OAConfiguration.BINDUNG_NONE.equals(originBinding)) { -// headerValue = "Basic realm=\"Bitte Benutzername und Passwort eingeben\""; -// } -// } - - String respHeader[] = new String[2]; - if ((conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) && headerKey.equalsIgnoreCase("content-length")) { - //alter the unauthorized message with template for login - //TODO: supply a special login form on unauthorized messages with bindings!=full - headerValue = Integer.toString(RET_401_MSG.length()); - } - respHeader[0]= headerKey; - respHeader[1]= headerValue; - - if (!(OAConfiguration.BINDUNG_FULL.equals(originBinding) && OAConfiguration.LOGINTYPE_STATELESS.equals(loginType) && headerKey.equalsIgnoreCase("WWW-Authenticate") && headerValue.startsWith("Basic realm=\""))) { - respHeaders.add(respHeader); - if (INTERNAL_DEBUG) Logger.debug("Resp header " + headerKey + ": " + headerValue); - } else { - Logger.debug("Resp header ---REMOVED--- " + headerKey + ": " + headerValue); - } - if (isTransferEncodingChunkedHeader(headerKey, headerValue) || "content-length".equalsIgnoreCase(headerKey)) { - respHeaders.remove(respHeader); - Logger.debug("Resp header " + headerKey + " REMOVED"); - } - - i++; - } - - - String headerValue; - String respHeader[] = new String[2]; - - //write out all Responseheaders - for (Iterator iter = respHeaders.iterator(); iter.hasNext();) { - respHeader = (String[]) iter.next(); - headerKey = respHeader[0]; - headerValue = respHeader[1]; - resp.addHeader(headerKey, headerValue); - } - - //Logger.debug(">>>> Copy Content"); - //Logger.debug(" from ()" + conn.getURL()); - //Logger.debug(" to (" + req.getRemoteAddr() + ":"+ ") " +req.getRequestURL()); - - // read response stream - Logger.debug("Resp from " + conn.getURL().toString() + ": status " + conn.getResponseCode()); - // Load content unless the server lets us know that the content is NOT MODIFIED... - if (conn.getResponseCode()!=HttpURLConnection.HTTP_NOT_MODIFIED ) { - BufferedInputStream respIn = new BufferedInputStream(conn.getInputStream()); - //Logger.debug("Got Inputstream"); - BufferedOutputStream respOut = new BufferedOutputStream(resp.getOutputStream()); - //Logger.debug("Got Outputstream"); - - byte [] buffer = new byte[4096]; - if (respOut != null) { - int bytesRead; - while ((bytesRead = respIn.read(buffer)) >= 0) { - if (conn.getResponseCode()!=HttpURLConnection.HTTP_UNAUTHORIZED) respOut.write(buffer, 0, bytesRead); - } - } else { - while (respIn.read(buffer) >= 0); - } - - - /* - int ch; - StringBuffer strBuf = new StringBuffer(""); - while ((ch = respIn.read()) >= 0) { - if (conn.getResponseCode()!=HttpURLConnection.HTTP_UNAUTHORIZED) respOut.write(ch); - strBuf.append((char)ch); - } - Logger.debug("Resp Content:"); - if (strBuf.toString().length()>500) - Logger.debug(strBuf.toString().substring(0,500)); - else - Logger.debug(strBuf.toString()); - */ - - - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { - respOut.write(RET_401_MSG.getBytes()); - } - respOut.flush(); - respOut.close(); - respIn.close(); - if (conn.getResponseCode()==HttpURLConnection.HTTP_UNAUTHORIZED) { - Logger.debug("Found 401 UNAUTHORIZED..."); - cb.disconnect(conn); - return conn.getResponseCode(); - } - } else { - //if (conn.getResponseCode()==HttpURLConnection.HTTP_NOT_MODIFIED) - Logger.debug("Found 304 NOT MODIFIED..."); - } - - cb.disconnect(conn); - Logger.debug("Request done"); - - return conn.getResponseCode(); -} - -/** - * Gets the current amount of the login try at the online application - * - * @param req the HttpServletRequest - * @return the number off the current login try - */ -private int getLoginTry(HttpServletRequest req) { - String oa_loginTry = (String) req.getSession().getAttribute(ATT_OA_LOGINTRY); - int loginTry = 1; - if (oa_loginTry!=null) loginTry = Integer.parseInt(oa_loginTry)+1; - return loginTry; -} -/** - * Determines whether a HTTP header is a basic authentication header of the kind "Authorization: Basic ..." - * - * @param headerKey header name - * @param headerValue header value - * @return true for a basic authentication header - */ -private boolean isBasicAuthenticationHeader(String headerKey, String headerValue) { - if (!"authorization".equalsIgnoreCase(headerKey)) - return false; - if (headerValue.length() < "basic".length()) - return false; - String authenticationSchema = headerValue.substring(0, "basic".length()); - return "basic".equalsIgnoreCase(authenticationSchema); -} -/** - * Determines whether a basic authentication header of the kind "Authorization: Basic ..." - * is included in a HTTP request - * @param req HTTP request - * @return true for a basic authentication header provided - */ -private boolean isBasicAuthenticationHeaderProvided(HttpServletRequest req) { - for (Enumeration enu = req.getHeaderNames(); enu.hasMoreElements();) { - String headerKey = (String) enu.nextElement(); - String headerValue = req.getHeader(headerKey); - if (isBasicAuthenticationHeader(headerKey, headerValue)) - return true; - } - return false; -} -/** - * Determines whether a HTTP header is "Transfer-encoding" header with value containing "chunked" - * - * @param headerKey header name - * @param headerValue header value - * @return true for a "Transfer-encoding: chunked" header - */ -private boolean isTransferEncodingChunkedHeader(String headerKey, String headerValue) { - if (!"transfer-encoding".equalsIgnoreCase(headerKey)) - return false; - return headerValue.indexOf("chunked") >= 0 || headerValue.indexOf("Chunked") >= 0 || headerValue.indexOf("CHUNKED") >= 0; -} - -/** - * Calls the web application initializer. - * - * @see javax.servlet.Servlet#init(ServletConfig) - */ -public void init(ServletConfig servletConfig) throws ServletException { - super.init(servletConfig); - try { - MOAIDProxyInitializer.initialize(); - Logger.info(MOAIDMessageProvider.getInstance().getMessage("proxy.00", null)); - } - catch (Exception ex) { - Logger.fatal(MOAIDMessageProvider.getInstance().getMessage("proxy.06", null), ex); - throw new ServletException(ex); - } -} - -/** - * Handles an error.
- *
    - *
  • Logs the error
  • - *
  • Places error message and exception thrown into the request - * as request attributes (to be used by "/errorpage-proxy.jsp")
  • - *
  • Sets HTTP status 500 (internal server error)
  • - *
- * - * @param errorMessage error message - * @param exceptionThrown exception thrown - * @param req servlet request - * @param resp servlet response - */ -protected void handleError( - String errorMessage, Throwable exceptionThrown, HttpServletRequest req, HttpServletResponse resp) { - - - if(null != errorMessage) { - Logger.error(errorMessage); - req.setAttribute("ErrorMessage", errorMessage ); - } - - if (null != exceptionThrown) { - if(null == errorMessage) errorMessage = exceptionThrown.getMessage(); - Logger.error(errorMessage, exceptionThrown); - //req.setAttribute("ExceptionThrown", exceptionThrown); - } - - if (Logger.isDebugEnabled()) { - req.setAttribute("LogLevel", "debug"); - } - - //forward this to errorpage-proxy.jsp where the HTML error page is generated - ServletContext context = getServletContext(); - RequestDispatcher dispatcher = context.getRequestDispatcher("/errorpage-proxy.jsp"); - try { - dispatcher.forward(req, resp); - } catch (ServletException e) { - Logger.error(e); - } catch (IOException e) { - Logger.error(e); - } - -} - - -// * taken from iaik.utils.util.copyStream: -/** - * Reads all data (until EOF is reached) from the given source to the - * destination stream. If the destination stream is null, all data is dropped. - * It uses the given buffer to read data and forward it. If the buffer is - * null, this method allocates a buffer. - * - * @param source The stream providing the data. - * @param destination The stream that takes the data. If this is null, all - * data from source will be read and discarded. - * @param buffer The buffer to use for forwarding. If it is null, the method - * allocates a buffer. - * @exception IOException If reading from the source or writing to the - * destination fails. - */ -private static void copyStream(InputStream source, OutputStream destination, byte[] buffer, String method) throws IOException { - if (source == null) { - throw new NullPointerException("Argument \"source\" must not be null."); - } - if (buffer == null) { - buffer = new byte[4096]; - } - - if (destination != null) { - int bytesRead; - while ((bytesRead = source.read(buffer)) >= 0) { - destination.write(buffer, 0, bytesRead); - //if (method.equalsIgnoreCase("POST")) Logger.debug(buffer.toString()); - } - } else { - while (source.read(buffer) >= 0); - } -} - -private static void generateErrorAndRedirct(HttpServletResponse resp, String errorURL, String message) { - try { - errorURL = addURLParameter(errorURL, PARAM_ERRORMASSAGE, - URLEncoder.encode(message, "UTF-8")); - - } catch (UnsupportedEncodingException e) { - errorURL = addURLParameter(errorURL, PARAM_ERRORMASSAGE, "Fehlermeldung%20konnte%20nicht%20%C3%BCbertragen%20werden."); - } - - errorURL = resp.encodeRedirectURL(errorURL); - resp.setContentType("text/html"); - resp.setStatus(302); - resp.addHeader("Location", errorURL); -} - -protected static String addURLParameter(String url, String paramname, - String paramvalue) { - String param = paramname + "=" + paramvalue; - if (url.indexOf("?") < 0) - return url + "?" + param; - else - return url + "&" + param; -} - -} diff --git a/id/server/pom.xml b/id/server/pom.xml index 22d9536d6..b88bf7b49 100644 --- a/id/server/pom.xml +++ b/id/server/pom.xml @@ -19,7 +19,7 @@ idserverlib - proxy + auth moa-id-commons stork2-saml-engine -- cgit v1.2.3 From 95ce504efcf6eb886e353310570505d598e10561 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jun 2015 11:00:40 +0200 Subject: add new AuthConfigurationProviderFactory --- .../moa/id/config/ConfigurationProvider.java | 66 +++ .../auth/AuthConfigurationProviderFactory.java | 62 +++ .../api/AbstractConfigurationImpl.java | 538 +++++++++++++++++++++ 3 files changed, 666 insertions(+) create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java new file mode 100644 index 000000000..5ec0a5bc6 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java @@ -0,0 +1,66 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.config; + +/** + * @author tlenz + * + */ +public interface ConfigurationProvider { + + /** + * The name of the system property which contains the file name of the + * configuration file. + */ + public static final String CONFIG_PROPERTY_NAME = + "moa.id.configuration"; + + /** + * The name of the system property which contains the file name of the + * configuration file. + */ + public static final String PROXY_CONFIG_PROPERTY_NAME = + "moa.id.proxy.configuration"; + + /** + * The name of the generic configuration property giving the certstore directory path. + */ + public static final String DIRECTORY_CERTSTORE_PARAMETER_PROPERTY = + "DirectoryCertStoreParameters.RootDir"; + + /** + * The name of the generic configuration property switching the ssl revocation checking on/off + */ + public static final String TRUST_MANAGER_REVOCATION_CHECKING = + "TrustManager.RevocationChecking"; + + public String getRootConfigFileDir(); + + public String getDefaultChainingMode(); + + public String getTrustedCACertificates(); + + public String getCertstoreDirectory(); + + public boolean isTrustmanagerrevoationchecking(); +} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java new file mode 100644 index 000000000..8fad1bc83 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java @@ -0,0 +1,62 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.config.auth; + +import at.gv.egovernment.moa.id.config.ConfigurationException; +import at.gv.egovernment.moa.id.config.ConfigurationProvider; +import at.gv.egovernment.moa.logging.Logger; + +/** + * @author tlenz + * + */ +public class AuthConfigurationProviderFactory { + + /** Singleton instance. null, if none has been created. */ + private static AuthConfiguration instance = null;; + + + public static synchronized AuthConfiguration getInstance() + throws ConfigurationException { + + if (instance == null) { + reload(); + } + return instance; + } + + /** + * @return + * @throws ConfigurationException + */ + public static AuthConfiguration reload() throws ConfigurationException { + String fileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); + if (fileName == null) { + throw new ConfigurationException("config.01", null); + } + Logger.info("Loading MOA-ID-AUTH configuration " + fileName); + + instance = new PropertyBasedAuthConfigurationProvider(fileName); + return instance; + } +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java new file mode 100644 index 000000000..801e765c3 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java @@ -0,0 +1,538 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egiz.components.configuration.api; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author tlenz + * + */ +public abstract class AbstractConfigurationImpl implements Configuration { + + private static final Logger logger = LoggerFactory + .getLogger(AbstractConfigurationImpl.class); + + /** + * Get all keys from configuration + * @return The List values or null if no keys found + */ + abstract protected List getAllKeys() throws ConfigurationException; + + /** + * Get key specific value from configuration + * @param key The cfg id + * @return The string value or null if not found + */ + abstract protected String getValue(String key) throws ConfigurationException; + + /** + * Check configuration contains a specific key + * @param key The cfg id + * @return True if the cfg key is found + */ + abstract protected boolean containsKey(String key) throws ConfigurationException; + + /** + * Store a key/value pair to configuration + * @param key The cfg key + * @param value The cfg value + */ + abstract protected void storeKey(String key, String value) throws ConfigurationException; + + /** + * Delete a key from configuration + * @param key The cfg key + */ + abstract protected void deleteKey(String key) throws ConfigurationException; + + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getStringValue(java.lang.String) + */ + @Override + public String getStringValue(String id) throws ConfigurationException { + return getStringValue(id, null); + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getStringValue(java.lang.String, java.lang.String) + */ + @Override + public String getStringValue(String id, String defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) { + return defaultValue; + } + return value; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setStringValue(java.lang.String, java.lang.String) + */ + @Override + public void setStringValue(String id, String value) + throws ConfigurationException { + if (containsKey(id)) { + logger.debug("{} is overwritten with {}", id, value); + } + storeKey(id, value); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getByteValue(java.lang.String) + */ + @Override + public byte getByteValue(String id) throws ConfigurationException { + return getByteValue(id, (byte) 0); + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getByteValue(java.lang.String, byte) + */ + @Override + public byte getByteValue(String id, byte defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + byte bvalue = Byte.parseByte(value); + return bvalue; + } catch (Throwable e) { + logger.warn("Invalid configuration value {} is not a byte value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setByteValue(java.lang.String, byte) + */ + @Override + public void setByteValue(String id, byte value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getShortValue(java.lang.String) + */ + @Override + public short getShortValue(String id) throws ConfigurationException { + return getShortValue(id, (short) 0); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getShortValue(java.lang.String, short) + */ + @Override + public short getShortValue(String id, short defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + short svalue = Short.parseShort(value); + return svalue; + } catch (Throwable e) { + logger.warn("Invalid configuration value {} is not a short value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setShortValue(java.lang.String, short) + */ + @Override + public void setShortValue(String id, short value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getIntegerValue(java.lang.String) + */ + @Override + public int getIntegerValue(String id) throws ConfigurationException { + return getIntegerValue(id, 0); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getIntegerValue(java.lang.String, int) + */ + @Override + public int getIntegerValue(String id, int defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + int ivalue = Integer.parseInt(value); + return ivalue; + } catch (Throwable e) { + logger.warn("Invalid configuration value {} is not a int value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setIntegerValue(java.lang.String, int) + */ + @Override + public void setIntegerValue(String id, int value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getLongValue(java.lang.String) + */ + @Override + public long getLongValue(String id) throws ConfigurationException { + return getLongValue(id, 0L); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getLongValue(java.lang.String, long) + */ + @Override + public long getLongValue(String id, long defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + long lvalue = Long.parseLong(value); + return lvalue; + } catch (Throwable e) { + logger.warn("Invalid configuration value {} is not a long value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setLongValue(java.lang.String, long) + */ + @Override + public void setLongValue(String id, long value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getFloatValue(java.lang.String) + */ + @Override + public float getFloatValue(String id) throws ConfigurationException { + return getFloatValue(id, 0.0F); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getFloatValue(java.lang.String, float) + */ + @Override + public float getFloatValue(String id, float defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + float fvalue = Float.parseFloat(value); + return fvalue; + } catch (Throwable e) { + logger.warn("Invalid configuration value {} is not a float value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setFloatValue(java.lang.String, float) + */ + @Override + public void setFloatValue(String id, float value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getDoubleValue(java.lang.String) + */ + @Override + public double getDoubleValue(String id) throws ConfigurationException { + return getDoubleValue(id, 0.0D); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getDoubleValue(java.lang.String, double) + */ + @Override + public double getDoubleValue(String id, double defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + double dvalue = Double.parseDouble(value); + return dvalue; + } catch (Throwable e) { + logger.warn("Invalid configuration value {} is not a double value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setDoubleValue(java.lang.String, double) + */ + @Override + public void setDoubleValue(String id, double value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getBooleanValue(java.lang.String) + */ + @Override + public boolean getBooleanValue(String id) throws ConfigurationException { + return getBooleanValue(id, false); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getBooleanValue(java.lang.String, boolean) + */ + @Override + public boolean getBooleanValue(String id, boolean defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) + return defaultValue; + try { + boolean bvalue = Boolean.parseBoolean(value); + return bvalue; + } catch (Throwable e) { + logger.warn( + "Invalid configuration value {} is not a boolean value", + id, e); + } + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setBooleanValue(java.lang.String, boolean) + */ + @Override + public void setBooleanValue(String id, boolean value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getCharValue(java.lang.String) + */ + @Override + public char getCharValue(String id) throws ConfigurationException { + return getCharValue(id, '\0'); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getCharValue(java.lang.String, char) + */ + @Override + public char getCharValue(String id, char defaultValue) + throws ConfigurationException { + String value = getValue(id); + if (value == null) { + return defaultValue; + } + if (value.toCharArray().length > 0) { + return value.toCharArray()[0]; + } + logger.warn("Invalid configuration value {} is not a char value", id); + return defaultValue; + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setCharValue(java.lang.String, short) + */ + @Override + public void setCharValue(String id, short value) + throws ConfigurationException { + setStringValue(id, String.valueOf(value)); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getObjectValue(java.lang.String, java.lang.Class) + */ + @Override + public T getObjectValue(String id, Class cls) + throws ConfigurationException { + return getObjectValue(id, cls, null); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getObjectValue(java.lang.String, java.lang.Class, java.lang.Object) + */ + @Override + public T getObjectValue(String id, Class cls, T defaultValue) + throws ConfigurationException { + String savedValue = getStringValue(id); + if (savedValue == null) { + return defaultValue; + } + ObjectTranslator objectTranslator = ConfigurationFactory + .getObjectTranslator(cls); + if (objectTranslator == null) { + logger.warn( + "Found object value but could not find Object Transator for cls {}", + cls.getName()); + + throw new ConfigurationException("No Object Translator for [" + + cls.getName() + "] available"); + } + return objectTranslator.toObject(savedValue, cls); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#setObjectValue(java.lang.String, java.lang.Object) + */ + @Override + public void setObjectValue(String id, Object object) + throws ConfigurationException { + ObjectTranslator objectTranslator = ConfigurationFactory + .getObjectTranslator(object); + if (objectTranslator == null) { + logger.warn("Could not find Object Transator for cls {}", object + .getClass().getName()); + + throw new ConfigurationException("No Object Translator for [" + + object.getClass().getName() + "] available"); + } + String cfgValue = objectTranslator.toString(object); + setStringValue(id, cfgValue); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#findConfigurationId(java.lang.String) + */ + @Override + abstract public String[] findConfigurationId(String searchString) + throws ConfigurationException; + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#findByValue(java.lang.String) + */ + @Override + abstract public String[] findByValue(String searchString) + throws ConfigurationException; + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getConfigurationIds() + */ + @Override + public String[] getConfigurationIds() throws ConfigurationException { + List allKeys = getAllKeys(); + return allKeys.toArray(new String[allKeys.size()]); + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getConfigurationIdNextLevel(java.lang.String) + */ + @Override + public String[] getConfigurationIdNextLevel(String prefix) + throws ConfigurationException { + String[] allIds = getConfigurationIds(); + Set subIds = new HashSet(); + + for (String id : allIds) { + if (id.startsWith(prefix)) { + String idAfterPrefix = id.substring(prefix.length()); + int index = idAfterPrefix.indexOf("."); + + if (index == 0) { + idAfterPrefix = idAfterPrefix.substring(1); + index = idAfterPrefix.indexOf("."); + } + + if (index > 0) { + String adding = idAfterPrefix.substring(0, index); + if (!(adding.isEmpty())) { + subIds.add(adding); + } + } else if (!(idAfterPrefix.isEmpty())) { + subIds.add(idAfterPrefix); + } + } + + } + + String[] subIdarray = new String[subIds.size()]; + subIdarray = (String[]) subIds.toArray(subIdarray); + return subIdarray; + + } + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#synchronize() + */ + @Override + abstract public void synchronize() throws ConfigurationException; + + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#getName() + */ + @Override + abstract public String getName(); + +} -- cgit v1.2.3 From 1fb729e35f4c423cf2a1996cdcc6a213122f4e0e Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jun 2015 12:14:20 +0200 Subject: fix merge problems --- .../moa/id/config/auth/AuthConfigLoader.java | 10 +- .../moa/id/config/auth/AuthConfiguration.java | 1 - .../id/config/auth/AuthConfigurationProvider.java | 3 +- .../config/auth/ConfigurationToJSONConverter.java | 310 ++++---- .../PropertyBasedAuthConfigurationProvider.java | 87 ++- .../moa/id/commons/config/ConfigurationUtil.java | 452 +++++------ .../id/commons/config/MigrateConfiguration.java | 206 ++--- .../commons/db/ConfigurationFromDBExtractor.java | 364 ++++----- .../moa/id/commons/db/NewConfigurationDBRead.java | 856 ++++++++++----------- .../moa/id/commons/db/NewConfigurationDBWrite.java | 274 +++---- .../utils/MOAHttpProtocolSocketFactory.java | 5 +- .../moa/id/commons/db/ConfigurationDBReadTest.java | 256 +++--- 12 files changed, 1446 insertions(+), 1378 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java index f5009f99f..80ecff2d2 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java @@ -47,11 +47,15 @@ public class AuthConfigLoader implements Runnable { Date dbdate = moaidconfig.getTimestampItem(); Date pvprefresh = moaidconfig.getPvp2RefreshItem(); - Date date = AuthConfigurationProviderFactory.getInstance().getTimeStamp(); - + //TODO: check!!!! + + //Date date = AuthConfigurationProviderFactory.getInstance().getTimeStamp(); + Date date = new Date(); + + if (dbdate != null && dbdate.after(date)) { AuthConfiguration instance = AuthConfigurationProviderFactory.getInstance(); - instance.reloadDataBaseConfig(); +// instance.reloadDataBaseConfig(); } Date pvpdate = MOAMetadataProvider.getTimeStamp(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java index cba80d536..7228e6129 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfiguration.java @@ -1,6 +1,5 @@ package at.gv.egovernment.moa.id.config.auth; -import java.util.Hashtable; import java.util.List; import java.util.Properties; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index 81a3dad8f..dfb2a4dfd 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -71,9 +71,7 @@ import at.gv.egovernment.moa.id.auth.modules.internal.tasks.GetMISSessionIDTask; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; -import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBWrite; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; -import at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; @@ -123,6 +121,7 @@ import at.gv.egovernment.moa.util.MiscUtil; import at.gv.util.config.EgovUtilPropertiesConfiguration; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; /** * A class providing access to the Auth Part of the MOA-ID configuration data. diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java index cdd112a43..e1c1ac49e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/ConfigurationToJSONConverter.java @@ -1,155 +1,155 @@ -package at.gv.egovernment.moa.id.config.auth; - -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; -import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; -import at.gv.egovernment.moa.id.config.ConfigurationException; -import at.gv.egovernment.moa.id.config.ConfigurationProvider; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class ConfigurationToJSONConverter { - - @Autowired - NewAuthConfigurationProvider configProvider; - - @Autowired - MOAIDConfiguration configDataBase; - - public static void main(String[] args) { - - try { - ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(args[0]); - converter.writeConfigToJSONDB(); - System.out.println("====================================="); - System.out.println("====================================="); - converter.readConfigFromDB(); - System.out.println("====================================="); - System.out.println("====================================="); - - // otherwise the database connection is not initialized - JaxBAuthConfigurationProvider.getInstance(); - List methodNames = Arrays.asList("getAllOnlineApplications", "getAllUsers", "getMOAIDConfiguration"); - converter.extractDataViaConfigurationDBRead(methodNames); - converter.readExtractedConfigurationDBReadData(methodNames); - - } catch (ConfigurationException e) { - e.printStackTrace(); - System.out.println("Problems reading the configuration file in: " + System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME)); - System.exit(1); - } - - } - - public ConfigurationToJSONConverter(String pathToDBConfigPropertiesFile) throws ConfigurationException { - - System.getProperties().setProperty("location", "file:" + pathToDBConfigPropertiesFile); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory(); - acbFactory.autowireBean(this); - - } - - public void extractDataViaConfigurationDBRead(List methodNames) { - System.out.println("Start extracting"); - // read objects from db and write to key-value - for (String name : methodNames) { - try { - Method method = ConfigurationDBRead.class.getMethod(name); - Object tmp = method.invoke(null, new Object[] {}); - JsonProperty annotation = method.getAnnotation(JsonProperty.class); - if (annotation != null) { - configDataBase.set(annotation.value(), tmp); - } else { - System.out.println("Annotate Method with name: " + name); - } - } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException - | InvocationTargetException e) { - System.out.println("Problems while extracting ConfigurationDBRead data."); - } - } - } - - public void readExtractedConfigurationDBReadData(List methodNames) { - for (String name : methodNames) { - Object tmp = configDataBase.get(name); - System.out.println(">>> OBJECT: " + tmp); - } - } - - public void writeConfigToJSONDB() { - - try { - // find all getter methods - for (PropertyDescriptor pd : Introspector.getBeanInfo(NewAuthConfigurationProvider.class).getPropertyDescriptors()) { - // check if correct methods, and not annotated with @JsonIgnore - if ((pd.getReadMethod() != null) - && (!"class".equals(pd.getName())) - && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { - - JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); - // get result of get method - Object tmp; - try { - tmp = pd.getReadMethod().invoke(configProvider); - // convert result to JSON - if (name != null) { - configDataBase.set(name.value(), tmp); - } else { - System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); - } - } catch (IllegalAccessException | InvocationTargetException e) { - System.out.println("Problems while writing the configuration to the database."); - } - } - } - - // no static method handling needed - - } catch (IllegalArgumentException e) { - System.out.println("Problems while using reflection to get all getter methods."); - } catch (IntrospectionException e) { - System.out.println("Problems while using reflection to get all getter methods."); - } - - } - - public void readConfigFromDB() { - try { - // find all getter methods - for (PropertyDescriptor pd : Introspector.getBeanInfo(NewAuthConfigurationProvider.class) - .getPropertyDescriptors()) { - // check if correct methods, and not annotated with @JsonIgnore - if ((pd.getReadMethod() != null) - && (!"class".equals(pd.getName())) - && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { - JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); - // get result of get method - if (name != null) { - System.out.println(">>> OBJECT: " + configDataBase.get(name.value())); - } else { - System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); - } - } - } - } catch (IllegalArgumentException e) { - System.out.println("Problems while using reflection to get all getter methods."); - } catch (IntrospectionException e) { - System.out.println("Problems while using reflection to get all getter methods."); - } - } - -} +//package at.gv.egovernment.moa.id.config.auth; +// +//import java.beans.IntrospectionException; +//import java.beans.Introspector; +//import java.beans.PropertyDescriptor; +//import java.lang.reflect.InvocationTargetException; +//import java.lang.reflect.Method; +//import java.util.Arrays; +//import java.util.List; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.config.AutowireCapableBeanFactory; +//import org.springframework.context.ApplicationContext; +//import org.springframework.context.support.ClassPathXmlApplicationContext; +// +//import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; +//import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; +//import at.gv.egovernment.moa.id.config.ConfigurationException; +//import at.gv.egovernment.moa.id.config.ConfigurationProvider; +// +//import com.fasterxml.jackson.annotation.JsonIgnore; +//import com.fasterxml.jackson.annotation.JsonProperty; +// +//public class ConfigurationToJSONConverter { +// +// @Autowired +// NewAuthConfigurationProvider configProvider; +// +// @Autowired +// MOAIDConfiguration configDataBase; +// +// public static void main(String[] args) { +// +// try { +// ConfigurationToJSONConverter converter = new ConfigurationToJSONConverter(args[0]); +// converter.writeConfigToJSONDB(); +// System.out.println("====================================="); +// System.out.println("====================================="); +// converter.readConfigFromDB(); +// System.out.println("====================================="); +// System.out.println("====================================="); +// +// // otherwise the database connection is not initialized +// JaxBAuthConfigurationProvider.getInstance(); +// List methodNames = Arrays.asList("getAllOnlineApplications", "getAllUsers", "getMOAIDConfiguration"); +// converter.extractDataViaConfigurationDBRead(methodNames); +// converter.readExtractedConfigurationDBReadData(methodNames); +// +// } catch (ConfigurationException e) { +// e.printStackTrace(); +// System.out.println("Problems reading the configuration file in: " + System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME)); +// System.exit(1); +// } +// +// } +// +// public ConfigurationToJSONConverter(String pathToDBConfigPropertiesFile) throws ConfigurationException { +// +// System.getProperties().setProperty("location", "file:" + pathToDBConfigPropertiesFile); +// ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); +// AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory(); +// acbFactory.autowireBean(this); +// +// } +// +// public void extractDataViaConfigurationDBRead(List methodNames) { +// System.out.println("Start extracting"); +// // read objects from db and write to key-value +// for (String name : methodNames) { +// try { +// Method method = ConfigurationDBRead.class.getMethod(name); +// Object tmp = method.invoke(null, new Object[] {}); +// JsonProperty annotation = method.getAnnotation(JsonProperty.class); +// if (annotation != null) { +// configDataBase.set(annotation.value(), tmp); +// } else { +// System.out.println("Annotate Method with name: " + name); +// } +// } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException +// | InvocationTargetException e) { +// System.out.println("Problems while extracting ConfigurationDBRead data."); +// } +// } +// } +// +// public void readExtractedConfigurationDBReadData(List methodNames) { +// for (String name : methodNames) { +// Object tmp = configDataBase.get(name); +// System.out.println(">>> OBJECT: " + tmp); +// } +// } +// +// public void writeConfigToJSONDB() { +// +// try { +// // find all getter methods +// for (PropertyDescriptor pd : Introspector.getBeanInfo(NewAuthConfigurationProvider.class).getPropertyDescriptors()) { +// // check if correct methods, and not annotated with @JsonIgnore +// if ((pd.getReadMethod() != null) +// && (!"class".equals(pd.getName())) +// && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { +// +// JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); +// // get result of get method +// Object tmp; +// try { +// tmp = pd.getReadMethod().invoke(configProvider); +// // convert result to JSON +// if (name != null) { +// configDataBase.set(name.value(), tmp); +// } else { +// System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); +// } +// } catch (IllegalAccessException | InvocationTargetException e) { +// System.out.println("Problems while writing the configuration to the database."); +// } +// } +// } +// +// // no static method handling needed +// +// } catch (IllegalArgumentException e) { +// System.out.println("Problems while using reflection to get all getter methods."); +// } catch (IntrospectionException e) { +// System.out.println("Problems while using reflection to get all getter methods."); +// } +// +// } +// +// public void readConfigFromDB() { +// try { +// // find all getter methods +// for (PropertyDescriptor pd : Introspector.getBeanInfo(NewAuthConfigurationProvider.class) +// .getPropertyDescriptors()) { +// // check if correct methods, and not annotated with @JsonIgnore +// if ((pd.getReadMethod() != null) +// && (!"class".equals(pd.getName())) +// && (pd.getReadMethod().getAnnotation(JsonIgnore.class) == null)) { +// JsonProperty name = pd.getReadMethod().getAnnotation(JsonProperty.class); +// // get result of get method +// if (name != null) { +// System.out.println(">>> OBJECT: " + configDataBase.get(name.value())); +// } else { +// System.out.println("CHECK if '" + pd.getDisplayName() + "' is NOT ANNOTATED"); +// } +// } +// } +// } catch (IllegalArgumentException e) { +// System.out.println("Problems while using reflection to get all getter methods."); +// } catch (IntrospectionException e) { +// System.out.println("Problems while using reflection to get all getter methods."); +// } +// } +// +//} diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java index 38af90ade..94fbe46c4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -6,6 +6,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.math.BigInteger; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -14,6 +15,8 @@ import java.util.Properties; import org.springframework.beans.factory.annotation.Autowired; +import com.fasterxml.jackson.annotation.JsonIgnore; + import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; @@ -51,6 +54,7 @@ import at.gv.egovernment.moa.id.config.auth.data.ProtocolAllowed; import at.gv.egovernment.moa.id.config.stork.STORKConfig; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; +import at.gv.util.config.EgovUtilPropertiesConfiguration; /** * A class providing access to the Auth Part of the MOA-ID configuration data. @@ -63,7 +67,9 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide private MOAIDConfiguration configuration; private final Properties properties = new Properties(); - + private EgovUtilPropertiesConfiguration eGovUtilsConfig = null; + + public PropertyBasedAuthConfigurationProvider() { } @@ -79,6 +85,23 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide try (FileInputStream in = new FileInputStream(propertiesFile);) { properties.load(in); + + //read eGovUtils client configuration + Properties eGovUtilsConfigProp = new Properties(); + for (Object key : properties.keySet()) { + String propPrefix = "service."; + if (key.toString().startsWith(propPrefix+"egovutil")) { + String propertyName = key.toString().substring(propPrefix.length()); + eGovUtilsConfigProp.put(propertyName, properties.get(key.toString())); + } + } + if (!eGovUtilsConfigProp.isEmpty()) { + Logger.info("Start eGovUtils client implementation configuration ..."); + eGovUtilsConfig = + new EgovUtilPropertiesConfiguration(eGovUtilsConfigProp, rootConfigFileDir); + } + + } catch (FileNotFoundException e) { throw new ConfigurationException("config.03", null, e); } catch (IOException e) { @@ -908,15 +931,6 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide return null; } - /** - * Returns the current time. - * @return the time stamp - */ - public static Date getTimeStamp() { - - return new Date(); - } - /** * Returns a list of all {@link OnlineApplication}. * @@ -980,4 +994,57 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide return result; } + //Load document service url from moa properties + public String getDocumentServiceUrl() { + String prop = properties.getProperty("stork.documentservice.url", "false"); + return prop; + } + + + public boolean isPVPSchemaValidationActive() { + String prop = properties.getProperty("protocols.pvp2.schemavalidation", "true"); + return Boolean.valueOf(prop); + } + + /** + * Checks if is fakeIdL is activated. + * + * @return true, if fake IdLs are available for stork + */ + public boolean isStorkFakeIdLActive() { + String prop = properties.getProperty("stork.fakeIdL.active", "false"); + return Boolean.valueOf(prop); + } + + /** + * Gets the countries which will receive a fake IdL + * + * @return the countries + */ + public List getStorkFakeIdLCountries() { + String prop = properties.getProperty("stork.fakeIdL.countries", ""); + return Arrays.asList(prop.replaceAll(" ", "").split(",")); + } + + /** + * Gets the resigning key (group) for the stork fake IdL. + * + * @return the resigning key + */ + public String getStorkFakeIdLResigningKey() { + String prop = properties.getProperty("stork.fakeIdL.keygroup"); + if (MiscUtil.isNotEmpty(prop)) + return prop; + else + return null; + } + + /** + * @return the eGovUtilsConfig + */ + @JsonIgnore + public EgovUtilPropertiesConfiguration geteGovUtilsConfig() { + return eGovUtilsConfig; + } + } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java index e794951d7..468e4a536 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java @@ -1,226 +1,226 @@ -package at.gv.egovernment.moa.id.commons.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Enumeration; -import java.util.List; -import java.util.Properties; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; - -import org.springframework.context.ApplicationContext; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; -import at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; - -import com.fasterxml.jackson.core.JsonProcessingException; - -public class ConfigurationUtil { - - final boolean isOverwriteData; - - public ConfigurationUtil(boolean isOverwriteData){ - this.isOverwriteData = isOverwriteData; - } - - /** - * Read an input MOAID 2 XML file, transfer it to properties and write the - * properties to a MOAID 3 property file. - * - * @param inStream - * the input stream to read from. - * @param outFile - * the output file to write to. - * @throws JAXBException - */ - public void readFromXMLFileConvertToPropertyFile(FileInputStream inStream, File outFile) throws JAXBException { - - try (FileOutputStream outStream = new FileOutputStream(outFile);) { - - // get config from xml file - JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); - Unmarshaller m = jc.createUnmarshaller(); - MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream); - - // serialize config to JSON properties - Properties result = moaIdConfigToJsonProperties(config); - - // write to output stream - result.store(outStream, null); - - } catch (FileNotFoundException e) { - System.out.println("Could not find the output file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not write to the output file."); - System.exit(1); - } - } - - /** - * Helper method to serialize a {@link MOAIDConfiguration} to Properties - * with JSON encoded values. - * - * @param config - * the MOAIDConfiguration to serialize - * @return {@link Properties} containing the database key and the serialized - * values - * @throws JsonProcessingException - * is thrown if problem occurred while serializing one of the - * database values - */ - private Properties moaIdConfigToJsonProperties(MOAIDConfiguration config) throws JsonProcessingException { - - Properties result = new Properties(); - boolean prettyPrint = true; - JsonMapper mapper = new JsonMapper(prettyPrint); - - // serialize config to JSON - String oaJson = mapper.serialize(config.getOnlineApplication()); - String authCompGeneralJson = mapper.serialize(config.getAuthComponentGeneral()); - String chainingModeJson = mapper.serialize(config.getChainingModes()); - String defaultBKUJson = mapper.serialize(config.getDefaultBKUs()); - String genericConfigJson = mapper.serialize(config.getGenericConfiguration()); - String pvp2RefreshJson = mapper.serialize(config.getPvp2RefreshItem()); - String slRequestTemplatesJson = mapper.serialize(config.getSLRequestTemplates()); - String timestampJson = mapper.serialize(config.getTimestampItem()); - String trustedCaCertJson = mapper.serialize(config.getTrustedCACertificates()); - - // add to properties - result.put(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oaJson); - result.put(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, authCompGeneralJson); - result.put(MOAIDConfigurationConstants.CHAINING_MODES_KEY, chainingModeJson); - result.put(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, defaultBKUJson); - result.put(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, genericConfigJson); - result.put(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, pvp2RefreshJson); - result.put(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, slRequestTemplatesJson); - result.put(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, timestampJson); - result.put(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, trustedCaCertJson); - - return result; - } - - /** - * Exports a key-value database to a property file, where keys are the same - * as in the database, and the values are serialized JSON objects. - * - * @param inputDBConfigFilePath - * the path to the database properties, for the db the data is - * read from. - * @param outFile - * the destination file for the exported data. - */ - public void readFromDBWriteToFile(String inputDBConfigFilePath, File outFile) { - - try (FileOutputStream outStream = new FileOutputStream(outFile);) { - - Properties result = new Properties(); - - System.getProperties().setProperty("location", "file:" + inputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - Configuration dbConfiguration = (Configuration) context.getBean("config"); - boolean prettyPrint = true; - at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); - - for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { - - // extract database value - Object value = dbConfiguration.get(key); - - // serialize value to JSON - String json = mapper.serialize(value); - - // add to properties - result.setProperty(key, json); - } - - // write to output stream - result.store(outStream, null); - - System.out.println("Property configuration written to:"); - System.out.println(outFile.getAbsolutePath()); - - } catch (FileNotFoundException e) { - System.out.println("Could not find the output file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not write to the output file."); - System.exit(1); - } - } - - /** - * Read an input property file, deserialize it's values and write them to - * the given database. - * - * @param inStream - * the FileInputStream to read from. - * @param outputDBConfigFilePath - * the path to the database properties, for the db which is - * written. - * @throws IOException - * is thrown in case the properties could not be loaded from the - * stream - */ - public void readFromFileWriteToDB(FileInputStream inStream, String outputDBConfigFilePath) throws IOException { - - Properties inProperties = new Properties(); - inProperties.load(inStream); - - System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); - Configuration dbConfiguration = (Configuration) context.getBean("config"); - boolean prettyPrint = true; - JsonMapper mapper = new JsonMapper(prettyPrint); - - List keys = dbConfiguration.getAllKeys(); - - if (keys == null) { - System.out.println("Database can not be read."); - System.exit(1); - } - - if (!keys.isEmpty() && !isOverwriteData) { - System.out.println("The database already contains configuration data."); - System.out.println("Use force switch if you want to override data)"); - System.exit(1); - } - - if (isOverwriteData) { - // remove existing entries - for (String key : keys) { - dbConfiguration.set(key, null); - } - } - - Enumeration propertyNames = inProperties.propertyNames(); - - while (propertyNames.hasMoreElements()) { - String key = (String) propertyNames.nextElement(); - // extract database value - String json = inProperties.getProperty(key); - - // deserialize value to object - Object value = mapper.deserialize(json, null); - - // add to database - boolean result = dbConfiguration.set(key, value); - if (!result) { - System.out.println("Could NOT persist the configuration file's information in the database."); - } - } - System.out.println("Data has been successfully written to the database."); - } - - private static void readFromDBWriteToDB(String inputDBConfigFilePath, String outputDBConfigFilePath) { - //TODO: implement - } - -} +//package at.gv.egovernment.moa.id.commons.config; +// +//import java.io.File; +//import java.io.FileInputStream; +//import java.io.FileNotFoundException; +//import java.io.FileOutputStream; +//import java.io.IOException; +//import java.util.Enumeration; +//import java.util.List; +//import java.util.Properties; +// +//import javax.xml.bind.JAXBContext; +//import javax.xml.bind.JAXBException; +//import javax.xml.bind.Unmarshaller; +// +//import org.springframework.context.ApplicationContext; +//import org.springframework.context.support.ClassPathXmlApplicationContext; +// +//import at.gv.egovernment.moa.id.commons.config.persistence.Configuration; +//import at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper; +//import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +// +//import com.fasterxml.jackson.core.JsonProcessingException; +// +//public class ConfigurationUtil { +// +// final boolean isOverwriteData; +// +// public ConfigurationUtil(boolean isOverwriteData){ +// this.isOverwriteData = isOverwriteData; +// } +// +// /** +// * Read an input MOAID 2 XML file, transfer it to properties and write the +// * properties to a MOAID 3 property file. +// * +// * @param inStream +// * the input stream to read from. +// * @param outFile +// * the output file to write to. +// * @throws JAXBException +// */ +// public void readFromXMLFileConvertToPropertyFile(FileInputStream inStream, File outFile) throws JAXBException { +// +// try (FileOutputStream outStream = new FileOutputStream(outFile);) { +// +// // get config from xml file +// JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); +// Unmarshaller m = jc.createUnmarshaller(); +// MOAIDConfiguration config = (MOAIDConfiguration) m.unmarshal(inStream); +// +// // serialize config to JSON properties +// Properties result = moaIdConfigToJsonProperties(config); +// +// // write to output stream +// result.store(outStream, null); +// +// } catch (FileNotFoundException e) { +// System.out.println("Could not find the output file."); +// System.exit(1); +// } catch (IOException e) { +// System.out.println("Could not write to the output file."); +// System.exit(1); +// } +// } +// +// /** +// * Helper method to serialize a {@link MOAIDConfiguration} to Properties +// * with JSON encoded values. +// * +// * @param config +// * the MOAIDConfiguration to serialize +// * @return {@link Properties} containing the database key and the serialized +// * values +// * @throws JsonProcessingException +// * is thrown if problem occurred while serializing one of the +// * database values +// */ +// private Properties moaIdConfigToJsonProperties(MOAIDConfiguration config) throws JsonProcessingException { +// +// Properties result = new Properties(); +// boolean prettyPrint = true; +// JsonMapper mapper = new JsonMapper(prettyPrint); +// +// // serialize config to JSON +// String oaJson = mapper.serialize(config.getOnlineApplication()); +// String authCompGeneralJson = mapper.serialize(config.getAuthComponentGeneral()); +// String chainingModeJson = mapper.serialize(config.getChainingModes()); +// String defaultBKUJson = mapper.serialize(config.getDefaultBKUs()); +// String genericConfigJson = mapper.serialize(config.getGenericConfiguration()); +// String pvp2RefreshJson = mapper.serialize(config.getPvp2RefreshItem()); +// String slRequestTemplatesJson = mapper.serialize(config.getSLRequestTemplates()); +// String timestampJson = mapper.serialize(config.getTimestampItem()); +// String trustedCaCertJson = mapper.serialize(config.getTrustedCACertificates()); +// +// // add to properties +// result.put(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oaJson); +// result.put(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, authCompGeneralJson); +// result.put(MOAIDConfigurationConstants.CHAINING_MODES_KEY, chainingModeJson); +// result.put(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, defaultBKUJson); +// result.put(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, genericConfigJson); +// result.put(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, pvp2RefreshJson); +// result.put(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, slRequestTemplatesJson); +// result.put(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, timestampJson); +// result.put(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, trustedCaCertJson); +// +// return result; +// } +// +// /** +// * Exports a key-value database to a property file, where keys are the same +// * as in the database, and the values are serialized JSON objects. +// * +// * @param inputDBConfigFilePath +// * the path to the database properties, for the db the data is +// * read from. +// * @param outFile +// * the destination file for the exported data. +// */ +// public void readFromDBWriteToFile(String inputDBConfigFilePath, File outFile) { +// +// try (FileOutputStream outStream = new FileOutputStream(outFile);) { +// +// Properties result = new Properties(); +// +// System.getProperties().setProperty("location", "file:" + inputDBConfigFilePath); +// ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); +// Configuration dbConfiguration = (Configuration) context.getBean("config"); +// boolean prettyPrint = true; +// at.gv.egovernment.moa.id.commons.config.persistence.JsonMapper mapper = new JsonMapper(prettyPrint); +// +// for (String key : MOAIDConfigurationConstants.getAllMOAIDConfigurationKeys()) { +// +// // extract database value +// Object value = dbConfiguration.get(key); +// +// // serialize value to JSON +// String json = mapper.serialize(value); +// +// // add to properties +// result.setProperty(key, json); +// } +// +// // write to output stream +// result.store(outStream, null); +// +// System.out.println("Property configuration written to:"); +// System.out.println(outFile.getAbsolutePath()); +// +// } catch (FileNotFoundException e) { +// System.out.println("Could not find the output file."); +// System.exit(1); +// } catch (IOException e) { +// System.out.println("Could not write to the output file."); +// System.exit(1); +// } +// } +// +// /** +// * Read an input property file, deserialize it's values and write them to +// * the given database. +// * +// * @param inStream +// * the FileInputStream to read from. +// * @param outputDBConfigFilePath +// * the path to the database properties, for the db which is +// * written. +// * @throws IOException +// * is thrown in case the properties could not be loaded from the +// * stream +// */ +// public void readFromFileWriteToDB(FileInputStream inStream, String outputDBConfigFilePath) throws IOException { +// +// Properties inProperties = new Properties(); +// inProperties.load(inStream); +// +// System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); +// ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); +// Configuration dbConfiguration = (Configuration) context.getBean("config"); +// boolean prettyPrint = true; +// JsonMapper mapper = new JsonMapper(prettyPrint); +// +// List keys = dbConfiguration.getAllKeys(); +// +// if (keys == null) { +// System.out.println("Database can not be read."); +// System.exit(1); +// } +// +// if (!keys.isEmpty() && !isOverwriteData) { +// System.out.println("The database already contains configuration data."); +// System.out.println("Use force switch if you want to override data)"); +// System.exit(1); +// } +// +// if (isOverwriteData) { +// // remove existing entries +// for (String key : keys) { +// dbConfiguration.set(key, null); +// } +// } +// +// Enumeration propertyNames = inProperties.propertyNames(); +// +// while (propertyNames.hasMoreElements()) { +// String key = (String) propertyNames.nextElement(); +// // extract database value +// String json = inProperties.getProperty(key); +// +// // deserialize value to object +// Object value = mapper.deserialize(json, null); +// +// // add to database +// boolean result = dbConfiguration.set(key, value); +// if (!result) { +// System.out.println("Could NOT persist the configuration file's information in the database."); +// } +// } +// System.out.println("Data has been successfully written to the database."); +// } +// +// private static void readFromDBWriteToDB(String inputDBConfigFilePath, String outputDBConfigFilePath) { +// //TODO: implement +// } +// +//} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java index 4e8c7dffd..32dd97148 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrateConfiguration.java @@ -1,103 +1,103 @@ -package at.gv.egovernment.moa.id.commons.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; - -import javax.xml.bind.JAXBException; - -import at.gv.egovernment.moa.id.commons.config.cli.MOAIDConfCLI; -import at.gv.egovernment.moa.id.commons.config.cli.MigrateConfigurationParams; - -/** - * CLI tool which is able to perform the following tasks: - *
    - *
  • transform a MoaID 2 XML configuration XML file to a MoaID 3 property file - *
  • - *
  • read a property file and transfer it's content to a database
  • - *
  • write the content of a database to a property file
  • - *
- */ -public class MigrateConfiguration { - - public static void main(String[] args) { - - MOAIDConfCLI cli = new MOAIDConfCLI(); - MigrateConfigurationParams parsedParameters = cli.parse(args); - - // consider settings of force switch - boolean isOverwriteData = parsedParameters.isOverwriteData(); - ConfigurationUtil configUtil = new ConfigurationUtil(isOverwriteData); - - if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { - // read input from file - workWithInputFromFile(parsedParameters.getInputTarget(), parsedParameters, configUtil); - - } else if (parsedParameters.getInputDBConfig() != null) { - // read input from database - workWithImputFromDB(parsedParameters, configUtil); - - } else { - System.exit(1); - } - } - - /** - * Handle the case where input from a file is read. - * - * @param inputFileUrl - * the url of the input file. - * @param parsedParameters - * the command line parameters. - * @param configUtil - * the class for working with the configuration. - */ - private static void workWithInputFromFile(String inputFileUrl, MigrateConfigurationParams parsedParameters, - ConfigurationUtil configUtil) { - File inFile = new File(inputFileUrl); - try (FileInputStream inStream = new FileInputStream(inFile);) { - - if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { - // input from file and output to a file is desired - File outFile = new File(parsedParameters.getOutputFile()); - configUtil.readFromXMLFileConvertToPropertyFile(inStream, outFile); - - } else if (parsedParameters.getOutputDBConfig() != null) { - // input from file and output to a database is desired - configUtil.readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); - } - } catch (JAXBException e) { - System.out.println("MOA-ID XML configuration can not be loaded from given file."); - System.exit(1); - } catch (FileNotFoundException e) { - System.out.println("Could not find the input file."); - System.exit(1); - } catch (IOException e) { - System.out.println("Could not read from the input file."); - System.exit(1); - } - } - - /** - * Handle the case where input is read from a database. - * - * @param parsedParameters - * the command line parameters. - * @param configUtil - * the class for working with the configuration. - */ - private static void workWithImputFromDB(MigrateConfigurationParams parsedParameters, ConfigurationUtil configUtil) { - if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { - // input from database and output to a file is desired - File outFile = new File(parsedParameters.getOutputFile()); - String inputDBConfigFilePath = parsedParameters.getInputDBConfig(); - configUtil.readFromDBWriteToFile(inputDBConfigFilePath, outFile); - - } else if (parsedParameters.getOutputDBConfig() != null) { - // input from database and output to a database is desired - // configUtil.readFromDBWriteToDB(inDBConfigFilePath, - // outDBConfigFilePath); - } - } -} \ No newline at end of file +//package at.gv.egovernment.moa.id.commons.config; +// +//import java.io.File; +//import java.io.FileInputStream; +//import java.io.FileNotFoundException; +//import java.io.IOException; +// +//import javax.xml.bind.JAXBException; +// +//import at.gv.egovernment.moa.id.commons.config.cli.MOAIDConfCLI; +//import at.gv.egovernment.moa.id.commons.config.cli.MigrateConfigurationParams; +// +///** +// * CLI tool which is able to perform the following tasks: +// *
    +// *
  • transform a MoaID 2 XML configuration XML file to a MoaID 3 property file +// *
  • +// *
  • read a property file and transfer it's content to a database
  • +// *
  • write the content of a database to a property file
  • +// *
+// */ +//public class MigrateConfiguration { +// +// public static void main(String[] args) { +// +// MOAIDConfCLI cli = new MOAIDConfCLI(); +// MigrateConfigurationParams parsedParameters = cli.parse(args); +// +// // consider settings of force switch +// boolean isOverwriteData = parsedParameters.isOverwriteData(); +// ConfigurationUtil configUtil = new ConfigurationUtil(isOverwriteData); +// +// if (!parsedParameters.isInputDB() && (parsedParameters.getInputTarget() != null)) { +// // read input from file +// workWithInputFromFile(parsedParameters.getInputTarget(), parsedParameters, configUtil); +// +// } else if (parsedParameters.getInputDBConfig() != null) { +// // read input from database +// workWithImputFromDB(parsedParameters, configUtil); +// +// } else { +// System.exit(1); +// } +// } +// +// /** +// * Handle the case where input from a file is read. +// * +// * @param inputFileUrl +// * the url of the input file. +// * @param parsedParameters +// * the command line parameters. +// * @param configUtil +// * the class for working with the configuration. +// */ +// private static void workWithInputFromFile(String inputFileUrl, MigrateConfigurationParams parsedParameters, +// ConfigurationUtil configUtil) { +// File inFile = new File(inputFileUrl); +// try (FileInputStream inStream = new FileInputStream(inFile);) { +// +// if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { +// // input from file and output to a file is desired +// File outFile = new File(parsedParameters.getOutputFile()); +// configUtil.readFromXMLFileConvertToPropertyFile(inStream, outFile); +// +// } else if (parsedParameters.getOutputDBConfig() != null) { +// // input from file and output to a database is desired +// configUtil.readFromFileWriteToDB(inStream, parsedParameters.getOutputDBConfig()); +// } +// } catch (JAXBException e) { +// System.out.println("MOA-ID XML configuration can not be loaded from given file."); +// System.exit(1); +// } catch (FileNotFoundException e) { +// System.out.println("Could not find the input file."); +// System.exit(1); +// } catch (IOException e) { +// System.out.println("Could not read from the input file."); +// System.exit(1); +// } +// } +// +// /** +// * Handle the case where input is read from a database. +// * +// * @param parsedParameters +// * the command line parameters. +// * @param configUtil +// * the class for working with the configuration. +// */ +// private static void workWithImputFromDB(MigrateConfigurationParams parsedParameters, ConfigurationUtil configUtil) { +// if (!parsedParameters.isOutputDB() && (parsedParameters.getOutputFile() != null)) { +// // input from database and output to a file is desired +// File outFile = new File(parsedParameters.getOutputFile()); +// String inputDBConfigFilePath = parsedParameters.getInputDBConfig(); +// configUtil.readFromDBWriteToFile(inputDBConfigFilePath, outFile); +// +// } else if (parsedParameters.getOutputDBConfig() != null) { +// // input from database and output to a database is desired +// // configUtil.readFromDBWriteToDB(inDBConfigFilePath, +// // outDBConfigFilePath); +// } +// } +//} \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java index f6066d68f..432991f33 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationFromDBExtractor.java @@ -1,182 +1,182 @@ -package at.gv.egovernment.moa.id.commons.db; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import javax.persistence.EntityManager; -import javax.persistence.TypedQuery; - -import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; -import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; -import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; -import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * This class is used to extract information from a legacy moa-id database. - */ -public class ConfigurationFromDBExtractor { - - /** - * This class should not be instantiated. - */ - private ConfigurationFromDBExtractor() { - } - - /** - * Helper method, to query for a single value. NOTE: returns {@code null} if - * there is no result, more than one result or if an exception is thrown - * while querying the database. - * - * @param queryString - * a jpa query string. - * @param clazz - * the class type of the expected result. - * @return the result of the query or {@code null}. - */ - private static T getSingleValue(String queryString, Class clazz) { - T result = null; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - TypedQuery query = session.createQuery(queryString, clazz); - try { - result = query.getSingleResult(); - } catch (Exception e) { - return null; - } - return result; - } - - /** - * Helper method, to query for a a list of values. NOTE: the returned list - * may be empty but is never {@code null}. - * - * @param queryString - * a jpa query string. - * @param clazz - * the class type of the elements the expected result list. - * @return a list with the result of the query or an empty list. - */ - private static List getListOfValues(String queryString, Class clazz) { - List result = new ArrayList(); - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - TypedQuery query = session.createQuery(queryString, clazz); - try { - result = query.getResultList(); - } catch (Exception e) { - return new ArrayList(); - } - return result; - } - - /** - * Extracts an {@link AuthComponentGeneral} from the database. NOTE: returns - * {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return an AuthComponentgeneral or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY) - public static AuthComponentGeneral getAuthComponentGeneral() { - return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); - } - - /** - * Extracts an {@link AuthComponentGeneral} from the database. NOTE: returns - * {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return an AuthComponentgeneral or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.CHAINING_MODES_KEY) - public static ChainingModes getChainingModes() { - return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); - } - - /** - * Extracts a list of {@link OnlineApplication} from the database. NOTE: the - * returned list may be empty but is never {@code null}. - * - * @return a list of {@link OnlineApplication}. - */ - @JsonProperty(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY) - public static List getOnlineApplications() { - return getListOfValues("from OnlineApplication", OnlineApplication.class); - } - - /** - * Extracts a list of {@link GenericConfiguration} from the database. NOTE: - * the returned list may be empty but is never {@code null}. - * - * @return a list of {@link GenericConfiguration}. - */ - @JsonProperty(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY) - public static List getGenericConfigurations() { - return getListOfValues("from GenericConfiguration", GenericConfiguration.class); - } - - /** - * Extracts the trusted CA-certificates from the database. NOTE: returns - * {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return the trusted CA-certificates or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY) - public static String getTrustedCACertificates() { - return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); - } - - /** - * Extracts a {@link DefaultBKUs} from the database. NOTE: returns - * {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return a DefaultBKUs or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY) - public static DefaultBKUs getDefaultBKUs() { - return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); - } - - /** - * Extracts a {@link SLRequestTemplates} from the database. NOTE: returns - * {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return a SLRequestTemplates or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY) - public static SLRequestTemplates getSLRequestTemplates() { - return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); - } - - /** - * Extracts the moa-id timestamp (last update) from the database. NOTE: - * returns {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return the moa-id timestamp (last update) or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY) - public static Date getTimeStampItem() { - return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); - } - - /** - * Extracts the date of the last pvp2refresh from the database. NOTE: - * returns {@code null} if there is no result, more than one result or if an - * exception is thrown while querying the database. - * - * @return the date of the last pvp2refresh or {@code null}. - */ - @JsonProperty(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY) - public static Date getPvp2RefreshItem() { - return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); - } - -} +//package at.gv.egovernment.moa.id.commons.db; +// +//import java.util.ArrayList; +//import java.util.Date; +//import java.util.List; +// +//import javax.persistence.EntityManager; +//import javax.persistence.TypedQuery; +// +//import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +//import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +//import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +//import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +//import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; +//import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +//import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +// +//import com.fasterxml.jackson.annotation.JsonProperty; +// +///** +// * This class is used to extract information from a legacy moa-id database. +// */ +//public class ConfigurationFromDBExtractor { +// +// /** +// * This class should not be instantiated. +// */ +// private ConfigurationFromDBExtractor() { +// } +// +// /** +// * Helper method, to query for a single value. NOTE: returns {@code null} if +// * there is no result, more than one result or if an exception is thrown +// * while querying the database. +// * +// * @param queryString +// * a jpa query string. +// * @param clazz +// * the class type of the expected result. +// * @return the result of the query or {@code null}. +// */ +// private static T getSingleValue(String queryString, Class clazz) { +// T result = null; +// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +// TypedQuery query = session.createQuery(queryString, clazz); +// try { +// result = query.getSingleResult(); +// } catch (Exception e) { +// return null; +// } +// return result; +// } +// +// /** +// * Helper method, to query for a a list of values. NOTE: the returned list +// * may be empty but is never {@code null}. +// * +// * @param queryString +// * a jpa query string. +// * @param clazz +// * the class type of the elements the expected result list. +// * @return a list with the result of the query or an empty list. +// */ +// private static List getListOfValues(String queryString, Class clazz) { +// List result = new ArrayList(); +// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +// TypedQuery query = session.createQuery(queryString, clazz); +// try { +// result = query.getResultList(); +// } catch (Exception e) { +// return new ArrayList(); +// } +// return result; +// } +// +// /** +// * Extracts an {@link AuthComponentGeneral} from the database. NOTE: returns +// * {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return an AuthComponentgeneral or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY) +// public static AuthComponentGeneral getAuthComponentGeneral() { +// return getSingleValue("from AuthComponentGeneral", AuthComponentGeneral.class); +// } +// +// /** +// * Extracts an {@link AuthComponentGeneral} from the database. NOTE: returns +// * {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return an AuthComponentgeneral or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.CHAINING_MODES_KEY) +// public static ChainingModes getChainingModes() { +// return (ChainingModes) getSingleValue("from ChainingModes", ChainingModes.class); +// } +// +// /** +// * Extracts a list of {@link OnlineApplication} from the database. NOTE: the +// * returned list may be empty but is never {@code null}. +// * +// * @return a list of {@link OnlineApplication}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY) +// public static List getOnlineApplications() { +// return getListOfValues("from OnlineApplication", OnlineApplication.class); +// } +// +// /** +// * Extracts a list of {@link GenericConfiguration} from the database. NOTE: +// * the returned list may be empty but is never {@code null}. +// * +// * @return a list of {@link GenericConfiguration}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY) +// public static List getGenericConfigurations() { +// return getListOfValues("from GenericConfiguration", GenericConfiguration.class); +// } +// +// /** +// * Extracts the trusted CA-certificates from the database. NOTE: returns +// * {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return the trusted CA-certificates or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY) +// public static String getTrustedCACertificates() { +// return getSingleValue("select trustedCACertificates from MOAIDConfiguration", String.class); +// } +// +// /** +// * Extracts a {@link DefaultBKUs} from the database. NOTE: returns +// * {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return a DefaultBKUs or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY) +// public static DefaultBKUs getDefaultBKUs() { +// return getSingleValue("select defaultBKUs from MOAIDConfiguration", DefaultBKUs.class); +// } +// +// /** +// * Extracts a {@link SLRequestTemplates} from the database. NOTE: returns +// * {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return a SLRequestTemplates or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY) +// public static SLRequestTemplates getSLRequestTemplates() { +// return getSingleValue("select SLRequestTemplates from MOAIDConfiguration", SLRequestTemplates.class); +// } +// +// /** +// * Extracts the moa-id timestamp (last update) from the database. NOTE: +// * returns {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return the moa-id timestamp (last update) or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY) +// public static Date getTimeStampItem() { +// return getSingleValue("select timestampItem from MOAIDConfiguration", Date.class); +// } +// +// /** +// * Extracts the date of the last pvp2refresh from the database. NOTE: +// * returns {@code null} if there is no result, more than one result or if an +// * exception is thrown while querying the database. +// * +// * @return the date of the last pvp2refresh or {@code null}. +// */ +// @JsonProperty(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY) +// public static Date getPvp2RefreshItem() { +// return getSingleValue("select pvp2RefreshItem from MOAIDConfiguration", Date.class); +// } +// +//} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 64d8e9d80..66143efad 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -1,428 +1,428 @@ -package at.gv.egovernment.moa.id.commons.db; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; - -import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; -import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; -import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; -import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; -import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; -import at.gv.egovernment.moa.logging.Logger; - -/** - * - * - */ -public class NewConfigurationDBRead { - - private static MOAIDConfiguration conf; - - @Autowired(required = true) - public void setConfiguration(MOAIDConfiguration conf) { - // https://jira.spring.io/browse/SPR-3845 - NewConfigurationDBRead.conf = conf; - } - - @SuppressWarnings("unchecked") - public static > T nullGuard(T item) { - if (item == null) { - return (T) Collections.emptyList(); - } else { - return item; - } - } - - /** - * - * @return - */ - public static List getAllUsers() { - Logger.trace("Get All Users from database."); - - // select userdatabase from UserDatabase userdatabase - List result = conf.getList("getAllUsers", UserDatabase.class); - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - - /** - * - * @return - */ - public static List getAllOnlineApplications() { - Logger.trace("Get All OnlineApplications from database."); - - // select onlineapplication from OnlineApplication onlineapplication - return conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); - - } - - /** - * - * @return - */ - public static List getAllNewOnlineApplications() { - Logger.trace("Get All New OnlineApplications from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' - List result = new ArrayList(); - List allOAs = getAllOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allOAs)) { - if (!oa.isIsActive() && oa.isIsAdminRequired()) { - result.add(oa); - } - } - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - - /** - * - * @return - */ - public static at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration getMOAIDConfiguration() { - Logger.trace("Load MOAID Configuration from database."); - - AuthComponentGeneral authComponent = (AuthComponentGeneral) conf.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, - AuthComponentGeneral.class); - - ChainingModes chainingModes = (ChainingModes) conf.get(MOAIDConfigurationConstants.CHAINING_MODES_KEY, ChainingModes.class); - List genericConfigurations = (List) conf.getList( - MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); - String trustedCaCertificates = (String) conf.get(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, String.class); - DefaultBKUs defaultBKUs = (DefaultBKUs) conf.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); - SLRequestTemplates slrRequestRemplates = (SLRequestTemplates) conf.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, - SLRequestTemplates.class); - Date timeStamp = (Date) conf.get(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, Date.class); - Date pvp2Refresh = (Date) conf.get(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, Date.class); - - // if (authComponent == null || chainingModes == null || trustedCaCertificates == null || defaultBKUs == null - // || slrRequestRemplates == null || timeStamp == null || pvp2Refresh == null - // - // ) { - // // TODO: is there a better approach in case of error? - // Logger.trace("Not all necessary data available. Create fresh instance."); - // return new MOAIDConfiguration(); - // } - - // select moaidconfiguration from MOAIDConfiguration moaidconfiguration - at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration result = new at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration(); - result.setAuthComponentGeneral(authComponent); - result.setChainingModes(chainingModes); - result.setGenericConfiguration(genericConfigurations); - result.setTrustedCACertificates(trustedCaCertificates); - result.setDefaultBKUs(defaultBKUs); - result.setSLRequestTemplates(slrRequestRemplates); - result.setTimestampItem(timeStamp); - result.setPvp2RefreshItem(pvp2Refresh); - - return result; - } - - /** - * - * @return - */ - public static List getAllActiveOnlineApplications() { - Logger.trace("Get All New OnlineApplications from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.isActive = '1' - List result = new ArrayList(); - List allOAs = getAllOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allOAs)) { - if (oa.isIsActive()) { - result.add(oa); - } - } - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - - /** - * - * @param id - * @return - */ - public static OnlineApplication getActiveOnlineApplication(String id) { - Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.publicURLPrefix = - // SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1' - OnlineApplication result = null; - List allActiveOAs = getAllActiveOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allActiveOAs)) { - String publicUrlPrefix = oa.getPublicURLPrefix(); - if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { - if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { - if (result != null) { - Logger.warn("OAIdentifier match to more then one DB-entry!"); - return null; - } else { - result = oa; - } - } - } - } - - return result; - } - - /** - * - * @param dbid - * @return - */ - public static OnlineApplication getOnlineApplication(long dbid) { - Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); - - // select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id - OnlineApplication result = null; - List allOAs = getAllOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allOAs)) { - if (oa.getHjid() == dbid) { - result = oa; - break; - } - } - - return result; - } - - /** - * - * @param id - * @return - */ - public static OnlineApplication getOnlineApplication(String id) { - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) - OnlineApplication result = null; - List allOAs = getAllOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allOAs)) { - String publicUrlPrefix = oa.getPublicURLPrefix(); - if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { - if (id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix)) { - if (result != null) { - Logger.warn("OAIdentifier match to more then one DB-entry!"); - return null; - } else { - result = oa; - } - } - } - } - - return result; - } - - /** - * - * @param id - * @return - */ - public static List searchOnlineApplications(String id) { - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.friendlyName like :id - List result = new ArrayList(); - List allOAs = getAllOnlineApplications(); - - for (OnlineApplication oa : nullGuard(allOAs)) { - if (id.equals(oa.getFriendlyName())) { - result.add(oa); - } - } - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - - /** - * - * @return - */ - public static List getAllOpenUsersRequests() { - Logger.trace("Get all new Users from Database"); - - // select userdatabase from UserDatabase userdatabase - // where userdatabase.userRequestTokken is not null - // and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0' - List result = new ArrayList(); - List allUsers = getAllUsers(); - - for (UserDatabase user : nullGuard(allUsers)) { - // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) - if ((user.getUserRequestTokken() != null && !user.getUserRequestTokken().isEmpty() && !user.getUserRequestTokken().equals("NULL")) - && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { - result.add(user); - } - } - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - - /** - * - * @param tokken - * @return - */ - public static UserDatabase getNewUserWithTokken(String tokken) { - Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); - - // select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken - UserDatabase result = null; - List allUsers = getAllUsers(); - - for (UserDatabase user : nullGuard(allUsers)) { - if (user.getUserRequestTokken().equals(tokken)) { - result = user; - break; - } - } - - return result; - } - - /** - * - * @param id - * @return - */ - public static UserDatabase getUsersWithOADBID(long id) { - Logger.trace("Getting Userinformation with OADBID " + id + " from database."); - - // select userdatabase from UserDatabase userdatabase - // inner join userdatabase.onlineApplication oa where oa.hjid = :id - UserDatabase result = null; - List allUsers = getAllUsers(); - - boolean quit = false; - for (UserDatabase user : nullGuard(allUsers)) { - - for (OnlineApplication oa : user.getOnlineApplication()) { - - if (oa.getHjid() == id) { - result = user; - quit = true; - break; - } - } - - if (quit) { - break; - } - } - - return result; - } - - /** - * - * @param id - * @return - */ - public static UserDatabase getUserWithID(long id) { - Logger.trace("Getting Userinformation with ID " + id + " from database."); - - // select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id - UserDatabase result = null; - List allUsers = getAllUsers(); - - for (UserDatabase user : nullGuard(allUsers)) { - if (user.getHjid() == id) { - result = user; - break; - } - } - - return result; - } - - /** - * - * @param username - * @return - */ - public static UserDatabase getUserWithUserName(String username) { - Logger.trace("Getting Userinformation with ID " + username + " from database."); - - // select userdatabase from UserDatabase userdatabase where userdatabase.username = :username - UserDatabase result = null; - List allUsers = getAllUsers(); - - for (UserDatabase user : nullGuard(allUsers)) { - if (user.getUsername().equals(username)) { - result = user; - break; - } - } - - return result; - } - - /** - * - * @param bpkwbpk - * @return - */ - public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { - Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); - - // select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk - UserDatabase result = null; - List allUsers = getAllUsers(); - - for (UserDatabase user : nullGuard(allUsers)) { - if (user.getBpk().equals(bpkwbpk)) { - result = user; - break; - } - } - - return result; - } - -} +//package at.gv.egovernment.moa.id.commons.db; +// +//import java.util.ArrayList; +//import java.util.Collections; +//import java.util.Date; +//import java.util.List; +// +//import org.springframework.beans.factory.annotation.Autowired; +// +//import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +//import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; +//import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +//import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +//import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +//import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; +//import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +//import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +//import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; +//import at.gv.egovernment.moa.logging.Logger; +// +///** +// * +// * +// */ +//public class NewConfigurationDBRead { +// +// private static MOAIDConfiguration conf; +// +// @Autowired(required = true) +// public void setConfiguration(MOAIDConfiguration conf) { +// // https://jira.spring.io/browse/SPR-3845 +// NewConfigurationDBRead.conf = conf; +// } +// +// @SuppressWarnings("unchecked") +// public static > T nullGuard(T item) { +// if (item == null) { +// return (T) Collections.emptyList(); +// } else { +// return item; +// } +// } +// +// /** +// * +// * @return +// */ +// public static List getAllUsers() { +// Logger.trace("Get All Users from database."); +// +// // select userdatabase from UserDatabase userdatabase +// List result = conf.getList("getAllUsers", UserDatabase.class); +// if (result.size() == 0) { +// Logger.trace("No entries found."); +// return null; +// } +// +// return result; +// } +// +// /** +// * +// * @return +// */ +// public static List getAllOnlineApplications() { +// Logger.trace("Get All OnlineApplications from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// return conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); +// +// } +// +// /** +// * +// * @return +// */ +// public static List getAllNewOnlineApplications() { +// Logger.trace("Get All New OnlineApplications from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' +// List result = new ArrayList(); +// List allOAs = getAllOnlineApplications(); +// +// for (OnlineApplication oa : nullGuard(allOAs)) { +// if (!oa.isIsActive() && oa.isIsAdminRequired()) { +// result.add(oa); +// } +// } +// +// if (result.size() == 0) { +// Logger.trace("No entries found."); +// return null; +// } +// +// return result; +// } +// +// /** +// * +// * @return +// */ +// public static at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration getMOAIDConfiguration() { +// Logger.trace("Load MOAID Configuration from database."); +// +// AuthComponentGeneral authComponent = (AuthComponentGeneral) conf.get(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, +// AuthComponentGeneral.class); +// +// ChainingModes chainingModes = (ChainingModes) conf.get(MOAIDConfigurationConstants.CHAINING_MODES_KEY, ChainingModes.class); +// List genericConfigurations = (List) conf.getList( +// MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); +// String trustedCaCertificates = (String) conf.get(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, String.class); +// DefaultBKUs defaultBKUs = (DefaultBKUs) conf.get(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, DefaultBKUs.class); +// SLRequestTemplates slrRequestRemplates = (SLRequestTemplates) conf.get(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, +// SLRequestTemplates.class); +// Date timeStamp = (Date) conf.get(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, Date.class); +// Date pvp2Refresh = (Date) conf.get(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, Date.class); +// +// // if (authComponent == null || chainingModes == null || trustedCaCertificates == null || defaultBKUs == null +// // || slrRequestRemplates == null || timeStamp == null || pvp2Refresh == null +// // +// // ) { +// // // TODO: is there a better approach in case of error? +// // Logger.trace("Not all necessary data available. Create fresh instance."); +// // return new MOAIDConfiguration(); +// // } +// +// // select moaidconfiguration from MOAIDConfiguration moaidconfiguration +// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration result = new at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration(); +// result.setAuthComponentGeneral(authComponent); +// result.setChainingModes(chainingModes); +// result.setGenericConfiguration(genericConfigurations); +// result.setTrustedCACertificates(trustedCaCertificates); +// result.setDefaultBKUs(defaultBKUs); +// result.setSLRequestTemplates(slrRequestRemplates); +// result.setTimestampItem(timeStamp); +// result.setPvp2RefreshItem(pvp2Refresh); +// +// return result; +// } +// +// /** +// * +// * @return +// */ +// public static List getAllActiveOnlineApplications() { +// Logger.trace("Get All New OnlineApplications from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.isActive = '1' +// List result = new ArrayList(); +// List allOAs = getAllOnlineApplications(); +// +// for (OnlineApplication oa : nullGuard(allOAs)) { +// if (oa.isIsActive()) { +// result.add(oa); +// } +// } +// +// if (result.size() == 0) { +// Logger.trace("No entries found."); +// return null; +// } +// +// return result; +// } +// +// /** +// * +// * @param id +// * @return +// */ +// public static OnlineApplication getActiveOnlineApplication(String id) { +// Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.publicURLPrefix = +// // SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1' +// OnlineApplication result = null; +// List allActiveOAs = getAllActiveOnlineApplications(); +// +// for (OnlineApplication oa : nullGuard(allActiveOAs)) { +// String publicUrlPrefix = oa.getPublicURLPrefix(); +// if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { +// if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { +// if (result != null) { +// Logger.warn("OAIdentifier match to more then one DB-entry!"); +// return null; +// } else { +// result = oa; +// } +// } +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param dbid +// * @return +// */ +// public static OnlineApplication getOnlineApplication(long dbid) { +// Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id +// OnlineApplication result = null; +// List allOAs = getAllOnlineApplications(); +// +// for (OnlineApplication oa : nullGuard(allOAs)) { +// if (oa.getHjid() == dbid) { +// result = oa; +// break; +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param id +// * @return +// */ +// public static OnlineApplication getOnlineApplication(String id) { +// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) +// OnlineApplication result = null; +// List allOAs = getAllOnlineApplications(); +// +// for (OnlineApplication oa : nullGuard(allOAs)) { +// String publicUrlPrefix = oa.getPublicURLPrefix(); +// if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { +// if (id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix)) { +// if (result != null) { +// Logger.warn("OAIdentifier match to more then one DB-entry!"); +// return null; +// } else { +// result = oa; +// } +// } +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param id +// * @return +// */ +// public static List searchOnlineApplications(String id) { +// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.friendlyName like :id +// List result = new ArrayList(); +// List allOAs = getAllOnlineApplications(); +// +// for (OnlineApplication oa : nullGuard(allOAs)) { +// if (id.equals(oa.getFriendlyName())) { +// result.add(oa); +// } +// } +// +// if (result.size() == 0) { +// Logger.trace("No entries found."); +// return null; +// } +// +// return result; +// } +// +// /** +// * +// * @return +// */ +// public static List getAllOpenUsersRequests() { +// Logger.trace("Get all new Users from Database"); +// +// // select userdatabase from UserDatabase userdatabase +// // where userdatabase.userRequestTokken is not null +// // and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0' +// List result = new ArrayList(); +// List allUsers = getAllUsers(); +// +// for (UserDatabase user : nullGuard(allUsers)) { +// // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) +// if ((user.getUserRequestTokken() != null && !user.getUserRequestTokken().isEmpty() && !user.getUserRequestTokken().equals("NULL")) +// && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { +// result.add(user); +// } +// } +// +// if (result.size() == 0) { +// Logger.trace("No entries found."); +// return null; +// } +// +// return result; +// } +// +// /** +// * +// * @param tokken +// * @return +// */ +// public static UserDatabase getNewUserWithTokken(String tokken) { +// Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); +// +// // select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken +// UserDatabase result = null; +// List allUsers = getAllUsers(); +// +// for (UserDatabase user : nullGuard(allUsers)) { +// if (user.getUserRequestTokken().equals(tokken)) { +// result = user; +// break; +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param id +// * @return +// */ +// public static UserDatabase getUsersWithOADBID(long id) { +// Logger.trace("Getting Userinformation with OADBID " + id + " from database."); +// +// // select userdatabase from UserDatabase userdatabase +// // inner join userdatabase.onlineApplication oa where oa.hjid = :id +// UserDatabase result = null; +// List allUsers = getAllUsers(); +// +// boolean quit = false; +// for (UserDatabase user : nullGuard(allUsers)) { +// +// for (OnlineApplication oa : user.getOnlineApplication()) { +// +// if (oa.getHjid() == id) { +// result = user; +// quit = true; +// break; +// } +// } +// +// if (quit) { +// break; +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param id +// * @return +// */ +// public static UserDatabase getUserWithID(long id) { +// Logger.trace("Getting Userinformation with ID " + id + " from database."); +// +// // select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id +// UserDatabase result = null; +// List allUsers = getAllUsers(); +// +// for (UserDatabase user : nullGuard(allUsers)) { +// if (user.getHjid() == id) { +// result = user; +// break; +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param username +// * @return +// */ +// public static UserDatabase getUserWithUserName(String username) { +// Logger.trace("Getting Userinformation with ID " + username + " from database."); +// +// // select userdatabase from UserDatabase userdatabase where userdatabase.username = :username +// UserDatabase result = null; +// List allUsers = getAllUsers(); +// +// for (UserDatabase user : nullGuard(allUsers)) { +// if (user.getUsername().equals(username)) { +// result = user; +// break; +// } +// } +// +// return result; +// } +// +// /** +// * +// * @param bpkwbpk +// * @return +// */ +// public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { +// Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); +// +// // select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk +// UserDatabase result = null; +// List allUsers = getAllUsers(); +// +// for (UserDatabase user : nullGuard(allUsers)) { +// if (user.getBpk().equals(bpkwbpk)) { +// result = user; +// break; +// } +// } +// +// return result; +// } +// +//} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java index 69e03db28..a2b1f120e 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBWrite.java @@ -1,137 +1,137 @@ -package at.gv.egovernment.moa.id.commons.db; - -import java.util.Date; -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; -import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; -import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; -import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; -import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; - -/** - * This class is used for writing to the key-value database. - */ -@Component -public class NewConfigurationDBWrite { - - private static MOAIDConfiguration conf; - - @Autowired(required = true) - public void setConfiguration(MOAIDConfiguration conf) { - // https://jira.spring.io/browse/SPR-3845 - NewConfigurationDBWrite.conf = conf; - } - - private static boolean saveAuthComponentGeneral(AuthComponentGeneral dbo) { - return conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); - } - - private static boolean saveChainingModes(ChainingModes dbo) { - return conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); - } - - private static boolean saveOnlineApplication(OnlineApplication dbo) { - - List storedObjects = conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); - storedObjects.add(dbo); - return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); - } - - private static boolean saveGenericConfiguration(GenericConfiguration dbo) { - - List storedObjects = conf.getList(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); - storedObjects.add(dbo); - return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); - } - - private static boolean saveTrustedCACertificates(String dbo) { - return conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); - } - - private static boolean saveDefaultBKUs(DefaultBKUs dbo) { - return conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); - } - - private static boolean saveSLRequestTemplates(SLRequestTemplates dbo) { - return conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); - } - - private static boolean saveTimeStampItem(Date dbo) { - return conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); - } - - private static boolean savePvp2RefreshItem(Date dbo) { - return conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); - } - - /** - * Saves the given list of {@link OnlineApplication} objects to database. - * @param oas the list - * @return {@code true} on success; {@code false} otherwise. - */ - public static boolean saveOnlineApplications(List oas) { - return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); - } - - /** - * Saves the given list of {@link GenericConfiguration} objects to database. - * @param gcs the list - * @return {@code true} on success; {@code false} otherwise. - */ - public static boolean saveGenericConfigurations(List gcs) { - return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, gcs); - } - - - /** - * Saves the given object to database - * @param dbo the object to save - * @return {@code true} on success; {@code false} otherwise. - */ - public static boolean save(Object dbo) { - - boolean result = false; - - if (dbo instanceof OnlineApplication) { - - result = saveOnlineApplication((OnlineApplication) dbo); - - } else if (dbo instanceof MOAIDConfiguration) { - - at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration moaconfig = - (at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration) dbo; - result = true; - - result &= saveAuthComponentGeneral(moaconfig.getAuthComponentGeneral()); - result &= saveChainingModes(moaconfig.getChainingModes()); - result &= saveDefaultBKUs(moaconfig.getDefaultBKUs()); - result &= saveGenericConfigurations(moaconfig.getGenericConfiguration()); - result &= savePvp2RefreshItem(moaconfig.getPvp2RefreshItem()); - result &= saveSLRequestTemplates(moaconfig.getSLRequestTemplates()); - result &= saveTrustedCACertificates(moaconfig.getTrustedCACertificates()); - result &= saveTimeStampItem(moaconfig.getTimestampItem()); - - } else if (dbo instanceof UserDatabase) { - // TODO implement user handling - } - - return result; - } - - /** - * Deletes the object associated with the given key. - * @param key the key - */ - public static void delete(String key) { - conf.set(key, null); - } - -} +//package at.gv.egovernment.moa.id.commons.db; +// +//import java.util.Date; +//import java.util.List; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +//import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; +//import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +//import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +//import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +//import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; +//import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +//import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +//import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; +// +///** +// * This class is used for writing to the key-value database. +// */ +//@Component +//public class NewConfigurationDBWrite { +// +// private static MOAIDConfiguration conf; +// +// @Autowired(required = true) +// public void setConfiguration(MOAIDConfiguration conf) { +// // https://jira.spring.io/browse/SPR-3845 +// NewConfigurationDBWrite.conf = conf; +// } +// +// private static boolean saveAuthComponentGeneral(AuthComponentGeneral dbo) { +// return conf.set(MOAIDConfigurationConstants.AUTH_COMPONENT_GENERAL_KEY, dbo); +// } +// +// private static boolean saveChainingModes(ChainingModes dbo) { +// return conf.set(MOAIDConfigurationConstants.CHAINING_MODES_KEY, dbo); +// } +// +// private static boolean saveOnlineApplication(OnlineApplication dbo) { +// +// List storedObjects = conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); +// storedObjects.add(dbo); +// return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, storedObjects); +// } +// +// private static boolean saveGenericConfiguration(GenericConfiguration dbo) { +// +// List storedObjects = conf.getList(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, GenericConfiguration.class); +// storedObjects.add(dbo); +// return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, storedObjects); +// } +// +// private static boolean saveTrustedCACertificates(String dbo) { +// return conf.set(MOAIDConfigurationConstants.TRUSTED_CERTIFICATES_KEY, dbo); +// } +// +// private static boolean saveDefaultBKUs(DefaultBKUs dbo) { +// return conf.set(MOAIDConfigurationConstants.DEFAULT_BKUS_KEY, dbo); +// } +// +// private static boolean saveSLRequestTemplates(SLRequestTemplates dbo) { +// return conf.set(MOAIDConfigurationConstants.SLREQUEST_TEMPLATES_KEY, dbo); +// } +// +// private static boolean saveTimeStampItem(Date dbo) { +// return conf.set(MOAIDConfigurationConstants.TIMESTAMP_ITEM_KEY, dbo); +// } +// +// private static boolean savePvp2RefreshItem(Date dbo) { +// return conf.set(MOAIDConfigurationConstants.PVP2REFRESH_ITEM_KEY, dbo); +// } +// +// /** +// * Saves the given list of {@link OnlineApplication} objects to database. +// * @param oas the list +// * @return {@code true} on success; {@code false} otherwise. +// */ +// public static boolean saveOnlineApplications(List oas) { +// return conf.set(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, oas); +// } +// +// /** +// * Saves the given list of {@link GenericConfiguration} objects to database. +// * @param gcs the list +// * @return {@code true} on success; {@code false} otherwise. +// */ +// public static boolean saveGenericConfigurations(List gcs) { +// return conf.set(MOAIDConfigurationConstants.GENERIC_CONFIGURATION_KEY, gcs); +// } +// +// +// /** +// * Saves the given object to database +// * @param dbo the object to save +// * @return {@code true} on success; {@code false} otherwise. +// */ +// public static boolean save(Object dbo) { +// +// boolean result = false; +// +// if (dbo instanceof OnlineApplication) { +// +// result = saveOnlineApplication((OnlineApplication) dbo); +// +// } else if (dbo instanceof MOAIDConfiguration) { +// +// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration moaconfig = +// (at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration) dbo; +// result = true; +// +// result &= saveAuthComponentGeneral(moaconfig.getAuthComponentGeneral()); +// result &= saveChainingModes(moaconfig.getChainingModes()); +// result &= saveDefaultBKUs(moaconfig.getDefaultBKUs()); +// result &= saveGenericConfigurations(moaconfig.getGenericConfiguration()); +// result &= savePvp2RefreshItem(moaconfig.getPvp2RefreshItem()); +// result &= saveSLRequestTemplates(moaconfig.getSLRequestTemplates()); +// result &= saveTrustedCACertificates(moaconfig.getTrustedCACertificates()); +// result &= saveTimeStampItem(moaconfig.getTimestampItem()); +// +// } else if (dbo instanceof UserDatabase) { +// // TODO implement user handling +// } +// +// return result; +// } +// +// /** +// * Deletes the object associated with the given key. +// * @param key the key +// */ +// public static void delete(String key) { +// conf.set(key, null); +// } +// +//} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAHttpProtocolSocketFactory.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAHttpProtocolSocketFactory.java index 3b6fc34ea..2ade63c1c 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAHttpProtocolSocketFactory.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/MOAHttpProtocolSocketFactory.java @@ -37,7 +37,6 @@ import org.apache.commons.httpclient.ConnectTimeoutException; import org.apache.commons.httpclient.params.HttpConnectionParams; import org.apache.commons.httpclient.protocol.SecureProtocolSocketFactory; -import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModeType; import at.gv.egovernment.moa.id.commons.ex.MOAHttpProtocolSocketFactoryException; import at.gv.egovernment.moa.id.commons.utils.ssl.SSLConfigurationException; import at.gv.egovernment.moa.id.commons.utils.ssl.SSLUtils; @@ -57,7 +56,7 @@ public class MOAHttpProtocolSocketFactory implements SecureProtocolSocketFactory String certStoreRootDirParam, String trustStoreURL, String acceptedServerCertURL, - ChainingModeType chainingMode, + String chainingMode, boolean checkRevocation ) throws MOAHttpProtocolSocketFactoryException { super(); @@ -68,7 +67,7 @@ public class MOAHttpProtocolSocketFactory implements SecureProtocolSocketFactory certStoreRootDirParam, trustStoreURL, acceptedServerCertURL, - chainingMode.value(), + chainingMode, checkRevocation, null, null, diff --git a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java index c8a234565..896a26064 100644 --- a/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java +++ b/id/server/moa-id-commons/src/test/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBReadTest.java @@ -1,128 +1,128 @@ -package at.gv.egovernment.moa.id.commons.db; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.List; -import java.util.Properties; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.annotation.IfProfileValue; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; - -import com.fasterxml.jackson.annotation.JsonProperty; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration("configuration.beans-test.xml") -@IfProfileValue(name = "test-groups", values = { "manual" }) -public class ConfigurationDBReadTest { - - @Autowired - MOAIDConfiguration configDataBase; - - private Properties getHibernateProperties() throws FileNotFoundException, IOException { - - Properties configProp = null; - try (InputStream in = ConfigurationDBReadTest.class.getResourceAsStream("hibernate.properties");) { - Properties props = new Properties(); - props.load(in); - // read Config Hibernate properties - configProp = new Properties(); - for (Object key : props.keySet()) { - String propPrefix = "configuration."; - if (key.toString().startsWith(propPrefix + "hibernate")) { - String propertyName = key.toString().substring(propPrefix.length()); - configProp.put(propertyName, props.get(key.toString())); - } - } - } - - return configProp; - } - - private void migrateDatabase(List methodNames) throws IllegalAccessException, IllegalArgumentException, - InvocationTargetException, NoSuchMethodException, SecurityException { - for (String name : methodNames) { - Method method = ConfigurationFromDBExtractor.class.getMethod(name); - Object tmp = method.invoke(null, new Object[] {}); - JsonProperty annotation = method.getAnnotation(JsonProperty.class); - if (annotation != null) { - configDataBase.set(annotation.value(), tmp); - } else { - System.out.println("Methods must be annotated, annotation is used as key in key-value db."); - assertTrue(false); - } - } - } - - @Before - public void initialize() throws FileNotFoundException, MOADatabaseException, IOException, IllegalAccessException, - IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { - - // initialize the connection to the old database - ConfigurationDBUtils.initHibernate(getHibernateProperties()); - - // migrate the data in the old database to a new key value database - List methodNames = Arrays.asList("getAuthComponentGeneral", "getChainingModes", - "getTrustedCACertificates", "getDefaultBKUs", "getSLRequestTemplates", "getTimeStampItem", - "getPvp2RefreshItem", "getOnlineApplications", "getGenericConfigurations"); - migrateDatabase(methodNames); - - // close the session with the old database - ConfigurationDBUtils.closeSession(); - } - - @Test - public void testGetMOAIDConfiguration() throws FileNotFoundException, MOADatabaseException, IOException, - IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, - SecurityException { - - // get the old moaid configuration - at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); - - // get the a new moaid configuration from the data in the key value - // database - at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); - - // check if both configurations yield a similar MOAIDConfiguration - // object - assertTrue(oldConfig.equals(newConfig)); - - } - - @Test - public void testGetMOAIDConfigurationNotEqual() throws FileNotFoundException, MOADatabaseException, IOException, - IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, - SecurityException { - - // get the old moaid configuration - at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); - - // delete part of the configuration - oldConfig.setAuthComponentGeneral(new AuthComponentGeneral()); - - // get the a new moaid configuration from the data in the key value - // database - at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); - - // check if both configurations yield a similar MOAIDConfiguration - // object - assertFalse(oldConfig.equals(newConfig)); - - } - -} +//package at.gv.egovernment.moa.id.commons.db; +// +//import static org.junit.Assert.assertFalse; +//import static org.junit.Assert.assertTrue; +// +//import java.io.FileNotFoundException; +//import java.io.IOException; +//import java.io.InputStream; +//import java.lang.reflect.InvocationTargetException; +//import java.lang.reflect.Method; +//import java.util.Arrays; +//import java.util.List; +//import java.util.Properties; +// +//import org.junit.Before; +//import org.junit.Test; +//import org.junit.runner.RunWith; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.test.annotation.IfProfileValue; +//import org.springframework.test.context.ContextConfiguration; +//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +// +//import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; +//import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +//import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +// +//import com.fasterxml.jackson.annotation.JsonProperty; +// +//@RunWith(SpringJUnit4ClassRunner.class) +//@ContextConfiguration("configuration.beans-test.xml") +//@IfProfileValue(name = "test-groups", values = { "manual" }) +//public class ConfigurationDBReadTest { +// +// @Autowired +// MOAIDConfiguration configDataBase; +// +// private Properties getHibernateProperties() throws FileNotFoundException, IOException { +// +// Properties configProp = null; +// try (InputStream in = ConfigurationDBReadTest.class.getResourceAsStream("hibernate.properties");) { +// Properties props = new Properties(); +// props.load(in); +// // read Config Hibernate properties +// configProp = new Properties(); +// for (Object key : props.keySet()) { +// String propPrefix = "configuration."; +// if (key.toString().startsWith(propPrefix + "hibernate")) { +// String propertyName = key.toString().substring(propPrefix.length()); +// configProp.put(propertyName, props.get(key.toString())); +// } +// } +// } +// +// return configProp; +// } +// +// private void migrateDatabase(List methodNames) throws IllegalAccessException, IllegalArgumentException, +// InvocationTargetException, NoSuchMethodException, SecurityException { +// for (String name : methodNames) { +// Method method = ConfigurationFromDBExtractor.class.getMethod(name); +// Object tmp = method.invoke(null, new Object[] {}); +// JsonProperty annotation = method.getAnnotation(JsonProperty.class); +// if (annotation != null) { +// configDataBase.set(annotation.value(), tmp); +// } else { +// System.out.println("Methods must be annotated, annotation is used as key in key-value db."); +// assertTrue(false); +// } +// } +// } +// +// @Before +// public void initialize() throws FileNotFoundException, MOADatabaseException, IOException, IllegalAccessException, +// IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { +// +// // initialize the connection to the old database +// ConfigurationDBUtils.initHibernate(getHibernateProperties()); +// +// // migrate the data in the old database to a new key value database +// List methodNames = Arrays.asList("getAuthComponentGeneral", "getChainingModes", +// "getTrustedCACertificates", "getDefaultBKUs", "getSLRequestTemplates", "getTimeStampItem", +// "getPvp2RefreshItem", "getOnlineApplications", "getGenericConfigurations"); +// migrateDatabase(methodNames); +// +// // close the session with the old database +// ConfigurationDBUtils.closeSession(); +// } +// +// @Test +// public void testGetMOAIDConfiguration() throws FileNotFoundException, MOADatabaseException, IOException, +// IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, +// SecurityException { +// +// // get the old moaid configuration +// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); +// +// // get the a new moaid configuration from the data in the key value +// // database +// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); +// +// // check if both configurations yield a similar MOAIDConfiguration +// // object +// assertTrue(oldConfig.equals(newConfig)); +// +// } +// +// @Test +// public void testGetMOAIDConfigurationNotEqual() throws FileNotFoundException, MOADatabaseException, IOException, +// IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, +// SecurityException { +// +// // get the old moaid configuration +// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration oldConfig = ConfigurationDBRead.getMOAIDConfiguration(); +// +// // delete part of the configuration +// oldConfig.setAuthComponentGeneral(new AuthComponentGeneral()); +// +// // get the a new moaid configuration from the data in the key value +// // database +// at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration newConfig = NewConfigurationDBRead.getMOAIDConfiguration(); +// +// // check if both configurations yield a similar MOAIDConfiguration +// // object +// assertFalse(oldConfig.equals(newConfig)); +// +// } +// +//} -- cgit v1.2.3 From 0ac1586549bf1bb391c48a4151a5f32a0863a5f4 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 19 Jun 2015 12:14:39 +0200 Subject: update pom --- id/server/idserverlib/pom.xml | 3 +++ id/server/moa-id-commons/pom.xml | 10 +++++++++- id/server/pom.xml | 9 +++------ 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml index eefa3761b..0bda107be 100644 --- a/id/server/idserverlib/pom.xml +++ b/id/server/idserverlib/pom.xml @@ -444,17 +444,20 @@ com.fasterxml.jackson.core jackson-core + 2.5.4 com.fasterxml.jackson.core jackson-databind + 2.5.4 com.fasterxml.jackson.core jackson-annotations + 2.5.4 diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 9260f8b22..c04ea13fa 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -147,6 +147,7 @@ commons-cli commons-cli + 1.2 @@ -158,10 +159,17 @@ spring-orm - + com.fasterxml.jackson.core jackson-databind + 2.5.4 + + com.fasterxml.jackson.core + jackson-annotations + 2.5.4 + + junit junit diff --git a/id/server/pom.xml b/id/server/pom.xml index b88bf7b49..45d7822a1 100644 --- a/id/server/pom.xml +++ b/id/server/pom.xml @@ -100,11 +100,7 @@ ${org.springframework.version} test -
- - - - + junit junit @@ -121,9 +117,10 @@ unitils-core 3.4.2 + - + - + org.hibernate.ejb.HibernatePersistence at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty diff --git a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java index 5f0ffd4e2..9896f2454 100644 --- a/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java +++ b/id/server/modules/module-monitoring/src/main/java/at/gv/egovernment/moa/id/monitoring/DatabaseTestModule.java @@ -29,11 +29,8 @@ import java.util.List; import org.hibernate.Query; import org.hibernate.Session; -import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; -import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; import at.gv.egovernment.moa.id.commons.db.StatisticLogDBUtils; -import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.session.AssertionStore; import at.gv.egovernment.moa.id.commons.db.dao.statistic.StatisticLog; import at.gv.egovernment.moa.id.config.auth.AuthConfiguration; @@ -96,10 +93,9 @@ public class DatabaseTestModule implements TestModuleInterface{ private String testMOAConfigurationDatabase() throws Exception{ - MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); - ConfigurationDBUtils.closeSession(); - - if (moaidconfig == null) + String publicURLPreFix = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); + + if (MiscUtil.isEmpty(publicURLPreFix)) return ("MOA-ID 2.x configuration can not be loaded from Database."); return null; diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java index 6f5cf0700..939390847 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/AbstractPepsConnectorWithLocalSigningTask.java @@ -54,6 +54,8 @@ import eu.stork.peps.auth.commons.IPersonalAttributeList; public abstract class AbstractPepsConnectorWithLocalSigningTask extends AbstractAuthServletTask { + public static final String PEPSCONNECTOR_SERVLET_URL_PATTERN = "/PEPSConnectorWithLocalSigning"; + String getCitizienSignatureFromSignResponse(SignResponse dssSignResponse) throws IllegalArgumentException, TransformerConfigurationException, UtilsException, TransformerException, TransformerFactoryConfigurationError, IOException, ApiUtilsException { diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java index 11051ceec..8b013ab4d 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/CreateStorkAuthRequestFormTask.java @@ -2,13 +2,49 @@ package at.gv.egovernment.moa.id.auth.modules.stork.tasks; import static at.gv.egovernment.moa.id.auth.MOAIDAuthConstants.*; +import java.io.IOException; +import java.io.StringWriter; +import java.math.BigInteger; +import java.net.URL; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.opensaml.common.IdentifierGenerator; +import org.opensaml.common.impl.SecureRandomIdentifierGenerator; +import org.w3c.dom.DOMException; + +import eu.stork.oasisdss.api.AdditionalProfiles; +import eu.stork.oasisdss.api.ApiUtils; +import eu.stork.oasisdss.api.Profiles; +import eu.stork.oasisdss.api.QualityLevels; +import eu.stork.oasisdss.api.SignatureTypes; +import eu.stork.oasisdss.api.exceptions.ApiUtilsException; +import eu.stork.oasisdss.profile.AnyType; +import eu.stork.oasisdss.profile.DocumentType; +import eu.stork.oasisdss.profile.SignRequest; +import eu.stork.peps.auth.commons.PEPSUtil; +import eu.stork.peps.auth.commons.PersonalAttribute; +import eu.stork.peps.auth.commons.PersonalAttributeList; +import eu.stork.peps.auth.commons.STORKAuthnRequest; +import eu.stork.peps.auth.engine.STORKSAMLEngine; +import eu.stork.peps.exceptions.STORKSAMLEngineException; import at.gv.egovernment.moa.id.auth.AuthenticationServer; +import at.gv.egovernment.moa.id.auth.builder.CreateXMLSignatureRequestBuilder; import at.gv.egovernment.moa.id.auth.builder.StartAuthenticationBuilder; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; @@ -17,12 +53,17 @@ import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; +import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.config.stork.CPEPS; import at.gv.egovernment.moa.id.config.stork.STORKConfig; +import at.gv.egovernment.moa.id.config.stork.StorkAttribute; import at.gv.egovernment.moa.id.process.api.ExecutionContext; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; +import at.gv.egovernment.moa.id.util.VelocityProvider; import at.gv.egovernment.moa.logging.Logger; /** @@ -95,7 +136,7 @@ public class CreateStorkAuthRequestFormTask extends AbstractAuthServletTask { executionContext.put(PROCESS_CTX_KEY_CPEPS_ISXMLSIGSUPPORTED, cpeps.isXMLSignatureSupported()); Logger.info("Starting STORK authentication for a citizen of country: " + moasession.getCcc()); - AuthenticationServer.startSTORKAuthentication(req, resp, moasession); + startSTORKAuthentication(req, resp, moasession); } catch (MOAIDException ex) { throw new TaskExecutionException(ex.getMessage(), ex); @@ -110,5 +151,285 @@ public class CreateStorkAuthRequestFormTask extends AbstractAuthServletTask { ConfigurationDBUtils.closeSession(); } } + + /** + * Starts a MOA-ID authentication process using STORK + * + * @param req HttpServletRequest + * @param resp HttpServletResponse + * @param ccc Citizen country code + * @param oaURL URL of the online application + * @param target Target parameter + * @param targetFriendlyName Friendly Name of Target + * @param authURL Authentication URL + * @param sourceID SourceID parameter + * @throws MOAIDException + * @throws AuthenticationException + * @throws WrongParametersException + * @throws ConfigurationException + */ + public void startSTORKAuthentication( + HttpServletRequest req, + HttpServletResponse resp, + AuthenticationSession moasession) throws MOAIDException, AuthenticationException, WrongParametersException, ConfigurationException { + + if (moasession == null) { + throw new AuthenticationException("auth.18", new Object[]{}); + } + + //read configuration paramters of OA + OAAuthParameter oaParam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(moasession.getPublicOAURLPrefix()); + if (oaParam == null) + throw new AuthenticationException("auth.00", new Object[]{moasession.getPublicOAURLPrefix()}); + + //Start of STORK Processing + STORKConfig storkConfig = AuthConfigurationProviderFactory.getInstance().getStorkConfig(); + + CPEPS cpeps = storkConfig.getCPEPS(moasession.getCcc()); + + Logger.debug("Preparing to assemble STORK AuthnRequest with the following values:"); + String destination = cpeps.getPepsURL().toExternalForm(); + Logger.debug("C-PEPS URL: " + destination); + + + String issuerValue = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); + // String acsURL = new DataURLBuilder().buildDataURL(issuerValue, + // PEPSConnectorServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN, moasession.getSessionID()); + + + String providerName = oaParam.getFriendlyName(); + Logger.debug("Issuer value: " + issuerValue); + + // prepare collection of required attributes + // - attributes for online application + Collection attributesFromConfig = oaParam.getRequestedSTORKAttributes(); + + // - prepare attribute list + PersonalAttributeList attributeList = new PersonalAttributeList(); + + // - fill container + for (StorkAttribute current : attributesFromConfig) { + PersonalAttribute newAttribute = new PersonalAttribute(); + newAttribute.setName(current.getName()); + + boolean globallyMandatory = false; + for (StorkAttribute currentGlobalAttribute : storkConfig.getStorkAttributes()) + if (current.getName().equals(currentGlobalAttribute.getName())) { + globallyMandatory = BooleanUtils.isTrue(currentGlobalAttribute.getMandatory()); + break; + } + + newAttribute.setIsRequired(current.getMandatory() || globallyMandatory); + attributeList.add(newAttribute); + } + + // add sign request + PersonalAttribute newAttribute = new PersonalAttribute(); + newAttribute.setName("signedDoc"); + newAttribute.setIsRequired(true); + List value = new ArrayList(); + + Logger.debug("PEPS supports XMLSignatures:"+cpeps.isXMLSignatureSupported()); + String acsURL; + if(cpeps.isXMLSignatureSupported())//Send SignRequest to PEPS + { + //solve Problem with sessionIDs + acsURL = issuerValue + PepsConnectorTask.PEPSCONNECTOR_SERVLET_URL_PATTERN; + + value.add(generateDssSignRequest(CreateXMLSignatureRequestBuilder.buildForeignIDTextToBeSigned("wie im Signaturzertifikat (as in my signature certificate)", oaParam, moasession), + "application/xhtml+xml", moasession.getCcc())); + newAttribute.setValue(value); + attributeList.add(newAttribute); + + // TODO[branch]: STORK AuthReq CPEPS acsURL "/PEPSConnector" + } + else//Process SignRequest locally with MOCCA + { + String target = moasession.getTarget(); + moasession.setTarget("AT"); + String signedDoc = (generateDssSignRequest(CreateXMLSignatureRequestBuilder.buildForeignIDTextToBeSigned("wie im Signaturzertifikat (as in my signature certificate)", oaParam, moasession), + "application/xhtml+xml", "AT"));//moasession.getCcc() + moasession.setTarget(target); + Logger.warn("signedDoc to store:"+signedDoc); + //attributeList.add(newAttribute); + + //store SignRequest for later... + moasession.setSignedDoc(signedDoc); + + acsURL = issuerValue + AbstractPepsConnectorWithLocalSigningTask.PEPSCONNECTOR_SERVLET_URL_PATTERN; + // TODO[branch]: STORK AuthReq acsURL "/PEPSConnectorWithLocalSigning" + try { + AuthenticationSessionStoreage.storeSession(moasession); + } catch (MOADatabaseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + Logger.debug("MOA Assertion Consumer URL (PEPSConnctor): " + acsURL); + + if (Logger.isDebugEnabled()) { + Logger.debug("The following attributes are requested for this OA:"); + for (StorkAttribute logReqAttr : attributesFromConfig) + Logger.debug("OA specific requested attribute: " + logReqAttr.getName() + ", isRequired: " + logReqAttr.getMandatory()); + } + + //TODO: check Target in case of SSO!! + String spSector = StringUtils.isEmpty(moasession.getTarget()) ? "Business" : moasession.getTarget(); + String spInstitution = StringUtils.isEmpty(oaParam.getFriendlyName()) ? "UNKNOWN" : oaParam.getFriendlyName(); + String spApplication = spInstitution; + String spCountry = "AT"; // intentionally set AT - the flow is limited on that use case only + + //generate AuthnRquest + STORKAuthnRequest authnRequest = new STORKAuthnRequest(); + authnRequest.setDestination(destination); + authnRequest.setAssertionConsumerServiceURL(acsURL);//PEPSConnectorWithLocalSigning + authnRequest.setProviderName(providerName); + authnRequest.setIssuer(issuerValue); + authnRequest.setQaa(oaParam.getQaaLevel()); + authnRequest.setSpInstitution(spInstitution); + authnRequest.setSpCountry(spCountry); + authnRequest.setSpApplication(spApplication); + authnRequest.setSpSector(spSector); + authnRequest.setPersonalAttributeList(attributeList); + + //TODO change + authnRequest.setEIDCrossBorderShare(true); + authnRequest.setEIDCrossSectorShare(true); + authnRequest.setEIDSectorShare(true); + + authnRequest.setCitizenCountryCode(moasession.getCcc()); + + Logger.debug("STORK AuthnRequest succesfully assembled."); + + STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("outgoing"); + + if (samlEngine == null) { + Logger.error("Could not initalize STORK SAML engine."); + throw new MOAIDException("stork.00", null); + } + + try { + authnRequest = samlEngine.generateSTORKAuthnRequest(authnRequest); + } catch (STORKSAMLEngineException e) { + Logger.error("Could not sign STORK SAML AuthnRequest.", e); + throw new MOAIDException("stork.00", null); + } + + Logger.info("STORK AuthnRequest successfully signed!"); + + //validate AuthnRequest + try { + samlEngine.validateSTORKAuthnRequest(authnRequest.getTokenSaml()); + } catch (STORKSAMLEngineException e) { + Logger.error("STORK SAML AuthnRequest not valid.", e); + throw new MOAIDException("stork.01", null); + } + + Logger.debug("STORK AuthnRequest successfully internally validated."); + + //send + moasession.setStorkAuthnRequest(authnRequest); + + // do PEPS-conform logging for easier evaluation + try { + // 2015-03-12 16:44:27.144#S-PEPS receives request from SP#spurl#spepsurl#spapp#spdomain#citizen country#qaa#msghash#msg_id id1# + Logger.info(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + "#S-PEPS receives request from SP#" + + moasession.getPublicOAURLPrefix() + "#" + issuerValue + "#" + spApplication + "#" + + new URL(moasession.getPublicOAURLPrefix()).getHost() + "#" + moasession.getCcc() + "#" + oaParam.getQaaLevel() + + "#_hash_#" + moasession.getProcessInstanceId() + "#"); + } catch (Exception e1) { + Logger.info("STORK PEPS conform logging failed because of: " + e1.getMessage()); + } + + AuthenticationSessionStoreage.changeSessionID(moasession, authnRequest.getSamlId()); + + + Logger.info("Preparing to send STORK AuthnRequest."); + Logger.info("prepared STORKAuthnRequest: "); + Logger.info(new String(authnRequest.getTokenSaml())); + + try { + Logger.trace("Initialize VelocityEngine..."); + + VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine(); + Template template = velocityEngine.getTemplate("/resources/templates/saml2-post-binding-moa.vm"); + VelocityContext context = new VelocityContext(); + context.put("SAMLRequest", PEPSUtil.encodeSAMLToken(authnRequest.getTokenSaml())); + context.put("RelayState", moasession.getSessionID()); + context.put("action", destination); + + StringWriter writer = new StringWriter(); + template.merge(context, writer); + + // TODO[branch]: SAML2 Form Submit to CPEPS, response to acsURL Servlet + + resp.setContentType("text/html;charset=UTF-8"); + resp.getOutputStream().write(writer.toString().getBytes("UTF-8")); + + } catch (Exception e) { + Logger.error("Error sending STORK SAML AuthnRequest.", e); + throw new MOAIDException("stork.02", new Object[]{destination}); + + } + + Logger.info("STORK AuthnRequest successfully successfully prepared for client with target location: " + authnRequest.getDestination()); + + // do PEPS-conform logging for easier evaluation + try { + // 2015-03-12 16:44:27.144#S-PEPS generates request to C-PEPS#spepsurl#cpepsurl#spapp#spdomain#citizen country#qaa#msghash#msg_id id1#id2# + Logger.info(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + "#S-PEPS generates request to C-PEPS#" + + issuerValue + "#" + destination + "#" + spApplication + "#" + + new URL(moasession.getPublicOAURLPrefix()).getHost() + "#" + moasession.getCcc() + "#" + oaParam.getQaaLevel() + + "#_hash_#" + moasession.getProcessInstanceId() + "#" + authnRequest.getSamlId() + "#"); + } catch (Exception e1) { + Logger.info("STORK PEPS conform logging failed because of: " + e1.getMessage()); + } + } + private String generateDssSignRequest(String text, String mimeType, String citizenCountry) { + IdentifierGenerator idGenerator; + try { + idGenerator = new SecureRandomIdentifierGenerator(); + + DocumentType doc = new DocumentType(); + doc.setBase64XML(text.getBytes("UTF-8")); + doc.setID(idGenerator.generateIdentifier()); + + SignRequest request = new SignRequest(); + request.setInputDocuments(ApiUtils.createInputDocuments(doc)); + + String id = idGenerator.generateIdentifier(); + request.setRequestID(id); + request.setDocUI(id); + + request.setProfile(Profiles.XADES_BES.toString()); + request.setNumberOfSigners(BigInteger.ONE); + request.setTargetCountry(citizenCountry); + + // no, no todo. PEPS will alter this value anyhow. + request.setReturnURL("http://invalid_return"); + + AnyType required = new AnyType(); + required.getAny().add(ApiUtils.createSignatureType(SignatureTypes.XMLSIG_RFC3275.toString())); + required.getAny().add(ApiUtils.createAdditionalProfile(AdditionalProfiles.XADES.toString())); + required.getAny().add(ApiUtils.createQualityRequirements(QualityLevels.QUALITYLEVEL_QUALIFIEDSIG)); + required.getAny().add(ApiUtils.createIncludeObject(doc)); + request.setOptionalInputs(required); + + return IOUtils.toString(ApiUtils.marshalToInputStream(request)); + } catch (NoSuchAlgorithmException e) { + Logger.error("Cannot generate id", e); + throw new RuntimeException(e); + } catch (ApiUtilsException e) { + Logger.error("Could not create SignRequest", e); + throw new RuntimeException(e); + } catch (DOMException e) { + Logger.error("Could not create SignRequest", e); + throw new RuntimeException(e); + } catch (IOException e) { + Logger.error("Could not create SignRequest", e); + throw new RuntimeException(e); + } + } } diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java index 84570141e..d9188d4fc 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorHandleResponseWithoutSignatureTask.java @@ -5,6 +5,7 @@ import iaik.x509.X509Certificate; import java.io.IOException; import java.io.StringWriter; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -26,12 +27,11 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; -import at.gv.egovernment.moa.id.auth.servlet.PEPSConnectorWithLocalSigningServlet; import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; -import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; +import at.gv.egovernment.moa.id.config.stork.StorkAttributeProviderPlugin; import at.gv.egovernment.moa.id.moduls.ModulUtils; import at.gv.egovernment.moa.id.process.api.ExecutionContext; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; @@ -290,17 +290,17 @@ public class PepsConnectorHandleResponseWithoutSignatureTask extends AbstractPep String issuerValue = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix(); String acsURL = issuerValue - + PEPSConnectorWithLocalSigningServlet.PEPSCONNECTOR_SERVLET_URL_PATTERN; + + AbstractPepsConnectorWithLocalSigningTask.PEPSCONNECTOR_SERVLET_URL_PATTERN; String url = acsURL + "?moaSessionID=" + newMOASessionID; // redirect to OASIS module and sign there boolean found = false; try { - List aps = AuthConfigurationProviderFactory.getInstance() + Collection aps = AuthConfigurationProviderFactory.getInstance() .getOnlineApplicationParameter(moaSession.getPublicOAURLPrefix()).getStorkAPs(); Logger.info("Found AttributeProviderPlugins:" + aps.size()); - for (AttributeProviderPlugin ap : aps) { + for (StorkAttributeProviderPlugin ap : aps) { Logger.info("Found AttributeProviderPlugin attribute:" + ap.getAttributes()); if (ap.getAttributes().equalsIgnoreCase("signedDoc")) { // FIXME: A servlet's class field is not thread safe!!! diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java index 748b7df5d..4a12e72ca 100644 --- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java +++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/tasks/PepsConnectorTask.java @@ -30,7 +30,6 @@ import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.opensaml.saml2.core.StatusCode; -import org.springframework.format.datetime.DateFormatter; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -43,7 +42,6 @@ import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.modules.TaskExecutionException; import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; -import at.gv.egovernment.moa.id.auth.servlet.PEPSConnectorServlet; import at.gv.egovernment.moa.id.auth.stork.STORKException; import at.gv.egovernment.moa.id.auth.stork.STORKResponseProcessor; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; @@ -64,10 +62,8 @@ import at.gv.egovernment.moa.util.XPathUtils; import at.gv.util.xsd.xmldsig.SignatureType; import at.gv.util.xsd.xmldsig.X509DataType; import eu.stork.documentservice.DocumentService; -import eu.stork.documentservice.data.DatabaseConnectorMySQLImpl; import eu.stork.oasisdss.api.ApiUtils; import eu.stork.oasisdss.api.LightweightSourceResolver; -import eu.stork.oasisdss.api.exceptions.ApiUtilsException; import eu.stork.oasisdss.profile.DocumentType; import eu.stork.oasisdss.profile.DocumentWithSignature; import eu.stork.oasisdss.profile.SignResponse; @@ -123,6 +119,8 @@ import eu.stork.peps.exceptions.STORKSAMLEngineException; */ public class PepsConnectorTask extends AbstractAuthServletTask { + public static final String PEPSCONNECTOR_SERVLET_URL_PATTERN = "/PEPSConnector"; + public PepsConnectorTask() { super(); @@ -336,7 +334,7 @@ public class PepsConnectorTask extends AbstractAuthServletTask { // //////////////////////////////////////////////////////////////////////// - AuthConfigurationProvider config = AuthConfigurationProvider.getInstance(); + AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); String citizenSignature = null; if(config.isStorkFakeIdLActive() && config.getStorkNoSignatureCountries().contains(storkAuthnRequest.getCitizenCountryCode()) && config.getStorkFakeIdLCountries().contains(storkAuthnRequest.getCitizenCountryCode())) { Logger.debug("signedDoc extraction skipped due to configuration"); @@ -456,7 +454,6 @@ public class PepsConnectorTask extends AbstractAuthServletTask { IdentityLink identityLink = null; executionContext.put("identityLinkAvailable", false); try { - AuthConfiguration config = AuthConfigurationProviderFactory.getInstance(); if(config.isStorkFakeIdLActive() && config.getStorkFakeIdLCountries().contains(storkAuthnRequest.getCitizenCountryCode())) { // create fake IdL // - fetch IdL template from resources -- cgit v1.2.3 From 409e23a07616387d675e065ceac7172997fef5b7 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 2 Jul 2015 07:34:08 +0200 Subject: new files for key/value config --- .../auth/data/SAML1ConfigurationParameters.java | 276 ++++ .../config/stork/StorkAttributeProviderPlugin.java | 81 + .../id/config/auth/moaid.configuration.beans.xml | 14 + .../config/ConfigurationMigrationUtils.java | 1638 ++++++++++++++++++++ .../moa/id/commons/config/MigrationTest.java | 69 + .../moa/id/commons/utils/KeyValueUtils.java | 101 ++ .../src/main/resources/configuration.beans.xml | 56 + 7 files changed, 2235 insertions(+) create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/data/SAML1ConfigurationParameters.java create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/StorkAttributeProviderPlugin.java create mode 100644 id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java create mode 100644 id/server/moa-id-commons/src/main/resources/configuration.beans.xml (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/data/SAML1ConfigurationParameters.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/data/SAML1ConfigurationParameters.java new file mode 100644 index 000000000..8ff64f188 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/data/SAML1ConfigurationParameters.java @@ -0,0 +1,276 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.config.auth.data; + +/** + * @author tlenz + * + */ +public class SAML1ConfigurationParameters { + + private boolean isActive = false; + private boolean provideBaseId = false; + private boolean provideAuthBlock = false; + private boolean provideIdl = false; + private boolean provideCertificate = false; + private boolean provideMandate = false; + private boolean provideAllErrors = true; + private boolean useCondition = false; + private String sourceID = null; + private String condition = new String(); + + + /** + * + */ + public SAML1ConfigurationParameters(boolean isActive, + boolean provideBaseId, boolean provideAuthBlock, + boolean provideIdl, boolean provideCertificate, + boolean provideMandate, boolean provideAllErrors, + boolean useCondition, String condition, + String sourceID) { + this.condition = condition; + this.isActive = isActive; + this.provideAllErrors = provideAllErrors; + this.provideAuthBlock = provideAuthBlock; + this.provideBaseId = provideBaseId; + this.provideCertificate = provideCertificate; + this.provideIdl = provideIdl; + this.provideMandate = provideMandate; + this.useCondition = useCondition; + this.sourceID = sourceID; + + } + + + /** + * + */ + public SAML1ConfigurationParameters() { + + } + + + /** + * Gets the value of the isActive property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isIsActive() { + return this.isActive; + } + + /** + * @param isActive the isActive to set + */ + public void setActive(boolean isActive) { + this.isActive = isActive; + } + + + /** + * @param provideBaseId the provideBaseId to set + */ + public void setProvideBaseId(boolean provideBaseId) { + this.provideBaseId = provideBaseId; + } + + + /** + * @param provideAuthBlock the provideAuthBlock to set + */ + public void setProvideAuthBlock(boolean provideAuthBlock) { + this.provideAuthBlock = provideAuthBlock; + } + + + /** + * @param provideIdl the provideIdl to set + */ + public void setProvideIdl(boolean provideIdl) { + this.provideIdl = provideIdl; + } + + + /** + * @param provideCertificate the provideCertificate to set + */ + public void setProvideCertificate(boolean provideCertificate) { + this.provideCertificate = provideCertificate; + } + + + /** + * @param provideMandate the provideMandate to set + */ + public void setProvideMandate(boolean provideMandate) { + this.provideMandate = provideMandate; + } + + + /** + * @param provideAllErrors the provideAllErrors to set + */ + public void setProvideAllErrors(boolean provideAllErrors) { + this.provideAllErrors = provideAllErrors; + } + + + /** + * @param useCondition the useCondition to set + */ + public void setUseCondition(boolean useCondition) { + this.useCondition = useCondition; + } + + + /** + * @param sourceID the sourceID to set + */ + public void setSourceID(String sourceID) { + this.sourceID = sourceID; + } + + + /** + * @param condition the condition to set + */ + public void setCondition(String condition) { + this.condition = condition; + } + + + /** + * Gets the value of the provideStammzahl property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isProvideStammzahl() { + return this.provideBaseId; + } + + /** + * Gets the value of the provideAUTHBlock property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isProvideAUTHBlock() { + return this.provideAuthBlock; + } + + /** + * Gets the value of the provideIdentityLink property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isProvideIdentityLink() { + return this.provideIdl; + } + + /** + * Gets the value of the provideCertificate property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isProvideCertificate() { + return this.provideCertificate; + } + + /** + * Gets the value of the provideFullMandatorData property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isProvideFullMandatorData() { + return this.provideMandate; + } + + /** + * Gets the value of the useCondition property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isUseCondition() { + return this.useCondition; + } + + /** + * Gets the value of the conditionLength property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + + public int getConditionLength() { + return condition.length(); + } + + /** + * Gets the value of the sourceID property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSourceID() { + return this.sourceID; + } + + /** + * Gets the value of the provideAllErrors property. + * + * @return + * possible object is + * {@link String } + * + */ + public Boolean isProvideAllErrors() { + return this.provideAllErrors; + } + +} + diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/StorkAttributeProviderPlugin.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/StorkAttributeProviderPlugin.java new file mode 100644 index 000000000..619af2358 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/StorkAttributeProviderPlugin.java @@ -0,0 +1,81 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.config.stork; + +/** + * @author tlenz + * + */ +public class StorkAttributeProviderPlugin { + private String name = null; + private String url = null; + private String attributes = null; + + /** + * + */ + public StorkAttributeProviderPlugin(String name, String url, String attributes) { + this.name = name; + this.url = url; + this.attributes = attributes; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + /** + * @return the url + */ + public String getUrl() { + return url; + } + /** + * @param url the url to set + */ + public void setUrl(String url) { + this.url = url; + } + /** + * @return the attributes + */ + public String getAttributes() { + return attributes; + } + /** + * @param attributes the attributes to set + */ + public void setAttributes(String attributes) { + this.attributes = attributes; + } + + +} diff --git a/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml b/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml new file mode 100644 index 000000000..cdfde11b1 --- /dev/null +++ b/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java new file mode 100644 index 000000000..59c6687d5 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -0,0 +1,1638 @@ +/* +moaidconfigmoaidconfigmoaidconfig * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.commons.config; + +import iaik.x509.X509Certificate; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.cert.CertificateException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; +import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType; +import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; +import at.gv.egovernment.moa.id.commons.db.dao.config.BPKDecryption; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModeType; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; +import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.EncBPKInformation; +import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; +import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; +import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; +import at.gv.egovernment.moa.id.commons.db.dao.config.InterfederationGatewayType; +import at.gv.egovernment.moa.id.commons.db.dao.config.InterfederationIDPType; +import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; +import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.OAOAUTH20; +import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.OASSO; +import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK; +import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute; +import at.gv.egovernment.moa.id.commons.db.dao.config.OAuth; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; +import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; +import at.gv.egovernment.moa.id.commons.db.dao.config.SAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; +import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; +import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; +import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; +import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; +import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; +import at.gv.egovernment.moa.id.commons.db.dao.config.TestCredentials; +import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; +import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; +import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils; +import at.gv.egovernment.moa.id.commons.validation.TargetValidator; +import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.Base64Utils; +import at.gv.egovernment.moa.util.MiscUtil; + +/** + * @author tlenz + * + */ +public class ConfigurationMigrationUtils { + + public static final String MOA_CONFIG_BUSINESSSERVICE = "businessService"; + public static final String MOA_CONFIG_STORKSERVICE = "storkService"; + public static final String MOA_CONFIG_PROTOCOL_SAML1 = "id_saml1"; + public static final String MOA_CONFIG_PROTOCOL_PVP2 = "id_pvp2x"; + public static final String MOA_CONFIG_PROTOCOL_STORK2 = "id_stork2"; + + public static final long DEFAULTTIMEOUTASSERTION = 120; //sec + public static final long DEFAULTTIMEOUTMOASESSIONCREATED = 1200; //sec + public static final long DEFAULTTIMEOUTMOASESSIONUPDATED = 2700; //sec + + /** + * Convert a MOA-ID 2.x OnlineApplication JaxB DAO to a 3.x key/value configuration + * The keys in the result only contains the OA specific suffix keys + * but no MOA-ID configuration prefix + * + * @param oa MOA-ID 2.x OnlineApplication configuration + * @return MOA-ID 3.x OnlineApplication configuration without prefix but never Null + */ + public static Map convertHyberJaxBOnlineApplicationToKeyValue(OnlineApplication oa) { + Map result = new HashMap(); + if (oa != null) { + //convert oaID and friendlyname + result.put(MOAIDConfigurationConstants.SERVICE_FRIENDLYNAME, oa.getFriendlyName()); + result.put(MOAIDConfigurationConstants.SERVICE_UNIQUEIDENTIFIER, oa.getPublicURLPrefix()); + + //convert isActive flag + if (oa.isIsActive() != null) + result.put(MOAIDConfigurationConstants.SERVICE_ISACTIVE, oa.isIsActive().toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_ISACTIVE, Boolean.FALSE.toString()); + + //convert oa type + if (oa.getType().equals(MOA_CONFIG_BUSINESSSERVICE)) + result.put(MOAIDConfigurationConstants.SERVICE_BUSINESSSERVICE, Boolean.TRUE.toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_BUSINESSSERVICE, Boolean.FALSE.toString()); + + + //convert target + String target_full = oa.getTarget(); + if (MiscUtil.isNotEmpty(target_full)) { + if (TargetValidator.isValidTarget(target_full)) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET, target_full); + + } else { + String[] target_split = target_full.split("-"); + + if (TargetValidator.isValidTarget(target_split[0])) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET, target_split[0]); + + if (target_split.length > 1) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET_SUB, target_split[1]); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_USE_SUB, Boolean.TRUE.toString()); + + } + + } else { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_OWN_TARGET, target_full); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_USE_OWN, Boolean.TRUE.toString()); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_OWN_NAME, oa.getTargetFriendlyName()); + + } + } + } + + AuthComponentOA oaauth = oa.getAuthComponentOA(); + if (oaauth != null) { + + //convert business identifier + IdentificationNumber idnumber = oaauth.getIdentificationNumber(); + if (idnumber != null) { + String number = idnumber.getValue(); + if (MiscUtil.isNotEmpty(number)) { + String[] split = number.split("\\+"); + + if (MOAIDConfigurationConstants.PREFIX_WPBK.startsWith(split[0]) && split.length >= 2) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE, split[1]); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_VALUE, split[2]); + + } else if (MOAIDConfigurationConstants.PREFIX_STORK.startsWith(split[0]) && split.length >= 2) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE, MOAIDConfigurationConstants.IDENIFICATIONTYPE_STORK); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_VALUE, split[2]); + } + } + } + + //concert BKU URLs + BKUURLS bkuurls = oaauth.getBKUURLS(); + if (bkuurls != null) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_HANDY, bkuurls.getHandyBKU()); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_LOCAL, bkuurls.getLocalBKU()); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_ONLINE, bkuurls.getOnlineBKU()); + + } + + //concert mandates + Mandates mandates = oaauth.getMandates(); + if (mandates != null) { + String mandateProfiles = null; + List profileList = mandates.getProfileName(); + for (String el : profileList) { + if (mandateProfiles == null) + mandateProfiles = el; + else + mandateProfiles += "," + el; + } + + //only for RC1 + if (MiscUtil.isNotEmpty(mandates.getProfiles())) { + if (mandateProfiles == null) + mandateProfiles = mandates.getProfiles(); + + else + mandateProfiles += "," + mandates.getProfiles(); + + } + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_PROFILES, mandateProfiles); + + if (mandateProfiles != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_USE, Boolean.TRUE.toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_USE, Boolean.FALSE.toString()); + } + + //convert securtiyLayer templates + TemplatesType templates = oaauth.getTemplates(); + if (templates != null) { + List templatetype = templates.getTemplate(); + if (templatetype != null) { + if (templatetype.size() > 0) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE, templatetype.get(0).getURL()); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_LEGACY, Boolean.TRUE.toString()); + + } else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_LEGACY, Boolean.FALSE.toString()); + + if (templatetype.size() > 1) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE, templatetype.get(1).getURL()); + + if (templatetype.size() > 2) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE, templatetype.get(2).getURL()); + + } + } + + //convert test credentials + if (oaauth.getTestCredentials() != null) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_ENABLED, String.valueOf(oaauth.getTestCredentials().isEnableTestCredentials())); + + if (oaauth.getTestCredentials().getCredentialOID() != null) { + String oids = null; + for (String el : oaauth.getTestCredentials().getCredentialOID()) { + if (oids == null) + oids = el; + else + oids += "," + oids; + + } + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_OIDs, oids); + } + } + + //convert foreign bPK + try { + EncBPKInformation bPKEncDec = oaauth.getEncBPKInformation(); + if (bPKEncDec != null) { + BPKDecryption bPKDec = bPKEncDec.getBPKDecryption(); + if (bPKDec != null) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_BLOB, Base64Utils.encode(bPKDec.getKeyInformation())); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_IV, Base64Utils.encode(bPKDec.getIv())); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_KEYALIAS, bPKDec.getKeyAlias()); + if (bPKDec.getKeyStoreFileName() != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_FILENAME, bPKDec.getKeyStoreFileName()); + + } + } + } catch (Exception e) { + Logger.warn("Foreign bPK decryption information can not converted.", e); + } + + //convert SSO + OASSO ssoconfig = oaauth.getOASSO(); + if(ssoconfig != null) { + if (ssoconfig.isUseSSO() != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_ENABLED, ssoconfig.isUseSSO().toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_ENABLED, Boolean.FALSE.toString()); + + if (ssoconfig.isAuthDataFrame() != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_USERREQUEST, ssoconfig.isAuthDataFrame().toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_USERREQUEST, Boolean.TRUE.toString()); + } + + //convert STORK config + OASTORK config = oaauth.getOASTORK(); + if(config != null) { + if (config.isStorkLogonEnabled() != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ENABLED, config.isStorkLogonEnabled().toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ENABLED, Boolean.FALSE.toString()); + + if (config.getQaa() != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL, config.getQaa().toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL, "4"); + + if (config.getCPEPS() != null) { + for (int i=0; i attributeProviderPlugins = config.getAttributeProviders(); + if (attributeProviderPlugins != null) { + for(int i=0; i PVP2X gateway configuration + InterfederationGatewayType gateway = oa.getInterfederationGateway(); + if (gateway != null) { + result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_GATEWAY); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_FORWARD_IDPIDENTIFIER, + gateway.getForwardIDPIdentifier()); + + } + + //set onlineapplication identifier if nothing is set + if (!result.containsKey(MOAIDConfigurationConstants.PREFIX_SERVICES)) + result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_OA); + } + + return result; + } + + /** + * Convert a MOA-ID 3.x key/value OnlineApplication to a 2.x JaxB DAO + * + * @param oa MOA-ID 3.x key/value OnlineApplication configuration. The MOA-ID specific prefix must be removed + * @return MOA-ID 2.x {OnlineApplication} or Null if oa contains no OnlineApplication keys + */ + public static OnlineApplication convertKeyValueToHyberJaxBOnlineApplication(Map oa) { + OnlineApplication dbOA = new OnlineApplication(); + + AuthComponentOA authoa = dbOA.getAuthComponentOA(); + if (authoa == null) { + authoa = new AuthComponentOA(); + dbOA.setAuthComponentOA(authoa); + } + + dbOA.setIsActive(Boolean.valueOf(oa.get(MOAIDConfigurationConstants.SERVICE_ISACTIVE))); + dbOA.setPublicURLPrefix(oa.get(MOAIDConfigurationConstants.SERVICE_UNIQUEIDENTIFIER)); + dbOA.setFriendlyName(oa.get(MOAIDConfigurationConstants.SERVICE_FRIENDLYNAME)); + + if (Boolean.valueOf(oa.get(MOAIDConfigurationConstants.SERVICE_BUSINESSSERVICE))) { + dbOA.setType(MOA_CONFIG_BUSINESSSERVICE); + + IdentificationNumber idnumber = authoa.getIdentificationNumber(); + if (idnumber == null) + idnumber = new IdentificationNumber(); + + if (oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE).equals(MOAIDConfigurationConstants.IDENIFICATIONTYPE_STORK)) { + idnumber.setValue(MOAIDConfigurationConstants.PREFIX_STORK + "AT" + "+" + oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_VALUE)); + idnumber.setType(MOAIDConfigurationConstants.BUSINESSSERVICENAMES.get(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE))); + } else { + idnumber.setValue(MOAIDConfigurationConstants.PREFIX_WPBK + oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE) + "+" + oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_VALUE)); + idnumber.setType(MOAIDConfigurationConstants.BUSINESSSERVICENAMES.get(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE))); + } + + authoa.setIdentificationNumber(idnumber); + + } else { + dbOA.setType(null); + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_OWN_TARGET)) + && Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_USE_OWN))) { + dbOA.setTarget(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_OWN_TARGET)); + dbOA.setTargetFriendlyName(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_OWN_NAME)); + + } else { + + String target = oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET); + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET_SUB)) + && Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_USE_SUB))) + dbOA.setTarget(target + "-" + oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_PUBLIC_TARGET_SUB)); + else + dbOA.setTarget(target); + + String targetname = TargetValidator.getTargetFriendlyName(target); + if (MiscUtil.isNotEmpty(targetname)) + dbOA.setTargetFriendlyName(targetname); + } + } + + //store BKU-URLs + BKUURLS bkuruls = new BKUURLS(); + authoa.setBKUURLS(bkuruls); + bkuruls.setHandyBKU(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_HANDY)); + bkuruls.setLocalBKU(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_LOCAL)); + bkuruls.setOnlineBKU(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_ONLINE)); + + //store SecurtiyLayerTemplates + TemplatesType templates = authoa.getTemplates(); + if (templates == null) { + templates = new TemplatesType(); + authoa.setTemplates(templates); + } + List template = templates.getTemplate(); + if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_LEGACY))) { + + if (template == null) + template = new ArrayList(); + else + template.clear(); + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE))) { + TemplateType el = new TemplateType(); + el.setURL(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE)); + template.add(el); + } else + template.add(new TemplateType()); + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE))) { + TemplateType el = new TemplateType(); + el.setURL(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE)); + template.add(el); + } else + template.add(new TemplateType()); + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE))) { + TemplateType el = new TemplateType(); + el.setURL(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE)); + template.add(el); + } else + template.add(new TemplateType()); + + } else { + if (template != null && template.size() > 0) template.clear(); + } + + + //store keyBox Identifier + dbOA.setKeyBoxIdentifier(MOAKeyBoxSelector.fromValue(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_KEYBOXIDENTIFIER))); + + Mandates mandates = new Mandates(); + if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_USE))) { + + if (oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_PROFILES) != null) { + String[] profileList = oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_PROFILES).split(","); + + List dbProfiles = mandates.getProfileName(); + if (dbProfiles == null) { + dbProfiles = new ArrayList(); + mandates.setProfileName(dbProfiles); + + } + + for (String el: profileList) + dbProfiles.add(el.trim()); + + mandates.setProfiles(null); + } + + } else { + mandates.setProfiles(null); + mandates.getProfileName().clear(); + } + authoa.setMandates(mandates); + + if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_ENABLED))) { + TestCredentials testing = authoa.getTestCredentials(); + testing = new TestCredentials(); + authoa.setTestCredentials(testing); + testing.setEnableTestCredentials(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_ENABLED))); + + if (oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_OIDs) != null) { + String[] profileList = oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TESTCREDENTIALS_OIDs).split(","); + List testCredentialOIDs = Arrays.asList(profileList); + testing.setCredentialOID(testCredentialOIDs); + } + + } else { + TestCredentials testing = authoa.getTestCredentials(); + if (testing != null) { + testing.setEnableTestCredentials(false); + } + + } + + + EncBPKInformation bPKEncDec = authoa.getEncBPKInformation(); + if (bPKEncDec == null) { + bPKEncDec = new EncBPKInformation(); + authoa.setEncBPKInformation(bPKEncDec); + + } + + BPKDecryption bPKDec = bPKEncDec.getBPKDecryption(); + if (bPKDec == null) { + bPKDec = new BPKDecryption(); + bPKEncDec.setBPKDecryption(bPKDec); + } + + bPKDec.setKeyStoreFileName(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_FILENAME)); + bPKDec.setKeyAlias(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_KEYALIAS)); + + try { + bPKDec.setIv(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_IV), false)); + bPKDec.setKeyInformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_FOREIGNBPK_DECRYPT_BLOB), false)); + + } catch (IOException e) { + Logger.error("Configuration encryption FAILED.", e); + + } + + OASSO sso = authoa.getOASSO(); + if (sso == null) { + sso = new OASSO(); + authoa.setOASSO(sso); + sso.setAuthDataFrame(true); + } + sso.setUseSSO(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_ENABLED))); + sso.setAuthDataFrame(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_USERREQUEST))); + + OASTORK stork = authoa.getOASTORK(); + if (stork == null) { + // if there is none, create a new one with default values. + stork = new OASTORK(); + authoa.setOASTORK(stork); + stork.setStorkLogonEnabled(false); + } + // transfer the incoming data to the database model + stork.setStorkLogonEnabled(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ENABLED))); + stork.setQaa(Integer.valueOf(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL))); + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.PREFIX_SERVICES)) + && oa.get(MOAIDConfigurationConstants.PREFIX_SERVICES).equals(MOAIDConfigurationConstants.PREFIX_VIDP)) + stork.setVidpEnabled(true); + + stork.setRequireConsent(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_REQUIRECONSENT))); + + Map pluginMap = new HashMap(); + Map attrMap = new HashMap(); + Map cpepsMap = new HashMap(); + + for (String el : oa.keySet()) { + if (el.startsWith(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST)) { + String index = KeyValueUtils.getFirstChildAfterPrefix(el, MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST); + OAStorkAttribute attr = new OAStorkAttribute(); + attr.setName(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_NAME)); + + attr.setMandatory(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY))); + + if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_REQUESTED))) + attrMap.put(index, attr); + + + } else if (el.startsWith(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST)) { + String index = KeyValueUtils.getFirstChildAfterPrefix(el, MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST); + AttributeProviderPlugin attr = new AttributeProviderPlugin(); + attr.setName(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_NAME)); + attr.setUrl(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_URL)); + attr.setAttributes(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTPROVIDER_LIST_ATTRIBUTES)); + pluginMap.put(index, attr); + + + } else if (el.startsWith(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST)) { + String index = KeyValueUtils.getFirstChildAfterPrefix(el, MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST); + CPEPS attr = new CPEPS(); + attr.setCountryCode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST_COUNTRYCODE)); + + if (Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST_ENABLED))) + cpepsMap.put(index, attr); + + } + } + + stork.setAttributeProviders(new ArrayList(pluginMap.values())); + stork.setOAAttributes(new ArrayList(attrMap.values())); + stork.setCPEPS(new ArrayList(cpepsMap.values())); + + OASAML1 saml1 = authoa.getOASAML1(); + if (saml1 == null) { + saml1 = new OASAML1(); + authoa.setOASAML1(saml1); + saml1.setIsActive(false); + } + saml1.setIsActive(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_ENABLED))); + saml1.setProvideAUTHBlock(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_AUTHBLOCK))); + saml1.setProvideCertificate(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_CERTIFICATE))); + saml1.setProvideFullMandatorData(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_MANDATE))); + saml1.setProvideIdentityLink(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_IDL))); + saml1.setProvideStammzahl(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_BASEID))); + saml1.setUseCondition(false); + saml1.setProvideAllErrors(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_SAML1_RETURNERROR))); + saml1.setConditionLength(BigInteger.valueOf(-1)); + + OAPVP2 pvp2 = authoa.getOAPVP2(); + if (pvp2 == null) { + pvp2 = new OAPVP2(); + authoa.setOAPVP2(pvp2); + } + + try { + pvp2.setCertificate(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_CERTIFICATE), false)); + + } catch (IOException e) { + Logger.warn("Uploaded Certificate can not be parsed", e); + + } + + pvp2.setMetadataURL(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_PVP2X_URL)); + + OAOAUTH20 oaOAuth20 = authoa.getOAOAUTH20(); + if (oaOAuth20 == null) { + oaOAuth20 = new OAOAUTH20(); + authoa.setOAOAUTH20(oaOAuth20); + } + oaOAuth20.setOAuthClientId(dbOA.getPublicURLPrefix()); + oaOAuth20.setOAuthRedirectUri(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_OPENID_REDIRECTURL)); + oaOAuth20.setOAuthClientSecret(oa.get(MOAIDConfigurationConstants.SERVICE_PROTOCOLS_OPENID_CLIENTSECRET)); + + + + dbOA.setRemoveBPKFromAuthBlock(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_AUTHBLOCK_REMOVEBPK))); + templates.setAditionalAuthBlockText(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_AUTHBLOCKTEXT)); + + //store BKU-selection and send-assertion templates + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION))) { + TransformsInfoType el1 = new TransformsInfoType(); + try { + el1.setTransformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION), false)); + el1.setFilename(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_FILENAME)); + templates.setBKUSelectionTemplate(el1); + + } catch (IOException e) { + Logger.warn("Converting BKU selection template FAILED.", e); + } + } + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION))) { + TransformsInfoType el1 = new TransformsInfoType(); + try { + el1.setTransformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION), false)); + el1.setFilename(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_FILENAME)); + templates.setSendAssertionTemplate(el1); + + } catch (IOException e) { + Logger.warn("Converting Send Assertion template FAILED.", e); + } + } + + BKUSelectionCustomizationType bkuselectioncustom = templates.getBKUSelectionCustomization(); + if (bkuselectioncustom == null) { + bkuselectioncustom = new BKUSelectionCustomizationType(); + templates.setBKUSelectionCustomization(bkuselectioncustom); + } + + + bkuselectioncustom.setMandateLoginButton(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_USE))); + bkuselectioncustom.setOnlyMandateLoginAllowed(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_ONLY))); + + bkuselectioncustom.setBackGroundColor(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BACKGROUNDCOLOR)); + bkuselectioncustom.setFrontColor(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FRONTCOLOR)); + + bkuselectioncustom.setHeaderBackGroundColor(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERBACKGROUNDCOLOR)); + bkuselectioncustom.setHeaderFrontColor(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERFRONTCOLOR)); + bkuselectioncustom.setHeaderText(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_HEADERTEXT)); + + bkuselectioncustom.setButtonBackGroundColor(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONBACKGROUNDCOLOR)); + bkuselectioncustom.setButtonBackGroundColorFocus(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONBACLGROUNDCOLORFOCUS)); + bkuselectioncustom.setButtonFontColor(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_BUTTONFRONTCOLOR)); + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETREDIRECTTARGET))) + bkuselectioncustom.setAppletRedirectTarget(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETREDIRECTTARGET)); + + bkuselectioncustom.setFontType(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FONTTYPE)); + + bkuselectioncustom.setAppletHeight(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETHEIGHT)); + bkuselectioncustom.setAppletWidth(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_APPLETWIDTH)); + + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.PREFIX_SERVICES)) + && oa.get(MOAIDConfigurationConstants.PREFIX_SERVICES).equals(MOAIDConfigurationConstants.PREFIX_IIDP)) + dbOA.setIsInterfederationIDP(true); + + InterfederationIDPType moaIDP = dbOA.getInterfederationIDP(); + if (moaIDP == null) { + moaIDP = new InterfederationIDPType(); + dbOA.setInterfederationIDP(moaIDP); + } + + moaIDP.setAttributeQueryURL(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_ATTRIBUTQUERY_URL)); + moaIDP.setInboundSSO(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_INBOUND))); + moaIDP.setOutboundSSO(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_OUTBOUND))); + moaIDP.setStoreSSOSession(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_STORE))); + moaIDP.setPerformLocalAuthenticationOnError(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_LOCALAUTHONERROR))); + moaIDP.setPerformPassivRequest(Boolean.parseBoolean(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_PASSIVEREQUEST))); + + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.PREFIX_SERVICES)) + && oa.get(MOAIDConfigurationConstants.PREFIX_SERVICES).equals(MOAIDConfigurationConstants.PREFIX_GATEWAY)) + dbOA.setIsInterfederationGateway(true); + InterfederationGatewayType gateway = dbOA.getInterfederationGateway(); + if (gateway == null) { + gateway = new InterfederationGatewayType(); + dbOA.setInterfederationGateway(gateway); + } + gateway.setForwardIDPIdentifier(oa.get(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_FORWARD_IDPIDENTIFIER)); + + + return dbOA; + } + + + /** + * Convert a MOA-ID 2.x MOAIDConfiguration JaxB DAO to a 3.x key/value configuration + * + * @param config MOA-ID 2.x configuration + * @return MOA-ID 3.x key/value configuration but never null + */ + public static Map convertHyberJaxBMOAIDConfigToKeyValue(MOAIDConfiguration config) { + Map result = new HashMap(); + if (config != null) { + AuthComponentGeneral auth = config.getAuthComponentGeneral(); + + if (auth != null) { + ForeignIdentities foreign = auth.getForeignIdentities(); + + if (foreign != null) { + ConnectionParameterClientAuthType connect_foreign = foreign.getConnectionParameter(); + if (connect_foreign != null) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_SZRGW_URL, + connect_foreign.getURL()); + } + } + + GeneralConfiguration authgen = auth.getGeneralConfiguration(); + if (authgen != null) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_CERTSTORE_URL, + authgen.getCertStoreDirectory()); + + if (authgen.isTrustManagerRevocationChecking() != null) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_REVOCATIONCHECKING, + authgen.isTrustManagerRevocationChecking().toString()); + else + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_REVOCATIONCHECKING, + Boolean.TRUE.toString()); + + result.put(MOAIDConfigurationConstants.GENERAL_PUBLICURLPREFIX, + authgen.getPublicURLPreFix()); + + TimeOuts timeouts = authgen.getTimeOuts(); + if (timeouts != null) { + + if(timeouts.getAssertion() != null) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION, + String.valueOf(timeouts.getAssertion().longValue())); + if(timeouts.getMOASessionCreated() != null) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE, + String.valueOf(timeouts.getMOASessionCreated().longValue())); + if(timeouts.getMOASessionUpdated() != null) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_UPDATE, + String.valueOf(timeouts.getMOASessionUpdated().longValue())); + + } + } + + MOASP moaspss = auth.getMOASP(); + if (moaspss != null) { + ConnectionParameterClientAuthType con = moaspss.getConnectionParameter(); + if (con != null) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_URL, + con.getURL()); + + VerifyAuthBlock authblock = moaspss.getVerifyAuthBlock(); + if (authblock != null) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD, + authblock.getTrustProfileID()); + + List list = authblock.getVerifyTransformsInfoProfileID(); + if (list.size() == 1) + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM, + list.get(0)); + + else { + Logger.warn("More the one AuthBlocktransformation are not supported any more."); + } + } + + VerifyIdentityLink idl = moaspss.getVerifyIdentityLink(); + if (idl != null) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD, + idl.getTrustProfileID()); + } + } + + OnlineMandates mandates = auth.getOnlineMandates(); + if (mandates != null) { + ConnectionParameterClientAuthType con = mandates.getConnectionParameter(); + if (con != null) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_OVS_URL, + con.getURL()); + } + } + + Protocols protocols = auth.getProtocols(); + if (protocols != null) { + LegacyAllowed legacy = protocols.getLegacyAllowed(); + + if (legacy != null) { + List list = legacy.getProtocolName(); + if (list.contains(MOA_CONFIG_PROTOCOL_SAML1)) + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_LEGACY, + Boolean.TRUE.toString()); + + if (list.contains(MOA_CONFIG_PROTOCOL_PVP2)) + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_LEGACY, + Boolean.TRUE.toString()); + } + + SAML1 saml1 = protocols.getSAML1(); + if (saml1 != null) { + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_ENABLED, + String.valueOf(saml1.isIsActive())); + + if (MiscUtil.isEmpty(saml1.getSourceID()) && MiscUtil.isNotEmpty(authgen.getAlternativeSourceID())) + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_SOURCEID, + authgen.getAlternativeSourceID()); + else + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_SOURCEID, + saml1.getSourceID()); + + } + + OAuth oauth = protocols.getOAuth(); + if (oauth != null) { + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_OPENID_ENABLED, + String.valueOf(oauth.isIsActive())); + + } + + PVP2 pvp2 = protocols.getPVP2(); + if (pvp2 != null) { + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_ENABLED, + String.valueOf(pvp2.isIsActive())); + + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME, + pvp2.getIssuerName()); + + List con = pvp2.getContact(); + + if (con != null && con.size() > 0) { + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_COMPANY, + con.get(0).getCompany()); + + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_FAMLIYNAME, + con.get(0).getSurName()); + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_GIVENNAME, + con.get(0).getGivenName()); + if (!con.get(0).getMail().isEmpty()) + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_MAIL, + con.get(0).getMail().get(0)); + if (!con.get(0).getPhone().isEmpty()) + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_PHONE, + con.get(0).getPhone().get(0)); + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE, + con.get(0).getType()); + } + + Organization org = pvp2.getOrganization(); + if (org != null) { + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME, + org.getDisplayName()); + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME, + org.getName()); + result.put(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL, + org.getURL()); + } + } + } + + SecurityLayer seclayer = auth.getSecurityLayer(); + if (seclayer != null) { + List list = seclayer.getTransformsInfo(); + if (!list.isEmpty()) { + try { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64, + Base64Utils.encode(list.get(0).getTransformation())); + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME, + list.get(0).getFilename()); + + } catch (IOException e) { + Logger.warn("AuthBlockTransformation can not converted.", e); + + } + + } else { + Logger.warn("AuthBlockTransformation can not converted."); + + } + } + + SSO sso = auth.getSSO(); + if (sso != null) { + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_SERVICENAME, + sso.getFriendlyName()); + + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_AUTHBLOCK_TEXT, + sso.getSpecialText()); + + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_TARGET, + sso.getTarget()); + } + } + + result.put(MOAIDConfigurationConstants.GENERAL_AUTH_TRUSTSTORE_URL, + config.getTrustedCACertificates()); + + + DefaultBKUs defaultbkus = config.getDefaultBKUs(); + if (defaultbkus != null) { + result.put(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_HANDY, + defaultbkus.getHandyBKU()); + result.put(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_LOCAL, + defaultbkus.getLocalBKU()); + result.put(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_ONLINE, + defaultbkus.getOnlineBKU()); + } + + SLRequestTemplates slreq = config.getSLRequestTemplates(); + if (slreq != null) { + result.put(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_HANDY, + slreq.getHandyBKU()); + result.put(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_LOCAL, + slreq.getLocalBKU()); + result.put(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_ONLINE, + slreq.getOnlineBKU()); + + } + + ForeignIdentities foreign = auth.getForeignIdentities(); + + if (foreign != null) { + STORK stork = foreign.getSTORK(); + + if (stork != null) { + // deep clone all the things + // to foreclose lazyloading session timeouts + if (stork.getCPEPS() != null) { + for (int i=0; i tmp = stork.getAttributes(); + if(null != tmp) { + for (int i=0; i moaconfig) { + + MOAIDConfiguration dbconfig = new MOAIDConfiguration(); + + + AuthComponentGeneral dbauth = dbconfig.getAuthComponentGeneral(); + if (dbauth == null) { + dbauth = new AuthComponentGeneral(); + dbconfig.setAuthComponentGeneral(dbauth); + } + + GeneralConfiguration dbauthgeneral = dbauth.getGeneralConfiguration(); + if (dbauthgeneral == null) { + dbauthgeneral = new GeneralConfiguration(); + dbauth.setGeneralConfiguration(dbauthgeneral); + } + + dbauthgeneral.setPublicURLPreFix(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PUBLICURLPREFIX)); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_CERTSTORE_URL))) + dbauthgeneral.setCertStoreDirectory(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_CERTSTORE_URL)); + + dbauthgeneral.setTrustManagerRevocationChecking(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_REVOCATIONCHECKING))); + + TimeOuts dbtimeouts = dbauthgeneral.getTimeOuts(); + if (dbtimeouts == null) { + dbtimeouts = new TimeOuts(); + dbauthgeneral.setTimeOuts(dbtimeouts); + } + + dbtimeouts.setAssertion(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))); + dbtimeouts.setMOASessionCreated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))); + dbtimeouts.setMOASessionUpdated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_UPDATE))); + + Protocols dbprotocols = dbauth.getProtocols(); + if (dbprotocols == null) { + dbprotocols = new Protocols(); + dbauth.setProtocols(dbprotocols); + } + LegacyAllowed legprot = dbprotocols.getLegacyAllowed(); + if (legprot == null) { + legprot = new LegacyAllowed(); + dbprotocols.setLegacyAllowed(legprot); + } + + List el = legprot.getProtocolName(); + if (el == null) { + el = new ArrayList(); + legprot.setProtocolName(el); + + } + + //Workaround for DB cleaning is only needed for one or the releases (insert in 2.1.1) + if (el.size() > 2) + el.clear(); + + if (el.contains(MOA_CONFIG_PROTOCOL_PVP2)) { + if (!Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_LEGACY))) + el.remove(MOA_CONFIG_PROTOCOL_PVP2); + + } else { + if (Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_LEGACY))) + el.add(MOA_CONFIG_PROTOCOL_PVP2); + } + + if (el.contains(MOA_CONFIG_PROTOCOL_SAML1)) { + if (!Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_LEGACY))) + el.remove(MOA_CONFIG_PROTOCOL_SAML1); + + } else { + if (Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_LEGACY))) + el.add(MOA_CONFIG_PROTOCOL_SAML1); + } + + SAML1 saml1= dbprotocols.getSAML1(); + if (saml1 == null) { + saml1 = new SAML1(); + dbprotocols.setSAML1(saml1); + } + saml1.setIsActive(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_ENABLED))); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_SOURCEID))) { + saml1.setSourceID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_SAML1_SOURCEID)); + } + + OAuth oauth= dbprotocols.getOAuth(); + if (oauth == null) { + oauth = new OAuth(); + dbprotocols.setOAuth(oauth); + } + oauth.setIsActive(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_OPENID_ENABLED))); + + PVP2 pvp2 = dbprotocols.getPVP2(); + if (pvp2 == null) { + pvp2 = new PVP2(); + dbprotocols.setPVP2(pvp2); + } + + pvp2.setIsActive(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_ENABLED))); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME))) + pvp2.setIssuerName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME)); + + Organization pvp2org = pvp2.getOrganization(); + if (pvp2org == null) { + pvp2org = new Organization(); + pvp2.setOrganization(pvp2org); + } + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME))) + pvp2org.setDisplayName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME)); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME))) + pvp2org.setName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME)); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL))) + pvp2org.setURL(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL)); + + List pvp2cont = pvp2.getContact(); + if (pvp2cont == null) { + pvp2cont = new ArrayList(); + pvp2.setContact(pvp2cont); + } + + if (pvp2cont.size() == 0) { + Contact cont = new Contact(); + pvp2cont.add(cont); + } + + Contact cont = pvp2cont.get(0); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_COMPANY))) + cont.setCompany(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_COMPANY)); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_GIVENNAME))) + cont.setGivenName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_GIVENNAME)); + + cont.setMail(Arrays.asList(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_MAIL))); + + cont.setPhone(Arrays.asList(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_PHONE))); + + cont.setSurName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_FAMLIYNAME)); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE))) + cont.setType(moaconfig.get(MOAIDConfigurationConstants.GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE)); + + SSO dbsso = dbauth.getSSO(); + if (dbsso == null) { + dbsso = new SSO(); + dbauth.setSSO(dbsso); + } + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_SERVICENAME))) + dbsso.setFriendlyName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_SERVICENAME)); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_AUTHBLOCK_TEXT))) + dbsso.setSpecialText(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_AUTHBLOCK_TEXT)); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_TARGET))) { + dbsso.setTarget(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SSO_TARGET)); + } + + DefaultBKUs dbbkus = dbconfig.getDefaultBKUs(); + + if (dbbkus == null) { + dbbkus = new DefaultBKUs(); + dbconfig.setDefaultBKUs(dbbkus); + } + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_HANDY))) + dbbkus.setHandyBKU(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_HANDY)); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_ONLINE))) + dbbkus.setOnlineBKU(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_ONLINE)); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_LOCAL))) + dbbkus.setLocalBKU(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_BKU_LOCAL)); + + ChainingModes dbchainingmodes = dbconfig.getChainingModes(); + if (dbchainingmodes == null) { + dbchainingmodes = new ChainingModes(); + dbconfig.setChainingModes(dbchainingmodes); + } + + dbchainingmodes.setSystemDefaultMode( + ChainingModeType.PKIX); + + IdentityLinkSigners idlsigners = dbauth.getIdentityLinkSigners(); + if (idlsigners == null) { + idlsigners = new IdentityLinkSigners(); + dbauth.setIdentityLinkSigners(idlsigners); + } + + ForeignIdentities dbforeign = dbauth.getForeignIdentities(); + if (dbforeign == null) { + dbforeign = new ForeignIdentities(); + dbauth.setForeignIdentities(dbforeign); + } + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_SZRGW_URL))) { + ConnectionParameterClientAuthType forcon = dbforeign.getConnectionParameter(); + if (forcon == null) { + forcon = new ConnectionParameterClientAuthType(); + dbforeign.setConnectionParameter(forcon); + } + forcon.setURL(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_SZRGW_URL)); + } + + ForeignIdentities foreign = dbauth.getForeignIdentities(); + if (foreign != null) { + STORK stork = foreign.getSTORK(); + if (stork == null) { + stork = new STORK(); + foreign.setSTORK(stork); + + } + + Map attrMap = new HashMap(); + Map cpepsMap = new HashMap(); + + for (String key : moaconfig.keySet()) { + if (key.startsWith(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST)) { + String index = KeyValueUtils.getFirstChildAfterPrefix(key, MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST); + StorkAttribute attr = new StorkAttribute(); + attr.setName(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME)); + attr.setMandatory(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST + + "." + index + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY))); + attrMap.put(index, attr); + + } else if (key.startsWith(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST)) { + String index = KeyValueUtils.getFirstChildAfterPrefix(key, MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST); + CPEPS attr = new CPEPS(); + attr.setCountryCode(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + + "." + index + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY)); + + attr.setURL(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + + "." + index + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL)); + + attr.setSupportsXMLSignature(Boolean.parseBoolean(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + + "." + index + "." + + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG))); + + cpepsMap.put(index, attr); + + } + } + + stork.setAttributes(new ArrayList(attrMap.values())); + stork.setCPEPS(new ArrayList(cpepsMap.values())); + + } + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_OVS_URL))) { + OnlineMandates dbmandate = dbauth.getOnlineMandates(); + if (dbmandate == null) { + dbmandate = new OnlineMandates(); + dbauth.setOnlineMandates(dbmandate); + } + ConnectionParameterClientAuthType dbmandateconnection = dbmandate.getConnectionParameter(); + + if (dbmandateconnection == null) { + dbmandateconnection = new ConnectionParameterClientAuthType(); + dbmandate.setConnectionParameter(dbmandateconnection); + } + dbmandateconnection.setURL(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_SERVICES_OVS_URL)); + } + + MOASP dbmoasp = dbauth.getMOASP(); + if (dbmoasp == null) { + dbmoasp = new MOASP(); + dbauth.setMOASP(dbmoasp); + } + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_URL))) { + ConnectionParameterClientAuthType moaspcon = dbmoasp.getConnectionParameter(); + if (moaspcon == null) { + moaspcon = new ConnectionParameterClientAuthType(); + dbmoasp.setConnectionParameter(moaspcon); + } + moaspcon.setURL(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_URL)); + } + VerifyIdentityLink moaidl = dbmoasp.getVerifyIdentityLink(); + if (moaidl == null) { + moaidl = new VerifyIdentityLink(); + dbmoasp.setVerifyIdentityLink(moaidl); + } + moaidl.setTrustProfileID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_IDL_PROD)); + VerifyAuthBlock moaauth = dbmoasp.getVerifyAuthBlock(); + if (moaauth == null) { + moaauth = new VerifyAuthBlock(); + dbmoasp.setVerifyAuthBlock(moaauth); + } + moaauth.setTrustProfileID(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_TRUSTPROFILE_AUTHBLOCK_PROD)); + + if (moaauth.getVerifyTransformsInfoProfileID() == null) { + moaauth.setVerifyTransformsInfoProfileID(new ArrayList()); + + } + moaauth.getVerifyTransformsInfoProfileID().add(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_MOASP_AUTHBLOCK_TRANSFORM)); + + SecurityLayer seclayertrans = dbauth.getSecurityLayer(); + if (seclayertrans == null) { + seclayertrans = new SecurityLayer(); + dbauth.setSecurityLayer(seclayertrans); + } + + try { + List trans = new ArrayList(); + TransformsInfoType elem = new TransformsInfoType(); + elem.setTransformation(Base64Utils.decode(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64), false)); + elem.setFilename(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME)); + trans.add(elem); + seclayertrans.setTransformsInfo(trans); + + } catch (IOException e) { + Logger.warn("Converting AuthBlock transformation FAILED.", e); + } + + + SLRequestTemplates slrequesttempl = dbconfig.getSLRequestTemplates(); + if (slrequesttempl == null) { + slrequesttempl = new SLRequestTemplates(); + dbconfig.setSLRequestTemplates(slrequesttempl); + } + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_HANDY))) + slrequesttempl.setHandyBKU(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_HANDY)); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_LOCAL))) + slrequesttempl.setLocalBKU(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_LOCAL)); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_ONLINE))) + slrequesttempl.setOnlineBKU(moaconfig.get(MOAIDConfigurationConstants.GENERAL_DEFAULTS_TEMPLATES_ONLINE)); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TRUSTSTORE_URL))) + dbconfig.setTrustedCACertificates(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TRUSTSTORE_URL)); + + + return dbconfig; + } + + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java new file mode 100644 index 000000000..2a8cd9c1c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.commons.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; + +import javax.xml.bind.JAXBException; + +/** + * @author tlenz + * + */ +public class MigrationTest { + + public static void main(String[] args) { + + String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_test.xml"; + String outputFile = "D:/Projekte/svn/moa-id/MOAID-3.0_config.propery"; + + String moaidconfig = "D:/Projekte/svn/moa-id/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/moa-id/moa-id.properties"; + try { + FileInputStream input = new FileInputStream(inputFile); + File out = new File(outputFile); + + ConfigurationUtil utils = new ConfigurationUtil(true); + utils.readFromXMLFileConvertToPropertyFile(input, out); + + FileInputStream dbInput = new FileInputStream(outputFile); + utils.readFromFileWriteToDB(dbInput, moaidconfig); + + + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java new file mode 100644 index 000000000..626db2167 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java @@ -0,0 +1,101 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.commons.utils; + +/** + * @author tlenz + * + */ +public class KeyValueUtils { + + /** + * Extract the first child of an input key after a the prefix + * + * @param key: Full input key + * @param prefix: Prefix + * @return Child key {String} if it exists or null + */ + public static String getFirstChildAfterPrefix(String key, String prefix) { + String idAfterPrefix = removePrefixFromKey(key, prefix); + if (idAfterPrefix != null) { + int index = idAfterPrefix.indexOf("."); + if (index > 0) { + String adding = idAfterPrefix.substring(0, index); + if (!(adding.isEmpty())) { + return adding; + + } + } else if (!(idAfterPrefix.isEmpty())) { + return idAfterPrefix; + + } + + } + return null; + } + + /** + * Extract the prefix from an input key + * + * @param key: Full input key + * @param suffix: Suffix of this key + * @return Prefix {String} of the key or null if input key does not ends with postfix string + */ + public static String getPrefixFromKey(String key, String suffix) { + if (key != null && key.endsWith(suffix)) { + String idPreforeSuffix = key.substring(0, key.length()-suffix.length()); + if (idPreforeSuffix.endsWith(".")) + return idPreforeSuffix.substring(0, idPreforeSuffix.length()-1); + else + return idPreforeSuffix; + } + return null; + + } + + /** + * Remove a prefix string from a key + * + * @param key: Full input key + * @param prefix: Prefix, which should be removed + * @return The suffix of the input key or null if the input does not starts with the prefix + */ + public static String removePrefixFromKey(String key, String prefix) { + if (prefix == null) + prefix = new String(); + + if (key!=null && key.startsWith(prefix)) { + String afterPrefix = key.substring(prefix.length()); + int index = afterPrefix.indexOf("."); + + if (index == 0) { + afterPrefix = afterPrefix.substring(1); + + } + return afterPrefix; + + } + return null; + } + +} diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml new file mode 100644 index 000000000..ea0e7c78d --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From a1ee0567607fe43909cd7fc1b75ace3197a2fa0b Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 3 Jul 2015 12:47:58 +0200 Subject: fix some configuration problems --- .../moa/id/auth/MOAIDAuthInitializer.java | 77 ++++++++++++---------- .../AuthenticationBlockAssertionBuilder.java | 11 +++- .../CreateXMLSignatureResponseValidator.java | 9 ++- .../moa/id/config/auth/OAAuthParameter.java | 2 +- .../PropertyBasedAuthConfigurationProvider.java | 7 +- .../moa/id/config/stork/STORKConfig.java | 30 +++++---- .../protocols/pvp2x/config/PVPConfiguration.java | 21 +++--- .../id/storage/AuthenticationSessionStoreage.java | 8 ++- .../id/config/auth/moaid.configuration.beans.xml | 14 ---- .../main/resources/moaid.configuration.beans.xml | 14 ++++ .../api/AbstractConfigurationImpl.java | 2 + .../config/ConfigurationMigrationUtils.java | 19 ++++-- .../config/MOAIDConfigurationConstants.java | 6 +- .../moa/id/commons/config/MigrationTest.java | 2 +- .../config/persistence/MOAIDConfigurationImpl.java | 11 ++-- .../db/dao/config/DatabaseConfigPropertyImpl.java | 6 +- 16 files changed, 137 insertions(+), 102 deletions(-) delete mode 100644 id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml create mode 100644 id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java index 39ab28285..65e3b10d7 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthInitializer.java @@ -131,43 +131,50 @@ public class MOAIDAuthInitializer { Constants.nSMap.put(Constants.DSIG_PREFIX, Constants.DSIG_NS_URI); // Loads the configuration - AuthConfiguration authConf = AuthConfigurationProviderFactory.reload(); - - ConnectionParameter moaSPConnParam = authConf - .getMoaSpConnectionParameter(); - - // If MOA-SP API calls: loads MOA-SP configuration and configures IAIK - if (moaSPConnParam == null) { - try { - LoggingContextManager.getInstance().setLoggingContext( - new LoggingContext("startup")); - ConfigurationProvider config = ConfigurationProvider - .getInstance(); - new IaikConfigurator().configure(config); - } catch (at.gv.egovernment.moa.spss.server.config.ConfigurationException ex) { - throw new ConfigurationException("config.10", new Object[] { ex - .toString() }, ex); + try { + AuthConfiguration authConf = AuthConfigurationProviderFactory.reload(); + + ConnectionParameter moaSPConnParam = authConf + .getMoaSpConnectionParameter(); + + // If MOA-SP API calls: loads MOA-SP configuration and configures IAIK + if (moaSPConnParam == null) { + try { + LoggingContextManager.getInstance().setLoggingContext( + new LoggingContext("startup")); + ConfigurationProvider config = ConfigurationProvider + .getInstance(); + new IaikConfigurator().configure(config); + } catch (at.gv.egovernment.moa.spss.server.config.ConfigurationException ex) { + throw new ConfigurationException("config.10", new Object[] { ex + .toString() }, ex); + } } + + // Initializes IAIKX509TrustManager logging + /* + String log4jConfigURL = System.getProperty("log4j.configuration"); + Logger.info("Log4J Configuration: " + log4jConfigURL); + if (log4jConfigURL != null) { + IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); + } + */ + + // Initializes the Axis secure socket factory for use in calling the + // MOA-SP web service + if (moaSPConnParam != null && moaSPConnParam.isHTTPSURL()) { + SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(authConf, + moaSPConnParam); + AxisSecureSocketFactory.initialize(ssf); + } + + + } catch (ConfigurationException e) { + Logger.error("MOA-ID-Auth start-up FAILED. Error during application configuration."); + System.exit(-1); + } - - // Initializes IAIKX509TrustManager logging - /* - String log4jConfigURL = System.getProperty("log4j.configuration"); - Logger.info("Log4J Configuration: " + log4jConfigURL); - if (log4jConfigURL != null) { - IAIKX509TrustManager.initLog(new LoggerConfigImpl(log4jConfigURL)); - } - */ - - // Initializes the Axis secure socket factory for use in calling the - // MOA-SP web service - if (moaSPConnParam != null && moaSPConnParam.isHTTPSURL()) { - SSLSocketFactory ssf = SSLUtils.getSSLSocketFactory(authConf, - moaSPConnParam); - AxisSecureSocketFactory.initialize(ssf); - } - - + // Starts the session cleaner thread to remove unpicked authentication data AuthenticationSessionCleaner.start(); AuthConfigLoader.start(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java index 6df0c4742..81699bcdf 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationBlockAssertionBuilder.java @@ -265,9 +265,12 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion String text = ""; try { - OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); - if (MiscUtil.isNotEmpty(text = oaparam.getAditionalAuthBlockText())) + OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); + if (MiscUtil.isNotEmpty(oaparam.getAditionalAuthBlockText())) { Logger.info("Use addional AuthBlock Text from OA=" + oaparam.getPublicURLPrefix()); + text = oaparam.getAditionalAuthBlockText(); + } + } catch (ConfigurationException e) { Logger.warn("Addional AuthBlock Text can not loaded from OA!", e); } @@ -418,8 +421,10 @@ public class AuthenticationBlockAssertionBuilder extends AuthenticationAssertion String text = ""; try { OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); - if (MiscUtil.isNotEmpty(text = oaparam.getAditionalAuthBlockText())) + if (MiscUtil.isNotEmpty(oaparam.getAditionalAuthBlockText())) { Logger.info("Use addional AuthBlock Text from OA=" + oaparam.getPublicURLPrefix()); + text = oaparam.getAditionalAuthBlockText(); + } } catch (ConfigurationException e) { Logger.warn("Addional AuthBlock Text can not loaded from OA!", e); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java index 34613e658..e1ab0025e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/validator/CreateXMLSignatureResponseValidator.java @@ -293,8 +293,10 @@ public class CreateXMLSignatureResponseValidator { String text = ""; try { OAAuthParameter oaparam = AuthConfigurationProviderFactory.getInstance().getOnlineApplicationParameter(session.getPublicOAURLPrefix()); - if (MiscUtil.isNotEmpty(text = oaparam.getAditionalAuthBlockText())) + if (MiscUtil.isNotEmpty(oaparam.getAditionalAuthBlockText())) { Logger.info("Use addional AuthBlock Text from OA=" + oaparam.getPublicURLPrefix()); + text = oaparam.getAditionalAuthBlockText(); + } } catch (ConfigurationException e) { Logger.warn("Addional AuthBlock Text can not loaded from OA!", e); } @@ -521,8 +523,11 @@ public class CreateXMLSignatureResponseValidator { String text = ""; try { - if (MiscUtil.isNotEmpty(text = AuthConfigurationProviderFactory.getInstance().getSSOSpecialText())) + if (MiscUtil.isNotEmpty(AuthConfigurationProviderFactory.getInstance().getSSOSpecialText())) { + text = AuthConfigurationProviderFactory.getInstance().getSSOSpecialText(); Logger.info("Use addional AuthBlock Text from SSO=" +text); + + } else text = new String(); } catch (ConfigurationException e) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java index dfe4a7448..3bf631108 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java @@ -86,7 +86,7 @@ import at.gv.egovernment.moa.util.MiscUtil; */ public class OAAuthParameter implements IOAAuthParameters { - final public static String DEFAULT_KEYBOXIDENTIFIER = "SECURE_SIGNATURE_KEYPAIR"; + final public static String DEFAULT_KEYBOXIDENTIFIER = "SecureSignatureKeypair"; private Map oaConfiguration; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java index 60ae3882e..08a8dcdf2 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -88,6 +88,11 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide Logger.error("OpenSAML initilalization FAILED. ", e); throw new ConfigurationException("config.23", null, e); + } catch (Exception e) { + Logger.error("General error during start-up process.", e); + throw new ConfigurationException("init.02", null, e); + + } finally { if (in != null) try { @@ -839,7 +844,7 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide STORKConfig result = null; try { Map storkProps = configuration.getPropertySubset( - MOAIDConfigurationConstants.GENERAL_AUTH_STORK); + MOAIDConfigurationConstants.GENERAL_AUTH_STORK + "."); if (storkProps == null) { Logger.warn("Error in MOA-ID Configuration. No STORK configuration found."); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java index c926e2b01..9532aa9ab 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/stork/STORKConfig.java @@ -38,6 +38,7 @@ import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; /** @@ -65,7 +66,7 @@ public class STORKConfig { Map storkCPEPSProps = AuthConfigurationProviderFactory.getInstance().getConfigurationWithPrefix( - MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST); + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST + "."); if (storkCPEPSProps != null) { Set keyValues = storkCPEPSProps.keySet(); for (Object elObj : keyValues) { @@ -74,19 +75,22 @@ public class STORKConfig { if (el.endsWith(MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY)) { int index = el.indexOf("."); String listCounter = el.substring(0, index); - try { - CPEPS moacpep = - new CPEPS(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY), - new URL(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL)), - Boolean.valueOf(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG))); - cpepsMap.put(moacpep.getCountryCode(), moacpep); + + if (MiscUtil.isNotEmpty(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY))) { + try { + CPEPS moacpep = + new CPEPS(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_COUNTRY), + new URL(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL)), + Boolean.valueOf(storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_SUPPORT_XMLDSIG))); + cpepsMap.put(moacpep.getCountryCode(), moacpep); - } catch (MalformedURLException e) { - Logger.warn("CPEPS URL " + - storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL) + - " are not parseable.", e); - - } + } catch (MalformedURLException e) { + Logger.warn("CPEPS URL " + + storkCPEPSProps.get(listCounter + "." + MOAIDConfigurationConstants.GENERAL_AUTH_STORK_CPEPS_LIST_URL) + + " are not parseable.", e); + + } + } } } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java index ca95ff90c..de58c34a1 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java @@ -93,16 +93,16 @@ public class PVPConfiguration { public static final String IDP_ISSUER_NAME = "servicename"; - public static final String IDP_ORG_NAME = "org.name.short"; - public static final String IDP_ORG_DISPNAME = "org.name.full"; - public static final String IDP_ORG_URL = "org.url"; - - public static final String IDP_CONTACT_SURNAME = "contact.familyname"; - public static final String IDP_CONTACT_GIVENNAME = "contact.givenname"; - public static final String IDP_CONTACT_MAIL = "contact.mail"; - public static final String IDP_CONTACT_TYPE = "contact.type"; - public static final String IDP_CONTACT_COMPANY = "contact.company"; - public static final String IDP_CONTACT_PHONE = "contact.phone"; + public static final String IDP_ORG_NAME = "name.short"; + public static final String IDP_ORG_DISPNAME = "name.full"; + public static final String IDP_ORG_URL = "url"; + + public static final String IDP_CONTACT_SURNAME = "familyname"; + public static final String IDP_CONTACT_GIVENNAME = "givenname"; + public static final String IDP_CONTACT_MAIL = "mail"; + public static final String IDP_CONTACT_TYPE = "type"; + public static final String IDP_CONTACT_COMPANY = "company"; + public static final String IDP_CONTACT_PHONE = "phone"; private static String moaIDVersion = null; @@ -255,6 +255,7 @@ public class PVPConfiguration { if (type == null) { Logger.error("IDP Contact with SurName " + contacts.get(IDP_CONTACT_SURNAME) + " has no type defined!"); + type = "unknown"; } ContactPersonTypeEnumeration enumType = null; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java index 1ca5dcce4..d843a171e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java @@ -385,8 +385,12 @@ public class AuthenticationSessionStoreage { //send transaction tx.commit(); - Logger.debug("Add SSO-Session login information for OA: " + OAUrl - + " and AssertionID: " + SLOInfo.getSessionIndex()); + if (SLOInfo != null) + Logger.debug("Add SSO-Session login information for OA: " + OAUrl + + " and AssertionID: " + SLOInfo.getSessionIndex()); + else + Logger.debug("Add SSO-Session login information for OA: " + OAUrl); + } } catch (MOADatabaseException e) { diff --git a/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml b/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml deleted file mode 100644 index cdfde11b1..000000000 --- a/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/config/auth/moaid.configuration.beans.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml b/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml new file mode 100644 index 000000000..cdfde11b1 --- /dev/null +++ b/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java index 801e765c3..d5ea2342a 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java @@ -28,11 +28,13 @@ import java.util.Set; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.transaction.annotation.Transactional; /** * @author tlenz * */ +@Transactional("transactionManager") public abstract class AbstractConfigurationImpl implements Configuration { private static final Logger logger = LoggerFactory diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java index 59c6687d5..974646ef0 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -218,6 +218,10 @@ public class ConfigurationMigrationUtils { result.put(MOAIDConfigurationConstants.SERVICE_AUTH_MANDATES_USE, Boolean.FALSE.toString()); } + //convert KeyBoxSelector + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_KEYBOXIDENTIFIER, + oa.getKeyBoxIdentifier().value()); + //convert securtiyLayer templates TemplatesType templates = oaauth.getTemplates(); if (templates != null) { @@ -1172,16 +1176,19 @@ public class ConfigurationMigrationUtils { if (seclayer != null) { List list = seclayer.getTransformsInfo(); if (!list.isEmpty()) { - try { +// try { + //TODO: check if Transformation is always BASE64 encoded +// result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64, +// Base64Utils.encode(list.get(0).getTransformation())); result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64, - Base64Utils.encode(list.get(0).getTransformation())); + new String(list.get(0).getTransformation())); result.put(MOAIDConfigurationConstants.GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME, list.get(0).getFilename()); - - } catch (IOException e) { - Logger.warn("AuthBlockTransformation can not converted.", e); - } +// } catch (IOException e) { +// Logger.warn("AuthBlockTransformation can not converted.", e); +// +// } } else { Logger.warn("AuthBlockTransformation can not converted."); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java index 884587d36..78eec24ee 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java @@ -244,9 +244,9 @@ public final class MOAIDConfigurationConstants { public static final String GENERAL_PROTOCOLS_PVP2X_METADATA = GENERAL_PROTOCOLS_PVP2X + ".metadata"; public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_SERVICENAMME = GENERAL_PROTOCOLS_PVP2X_METADATA + ".servicename"; public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG = GENERAL_PROTOCOLS_PVP2X_METADATA + ".org"; - public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME = GENERAL_PROTOCOLS_PVP2X_METADATA + ".name.short"; - public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME = GENERAL_PROTOCOLS_PVP2X_METADATA + ".name.full"; - public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL = GENERAL_PROTOCOLS_PVP2X_METADATA + ".url"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_SHORTNAME = GENERAL_PROTOCOLS_PVP2X_METADATA_ORG + ".name.short"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_FULLNAME = GENERAL_PROTOCOLS_PVP2X_METADATA_ORG + ".name.full"; + public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_ORG_URL = GENERAL_PROTOCOLS_PVP2X_METADATA_ORG + ".url"; public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT = GENERAL_PROTOCOLS_PVP2X_METADATA + ".contact"; public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_FAMLIYNAME = GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT + ".familyname"; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java index 2a8cd9c1c..7dbbac5b4 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java @@ -37,7 +37,7 @@ public class MigrationTest { public static void main(String[] args) { - String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_test.xml"; + String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_labda_12.05.2015.xml"; String outputFile = "D:/Projekte/svn/moa-id/MOAID-3.0_config.propery"; String moaidconfig = "D:/Projekte/svn/moa-id/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/moa-id/moa-id.properties"; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java index 06e174942..832c82e78 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java @@ -9,8 +9,6 @@ import javax.persistence.EntityManager; import javax.persistence.TypedQuery; import org.springframework.stereotype.Component; -import org.springframework.stereotype.Repository; -import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Transactional; import at.gv.egiz.components.configuration.api.Configuration; @@ -25,8 +23,7 @@ import at.gv.egovernment.moa.logging.Logger; * The implementation of a key-value configuration implementing the {@link Configuration} interface. * It employs the {@link ConfigPropertyDao} to persist configuration data. */ -@Repository -@EnableTransactionManagement +@Component @Transactional("transactionManager") public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implements MOAIDConfiguration { @@ -52,8 +49,8 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement } - TypedQuery configQuery = em.createQuery("select * from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class); - configQuery.setParameter("key", preFix + ".%"); + TypedQuery configQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class); + configQuery.setParameter("key", preFix + "%"); List configResult = configQuery.getResultList(); if (configResult == null || configResult.isEmpty()) { @@ -83,7 +80,7 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement } - TypedQuery configQuery = em.createQuery("select * from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class); + TypedQuery configQuery = em.createQuery("select dbconfig from ConfigProperty dbconfig where dbconfig.key like :key", ConfigProperty.class); configQuery.setParameter("key", searchKey.replace("*", "%")); List configResult = configQuery.getResultList(); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java index 72cb2fdf4..8e845478b 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java @@ -6,12 +6,9 @@ import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.TypedQuery; -import org.hibernate.SessionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Repository; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.Transactional; import at.gv.egiz.components.configuration.api.AbstractConfigurationImpl; @@ -96,7 +93,8 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { property.setKey(key); property.setValue(value); log.debug("Storing '{}'.", property.toString()); - em.persist(property); +// em.persist(property); + em.merge(property); } -- cgit v1.2.3 From 91dfafd601d12d91347b1c09efb47d8f14da8760 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 3 Jul 2015 12:55:34 +0200 Subject: fix problems with dynamic PVP2X metadata refresh --- .../id/protocols/pvp2x/binding/PostBinding.java | 11 ++++-- .../protocols/pvp2x/binding/RedirectBinding.java | 4 +-- .../pvp2x/metadata/MOAMetadataProvider.java | 42 +++++++++++++++++++--- .../resources/properties/id_messages_de.properties | 2 +- .../protocol_response_statuscodes_de.properties | 1 + 5 files changed, 49 insertions(+), 11 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java index 1a268c812..5402e3dce 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/PostBinding.java @@ -62,6 +62,7 @@ import at.gv.egovernment.moa.id.protocols.pvp2x.signer.CredentialProvider; import at.gv.egovernment.moa.id.protocols.pvp2x.signer.CredentialsNotAvailableException; import at.gv.egovernment.moa.id.util.VelocityProvider; import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.MiscUtil; public class PostBinding implements IDecoder, IEncoder { @@ -170,10 +171,12 @@ public class PostBinding implements IDecoder, IEncoder { RequestAbstractType inboundMessage = (RequestAbstractType) messageContext .getInboundMessage(); msg = new MOARequest(inboundMessage, getSAML2BindingName()); + msg.setEntityID(inboundMessage.getIssuer().getValue()); } else if (messageContext.getInboundMessage() instanceof StatusResponseType){ - StatusResponseType inboundMessage = (StatusResponseType) messageContext.getInboundMessage(); + StatusResponseType inboundMessage = (StatusResponseType) messageContext.getInboundMessage(); msg = new MOAResponse(inboundMessage); + msg.setEntityID(inboundMessage.getIssuer().getValue()); } else //create empty container if request type is unknown @@ -182,8 +185,10 @@ public class PostBinding implements IDecoder, IEncoder { if (messageContext.getPeerEntityMetadata() != null) msg.setEntityID(messageContext.getPeerEntityMetadata().getEntityID()); - else - Logger.info("No Metadata found for OA with EntityID " + messageContext.getInboundMessageIssuer()); + else { + if (MiscUtil.isEmpty(msg.getEntityID())) + Logger.info("No Metadata found for OA with EntityID " + messageContext.getInboundMessageIssuer()); + } msg.setVerified(false); msg.setRelayState(messageContext.getRelayState()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java index 0b6cb6eea..81863f48f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/binding/RedirectBinding.java @@ -178,12 +178,12 @@ public class RedirectBinding implements IDecoder, IEncoder { signatureRule.evaluate(messageContext); } catch (SecurityException e) { - if (MiscUtil.isEmpty(messageContext.getPeerEntityId())) { + if (MiscUtil.isEmpty(messageContext.getInboundMessageIssuer())) { throw e; } Logger.debug("PVP2X message validation FAILED. Relead metadata for entityID: " + messageContext.getPeerEntityId()); - if (!MOAMetadataProvider.getInstance().refreshMetadataProvider(messageContext.getPeerEntityId())) + if (!MOAMetadataProvider.getInstance().refreshMetadataProvider(messageContext.getInboundMessageIssuer())) throw e; else { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java index c2127a2af..389b9825f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/metadata/MOAMetadataProvider.java @@ -26,12 +26,14 @@ import java.io.IOException; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.Timer; import javax.net.ssl.SSLHandshakeException; @@ -46,6 +48,8 @@ import org.opensaml.saml2.metadata.provider.HTTPMetadataProvider; import org.opensaml.saml2.metadata.provider.MetadataFilter; import org.opensaml.saml2.metadata.provider.MetadataProvider; import org.opensaml.saml2.metadata.provider.MetadataProviderException; +import org.opensaml.saml2.metadata.provider.ObservableMetadataProvider; +import org.opensaml.saml2.metadata.provider.ObservableMetadataProvider.Observer; import org.opensaml.xml.XMLObject; import org.opensaml.xml.parse.BasicParserPool; @@ -66,11 +70,12 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Base64Utils; import at.gv.egovernment.moa.util.MiscUtil; -public class MOAMetadataProvider implements MetadataProvider { +public class MOAMetadataProvider implements ObservableMetadataProvider{ private static MOAMetadataProvider instance = null; - private static Object mutex = new Object(); + private List observers; + public static MOAMetadataProvider getInstance() { if (instance == null) { @@ -111,7 +116,6 @@ public class MOAMetadataProvider implements MetadataProvider { MetadataProvider internalProvider; - public boolean refreshMetadataProvider(String entityID) { try { OAAuthParameter oaParam = @@ -142,6 +146,9 @@ public class MOAMetadataProvider implements MetadataProvider { cert)); chainProvider.addMetadataProvider(newMetadataProvider); + + emitChangeEvent(); + Logger.info("PVP2X metadata for onlineApplication: " + entityID + " is added."); return true; @@ -299,6 +306,8 @@ public class MOAMetadataProvider implements MetadataProvider { try { chainProvider.setProviders(new ArrayList(providersinuse.values())); + emitChangeEvent(); + } catch (MetadataProviderException e) { Logger.warn("ReInitalize MOAMetaDataProvider is not possible! MOA-ID Instance has to be restarted manualy", e); @@ -328,7 +337,9 @@ public class MOAMetadataProvider implements MetadataProvider { } else { Logger.warn("MetadataProvider can not be destroyed."); } - } + } + + this.observers = Collections.emptyList(); instance = null; } else { Logger.warn("ReInitalize MOAMetaDataProvider is not possible! MOA-ID Instance has to be restarted manualy"); @@ -337,10 +348,12 @@ public class MOAMetadataProvider implements MetadataProvider { private MOAMetadataProvider() { ChainingMetadataProvider chainProvider = new ChainingMetadataProvider(); - Logger.info("Loading metadata"); + this.observers = new CopyOnWriteArrayList(); + Logger.info("Loading metadata"); Map providersinuse = new HashMap(); try { + //TODO: database search does not work!!!!! Map allOAs = AuthConfigurationProviderFactory.getInstance().getConfigurationWithWildCard( MOAIDConfigurationConstants.PREFIX_SERVICES + ".%." @@ -550,4 +563,23 @@ public class MOAMetadataProvider implements MetadataProvider { return internalProvider.getRole(entityID, roleName, supportedProtocol); } + /* (non-Javadoc) + * @see org.opensaml.saml2.metadata.provider.ObservableMetadataProvider#getObservers() + */ + @Override + public List getObservers() { + return ((ChainingMetadataProvider) internalProvider).getObservers(); + } + + protected void emitChangeEvent() { + if ((getObservers() == null) || (getObservers().size() == 0)) { + return; + } + + List tempObserverList = new ArrayList(getObservers()); + for (ObservableMetadataProvider.Observer observer : tempObserverList) + if (observer != null) + observer.onEvent(this); + } + } diff --git a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties index 985d499ba..fc1aa714e 100644 --- a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties +++ b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties @@ -48,7 +48,7 @@ auth.27=Federated authentication FAILED. init.00=MOA ID Authentisierung wurde erfolgreich gestartet init.01=Fehler beim Aktivieren des IAIK-JCE/JSSE/JDK1.3 Workaround\: SSL ist m\u00F6glicherweise nicht verf\u00FCgbar -init.02=Fehler beim Starten des Service MOA ID Authentisierung +init.02=Fehler beim Starten des Service MOA-ID-Auth init.04=Fehler beim Datenbankzugriff mit der SessionID {0} diff --git a/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties index eeacdc627..faafa6fd2 100644 --- a/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties +++ b/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties @@ -54,6 +54,7 @@ config.19=9199 config.20=9199 config.21=9006 config.22=9008 +config.23=9199 parser.00=1101 parser.01=1101 -- cgit v1.2.3 From ff9703e221414e9840638911b53f441eb86afb72 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 3 Jul 2015 13:21:37 +0200 Subject: fix problems with absolut configuration paths --- .../auth/PropertyBasedAuthConfigurationProvider.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java index 08a8dcdf2..9535c9aa3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -5,6 +5,8 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.math.BigInteger; +import java.net.MalformedURLException; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -63,7 +65,14 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide public PropertyBasedAuthConfigurationProvider(String fileName) throws ConfigurationException { File propertiesFile = new File(fileName); rootConfigFileDir = propertiesFile.getParent(); - + try { + rootConfigFileDir = new File(rootConfigFileDir).toURI().toURL().toString(); + + } catch (MalformedURLException t) { + throw new ConfigurationException("config.03", null, t); + + } + System.getProperties().setProperty("location", "file:" + fileName); context = new ClassPathXmlApplicationContext( new String[] { "moaid.configuration.beans.xml", @@ -946,7 +955,7 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide @Override public String getCertstoreDirectory() { try { - String path = configuration.getStringValue( + String path = rootConfigFileDir + configuration.getStringValue( MOAIDConfigurationConstants.GENERAL_AUTH_CERTSTORE_URL); if (MiscUtil.isNotEmpty(path)) return path; @@ -966,7 +975,7 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide @Override public String getTrustedCACertificates() { try { - String path = configuration.getStringValue( + String path = rootConfigFileDir + configuration.getStringValue( MOAIDConfigurationConstants.GENERAL_AUTH_TRUSTSTORE_URL); if (MiscUtil.isNotEmpty(path)) return path; -- cgit v1.2.3 From d774a81910498c9ee1277c1611d57b07bf069fbd Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 10 Jul 2015 15:28:25 +0200 Subject: First parts of the new MOA-ID configuration module --- id/server/moa-id-commons/pom.xml | 6 +- .../api/AbstractConfigurationImpl.java | 6 + .../config/ConfigurationMigrationUtils.java | 3 + .../config/MOAIDConfigurationConstants.java | 25 +- .../moa/id/commons/db/NewConfigurationDBRead.java | 776 +++++++++++---------- .../db/dao/config/DatabaseConfigPropertyImpl.java | 22 +- .../moa/id/commons/utils/KeyValueUtils.java | 134 +++- 7 files changed, 574 insertions(+), 398 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index c04ea13fa..591998185 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -53,15 +53,15 @@ at.gv.egiz.components egiz-configuration-api - 0.1 + 0.2 sources at.gv.egiz.components egiz-configuration-file - 0.1 + 0.2 sources - +
org.hibernate diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java index d5ea2342a..e2db54609 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egiz/components/configuration/api/AbstractConfigurationImpl.java @@ -525,6 +525,12 @@ public abstract class AbstractConfigurationImpl implements Configuration { } + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.Configuration#deleteIds(java.lang.String) + */ + @Override + abstract public void deleteIds(String idSearch) throws ConfigurationException; + /* (non-Javadoc) * @see at.gv.egiz.components.configuration.api.Configuration#synchronize() */ diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java index 974646ef0..694ff0720 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -113,6 +113,9 @@ public class ConfigurationMigrationUtils { * @return MOA-ID 3.x OnlineApplication configuration without prefix but never Null */ public static Map convertHyberJaxBOnlineApplicationToKeyValue(OnlineApplication oa) { + //TODO: add C-PEPS countries and STORK attributes from general config!!!! + //TODO: add correct list identifiers for metadata handling + Map result = new HashMap(); if (oa != null) { //convert oaID and friendlyname diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java index 78eec24ee..34e3f3c7e 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java @@ -1,7 +1,9 @@ package at.gv.egovernment.moa.id.commons.config; +import java.util.ArrayList; import java.util.Collections; import java.util.Hashtable; +import java.util.List; import java.util.Map; /** @@ -26,14 +28,24 @@ public final class MOAIDConfigurationConstants { public static final Map BUSINESSSERVICENAMES; + public static final List ALLOWED_WBPK_PREFIXES; + static { Hashtable tmp = new Hashtable(); tmp.put(IDENIFICATIONTYPE_FN, "Firmenbuchnummer"); tmp.put(IDENIFICATIONTYPE_ZVR, "Vereinsnummer"); tmp.put(IDENIFICATIONTYPE_ERSB, "ERsB Kennzahl"); tmp.put(IDENIFICATIONTYPE_STORK, "STORK"); - BUSINESSSERVICENAMES = Collections.unmodifiableMap(tmp); + + List awbpk = new ArrayList(); + awbpk.add(IDENIFICATIONTYPE_FN); + awbpk.add(IDENIFICATIONTYPE_ERSB); + awbpk.add(IDENIFICATIONTYPE_ZVR); + awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_FN); + awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_ERSB); + awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_ZVR); + ALLOWED_WBPK_PREFIXES = Collections.unmodifiableList(awbpk); } @@ -206,9 +218,10 @@ public final class MOAIDConfigurationConstants { public static final String GENERAL_DEFAULTS_TEMPLATES_ONLINE = GENERAL_DEFAULTS_TEMPLATES + ".onlineBKU"; private static final String GENERAL_AUTH = PREFIX_MOAID_GENERAL + ".auth"; - public static final String GENERAL_AUTH_CERTSTORE_URL = GENERAL_AUTH + ".certstore.url"; - public static final String GENERAL_AUTH_TRUSTSTORE_URL = GENERAL_AUTH + ".truststore.url"; - public static final String GENERAL_AUTH_REVOCATIONCHECKING = GENERAL_AUTH + ".revocationchecking"; + private static final String GENERAL_AUTH_CERTIFICATE = GENERAL_AUTH + ".certificate"; + public static final String GENERAL_AUTH_CERTSTORE_URL = GENERAL_AUTH_CERTIFICATE + ".certstore.url"; + public static final String GENERAL_AUTH_TRUSTSTORE_URL = GENERAL_AUTH_CERTIFICATE + ".truststore.url"; + public static final String GENERAL_AUTH_REVOCATIONCHECKING = GENERAL_AUTH_CERTIFICATE + ".revocationchecking"; public static final String GENERAL_AUTH_TIMEOUTS_TRANSACTION = GENERAL_AUTH + ".timeouts.transaction"; //Anmeldedaten public static final String GENERAL_AUTH_TIMEOUS_SSO_CREATE = GENERAL_AUTH + ".timeouts.sso.create"; @@ -256,8 +269,8 @@ public final class MOAIDConfigurationConstants { public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_COMPANY = GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT + ".company"; public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE = GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT + ".type"; - public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME = GENERAL_AUTH + ".authblock.transformation.name"; - public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64 = GENERAL_AUTH + ".authblock.transformation.base64"; + public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME = GENERAL_AUTH + ".authblock.transformation.preview"; + public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64 = GENERAL_AUTH + ".authblock.transformation.data"; public static final String GENERAL_AUTH_STORK = GENERAL_AUTH + "." + STORK; public static final String GENERAL_AUTH_STORK_QAA = GENERAL_AUTH_STORK + ".qaa"; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java index 66143efad..8f6100f84 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/NewConfigurationDBRead.java @@ -1,53 +1,69 @@ -//package at.gv.egovernment.moa.id.commons.db; -// -//import java.util.ArrayList; -//import java.util.Collections; -//import java.util.Date; -//import java.util.List; -// -//import org.springframework.beans.factory.annotation.Autowired; -// -//import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; -//import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; -//import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; -//import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; -//import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; -//import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; -//import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; -//import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; -//import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; -//import at.gv.egovernment.moa.logging.Logger; -// -///** -// * -// * -// */ -//public class NewConfigurationDBRead { -// -// private static MOAIDConfiguration conf; -// -// @Autowired(required = true) -// public void setConfiguration(MOAIDConfiguration conf) { -// // https://jira.spring.io/browse/SPR-3845 -// NewConfigurationDBRead.conf = conf; -// } -// -// @SuppressWarnings("unchecked") -// public static > T nullGuard(T item) { -// if (item == null) { -// return (T) Collections.emptyList(); -// } else { -// return item; -// } -// } -// -// /** -// * -// * @return -// */ -// public static List getAllUsers() { -// Logger.trace("Get All Users from database."); -// +package at.gv.egovernment.moa.id.commons.db; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; + +import at.gv.egiz.components.configuration.api.ConfigurationException; +import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.GenericConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; + +import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; +import at.gv.egovernment.moa.logging.Logger; + +/** + * + * + */ +public class NewConfigurationDBRead { + + private static MOAIDConfiguration conf; + + @Autowired(required = true) + public void setConfiguration(MOAIDConfiguration conf) { + // https://jira.spring.io/browse/SPR-3845 + NewConfigurationDBRead.conf = conf; + } + + @SuppressWarnings("unchecked") + public static > T nullGuard(T item) { + if (item == null) { + return (T) Collections.emptyList(); + } else { + return item; + } + + } + + public static Map getOnlineApplicationKeyValueWithId(String id) { + try { + return conf.getOnlineApplication(id); + + } catch (ConfigurationException e) { + Logger.warn("OnlineApplication with Id: " + id + " not found.", e); + return null; + + } + } + + + + /** + * + * @return + */ + public static List getAllUsers() { + Logger.trace("Get All Users from database."); + // // select userdatabase from UserDatabase userdatabase // List result = conf.getList("getAllUsers", UserDatabase.class); // if (result.size() == 0) { @@ -56,46 +72,52 @@ // } // // return result; -// } -// -// /** -// * -// * @return -// */ -// public static List getAllOnlineApplications() { -// Logger.trace("Get All OnlineApplications from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication + + //TODO!!! + return null; + } + + /** + * + * @return + */ + public static List getAllOnlineApplications() { + Logger.trace("Get All OnlineApplications from database."); + + // select onlineapplication from OnlineApplication onlineapplication // return conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); -// -// } -// -// /** -// * -// * @return -// */ -// public static List getAllNewOnlineApplications() { -// Logger.trace("Get All New OnlineApplications from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication -// // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' -// List result = new ArrayList(); -// List allOAs = getAllOnlineApplications(); -// -// for (OnlineApplication oa : nullGuard(allOAs)) { -// if (!oa.isIsActive() && oa.isIsAdminRequired()) { -// result.add(oa); -// } -// } -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// return result; -// } -// + + //TODO!!! + return null; + + } + + /** + * + * @return + */ + public static List getAllNewOnlineApplications() { + Logger.trace("Get All New OnlineApplications from database."); + + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' + List result = new ArrayList(); + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allOAs)) { + if (!oa.isIsActive() && oa.isIsAdminRequired()) { + result.add(oa); + } + } + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return result; + } + // /** // * // * @return @@ -138,291 +160,291 @@ // // return result; // } -// -// /** -// * -// * @return -// */ -// public static List getAllActiveOnlineApplications() { -// Logger.trace("Get All New OnlineApplications from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication -// // where onlineapplication.isActive = '1' -// List result = new ArrayList(); -// List allOAs = getAllOnlineApplications(); -// -// for (OnlineApplication oa : nullGuard(allOAs)) { -// if (oa.isIsActive()) { -// result.add(oa); -// } -// } -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// return result; -// } -// -// /** -// * -// * @param id -// * @return -// */ -// public static OnlineApplication getActiveOnlineApplication(String id) { -// Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication -// // where onlineapplication.publicURLPrefix = -// // SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1' -// OnlineApplication result = null; -// List allActiveOAs = getAllActiveOnlineApplications(); -// -// for (OnlineApplication oa : nullGuard(allActiveOAs)) { -// String publicUrlPrefix = oa.getPublicURLPrefix(); -// if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { -// if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { -// if (result != null) { -// Logger.warn("OAIdentifier match to more then one DB-entry!"); -// return null; -// } else { -// result = oa; -// } -// } -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param dbid -// * @return -// */ -// public static OnlineApplication getOnlineApplication(long dbid) { -// Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id -// OnlineApplication result = null; -// List allOAs = getAllOnlineApplications(); -// -// for (OnlineApplication oa : nullGuard(allOAs)) { -// if (oa.getHjid() == dbid) { -// result = oa; -// break; -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param id -// * @return -// */ -// public static OnlineApplication getOnlineApplication(String id) { -// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication -// // where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) -// OnlineApplication result = null; -// List allOAs = getAllOnlineApplications(); -// -// for (OnlineApplication oa : nullGuard(allOAs)) { -// String publicUrlPrefix = oa.getPublicURLPrefix(); -// if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { -// if (id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix)) { -// if (result != null) { -// Logger.warn("OAIdentifier match to more then one DB-entry!"); -// return null; -// } else { -// result = oa; -// } -// } -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param id -// * @return -// */ -// public static List searchOnlineApplications(String id) { -// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); -// -// // select onlineapplication from OnlineApplication onlineapplication -// // where onlineapplication.friendlyName like :id -// List result = new ArrayList(); -// List allOAs = getAllOnlineApplications(); -// -// for (OnlineApplication oa : nullGuard(allOAs)) { -// if (id.equals(oa.getFriendlyName())) { -// result.add(oa); -// } -// } -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// return result; -// } -// -// /** -// * -// * @return -// */ -// public static List getAllOpenUsersRequests() { -// Logger.trace("Get all new Users from Database"); -// -// // select userdatabase from UserDatabase userdatabase -// // where userdatabase.userRequestTokken is not null -// // and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0' -// List result = new ArrayList(); -// List allUsers = getAllUsers(); -// -// for (UserDatabase user : nullGuard(allUsers)) { -// // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) -// if ((user.getUserRequestTokken() != null && !user.getUserRequestTokken().isEmpty() && !user.getUserRequestTokken().equals("NULL")) -// && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { -// result.add(user); -// } -// } -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// return result; -// } -// -// /** -// * -// * @param tokken -// * @return -// */ -// public static UserDatabase getNewUserWithTokken(String tokken) { -// Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); -// -// // select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken -// UserDatabase result = null; -// List allUsers = getAllUsers(); -// -// for (UserDatabase user : nullGuard(allUsers)) { -// if (user.getUserRequestTokken().equals(tokken)) { -// result = user; -// break; -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param id -// * @return -// */ -// public static UserDatabase getUsersWithOADBID(long id) { -// Logger.trace("Getting Userinformation with OADBID " + id + " from database."); -// -// // select userdatabase from UserDatabase userdatabase -// // inner join userdatabase.onlineApplication oa where oa.hjid = :id -// UserDatabase result = null; -// List allUsers = getAllUsers(); -// -// boolean quit = false; -// for (UserDatabase user : nullGuard(allUsers)) { -// -// for (OnlineApplication oa : user.getOnlineApplication()) { -// -// if (oa.getHjid() == id) { -// result = user; -// quit = true; -// break; -// } -// } -// -// if (quit) { -// break; -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param id -// * @return -// */ -// public static UserDatabase getUserWithID(long id) { -// Logger.trace("Getting Userinformation with ID " + id + " from database."); -// -// // select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id -// UserDatabase result = null; -// List allUsers = getAllUsers(); -// -// for (UserDatabase user : nullGuard(allUsers)) { -// if (user.getHjid() == id) { -// result = user; -// break; -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param username -// * @return -// */ -// public static UserDatabase getUserWithUserName(String username) { -// Logger.trace("Getting Userinformation with ID " + username + " from database."); -// -// // select userdatabase from UserDatabase userdatabase where userdatabase.username = :username -// UserDatabase result = null; -// List allUsers = getAllUsers(); -// -// for (UserDatabase user : nullGuard(allUsers)) { -// if (user.getUsername().equals(username)) { -// result = user; -// break; -// } -// } -// -// return result; -// } -// -// /** -// * -// * @param bpkwbpk -// * @return -// */ -// public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { -// Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); -// -// // select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk -// UserDatabase result = null; -// List allUsers = getAllUsers(); -// -// for (UserDatabase user : nullGuard(allUsers)) { -// if (user.getBpk().equals(bpkwbpk)) { -// result = user; -// break; -// } -// } -// -// return result; -// } -// -//} + + /** + * + * @return + */ + public static List getAllActiveOnlineApplications() { + Logger.trace("Get All New OnlineApplications from database."); + + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.isActive = '1' + List result = new ArrayList(); + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allOAs)) { + if (oa.isIsActive()) { + result.add(oa); + } + } + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static OnlineApplication getActiveOnlineApplication(String id) { + Logger.trace("Getting Active OnlineApplication with ID " + id + " from database."); + + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.publicURLPrefix = + // SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1' + OnlineApplication result = null; + List allActiveOAs = getAllActiveOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allActiveOAs)) { + String publicUrlPrefix = oa.getPublicURLPrefix(); + if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { + if ((id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix))) { + if (result != null) { + Logger.warn("OAIdentifier match to more then one DB-entry!"); + return null; + } else { + result = oa; + } + } + } + } + + return result; + } + + /** + * + * @param dbid + * @return + */ + public static OnlineApplication getOnlineApplication(long dbid) { + Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); + + // select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id + OnlineApplication result = null; + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allOAs)) { + if (oa.getHjid() == dbid) { + result = oa; + break; + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static OnlineApplication getOnlineApplication(String id) { + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) + OnlineApplication result = null; + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allOAs)) { + String publicUrlPrefix = oa.getPublicURLPrefix(); + if (publicUrlPrefix != null && publicUrlPrefix.length() <= id.length()) { + if (id.substring(1, publicUrlPrefix.length()).equals(publicUrlPrefix)) { + if (result != null) { + Logger.warn("OAIdentifier match to more then one DB-entry!"); + return null; + } else { + result = oa; + } + } + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static List searchOnlineApplications(String id) { + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + // select onlineapplication from OnlineApplication onlineapplication + // where onlineapplication.friendlyName like :id + List result = new ArrayList(); + List allOAs = getAllOnlineApplications(); + + for (OnlineApplication oa : nullGuard(allOAs)) { + if (id.equals(oa.getFriendlyName())) { + result.add(oa); + } + } + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return result; + } + + /** + * + * @return + */ + public static List getAllOpenUsersRequests() { + Logger.trace("Get all new Users from Database"); + + // select userdatabase from UserDatabase userdatabase + // where userdatabase.userRequestTokken is not null + // and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0' + List result = new ArrayList(); + List allUsers = getAllUsers(); + + for (UserDatabase user : nullGuard(allUsers)) { + // TODO check result of query "... userdatabase.userRequestTokken is not null" if Tokken is null -> (null, "NULL", "", ... ?) + if ((user.getUserRequestTokken() != null && !user.getUserRequestTokken().isEmpty() && !user.getUserRequestTokken().equals("NULL")) + && (user.isIsAdminRequest()) && (!user.isIsMailAddressVerified())) { + result.add(user); + } + } + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return result; + } + + /** + * + * @param tokken + * @return + */ + public static UserDatabase getNewUserWithTokken(String tokken) { + Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); + + // select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : nullGuard(allUsers)) { + if (user.getUserRequestTokken().equals(tokken)) { + result = user; + break; + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static UserDatabase getUsersWithOADBID(long id) { + Logger.trace("Getting Userinformation with OADBID " + id + " from database."); + + // select userdatabase from UserDatabase userdatabase + // inner join userdatabase.onlineApplication oa where oa.hjid = :id + UserDatabase result = null; + List allUsers = getAllUsers(); + + boolean quit = false; + for (UserDatabase user : nullGuard(allUsers)) { + + for (OnlineApplication oa : user.getOnlineApplication()) { + + if (oa.getHjid() == id) { + result = user; + quit = true; + break; + } + } + + if (quit) { + break; + } + } + + return result; + } + + /** + * + * @param id + * @return + */ + public static UserDatabase getUserWithID(long id) { + Logger.trace("Getting Userinformation with ID " + id + " from database."); + + // select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : nullGuard(allUsers)) { + if (user.getHjid() == id) { + result = user; + break; + } + } + + return result; + } + + /** + * + * @param username + * @return + */ + public static UserDatabase getUserWithUserName(String username) { + Logger.trace("Getting Userinformation with ID " + username + " from database."); + + // select userdatabase from UserDatabase userdatabase where userdatabase.username = :username + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : nullGuard(allUsers)) { + if (user.getUsername().equals(username)) { + result = user; + break; + } + } + + return result; + } + + /** + * + * @param bpkwbpk + * @return + */ + public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { + Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); + + // select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk + UserDatabase result = null; + List allUsers = getAllUsers(); + + for (UserDatabase user : nullGuard(allUsers)) { + if (user.getBpk().equals(bpkwbpk)) { + result = user; + break; + } + } + + return result; + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java index 8e845478b..00c191228 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java @@ -100,7 +100,10 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { protected void deleteKey(String key) { log.debug("Deleting entry with key '{}'.", key); - em.remove(em.find(ConfigProperty.class, key)); + ConfigProperty el = em.find(ConfigProperty.class, key); + if (el != null) + em.remove(el); + } /* (non-Javadoc) @@ -117,7 +120,10 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { TypedQuery query = em.createQuery("select key from ConfigProperty dbconfig where dbconfig.key like :key", String.class); query.setParameter("key", searchString.replace("*", "%")); List result = query.getResultList(); - return result.toArray(new String[result.size()]); + if (result == null) + return null; + else + return result.toArray(new String[result.size()]); } /* (non-Javadoc) @@ -166,7 +172,17 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { return result; } - + /* (non-Javadoc) + * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#deleteIds(java.lang.String) + */ + @Override + public void deleteIds(String idSearch) throws ConfigurationException { + String[] keyList = findConfigurationId(idSearch); + for (String el : keyList) { + deleteKey(el); + + } + } // @Override // public String getPropertyValue(String key) { diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java index 626db2167..0e4616825 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java @@ -22,23 +22,35 @@ */ package at.gv.egovernment.moa.id.commons.utils; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import at.gv.egovernment.moa.util.MiscUtil; + /** * @author tlenz * */ public class KeyValueUtils { + public static final String KEY_DELIMITER = "."; + /** * Extract the first child of an input key after a the prefix * - * @param key: Full input key - * @param prefix: Prefix + * @param key Full input key + * @param prefix Prefix * @return Child key {String} if it exists or null */ public static String getFirstChildAfterPrefix(String key, String prefix) { String idAfterPrefix = removePrefixFromKey(key, prefix); if (idAfterPrefix != null) { - int index = idAfterPrefix.indexOf("."); + int index = idAfterPrefix.indexOf(KEY_DELIMITER); if (index > 0) { String adding = idAfterPrefix.substring(0, index); if (!(adding.isEmpty())) { @@ -57,14 +69,14 @@ public class KeyValueUtils { /** * Extract the prefix from an input key * - * @param key: Full input key - * @param suffix: Suffix of this key + * @param key Full input key + * @param suffix Suffix of this key * @return Prefix {String} of the key or null if input key does not ends with postfix string */ public static String getPrefixFromKey(String key, String suffix) { if (key != null && key.endsWith(suffix)) { String idPreforeSuffix = key.substring(0, key.length()-suffix.length()); - if (idPreforeSuffix.endsWith(".")) + if (idPreforeSuffix.endsWith(KEY_DELIMITER)) return idPreforeSuffix.substring(0, idPreforeSuffix.length()-1); else return idPreforeSuffix; @@ -76,8 +88,8 @@ public class KeyValueUtils { /** * Remove a prefix string from a key * - * @param key: Full input key - * @param prefix: Prefix, which should be removed + * @param key Full input key + * @param prefix Prefix, which should be removed * @return The suffix of the input key or null if the input does not starts with the prefix */ public static String removePrefixFromKey(String key, String prefix) { @@ -86,7 +98,7 @@ public class KeyValueUtils { if (key!=null && key.startsWith(prefix)) { String afterPrefix = key.substring(prefix.length()); - int index = afterPrefix.indexOf("."); + int index = afterPrefix.indexOf(KEY_DELIMITER); if (index == 0) { afterPrefix = afterPrefix.substring(1); @@ -98,4 +110,108 @@ public class KeyValueUtils { return null; } + /** + * Remove a prefix string from all keys in {Map} of key/value pairs + * + * @param keys Input data of key/value pairs + * @param prefix Prefix which should be removed + * @return {Map} of key/value pairs without prefix in key, but never null + */ + public static Map removePrefixFromKeys(Map keys, String prefix) { + Map result = new HashMap(); + Iterator> interator = keys.entrySet().iterator(); + while(interator.hasNext()) { + Entry el = interator.next(); + String newKey = removePrefixFromKey(el.getKey(), prefix); + if (MiscUtil.isNotEmpty(newKey)) { + result.put(newKey, el.getValue()); + } + } + + return result; + } + + /** + * Get a subset of key/value pairs which starts with a prefix string + * The Prefix is removed from the key + * + * @param keys Input data of key/value pairs + * @param prefix Prefix string + * @return {Map} of key/value pairs without prefix in key, but never null + */ + public static Map getSubSetWithPrefix(Map keys, String prefix) { + return removePrefixFromKeys(keys, prefix); + } + + + /** + * Add a prefix to key/value pairs to make the key absolute according to key namespace convention + * + * @param input Input key/value pairs which should be updated + * @param prefix Key prefix, which should be added if the key is not absolute + * @param absolutIdentifier Key identifier, which indicates an absolute key + * @return {Map} of key/value pairs in which all keys are absolute but never null + */ + public static Map makeKeysAbsolut(Map input, String prefix, String absolutIdentifier) { + Map result = new HashMap(); + Iterator> interator = input.entrySet().iterator(); + while(interator.hasNext()) { + Entry el = interator.next(); + if (!el.getKey().startsWith(absolutIdentifier)) { + //key is not absolute -> add prefix + result.put(prefix + + KEY_DELIMITER + + el.getKey(), + el.getValue()); + + } else { + //key is absolute + result.put(el.getKey(), el.getValue()); + } + } + return result; + } + + /** + * Get the parent key string from an input key + * + * @param key input key + * @return parent key or the empty String if no parent exists + */ + public static String getParentKey(String key) { + if (MiscUtil.isNotEmpty(key)) { + int index = key.lastIndexOf(KEY_DELIMITER); + if (index > 0) { + return key.substring(0, index); + + } + } + + return new String(); + } + + /** + * Find the highest free list counter + * + * @param input Array of list keys + * @param listPrefix {String} prefix of the list + * @return {int} highest free list counter + */ + public static int findNextFreeListCounter(String[] input, + String listPrefix) { + List counters = new ArrayList(); + if (input == null || input.length == 0) + return 0; + + else { + for (String key : input) { + String listIndex = getFirstChildAfterPrefix(key, listPrefix); + counters.add(Integer.parseInt(listIndex)); + + } + Collections.sort(counters); + return counters.get(counters.size()-1) + 1; + } + } + } -- cgit v1.2.3 From 98dbb23fa5dcd9518beb56fd2410667b385b5524 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 17 Jul 2015 09:18:28 +0200 Subject: first beta version of new MOA-ID WebGUI module for configuration --- .../moa/id/auth/AuthenticationServer.java | 2 +- .../moa/id/auth/MOAIDAuthConstants.java | 11 +- .../id/auth/builder/AuthenticationDataBuilder.java | 2 +- .../moa/id/auth/builder/DataURLBuilder.java | 3 +- .../StartAuthentificationParameterParser.java | 2 +- .../moa/id/auth/servlet/AuthServlet.java | 2 +- .../servlet/GenerateIFrameTemplateServlet.java | 9 +- .../id/auth/servlet/IDPSingleLogOutServlet.java | 13 +- .../auth/servlet/ProcessEngineSignalServlet.java | 10 +- .../moa/id/auth/servlet/RedirectServlet.java | 11 +- .../moa/id/config/ConfigurationUtils.java | 1 - .../auth/AuthConfigurationProviderFactory.java | 18 +- .../moa/id/config/auth/OAAuthParameter.java | 11 +- .../PropertyBasedAuthConfigurationProvider.java | 19 +- .../moa/id/entrypoints/DispatcherServlet.java | 7 +- .../moa/id/moduls/AuthenticationManager.java | 2 +- .../at/gv/egovernment/moa/id/moduls/IAction.java | 2 +- .../moa/id/protocols/pvp2x/PVP2XProtocol.java | 2 +- .../moa/id/protocols/pvp2x/SingleLogOutAction.java | 7 +- .../builder/attributes/IPVPAttributeBuilder.java | 3 +- .../moa/id/protocols/saml1/GetArtifactAction.java | 9 +- .../moa/id/protocols/saml1/SAML1Protocol.java | 2 +- .../protocols/stork2/AttributeProviderFactory.java | 10 +- .../moa/id/protocols/stork2/STORKProtocol.java | 2 +- .../moa/id/util/ParamValidatorUtils.java | 2 +- .../moa/id/util/legacy/LegacyHelper.java | 2 +- .../main/resources/moaid.configuration.beans.xml | 24 ++ .../resources/properties/id_messages_de.properties | 3 +- .../protocol_response_statuscodes_de.properties | 1 + .../src/test/java/test/tlenz/simpletest.java | 22 ++ .../egovernment/moa/id/commons/MOAIDConstants.java | 109 ++++++++++ .../config/ConfigurationMigrationUtils.java | 242 ++++++++++++++------- .../moa/id/commons/config/ConfigurationUtil.java | 34 ++- .../config/MOAIDConfigurationConstants.java | 90 ++------ .../moa/id/commons/config/MigrationTest.java | 2 +- .../config/persistence/MOAIDConfigurationImpl.java | 10 + .../db/dao/config/DatabaseConfigPropertyImpl.java | 3 +- .../moa/id/commons/utils/KeyValueUtils.java | 13 ++ .../src/main/resources/configuration.beans.xml | 28 ++- .../src/main/resources/moaid.migration.beans.xml | 40 ++++ 40 files changed, 531 insertions(+), 254 deletions(-) create mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java create mode 100644 id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index f62c21ed9..54484a854 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -99,7 +99,7 @@ import at.gv.util.xsd.srzgw.MISType.Filters; * @version $Id: AuthenticationServer.java 1273 2012-02-27 14:50:18Z kstranacher * $ */ -public class AuthenticationServer implements MOAIDAuthConstants { +public class AuthenticationServer extends MOAIDAuthConstants { /** * single instance diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java index 5223a181d..3d12bae61 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthConstants.java @@ -9,6 +9,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import at.gv.egovernment.moa.id.commons.MOAIDConstants; +import at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration; + import iaik.asn1.ObjectID; @@ -18,7 +21,7 @@ import iaik.asn1.ObjectID; * @author Paul Ivancsics * @version $Id$ */ -public interface MOAIDAuthConstants { +public class MOAIDAuthConstants extends MOAIDConstants{ /** servlet parameter "Target" */ public static final String PARAM_TARGET = "Target"; @@ -113,9 +116,7 @@ public interface MOAIDAuthConstants { // /** the number of the certifcate extension for party organ representatives */ // public static final String PARTY_ORGAN_REPRESENTATION_OID_NUMBER = PARTY_REPRESENTATION_OID_NUMBER + ".10"; - - public static final String PREFIX_WPBK = "urn:publicid:gv.at:wbpk+"; - + /** OW */ public static final String OW_ORGANWALTER = PARTY_REPRESENTATION_OID_NUMBER + ".4"; @@ -143,8 +144,6 @@ public interface MOAIDAuthConstants { public static final String PARAM_APPLET_HEIGTH = "heigth"; public static final String PARAM_APPLET_WIDTH = "width"; - public static final String TESTCREDENTIALROOTOID = "1.2.40.0.10.2.4.1"; - public static final Map COUNTRYCODE_XX_TO_NAME = Collections.unmodifiableMap(new HashMap() { private static final long serialVersionUID = 1L; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java index ffadc2631..573f2e09f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/AuthenticationDataBuilder.java @@ -116,7 +116,7 @@ import at.gv.util.xsd.szr.PersonInfoType; * @author tlenz * */ -public class AuthenticationDataBuilder implements MOAIDAuthConstants { +public class AuthenticationDataBuilder extends MOAIDAuthConstants { public static IAuthData buildAuthenticationData(IRequest protocolRequest, AuthenticationSession session, List reqAttributes) throws ConfigurationException, BuildException, WrongParametersException, DynamicOABuildException { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java index 924051e2a..899b0fd15 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/DataURLBuilder.java @@ -46,6 +46,7 @@ package at.gv.egovernment.moa.id.auth.builder; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; /** @@ -96,7 +97,7 @@ public class DataURLBuilder { dataURL = authBaseURL + authServletName; - dataURL = addParameter(dataURL, AuthServlet.PARAM_SESSIONID, sessionID); + dataURL = addParameter(dataURL, MOAIDAuthConstants.PARAM_SESSIONID, sessionID); return dataURL; } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java index a26dec969..3b903009c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java @@ -44,7 +44,7 @@ import at.gv.egovernment.moa.util.FileUtils; import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; -public class StartAuthentificationParameterParser implements MOAIDAuthConstants{ +public class StartAuthentificationParameterParser extends MOAIDAuthConstants{ public static void parse(AuthenticationSession moasession, String target, diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java index c4c4b2691..43f4f90ff 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/AuthServlet.java @@ -96,7 +96,7 @@ import at.gv.egovernment.moa.util.URLDecoder; * @author Paul Ivancsics * @version $Id$ */ -public class AuthServlet extends HttpServlet implements MOAIDAuthConstants { +public class AuthServlet extends HttpServlet { /** * diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java index 5802ce3b9..7b55564c4 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GenerateIFrameTemplateServlet.java @@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringEscapeUtils; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; @@ -64,10 +65,10 @@ public class GenerateIFrameTemplateServlet extends AuthServlet { String pendingRequestID = null; try { - String bkuid = req.getParameter(PARAM_BKU); - String useMandate = req.getParameter(PARAM_USEMANDATE); - String ccc = req.getParameter(PARAM_CCC); - String moasessionid = req.getParameter(PARAM_SESSIONID); + String bkuid = req.getParameter(MOAIDAuthConstants.PARAM_BKU); + String useMandate = req.getParameter(MOAIDAuthConstants.PARAM_USEMANDATE); + String ccc = req.getParameter(MOAIDAuthConstants.PARAM_CCC); + String moasessionid = req.getParameter(MOAIDAuthConstants.PARAM_SESSIONID); moasessionid = StringEscapeUtils.escapeHtml(moasessionid); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java index 626c95b19..0a6d30be7 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java @@ -32,6 +32,7 @@ import org.apache.velocity.VelocityContext; import org.opensaml.saml2.core.LogoutResponse; import org.opensaml.saml2.metadata.SingleLogoutService; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; @@ -64,9 +65,9 @@ public class IDPSingleLogOutServlet extends AuthServlet { SSOManager ssomanager = SSOManager.getInstance(); String ssoid = ssomanager.getSSOSessionID(req); - Object restartProcessObj = req.getParameter(PARAM_SLORESTART); + Object restartProcessObj = req.getParameter(MOAIDAuthConstants.PARAM_SLORESTART); - Object tokkenObj = req.getParameter(PARAM_SLOSTATUS); + Object tokkenObj = req.getParameter(MOAIDAuthConstants.PARAM_SLOSTATUS); String tokken = null; String status = null; if (tokkenObj != null && tokkenObj instanceof String) { @@ -78,7 +79,7 @@ public class IDPSingleLogOutServlet extends AuthServlet { } VelocityContext context = new VelocityContext(); - if (SLOSTATUS_SUCCESS.equals(status)) + if (MOAIDAuthConstants.SLOSTATUS_SUCCESS.equals(status)) context.put("successMsg", MOAIDMessageProvider.getInstance().getMessage("slo.00", null)); else @@ -148,12 +149,12 @@ public class IDPSingleLogOutServlet extends AuthServlet { String statusCode = null; if (sloContainer.getSloFailedOAs() == null || sloContainer.getSloFailedOAs().size() == 0) - statusCode = SLOSTATUS_SUCCESS; + statusCode = MOAIDAuthConstants.SLOSTATUS_SUCCESS; else - statusCode = SLOSTATUS_ERROR; + statusCode = MOAIDAuthConstants.SLOSTATUS_ERROR; AssertionStorage.getInstance().put(artifact, statusCode); - redirectURL = addURLParameter(redirectURL, PARAM_SLOSTATUS, artifact); + redirectURL = addURLParameter(redirectURL, MOAIDAuthConstants.PARAM_SLOSTATUS, artifact); } //redirect to Redirect Servlet diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java index 43b6c03d4..0b6180d0f 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/ProcessEngineSignalServlet.java @@ -33,10 +33,10 @@ public class ProcessEngineSignalServlet extends AuthServlet { * The HttpServletResponse. */ private void setNoCachingHeaders(HttpServletResponse resp) { - resp.setHeader(HEADER_EXPIRES, HEADER_VALUE_EXPIRES); - resp.setHeader(HEADER_PRAGMA, HEADER_VALUE_PRAGMA); - resp.setHeader(HEADER_CACHE_CONTROL, HEADER_VALUE_CACHE_CONTROL); - resp.addHeader(HEADER_CACHE_CONTROL, HEADER_VALUE_CACHE_CONTROL_IE); + resp.setHeader(MOAIDAuthConstants.HEADER_EXPIRES, MOAIDAuthConstants.HEADER_VALUE_EXPIRES); + resp.setHeader(MOAIDAuthConstants.HEADER_PRAGMA, MOAIDAuthConstants.HEADER_VALUE_PRAGMA); + resp.setHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL, MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL); + resp.addHeader(MOAIDAuthConstants.HEADER_CACHE_CONTROL, MOAIDAuthConstants.HEADER_VALUE_CACHE_CONTROL_IE); } /** @@ -95,7 +95,7 @@ public class ProcessEngineSignalServlet extends AuthServlet { * @return The current MOA session id. */ public String getMoaSessionId(HttpServletRequest request) { - return StringEscapeUtils.escapeHtml(request.getParameter(PARAM_SESSIONID)); + return StringEscapeUtils.escapeHtml(request.getParameter(MOAIDAuthConstants.PARAM_SESSIONID)); } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java index 7266a3302..431a7e0f7 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/RedirectServlet.java @@ -29,6 +29,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.builder.RedirectFormBuilder; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProviderFactory; @@ -55,9 +56,9 @@ public class RedirectServlet extends AuthServlet{ Logger.debug("Receive " + RedirectServlet.class + " Request"); String url = req.getParameter(REDIRCT_PARAM_URL); - String target = req.getParameter(PARAM_TARGET); - String artifact = req.getParameter(PARAM_SAMLARTIFACT); - String interIDP = req.getParameter(INTERFEDERATION_IDP); + String target = req.getParameter(MOAIDAuthConstants.PARAM_TARGET); + String artifact = req.getParameter(MOAIDAuthConstants.PARAM_SAMLARTIFACT); + String interIDP = req.getParameter(MOAIDAuthConstants.INTERFEDERATION_IDP); Logger.debug("Check URL against online-applications"); OAAuthParameter oa = null; @@ -85,12 +86,12 @@ public class RedirectServlet extends AuthServlet{ if (MiscUtil.isNotEmpty(target)) { // redirectURL = addURLParameter(redirectURL, PARAM_TARGET, // URLEncoder.encode(session.getTarget(), "UTF-8")); - url = addURLParameter(url, PARAM_TARGET, + url = addURLParameter(url, MOAIDAuthConstants.PARAM_TARGET, URLEncoder.encode(target, "UTF-8")); } - url = addURLParameter(url, PARAM_SAMLARTIFACT, + url = addURLParameter(url, MOAIDAuthConstants.PARAM_SAMLARTIFACT, URLEncoder.encode(artifact, "UTF-8")); url = resp.encodeRedirectURL(url); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationUtils.java index d4cb909d9..d36a4318a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationUtils.java @@ -27,7 +27,6 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; -import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.Base64Utils; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java index 8fad1bc83..38135b028 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProviderFactory.java @@ -22,6 +22,10 @@ */ package at.gv.egovernment.moa.id.config.auth; +import java.net.URI; +import java.net.URISyntaxException; + +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.ConfigurationProvider; import at.gv.egovernment.moa.logging.Logger; @@ -50,13 +54,21 @@ public class AuthConfigurationProviderFactory { * @throws ConfigurationException */ public static AuthConfiguration reload() throws ConfigurationException { - String fileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); + String fileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME); if (fileName == null) { throw new ConfigurationException("config.01", null); } Logger.info("Loading MOA-ID-AUTH configuration " + fileName); - - instance = new PropertyBasedAuthConfigurationProvider(fileName); + + try { + URI fileURI = new URI(fileName); + instance = new PropertyBasedAuthConfigurationProvider(fileURI); + + } catch (URISyntaxException e){ + Logger.error("MOA-ID-Auth configuration file does not starts with file:/ as prefix."); + throw new ConfigurationException("config24", new Object[]{MOAIDAuthConstants.FILE_URI_PREFIX, fileName}); + + } return instance; } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java index 3bf631108..4587f0bc3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java @@ -59,6 +59,7 @@ import java.util.Set; import org.apache.commons.lang.SerializationUtils; import at.gv.egovernment.moa.id.auth.exception.BuildException; +import at.gv.egovernment.moa.id.commons.MOAIDConstants; import at.gv.egovernment.moa.id.commons.config.MOAIDConfigurationConstants; import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils; import at.gv.egovernment.moa.id.commons.validation.TargetValidator; @@ -113,11 +114,11 @@ public String getIdentityLinkDomainIdentifier() { String type = oaConfiguration.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_TYPE); String value = oaConfiguration.get(MOAIDConfigurationConstants.SERVICE_AUTH_TARGET_BUSINESS_VALUE); if (MiscUtil.isNotEmpty(type) && MiscUtil.isNotEmpty(value)) { - if (MOAIDConfigurationConstants.IDENIFICATIONTYPE_STORK.equals(type)) { - return MOAIDConfigurationConstants.PREFIX_STORK + "AT" + "+" + value; + if (MOAIDConstants.IDENIFICATIONTYPE_STORK.equals(type)) { + return MOAIDConstants.PREFIX_STORK + "AT" + "+" + value; } else { - return MOAIDConfigurationConstants.PREFIX_WPBK + type + "+" + value; + return MOAIDConstants.PREFIX_WPBK + type + "+" + value; } } @@ -567,7 +568,7 @@ public Collection getStorkAPs() { @Override public byte[] getBKUSelectionTemplate() { try { - String bkuSelectionTemplateBase64 = oaConfiguration.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION); + String bkuSelectionTemplateBase64 = oaConfiguration.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA); if (MiscUtil.isNotEmpty(bkuSelectionTemplateBase64)) { return Base64Utils.decode(bkuSelectionTemplateBase64, false); @@ -587,7 +588,7 @@ public byte[] getBKUSelectionTemplate() { @Override public byte[] getSendAssertionTemplate() { try { - String bkuSelectionTemplateBase64 = oaConfiguration.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION); + String bkuSelectionTemplateBase64 = oaConfiguration.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA); if (MiscUtil.isNotEmpty(bkuSelectionTemplateBase64)) { return Base64Utils.decode(bkuSelectionTemplateBase64, false); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java index 9535c9aa3..9fc03e2df 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/PropertyBasedAuthConfigurationProvider.java @@ -62,7 +62,7 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide * @param fileName the path to the properties file * @throws ConfigurationException if an error occurs during loading the properties file. */ - public PropertyBasedAuthConfigurationProvider(String fileName) throws ConfigurationException { + public PropertyBasedAuthConfigurationProvider(URI fileName) throws ConfigurationException { File propertiesFile = new File(fileName); rootConfigFileDir = propertiesFile.getParent(); try { @@ -72,14 +72,6 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide throw new ConfigurationException("config.03", null, t); } - - System.getProperties().setProperty("location", "file:" + fileName); - context = new ClassPathXmlApplicationContext( - new String[] { "moaid.configuration.beans.xml", - "configuration.beans.xml" - }); - AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory(); - acbFactory.autowireBean(this); FileInputStream in = null; try { @@ -87,6 +79,15 @@ public class PropertyBasedAuthConfigurationProvider extends ConfigurationProvide properties.load(in); super.initial(properties); +// JPAPropertiesWithJavaConfig.setLocalProperties(configProp); +// System.getProperties().setProperty("location", "file:" + fileName); + context = new ClassPathXmlApplicationContext( + new String[] { "moaid.configuration.beans.xml", + "configuration.beans.xml" + }); + AutowireCapableBeanFactory acbFactory = context.getAutowireCapableBeanFactory(); + acbFactory.autowireBean(this); + } catch (FileNotFoundException e) { throw new ConfigurationException("config.03", null, e); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java index 2e0aa5486..15dbf818d 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java @@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import at.gv.egovernment.moa.id.advancedlogging.StatisticLogger; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer; import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataBuilder; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; @@ -279,7 +280,7 @@ public class DispatcherServlet extends AuthServlet{ //create interfederated MOASession String sessionID = AuthenticationSessionStoreage.createInterfederatedSession(protocolRequest, true, ssoId); - req.getParameterMap().put(PARAM_SESSIONID, new String[]{ sessionID }); + req.getParameterMap().put(MOAIDAuthConstants.PARAM_SESSIONID, new String[]{ sessionID }); Logger.info("PreProcessing of SSO interfederation response complete. "); @@ -459,7 +460,7 @@ public class DispatcherServlet extends AuthServlet{ } } else { - moasessionID = (String) req.getParameter(PARAM_SESSIONID); + moasessionID = (String) req.getParameter(MOAIDAuthConstants.PARAM_SESSIONID); moasession = AuthenticationSessionStoreage.getSession(moasessionID); } @@ -475,7 +476,7 @@ public class DispatcherServlet extends AuthServlet{ } } else { - moasessionID = (String) req.getParameter(PARAM_SESSIONID); + moasessionID = (String) req.getParameter(MOAIDAuthConstants.PARAM_SESSIONID); moasession = AuthenticationSessionStoreage.getSession(moasessionID); moasessionID = AuthenticationSessionStoreage.changeSessionID(moasession); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java index e4a358cdb..25aaf4310 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java @@ -103,7 +103,7 @@ import at.gv.egovernment.moa.id.util.Random; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; -public class AuthenticationManager implements MOAIDAuthConstants { +public class AuthenticationManager extends MOAIDAuthConstants { private static final AuthenticationManager INSTANCE = new AuthenticationManager(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/IAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/IAction.java index 529e2ab81..fda92d71a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/IAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/IAction.java @@ -31,7 +31,7 @@ import at.gv.egovernment.moa.id.data.AuthenticationData; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.data.SLOInformationInterface; -public interface IAction extends MOAIDAuthConstants { +public interface IAction { public SLOInformationInterface processRequest(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp, IAuthData authData) throws MOAIDException; public boolean needAuthentication(IRequest req, HttpServletRequest httpReq, HttpServletResponse httpResp); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java index 6b5e6a0f3..e9b18348c 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java @@ -99,7 +99,7 @@ import at.gv.egovernment.moa.id.util.VelocityLogAdapter; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; -public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants { +public class PVP2XProtocol extends MOAIDAuthConstants implements IModulInfo { public static final String NAME = PVP2XProtocol.class.getName(); public static final String PATH = "id_pvp2x"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java index 9884d2a8a..b567798fa 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/SingleLogOutAction.java @@ -60,6 +60,7 @@ import org.opensaml.xml.XMLObject; import org.opensaml.xml.security.SecurityException; import org.opensaml.xml.security.x509.X509Credential; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; @@ -265,12 +266,12 @@ public class SingleLogOutAction implements IAction { String statusCode = null; if (sloContainer.getSloFailedOAs() == null || sloContainer.getSloFailedOAs().size() == 0) - statusCode = SLOSTATUS_SUCCESS; + statusCode = MOAIDAuthConstants.SLOSTATUS_SUCCESS; else - statusCode = SLOSTATUS_ERROR; + statusCode = MOAIDAuthConstants.SLOSTATUS_ERROR; AssertionStorage.getInstance().put(artifact, statusCode); - redirectURL = addURLParameter(redirectURL, PARAM_SLOSTATUS, artifact); + redirectURL = addURLParameter(redirectURL, MOAIDAuthConstants.PARAM_SLOSTATUS, artifact); } //redirect to Redirect Servlet diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/IPVPAttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/IPVPAttributeBuilder.java index 8adf5cad9..72775ec02 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/IPVPAttributeBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/builder/attributes/IPVPAttributeBuilder.java @@ -22,9 +22,8 @@ *******************************************************************************/ package at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes; -import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; -interface IPVPAttributeBuilder extends PVPConstants, MOAIDAuthConstants, IAttributeBuilder { +interface IPVPAttributeBuilder extends PVPConstants, IAttributeBuilder { } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java index 5b1f49411..2019b0d20 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetArtifactAction.java @@ -27,6 +27,7 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.servlet.RedirectServlet; @@ -83,8 +84,8 @@ public class GetArtifactAction implements IAction { String url = AuthConfigurationProviderFactory.getInstance().getPublicURLPrefix() + "/RedirectServlet"; url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(oaURL, "UTF-8")); if (!oaParam.getBusinessService()) - url = addURLParameter(url, PARAM_TARGET, URLEncoder.encode(req.getTarget(), "UTF-8")); - url = addURLParameter(url, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); + url = addURLParameter(url, MOAIDAuthConstants.PARAM_TARGET, URLEncoder.encode(req.getTarget(), "UTF-8")); + url = addURLParameter(url, MOAIDAuthConstants.PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); url = httpResp.encodeRedirectURL(url); httpResp.setContentType("text/html"); @@ -94,12 +95,12 @@ public class GetArtifactAction implements IAction { } else { String redirectURL = oaURL; if (!oaParam.getBusinessService()) { - redirectURL = addURLParameter(redirectURL, PARAM_TARGET, + redirectURL = addURLParameter(redirectURL, MOAIDAuthConstants.PARAM_TARGET, URLEncoder.encode(req.getTarget(), "UTF-8")); } - redirectURL = addURLParameter(redirectURL, PARAM_SAMLARTIFACT, + redirectURL = addURLParameter(redirectURL, MOAIDAuthConstants.PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); redirectURL = httpResp.encodeRedirectURL(redirectURL); httpResp.setContentType("text/html"); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java index bc38735ac..cdc50d8a3 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java @@ -49,7 +49,7 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.URLEncoder; -public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants { +public class SAML1Protocol extends MOAIDAuthConstants implements IModulInfo { public static final String NAME = SAML1Protocol.class.getName(); public static final String PATH = "id_saml1"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java index f0b0f58de..de1924ba1 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AttributeProviderFactory.java @@ -22,6 +22,7 @@ *******************************************************************************/ package at.gv.egovernment.moa.id.protocols.stork2; +import at.gv.egovernment.moa.id.commons.MOAIDConstants; import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.config.stork.StorkAttributeProviderPlugin; import at.gv.egovernment.moa.id.protocols.stork2.attributeproviders.AttributeProvider; @@ -50,14 +51,7 @@ public class AttributeProviderFactory { * @return the available plugins */ public static List getAvailablePlugins() { - List result = new ArrayList(); - result.add("StorkAttributeRequestProvider"); - result.add("EHvdAttributeProvider_deprecated"); - result.add("EHvdAttributeProvider"); - result.add("SignedDocAttributeRequestProvider"); - result.add("MandateAttributeRequestProvider"); - result.add("PVPAuthenticationProvider"); - return result; + return MOAIDConstants.ALLOWED_STORKATTRIBUTEPROVIDERS; } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java index 9eab99c52..42cf04877 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java @@ -45,7 +45,7 @@ import java.util.HashMap; * * @author bsuzic */ -public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { +public class STORKProtocol extends MOAIDAuthConstants implements IModulInfo { public static final String NAME = STORKProtocol.class.getName(); public static final String PATH = "id_stork2"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java index 64ae95093..47010a735 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java @@ -72,7 +72,7 @@ import at.gv.egovernment.moa.util.MiscUtil; import at.gv.egovernment.moa.util.StringUtils; -public class ParamValidatorUtils implements MOAIDAuthConstants{ +public class ParamValidatorUtils extends MOAIDAuthConstants{ /** * Checks if the given target is valid diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/legacy/LegacyHelper.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/legacy/LegacyHelper.java index 9ce44fe15..dd4e67bcd 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/legacy/LegacyHelper.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/legacy/LegacyHelper.java @@ -30,7 +30,7 @@ import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; -public class LegacyHelper implements MOAIDAuthConstants{ +public class LegacyHelper extends MOAIDAuthConstants{ public static boolean isUseMandateRequested(HttpServletRequest req) throws WrongParametersException { diff --git a/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml b/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml index cdfde11b1..e9e4eb23d 100644 --- a/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml +++ b/id/server/idserverlib/src/main/resources/moaid.configuration.beans.xml @@ -9,6 +9,30 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties index fc1aa714e..827eeec8d 100644 --- a/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties +++ b/id/server/idserverlib/src/main/resources/resources/properties/id_messages_de.properties @@ -75,7 +75,8 @@ config.19=Kein Schl\u00FCssel f\u00FCr die Resignierung der Personenbindung gefu config.20=Umgebungsvariable "moa.id.proxy.configuration" nicht gesetzt config.21=F\u00FCr diese Online Applikation sind keine Vollmachtsprofile hinterlegt. config.22=F\u00FCr den Interfederation-Gateway mit der ID {0} ist kein Endpunkt zur Weiterleitung konfiguriert. -config.23=Fehler beim initialisieren von OpenSAML +config.23=Fehler beim initialisieren von OpenSAML +config.24=MOA-ID-Auth Configfile {1} does not start with {0} prefix. parser.00=Leichter Fehler beim Parsen: {0} parser.01=Fehler beim Parsen: {0} diff --git a/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties b/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties index faafa6fd2..59a29d9bd 100644 --- a/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties +++ b/id/server/idserverlib/src/main/resources/resources/properties/protocol_response_statuscodes_de.properties @@ -55,6 +55,7 @@ config.20=9199 config.21=9006 config.22=9008 config.23=9199 +config.24=9199 parser.00=1101 parser.01=1101 diff --git a/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java b/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java index 6e1f612c8..fd1473b1f 100644 --- a/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java +++ b/id/server/idserverlib/src/test/java/test/tlenz/simpletest.java @@ -1,10 +1,19 @@ package test.tlenz; +import java.io.FileInputStream; +import java.io.InputStream; + +import org.w3c.dom.Element; + import iaik.asn1.structures.Name; import iaik.utils.RFC2253NameParser; import iaik.utils.RFC2253NameParserException; +import at.gv.egovernment.moa.id.auth.data.IdentityLink; +import at.gv.egovernment.moa.id.auth.parser.IdentityLinkAssertionParser; import at.gv.egovernment.moa.id.data.AuthenticationRole; import at.gv.egovernment.moa.id.data.AuthenticationRoleFactory; +import at.gv.egovernment.moa.id.util.IdentityLinkReSigner; +import at.gv.egovernment.moa.util.DOMUtils; /******************************************************************************* * Copyright 2014 Federal Chancellery Austria @@ -49,6 +58,19 @@ import at.gv.egovernment.moa.id.data.AuthenticationRoleFactory; public class simpletest { // public static void main(String[] args) { + try { + InputStream s = new FileInputStream("D:/idl_test/identity_link.xml"); + Element idlTemplate = DOMUtils.parseXmlValidating(s); + + //resign IDL + IdentityLinkReSigner identitylinkresigner = IdentityLinkReSigner.getInstance(); + Element resignedilAssertion = identitylinkresigner.resignIdentityLink(idlTemplate, "IDLSigning"); + IdentityLink identityLink = new IdentityLinkAssertionParser(resignedilAssertion).parseIdentityLink(); + + } catch (Exception e) { + System.out.println(e.getMessage()); + + } String subjectName = "serialNumber=896929130327, givenName=OCSP, SN=Responder 03-1, CN=OCSP Responder 03-1, C=AT"; diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java new file mode 100644 index 000000000..e084c07e5 --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/MOAIDConstants.java @@ -0,0 +1,109 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.commons; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; + +/** + * @author tlenz + * + */ +public class MOAIDConstants { + + //general configuration constants + + public static final String FILE_URI_PREFIX = "file:/"; + + public static final String PREFIX_WPBK = "urn:publicid:gv.at:wbpk+"; + public static final String PREFIX_STORK = "urn:publicid:gv.at:storkid+"; + + public static final String IDENIFICATIONTYPE_FN = "FN"; + public static final String IDENIFICATIONTYPE_ERSB = "ERSB"; + public static final String IDENIFICATIONTYPE_ZVR = "ZVR"; + public static final String IDENIFICATIONTYPE_STORK = "STORK"; + + public static final String KEYBOXIDENTIFIER_SECURE = "SecureSignatureKeypair"; + public static final String KEYBOXIDENTIFIER_CERTIFIED = "CertifiedKeypair"; + + public static final String TESTCREDENTIALROOTOID = "1.2.40.0.10.2.4.1"; + + public static final String REDIRECTTARGET_TOP = "_top"; + public static final String REDIRECTTARGET_SELF = "_self"; + public static final String REDIRECTTARGET_PARENT = "_parent"; + public static final String REDIRECTTARGET_BLANK = "_blank"; + + public static final Map BUSINESSSERVICENAMES; + public static final List ALLOWED_WBPK_PREFIXES; + public static final List ALLOWED_KEYBOXIDENTIFIER; + public static final List ALLOWED_REDIRECTTARGETNAMES; + public static final List ALLOWED_STORKATTRIBUTEPROVIDERS; + + + static { + Hashtable tmp = new Hashtable(); + tmp.put(IDENIFICATIONTYPE_FN, "Firmenbuchnummer"); + tmp.put(IDENIFICATIONTYPE_ZVR, "Vereinsnummer"); + tmp.put(IDENIFICATIONTYPE_ERSB, "ERsB Kennzahl"); + tmp.put(IDENIFICATIONTYPE_STORK, "STORK"); + BUSINESSSERVICENAMES = Collections.unmodifiableMap(tmp); + + List awbpk = new ArrayList(); + awbpk.add(IDENIFICATIONTYPE_FN); + awbpk.add(IDENIFICATIONTYPE_ERSB); + awbpk.add(IDENIFICATIONTYPE_ZVR); + awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_FN); + awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_ERSB); + awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_ZVR); + ALLOWED_WBPK_PREFIXES = Collections.unmodifiableList(awbpk); + + List keyboxIDs = new ArrayList(); + awbpk.add(KEYBOXIDENTIFIER_SECURE); + awbpk.add(KEYBOXIDENTIFIER_CERTIFIED); + ALLOWED_KEYBOXIDENTIFIER = Collections.unmodifiableList(keyboxIDs); + + List redirectTargets = new ArrayList(); + redirectTargets.add(REDIRECTTARGET_BLANK); + redirectTargets.add(REDIRECTTARGET_PARENT); + redirectTargets.add(REDIRECTTARGET_SELF); + redirectTargets.add(REDIRECTTARGET_TOP); + ALLOWED_REDIRECTTARGETNAMES = Collections.unmodifiableList(redirectTargets); + + } + + static { + List storkAttrProvider = new ArrayList(); + storkAttrProvider.add("StorkAttributeRequestProvider"); + storkAttrProvider.add("EHvdAttributeProvider_deprecated"); + storkAttrProvider.add("EHvdAttributeProvider"); + storkAttrProvider.add("SignedDocAttributeRequestProvider"); + storkAttrProvider.add("MandateAttributeRequestProvider"); + storkAttrProvider.add("PVPAuthenticationProvider"); + ALLOWED_STORKATTRIBUTEPROVIDERS = Collections.unmodifiableList(storkAttrProvider); + + } + +} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java index 694ff0720..4f47efb78 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -30,6 +30,7 @@ import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; @@ -110,12 +111,10 @@ public class ConfigurationMigrationUtils { * but no MOA-ID configuration prefix * * @param oa MOA-ID 2.x OnlineApplication configuration + * @param storkConfig * @return MOA-ID 3.x OnlineApplication configuration without prefix but never Null */ - public static Map convertHyberJaxBOnlineApplicationToKeyValue(OnlineApplication oa) { - //TODO: add C-PEPS countries and STORK attributes from general config!!!! - //TODO: add correct list identifiers for metadata handling - + public static Map convertHyberJaxBOnlineApplicationToKeyValue(OnlineApplication oa, STORK storkConfig) { Map result = new HashMap(); if (oa != null) { //convert oaID and friendlyname @@ -296,6 +295,34 @@ public class ConfigurationMigrationUtils { result.put(MOAIDConfigurationConstants.SERVICE_AUTH_SSO_USERREQUEST, Boolean.TRUE.toString()); } + //convert interfederation configuration + InterfederationIDPType moaIDP = oa.getInterfederationIDP(); + if (moaIDP != null) { + result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_IIDP); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_ATTRIBUTQUERY_URL, + moaIDP.getAttributeQueryURL()); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_INBOUND, + String.valueOf(moaIDP.isInboundSSO())); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_OUTBOUND, + String.valueOf(moaIDP.isOutboundSSO())); + + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_STORE, + String.valueOf(moaIDP.isStoreSSOSession())); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_LOCALAUTHONERROR, + String.valueOf(moaIDP.isPerformLocalAuthenticationOnError())); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_PASSIVEREQUEST, + String.valueOf(moaIDP.isPerformPassivRequest())); + } + + //convert STORK <-> PVP2X gateway configuration + InterfederationGatewayType gateway = oa.getInterfederationGateway(); + if (gateway != null) { + result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_GATEWAY); + result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_FORWARD_IDPIDENTIFIER, + gateway.getForwardIDPIdentifier()); + + } + //convert STORK config OASTORK config = oaauth.getOASTORK(); if(config != null) { @@ -309,46 +336,6 @@ public class ConfigurationMigrationUtils { else result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_MINQAALEVEL, "4"); - if (config.getCPEPS() != null) { - for (int i=0; i configuredCPEPs = new ArrayList(); + if (storkConfig != null && storkConfig.getCPEPS() != null) { + for (CPEPS el : storkConfig.getCPEPS()) { + if (MiscUtil.isNotEmpty(el.getCountryCode())) + configuredCPEPs.add(el.getCountryCode()); + + } + } + int listCounter = 0; + if (config.getCPEPS() != null) { + Iterator oaCPEPSInterator = config.getCPEPS().iterator(); + while(oaCPEPSInterator.hasNext()) { + CPEPS oaCpeps = oaCPEPSInterator.next(); + String oaCountryCode = oaCpeps.getCountryCode(); + if (MiscUtil.isNotEmpty(oaCountryCode)) { + if (configuredCPEPs.contains(oaCountryCode)) + configuredCPEPs.remove(oaCountryCode); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST_ENABLED, + Boolean.TRUE.toString()); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST_COUNTRYCODE, + oaCountryCode); + + listCounter++; + } + } + } + Iterator confCPEPS = configuredCPEPs.iterator(); + while (confCPEPS.hasNext()) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST_ENABLED, + Boolean.TRUE.toString()); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_COUNTRIES_LIST_COUNTRYCODE, + confCPEPS.next()); + listCounter++; + + } + + //fetch STORK attributes + List configuredAttributs = new ArrayList(); + if (storkConfig != null && storkConfig.getAttributes() != null) { + for (StorkAttribute el : storkConfig.getAttributes()) { + if (MiscUtil.isNotEmpty(el.getName())) + configuredAttributs.add(el.getName()); + + } + } + listCounter = 0; + if (config.getOAAttributes() != null) { + Iterator oaAttributeInterator = config.getOAAttributes().iterator(); + while (oaAttributeInterator.hasNext()) { + OAStorkAttribute oaAttr = oaAttributeInterator.next(); + if (MiscUtil.isNotEmpty(oaAttr.getName())) { + if (configuredAttributs.contains(oaAttr.getName())) + configuredAttributs.remove(oaAttr.getName()); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_NAME, + oaAttr.getName()); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_REQUESTED, + Boolean.TRUE.toString()); + + + if (oaAttr.isMandatory() != null) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, + oaAttr.isMandatory().toString()); + else + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, + Boolean.FALSE.toString()); + listCounter++; + } + } + } + Iterator configuredAttributsInterator = configuredAttributs.iterator(); + while (configuredAttributsInterator.hasNext()) { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_NAME, + configuredAttributsInterator.next()); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_REQUESTED, + Boolean.TRUE.toString()); + + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST + + "." + String.valueOf(listCounter) + "." + + MOAIDConfigurationConstants.SERVICE_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY, + Boolean.FALSE.toString()); + listCounter++; + + } + } } //convert protocols SAML1 @@ -479,9 +580,9 @@ public class ConfigurationMigrationUtils { TransformsInfoType bkuSelectTemplate = templates.getBKUSelectionTemplate(); if (bkuSelectTemplate != null && MiscUtil.isNotEmpty(bkuSelectTemplate.getFilename())) { try { - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION, + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA, Base64Utils.encode(bkuSelectTemplate.getTransformation())); - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_FILENAME, + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW, bkuSelectTemplate.getFilename()); } catch (Exception e) { @@ -495,9 +596,9 @@ public class ConfigurationMigrationUtils { TransformsInfoType sendAssertionTemplate = templates.getSendAssertionTemplate(); if (sendAssertionTemplate != null && MiscUtil.isNotEmpty(sendAssertionTemplate.getFilename())) { try { - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION, + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA, Base64Utils.encode(sendAssertionTemplate.getTransformation())); - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_FILENAME, + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW, sendAssertionTemplate.getFilename()); } catch (Exception e) { @@ -577,38 +678,11 @@ public class ConfigurationMigrationUtils { } } } - - //convert interfederation configuration - InterfederationIDPType moaIDP = oa.getInterfederationIDP(); - if (moaIDP != null) { - result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_IIDP); - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_ATTRIBUTQUERY_URL, - moaIDP.getAttributeQueryURL()); - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_INBOUND, - String.valueOf(moaIDP.isInboundSSO())); - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_OUTBOUND, - String.valueOf(moaIDP.isOutboundSSO())); - - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_SSO_STORE, - String.valueOf(moaIDP.isStoreSSOSession())); - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_LOCALAUTHONERROR, - String.valueOf(moaIDP.isPerformLocalAuthenticationOnError())); - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_PASSIVEREQUEST, - String.valueOf(moaIDP.isPerformPassivRequest())); - } - - //convert STORK <-> PVP2X gateway configuration - InterfederationGatewayType gateway = oa.getInterfederationGateway(); - if (gateway != null) { - result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_GATEWAY); - result.put(MOAIDConfigurationConstants.SERVICE_INTERFEDERATION_FORWARD_IDPIDENTIFIER, - gateway.getForwardIDPIdentifier()); - - } - + //set onlineapplication identifier if nothing is set - if (!result.containsKey(MOAIDConfigurationConstants.PREFIX_SERVICES)) + if (!result.containsKey(MOAIDConfigurationConstants.PREFIX_SERVICES)) { result.put(MOAIDConfigurationConstants.PREFIX_SERVICES, MOAIDConfigurationConstants.PREFIX_OA); + } } return result; @@ -922,11 +996,11 @@ public class ConfigurationMigrationUtils { templates.setAditionalAuthBlockText(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_AUTHBLOCKTEXT)); //store BKU-selection and send-assertion templates - if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION))) { + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA))) { TransformsInfoType el1 = new TransformsInfoType(); try { - el1.setTransformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION), false)); - el1.setFilename(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_FILENAME)); + el1.setTransformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA), false)); + el1.setFilename(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW)); templates.setBKUSelectionTemplate(el1); } catch (IOException e) { @@ -934,11 +1008,11 @@ public class ConfigurationMigrationUtils { } } - if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION))) { + if (MiscUtil.isNotEmpty(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA))) { TransformsInfoType el1 = new TransformsInfoType(); try { - el1.setTransformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION), false)); - el1.setFilename(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_FILENAME)); + el1.setTransformation(Base64Utils.decode(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA), false)); + el1.setFilename(oa.get(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW)); templates.setSendAssertionTemplate(el1); } catch (IOException e) { diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java index bac2d0011..399533d3f 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationUtil.java @@ -23,6 +23,7 @@ import at.gv.egiz.components.configuration.api.Configuration; import at.gv.egiz.components.configuration.api.ConfigurationException; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; @@ -86,11 +87,24 @@ public class ConfigurationUtil { Properties result = new Properties(); + if (config == null) { + return null; + + } + STORK storkConfig = null; + try { + storkConfig = config.getAuthComponentGeneral().getForeignIdentities().getSTORK(); + + } catch (Exception e) { + Logger.debug("No general STORK configuration found."); + + } + //convert all online applications List oaList = config.getOnlineApplication(); for (int i=0; i keyValueOA = ConfigurationMigrationUtils.convertHyberJaxBOnlineApplicationToKeyValue(oa); + Map keyValueOA = ConfigurationMigrationUtils.convertHyberJaxBOnlineApplicationToKeyValue(oa, storkConfig); String serviceIdentifier = keyValueOA.get(MOAIDConfigurationConstants.PREFIX_SERVICES); if (MiscUtil.isEmpty(serviceIdentifier)) { @@ -106,7 +120,13 @@ public class ConfigurationUtil { + key, keyValueOA.get(key)); - } + } + //set correct metadata list identifier + result.put(MOAIDConfigurationConstants.PREFIX_MOAID_SERVICES + + "." + serviceIdentifier + "." + String.valueOf(i) + "." + + MOAIDConfigurationConstants.METADATA_LIST +".0", + MOAIDConfigurationConstants.PREFIX_MOAID_SERVICES + + "." + serviceIdentifier); } Map keyValueGeneral = ConfigurationMigrationUtils.convertHyberJaxBMOAIDConfigToKeyValue(config); @@ -189,8 +209,12 @@ public class ConfigurationUtil { Properties inProperties = new Properties(); inProperties.load(inStream); - System.getProperties().setProperty("location", "file:" + outputDBConfigFilePath); - ApplicationContext context = new ClassPathXmlApplicationContext("configuration.beans.xml"); + System.getProperties().setProperty("moa.id.webconfig", "file:" + outputDBConfigFilePath); + ApplicationContext context = new ClassPathXmlApplicationContext( + new String[]{ + "configuration.beans.xml", + "moaid.migration.beans.xml" + }); Configuration dbConfiguration = (Configuration) context.getBean("moaidconfig"); List keys = null; @@ -217,7 +241,7 @@ public class ConfigurationUtil { // remove existing entries for (String key : keys) { try { - dbConfiguration.setStringValue(key, null); + dbConfiguration.deleteIds(key); } catch (ConfigurationException e) { System.out.println("Could NOT persist the configuration file's information in the database."); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java index 34e3f3c7e..fab5b437f 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MOAIDConfigurationConstants.java @@ -1,54 +1,20 @@ package at.gv.egovernment.moa.id.commons.config; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; +import at.gv.egovernment.moa.id.commons.MOAIDConstants; /** * * */ -public final class MOAIDConfigurationConstants { +public final class MOAIDConfigurationConstants extends MOAIDConstants { private MOAIDConfigurationConstants() { // restrict instantiation } - - //general configuration constants - - public static final String PREFIX_WPBK = "urn:publicid:gv.at:wbpk+"; - public static final String PREFIX_STORK = "urn:publicid:gv.at:storkid+"; + public static final String METADATA_LIST = "__LI"; - public static final String IDENIFICATIONTYPE_FN = "FN"; - public static final String IDENIFICATIONTYPE_ERSB = "ERSB"; - public static final String IDENIFICATIONTYPE_ZVR = "ZVR"; - public static final String IDENIFICATIONTYPE_STORK = "STORK"; + public static final String WEBGUI_EMPTY_ELEMENT = "null"; - public static final Map BUSINESSSERVICENAMES; - - public static final List ALLOWED_WBPK_PREFIXES; - - static { - Hashtable tmp = new Hashtable(); - tmp.put(IDENIFICATIONTYPE_FN, "Firmenbuchnummer"); - tmp.put(IDENIFICATIONTYPE_ZVR, "Vereinsnummer"); - tmp.put(IDENIFICATIONTYPE_ERSB, "ERsB Kennzahl"); - tmp.put(IDENIFICATIONTYPE_STORK, "STORK"); - BUSINESSSERVICENAMES = Collections.unmodifiableMap(tmp); - - List awbpk = new ArrayList(); - awbpk.add(IDENIFICATIONTYPE_FN); - awbpk.add(IDENIFICATIONTYPE_ERSB); - awbpk.add(IDENIFICATIONTYPE_ZVR); - awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_FN); - awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_ERSB); - awbpk.add(PREFIX_WPBK + IDENIFICATIONTYPE_ZVR); - ALLOWED_WBPK_PREFIXES = Collections.unmodifiableList(awbpk); - } - - //Basic key namespaces public static final String PREFIX_MOAID = "moa.id"; public static final String PREFIX_GENERAL = "general"; @@ -97,7 +63,7 @@ public final class MOAIDConfigurationConstants { public static final String SERVICE_AUTH_TARGET_PUBLIC_TARGET = SERVICE_AUTH_TARGET_PUBLIC + ".target"; public static final String SERVICE_AUTH_TARGET_PUBLIC_TARGET_SUB = SERVICE_AUTH_TARGET_PUBLIC + ".target.sub"; public static final String SERVICE_AUTH_TARGET_PUBLIC_USE_SUB = SERVICE_AUTH_TARGET_PUBLIC + ".use.sub"; - public static final String SERVICE_AUTH_TARGET_PUBLIC_USE_OWN = SERVICE_AUTH_TARGET_PUBLIC + ".use.own"; + public static final String SERVICE_AUTH_TARGET_PUBLIC_USE_OWN = SERVICE_AUTH_TARGET_PUBLIC + ".own.use"; public static final String SERVICE_AUTH_TARGET_PUBLIC_OWN_TARGET = SERVICE_AUTH_TARGET_PUBLIC + ".own.target"; public static final String SERVICE_AUTH_TARGET_PUBLIC_OWN_NAME = SERVICE_AUTH_TARGET_PUBLIC + ".own.name"; @@ -111,13 +77,15 @@ public final class MOAIDConfigurationConstants { public static final String SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE = SERVICE_AUTH_BKU_TEMPLATE + ".first.url"; public static final String SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE = SERVICE_AUTH_BKU_TEMPLATE + ".second.url"; public static final String SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE = SERVICE_AUTH_BKU_TEMPLATE + ".third.url"; - public static final String SERVICE_AUTH_BKU_AUTHBLOCKTEXT = SERVICE_AUTH_BKU + "authblock.additionaltext"; - public static final String SERVICE_AUTH_BKU_AUTHBLOCK_REMOVEBPK = SERVICE_AUTH_BKU + "authblock.removebPK"; + public static final String SERVICE_AUTH_BKU_AUTHBLOCKTEXT = AUTH + ".authblock.additionaltext"; + public static final String SERVICE_AUTH_BKU_AUTHBLOCK_REMOVEBPK = AUTH + ".authblock.removebPK"; private static final String SERVICE_AUTH_TEMPLATES = AUTH + "." + TEMPLATES; - public static final String SERVICE_AUTH_TEMPLATES_BKUSELECTION = SERVICE_AUTH_TEMPLATES + ".bkuselection"; + public static final String SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA = SERVICE_AUTH_TEMPLATES + ".bkuselection.data"; + public static final String SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW = SERVICE_AUTH_TEMPLATES + ".bkuselection.preview"; public static final String SERVICE_AUTH_TEMPLATES_BKUSELECTION_FILENAME = SERVICE_AUTH_TEMPLATES + ".bkuselection.filename"; - public static final String SERVICE_AUTH_TEMPLATES_SENDASSERTION = SERVICE_AUTH_TEMPLATES + ".sendAssertion"; + public static final String SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA = SERVICE_AUTH_TEMPLATES + ".sendAssertion.data"; + public static final String SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW = SERVICE_AUTH_TEMPLATES + ".sendAssertion.preview"; public static final String SERVICE_AUTH_TEMPLATES_SENDASSERTION_FILENAME = SERVICE_AUTH_TEMPLATES + ".sendAssertion.filename"; private static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION = SERVICE_AUTH_TEMPLATES + ".customize"; public static final String SERVICE_AUTH_TEMPLATES_CUSTOMIZATION_FONTTYPE = SERVICE_AUTH_TEMPLATES_CUSTOMIZATION + ".fonttype"; @@ -184,8 +152,8 @@ public final class MOAIDConfigurationConstants { private static final String SERVICE_PROTOCOLS_PVP2X = PROTOCOLS + "." + PVP2X; public static final String SERVICE_PROTOCOLS_PVP2X_RELOAD = SERVICE_PROTOCOLS_PVP2X + ".reload"; public static final String SERVICE_PROTOCOLS_PVP2X_URL = SERVICE_PROTOCOLS_PVP2X + ".URL"; - public static final String SERVICE_PROTOCOLS_PVP2X_CERTIFICATE = SERVICE_PROTOCOLS_PVP2X + ".certificate"; - public static final String SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT = SERVICE_PROTOCOLS_PVP2X + ".certificate.subject"; + public static final String SERVICE_PROTOCOLS_PVP2X_CERTIFICATE = SERVICE_PROTOCOLS_PVP2X + ".certificate.data"; + public static final String SERVICE_PROTOCOLS_PVP2X_CERTIFICATE_SUBJECT = SERVICE_PROTOCOLS_PVP2X + ".certificate.preview"; private static final String SERVICE_PROTOCOLS_OPENID = PROTOCOLS + "." + OPENID; public static final String SERVICE_PROTOCOLS_OPENID_CLIENTID = SERVICE_PROTOCOLS_OPENID + ".clientID"; @@ -270,6 +238,7 @@ public final class MOAIDConfigurationConstants { public static final String GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT_TYPE = GENERAL_PROTOCOLS_PVP2X_METADATA_CONTACT + ".type"; public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_NAME = GENERAL_AUTH + ".authblock.transformation.preview"; + public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_FILENAME = GENERAL_AUTH + ".authblock.transformation.filename"; public static final String GENERAL_AUTH_AUTHBLOCK_TRANSFORMATION_BASE64 = GENERAL_AUTH + ".authblock.transformation.data"; public static final String GENERAL_AUTH_STORK = GENERAL_AUTH + "." + STORK; @@ -282,35 +251,4 @@ public final class MOAIDConfigurationConstants { public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST = GENERAL_AUTH_STORK + ".attributes"; public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST_NAME = "friendlyname"; public static final String GENERAL_AUTH_STORK_ATTRIBUTES_LIST_MANDATORY = "mandatory"; - -// // old!!!!!!!!!!! // -// // keys for the object in the key-value database -// public static final String ONLINE_APPLICATIONS_KEY = "OnlineApplications"; -// public static final String AUTH_COMPONENT_GENERAL_KEY = "AuthComponentGeneral"; -// public static final String CHAINING_MODES_KEY = "ChainingModes"; -// public static final String TRUSTED_CERTIFICATES_KEY = "TruestedCertificates"; -// public static final String DEFAULT_BKUS_KEY = "DefaultBKUs"; -// public static final String SLREQUEST_TEMPLATES_KEY = "SLRequestTemplates"; -// public static final String TIMESTAMP_ITEM_KEY = "TimestampItem"; -// public static final String PVP2REFRESH_ITEM_KEY = "Pvp2RefreshItem"; -// public static final String GENERIC_CONFIGURATION_KEY = "GenericConfiguration"; -// -// /** -// * Returns all relevant (database-) keys that {@link MOAIDConfiguration} contains. -// * @return the keys as {@code String[]} -// */ -// public static final String[] getMOAIDConfigurationKeys() { -// return new String[] { AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, TRUSTED_CERTIFICATES_KEY, -// DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, PVP2REFRESH_ITEM_KEY }; -// } -// -// /** -// * Returns all (database-) keys that {@link MOAIDConfiguration} contains. -// * @return the keys as {@code String[]} -// */ -// public static final String[] getAllMOAIDConfigurationKeys() { -// return new String[] { ONLINE_APPLICATIONS_KEY, AUTH_COMPONENT_GENERAL_KEY, CHAINING_MODES_KEY, -// TRUSTED_CERTIFICATES_KEY, DEFAULT_BKUS_KEY, SLREQUEST_TEMPLATES_KEY, TIMESTAMP_ITEM_KEY, -// PVP2REFRESH_ITEM_KEY }; -// } } diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java index 7dbbac5b4..c472299b9 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java @@ -40,7 +40,7 @@ public class MigrationTest { String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_labda_12.05.2015.xml"; String outputFile = "D:/Projekte/svn/moa-id/MOAID-3.0_config.propery"; - String moaidconfig = "D:/Projekte/svn/moa-id/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/moa-id/moa-id.properties"; + String moaidconfig = "D:/Projekte/svn/moa-id/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/moa-id-configuration/moa-id.properties"; try { FileInputStream input = new FileInputStream(inputFile); File out = new File(outputFile); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java index 832c82e78..805bcb33e 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/persistence/MOAIDConfigurationImpl.java @@ -38,6 +38,16 @@ public class MOAIDConfigurationImpl extends DatabaseConfigPropertyImpl implement // this.configPropertyDao = configPropertyDao; // } + public void setStringValue(String id, String value) throws ConfigurationException { + super.setStringValue(id, value); + + } + + public void deleteIds(String idSearch) throws ConfigurationException { + super.deleteIds(idSearch); + + } + /* (non-Javadoc) * @see at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfiguration#getPropertySubset(java.lang.String) */ diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java index 00c191228..f47b0c9e2 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/DatabaseConfigPropertyImpl.java @@ -82,7 +82,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#storeKey(java.lang.String, java.lang.String) */ @Override - @Transactional(value="transactionManager") + @Transactional("transactionManager") protected void storeKey(String key, String value) throws ConfigurationException { if (null == em) { log.error("No EntityManager set!"); @@ -176,6 +176,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { * @see at.gv.egiz.components.configuration.api.AbstractConfigurationImpl#deleteIds(java.lang.String) */ @Override + @Transactional("transactionManager") public void deleteIds(String idSearch) throws ConfigurationException { String[] keyList = findConfigurationId(idSearch); for (String el : keyList) { diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java index 0e4616825..f20647fb0 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/utils/KeyValueUtils.java @@ -29,6 +29,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import at.gv.egovernment.moa.util.MiscUtil; @@ -213,5 +214,17 @@ public class KeyValueUtils { return counters.get(counters.size()-1) + 1; } } + + /** + * Find the highest free list counter + * + * @param keySet {Set} of list keys + * @param listPrefix {String} prefix of the list + * @return {int} highest free list counter + */ + public static int findNextFreeListCounter(Set keySet, + String listPrefix) { + return findNextFreeListCounter((String[]) keySet.toArray(), listPrefix); + } } diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml index ea0e7c78d..775d02d05 100644 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml +++ b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml @@ -11,7 +11,10 @@ - + + + @@ -24,22 +27,27 @@ - + - + diff --git a/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml b/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml new file mode 100644 index 000000000..a2961b0f6 --- /dev/null +++ b/id/server/moa-id-commons/src/main/resources/moaid.migration.beans.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 04a7d51aa7b1ba3909f05ae36b7e54e4dabe22e1 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 17 Jul 2015 09:19:34 +0200 Subject: add 'nonce' attribute to OpenID Connect protocol --- .../moa/id/protocols/oauth20/OAuth20Constants.java | 1 + .../attributes/OAuth20AttributeBuilder.java | 29 +++++++---- .../oauth20/attributes/OpenIdNonceAttribute.java | 57 ++++++++++++++++++++++ .../oauth20/protocol/OAuth20AuthAction.java | 6 +-- .../oauth20/protocol/OAuth20AuthRequest.java | 20 +++++++- 5 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OpenIdNonceAttribute.java (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Constants.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Constants.java index 75501d812..b0736ff2e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Constants.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20Constants.java @@ -48,6 +48,7 @@ public final class OAuth20Constants { public static final String PARAM_RESPONSE_TYPE = "response_type"; public static final String PARAM_REDIRECT_URI = "redirect_uri"; public static final String PARAM_STATE = "state"; + public static final String PARAM_NONCE = "nonce"; public static final String PARAM_GRANT_TYPE = "grant_type"; public static final String PARAM_GRANT_TYPE_VALUE_AUTHORIZATION_CODE = "authorization_code"; public static final String PARAM_CLIENT_ID = "client_id"; diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java index 583120a86..439d08e0b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OAuth20AttributeBuilder.java @@ -30,6 +30,7 @@ import org.apache.commons.lang.StringUtils; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.data.IAuthData; import at.gv.egovernment.moa.id.protocols.oauth20.Pair; +import at.gv.egovernment.moa.id.protocols.oauth20.protocol.OAuth20AuthRequest; import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.BPKAttributeBuilder; import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.EIDAuthBlock; import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.EIDCcsURL; @@ -116,6 +117,7 @@ public final class OAuth20AttributeBuilder { buildersOpenId.add(new OpenIdIssueInstantAttribute()); buildersOpenId.add(new OpenIdAuthenticationTimeAttribute()); buildersOpenId.add(new OpenIdAudiencesAttribute()); + buildersOpenId.add(new OpenIdNonceAttribute()); // profile buildersProfile.add(new ProfileGivenNameAttribute()); @@ -173,10 +175,18 @@ public final class OAuth20AttributeBuilder { } private static void addAttibutes(final List builders, final JsonObject jsonObject, - final OAAuthParameter oaParam, final IAuthData authData) { + final OAAuthParameter oaParam, final IAuthData authData, OAuth20AuthRequest oAuthRequest) { for (IAttributeBuilder b : builders) { try { - Pair attribute = b.build(oaParam, authData, generator); + //TODO: better solution requires more refactoring :( + Pair attribute = null; + if (b instanceof OpenIdNonceAttribute) { + OpenIdNonceAttribute nonceBuilder = (OpenIdNonceAttribute) b; + attribute = nonceBuilder.build(oaParam, authData, oAuthRequest, generator); + + } else + attribute = b.build(oaParam, authData, generator); + if (attribute != null && !StringUtils.isEmpty(attribute.getSecond().getAsString())) { jsonObject.add(attribute.getFirst(), attribute.getSecond()); } @@ -188,33 +198,34 @@ public final class OAuth20AttributeBuilder { } public static void addScopeOpenId(final JsonObject jsonObject, - final OAAuthParameter oaParam, final IAuthData authData) { - addAttibutes(buildersOpenId, jsonObject, oaParam, authData); + final OAAuthParameter oaParam, final IAuthData authData, + final OAuth20AuthRequest oAuthRequest) { + addAttibutes(buildersOpenId, jsonObject, oaParam, authData, oAuthRequest); } public static void addScopeProfile(final JsonObject jsonObject, final OAAuthParameter oaParam, final IAuthData authData) { - addAttibutes(buildersProfile, jsonObject, oaParam, authData); + addAttibutes(buildersProfile, jsonObject, oaParam, authData, null); } public static void addScopeEID(final JsonObject jsonObject, final OAAuthParameter oaParam, final IAuthData authData) { - addAttibutes(buildersEID, jsonObject, oaParam, authData); + addAttibutes(buildersEID, jsonObject, oaParam, authData, null); } public static void addScopeEIDGov(final JsonObject jsonObject, final OAAuthParameter oaParam, final IAuthData authData) { - addAttibutes(buildersEIDGov, jsonObject, oaParam, authData); + addAttibutes(buildersEIDGov, jsonObject, oaParam, authData, null); } public static void addScopeMandate(final JsonObject jsonObject, final OAAuthParameter oaParam, final IAuthData authData) { - addAttibutes(buildersMandate, jsonObject, oaParam, authData); + addAttibutes(buildersMandate, jsonObject, oaParam, authData, null); } public static void addScopeSTORK(final JsonObject jsonObject, final OAAuthParameter oaParam, final IAuthData authData) { - addAttibutes(buildersSTORK, jsonObject, oaParam, authData); + addAttibutes(buildersSTORK, jsonObject, oaParam, authData, null); } /** diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OpenIdNonceAttribute.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OpenIdNonceAttribute.java new file mode 100644 index 000000000..6baa69b1e --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/attributes/OpenIdNonceAttribute.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + *******************************************************************************/ +package at.gv.egovernment.moa.id.protocols.oauth20.attributes; + +import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; +import at.gv.egovernment.moa.id.data.IAuthData; +import at.gv.egovernment.moa.id.protocols.oauth20.protocol.OAuth20AuthRequest; +import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.IAttributeBuilder; +import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.IAttributeGenerator; +import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.exceptions.AttributeException; +import at.gv.egovernment.moa.util.MiscUtil; + +public class OpenIdNonceAttribute implements IAttributeBuilder { + + public String getName() { + return "nonce"; + } + + public ATT build(OAAuthParameter oaParam, IAuthData authData, + IAttributeGenerator g) throws AttributeException { + return g.buildStringAttribute(this.getName(), "", null); + } + + public ATT build(OAAuthParameter oaParam, IAuthData authData, OAuth20AuthRequest oAuthRequest, + IAttributeGenerator g) throws AttributeException { + if (MiscUtil.isNotEmpty(oAuthRequest.getNonce())) + return g.buildStringAttribute(this.getName(), "", oAuthRequest.getNonce()); + else + return null; + } + + public ATT buildEmpty(IAttributeGenerator g) { + return g.buildEmptyAttribute(this.getName(), ""); + } + +} + diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java index 2a0d3b30f..df12c7fa9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthAction.java @@ -52,6 +52,7 @@ import at.gv.egovernment.moa.id.protocols.oauth20.json.OAuthSigner; import at.gv.egovernment.moa.id.storage.AssertionStorage; import at.gv.egovernment.moa.id.util.Random; import at.gv.egovernment.moa.logging.Logger; +import at.gv.egovernment.moa.util.MiscUtil; class OAuth20AuthAction implements IAction { @@ -126,8 +127,7 @@ class OAuth20AuthAction implements IAction { Map params = new HashMap(); params.put(OAuth20Constants.RESPONSE_ACCESS_TOKEN, accessToken); params.put(OAuth20Constants.RESPONSE_TOKEN_TYPE, OAuth20Constants.RESPONSE_TOKEN_TYPE_VALUE_BEARER); - params.put(OAuth20Constants.RESPONSE_EXPIRES_IN, OpenIdExpirationTimeAttribute.expirationTime); - + params.put(OAuth20Constants.RESPONSE_EXPIRES_IN, OpenIdExpirationTimeAttribute.expirationTime); // build id token and scope Pair pair = buildIdToken(auth20SessionObject.getScope(), oAuthRequest, authData); @@ -149,7 +149,7 @@ class OAuth20AuthAction implements IAction { StringBuilder resultScopes = new StringBuilder(); // always fill with open id - OAuth20AttributeBuilder.addScopeOpenId(token.getPayloadAsJsonObject(), oaParam, authData); + OAuth20AttributeBuilder.addScopeOpenId(token.getPayloadAsJsonObject(), oaParam, authData, oAuthRequest); resultScopes.append("openId"); for (String s : scope.split(" ")) { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java index 03b5d98f9..b5baa6a05 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/protocol/OAuth20AuthRequest.java @@ -46,7 +46,7 @@ import at.gv.egovernment.moa.id.protocols.pvp2x.builder.AttributQueryBuilder; import at.gv.egovernment.moa.id.protocols.pvp2x.builder.attributes.IAttributeBuilder; import at.gv.egovernment.moa.logging.Logger; -class OAuth20AuthRequest extends OAuth20BaseRequest { +public class OAuth20AuthRequest extends OAuth20BaseRequest { private static final long serialVersionUID = 1L; @@ -55,6 +55,7 @@ class OAuth20AuthRequest extends OAuth20BaseRequest { private String redirectUri; private String scope; private String clientID; + private String nonce; /** * @return the responseType @@ -131,6 +132,22 @@ class OAuth20AuthRequest extends OAuth20BaseRequest { this.clientID = clientID; } + + + /** + * @return the nonce + */ + public String getNonce() { + return nonce; + } + + /** + * @param nonce the nonce to set + */ + public void setNonce(String nonce) { + this.nonce = nonce; + } + @Override protected void populateSpecialParameters(HttpServletRequest request) throws OAuth20Exception { this.setResponseType(this.getParam(request, OAuth20Constants.PARAM_RESPONSE_TYPE, true)); @@ -138,6 +155,7 @@ class OAuth20AuthRequest extends OAuth20BaseRequest { this.setRedirectUri(this.getParam(request, OAuth20Constants.PARAM_REDIRECT_URI, true)); this.setClientID(this.getParam(request, OAuth20Constants.PARAM_CLIENT_ID, true)); this.setScope(this.getParam(request, OAuth20Constants.PARAM_SCOPE, false)); + this.setNonce(this.getParam(request, OAuth20Constants.PARAM_NONCE, false)); // check for response type if (!this.responseType.equals(OAuth20Constants.RESPONSE_CODE)) { -- cgit v1.2.3 From 9cf5a828582b61bd8944060c2bb3b409d92f5b48 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 17 Jul 2015 11:16:18 +0200 Subject: add CLI for 2.x -> 3.x configuration migration --- id/server/moa-id-commons/pom.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'id/server') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 591998185..ed18301df 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -317,6 +317,42 @@
+ + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + true + at.gv.egovernment.moa.id.commons.config.MigrateConfiguration + dependency-jars/ + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.5.1 + + + copy-dependencies + package + + copy-dependencies + + + + ${project.build.directory}/dependency-jars/ + + + + + + +