diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-20 13:58:32 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-20 13:58:32 +0200 |
commit | 7b6f65663145b228991794d6390567fbb84dc9c0 (patch) | |
tree | 5b0cd320f861f2280bd8649b8164866af60616d7 /id/server/moa-id-commons/src | |
parent | 77a575c0489e3739c5b6184aa5a7d46c542c35f5 (diff) | |
download | moa-id-spss-7b6f65663145b228991794d6390567fbb84dc9c0.tar.gz moa-id-spss-7b6f65663145b228991794d6390567fbb84dc9c0.tar.bz2 moa-id-spss-7b6f65663145b228991794d6390567fbb84dc9c0.zip |
remove deprecated MOA-ID 2.x configuration DAO functionality
Diffstat (limited to 'id/server/moa-id-commons/src')
13 files changed, 1120 insertions, 2270 deletions
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 4f47efb78..ae481578a 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 @@ -34,55 +34,55 @@ import java.util.Iterator; 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.db.dao.config.deprecated.AttributeProviderPlugin; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.AuthComponentOA; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.BKUSelectionCustomizationType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.BKUURLS; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.BPKDecryption; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.CPEPS; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.ChainingModeType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.ChainingModes; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.ConnectionParameterClientAuthType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.Contact; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.DefaultBKUs; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.EncBPKInformation; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.ForeignIdentities; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.GeneralConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.IdentificationNumber; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.IdentityLinkSigners; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.InterfederationGatewayType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.InterfederationIDPType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.LegacyAllowed; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.MOAKeyBoxSelector; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.MOASP; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.Mandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OAOAUTH20; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OAPVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OASAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OASSO; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OASTORK; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OAStorkAttribute; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OAuth; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OnlineMandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.Organization; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.Protocols; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.SAML1; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.SSO; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.STORK; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.SecurityLayer; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.StorkAttribute; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TemplateType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TemplatesType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TestCredentials; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TimeOuts; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TransformsInfoType; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.VerifyAuthBlock; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.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; 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 399533d3f..762ae44a0 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 @@ -21,9 +21,9 @@ import org.springframework.transaction.annotation.Transactional; 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.id.commons.db.dao.config.deprecated.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.STORK; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; 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 5c14df671..3836d5a1e 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 @@ -1,403 +1,403 @@ -/******************************************************************************* - * 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.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; -import at.gv.egovernment.moa.logging.Logger; -import at.gv.egovernment.moa.util.MiscUtil; -//import org.apache.commons.lang.StringEscapeUtils; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * - * @author tlenz - * - * @deprecated - */ - -@SuppressWarnings("rawtypes") -public class ConfigurationDBRead { - - private static Map<String, String> QUERIES = new HashMap<String, String>(); - - static { - QUERIES.put("getActiveOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1'"); - QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix))"); - QUERIES.put("getOnlineApplicationWithDBID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id"); - QUERIES.put("getAllOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication"); - QUERIES.put("getAllActiveOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '1'"); - QUERIES.put("getAllNewOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1'"); - QUERIES.put("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration"); - QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id"); - QUERIES.put("getNewUserWithUserTokken", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken"); - QUERIES.put("getAllNewUsers", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '1'"); - QUERIES.put("getAllOpenUsersRequests", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is not null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0'"); - QUERIES.put("getUserWithUserBPKWBPK", "select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk"); - QUERIES.put("getUserWithUserUsername", "select userdatabase from UserDatabase userdatabase where userdatabase.username = :username"); - QUERIES.put("getAllUsers", "select userdatabase from UserDatabase userdatabase"); - QUERIES.put("getUsersWithOADBID", "select userdatabase from UserDatabase userdatabase inner join userdatabase.onlineApplication oa where oa.hjid = :id"); - QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id"); - } - -// public static OnlineApplication getActiveOnlineApplication(String id) { -// MiscUtil.assertNotNull(id, "OnlineApplictionID"); -// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); -// -// List result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID")); -// //query.setParameter("id", id+"%"); -// query.setParameter("id", StringEscapeUtils.escapeHtml4(id)); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.debug("No entries found."); -// return null; -// } -// -// if (result.size() > 1) { -// Logger.warn("OAIdentifier match to more then one DB-entry!"); -// return null; -// } -// -// return (OnlineApplication) result.get(0); -// } -// -// public static OnlineApplication getOnlineApplication(String id) { -// MiscUtil.assertNotNull(id, "OnlineApplictionID"); -// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); -// -// List result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID")); -// //query.setParameter("id", id+"%"); -// query.setParameter("id", id); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// if (result.size() > 1) { -// Logger.warn("OAIdentifier match to more then one DB-entry!"); -// return null; -// } -// -// return (OnlineApplication) result.get(0); -// } -// -// public static OnlineApplication getOnlineApplication(long dbid) { -// MiscUtil.assertNotNull(dbid, "OnlineApplictionID"); -// Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); -// -// List result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithDBID")); -// //query.setParameter("id", id+"%"); -// query.setParameter("id", dbid); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// return (OnlineApplication) result.get(0); -// } -// -// @JsonProperty("getMOAIDConfiguration") -// public static MOAIDConfiguration getMOAIDConfiguration() { -// Logger.trace("Load MOAID Configuration from database."); -// -// List<MOAIDConfiguration> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getMOAIDConfiguration")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found. Create fresh instance."); -// return null; -// } -// -// return (MOAIDConfiguration) result.get(0); -// } -// -// @JsonProperty("getAllOnlineApplications") -// public static List<OnlineApplication> getAllOnlineApplications() { -// Logger.trace("Get All OnlineApplications from database."); -// -// List<OnlineApplication> result = null; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOnlineApplications")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return result; -// } -// -// public static List<OnlineApplication> getAllNewOnlineApplications() { -// Logger.trace("Get All OnlineApplications from database."); -// -// List<OnlineApplication> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewOnlineApplications")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return result; -// } -// -// @JsonProperty("getAllUsers") -// public static List<UserDatabase> getAllUsers() { -// Logger.trace("Get All OnlineApplications from database."); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllUsers")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return result; -// } -// -// public static List<OnlineApplication> getAllActiveOnlineApplications() { -// Logger.trace("Get All active OnlineApplications from database."); -// -// List<OnlineApplication> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllActiveOnlineApplications")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// result = new ArrayList<OnlineApplication>(); -// -// } -// return result; -// } -// -// @SuppressWarnings("rawtypes") -// public static List<OnlineApplication> searchOnlineApplications(String id) { -// MiscUtil.assertNotNull(id, "OnlineApplictionID"); -// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); -// -// List<OnlineApplication> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsWithID")); -// query.setParameter("id", "%" + id + "%"); -// -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// -// return result; -// } -// -// public static UserDatabase getUserWithID(long id) { -// MiscUtil.assertNotNull(id, "UserID"); -// Logger.trace("Getting Userinformation with ID " + id + " from database."); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserID")); -// query.setParameter("id", id); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return (UserDatabase) result.get(0); -// } -// -// public static UserDatabase getUsersWithOADBID(long id) { -// MiscUtil.assertNotNull(id, "OADBID"); -// Logger.trace("Getting Userinformation with OADBID " + id + " from database."); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getUsersWithOADBID")); -// query.setParameter("id", id); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return (UserDatabase) result.get(0); -// } -// -// public static UserDatabase getUserWithUserName(String username) { -// MiscUtil.assertNotNull(username, "UserName"); -// Logger.trace("Getting Userinformation with ID " + username + " from database."); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserUsername")); -// query.setParameter("username", username); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return (UserDatabase) result.get(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. +// *******************************************************************************/ +//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; +//import at.gv.egovernment.moa.logging.Logger; +//import at.gv.egovernment.moa.util.MiscUtil; +////import org.apache.commons.lang.StringEscapeUtils; +// +//import com.fasterxml.jackson.annotation.JsonProperty; +// +///** +// * +// * @author tlenz +// * +// * @deprecated +// */ +// +//@SuppressWarnings("rawtypes") +//public class ConfigurationDBRead { +// +// private static Map<String, String> QUERIES = new HashMap<String, String>(); +// +// static { +// QUERIES.put("getActiveOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1'"); +// QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix))"); +// QUERIES.put("getOnlineApplicationWithDBID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id"); +// QUERIES.put("getAllOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication"); +// QUERIES.put("getAllActiveOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '1'"); +// QUERIES.put("getAllNewOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1'"); +// QUERIES.put("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration"); +// QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id"); +// QUERIES.put("getNewUserWithUserTokken", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken"); +// QUERIES.put("getAllNewUsers", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '1'"); +// QUERIES.put("getAllOpenUsersRequests", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is not null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0'"); +// QUERIES.put("getUserWithUserBPKWBPK", "select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk"); +// QUERIES.put("getUserWithUserUsername", "select userdatabase from UserDatabase userdatabase where userdatabase.username = :username"); +// QUERIES.put("getAllUsers", "select userdatabase from UserDatabase userdatabase"); +// QUERIES.put("getUsersWithOADBID", "select userdatabase from UserDatabase userdatabase inner join userdatabase.onlineApplication oa where oa.hjid = :id"); +// QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id"); // } // -// public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { -// MiscUtil.assertNotNull(bpkwbpk, "bpk/wbpk"); -// Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserBPKWBPK")); -// query.setParameter("bpk", bpkwbpk); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return (UserDatabase) result.get(0); -// } -// -// public static UserDatabase getNewUserWithTokken(String tokken) { -// MiscUtil.assertNotNull(tokken, "bpk/wbpk"); -// Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getNewUserWithUserTokken")); -// query.setParameter("tokken", tokken); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return (UserDatabase) result.get(0); -// } -// -// public static List<UserDatabase> getAllNewUsers() { -// Logger.trace("Get all new Users from Database"); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewUsers")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return result; -// } -// -// public static List<UserDatabase> getAllOpenUsersRequests() { -// Logger.trace("Get all new Users from Database"); -// -// List<UserDatabase> result; -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// -// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOpenUsersRequests")); -// result = query.getResultList(); -// -// Logger.trace("Found entries: " + result.size()); -// -// if (result.size() == 0) { -// Logger.trace("No entries found."); -// return null; -// } -// return result; -// } -} +//// public static OnlineApplication getActiveOnlineApplication(String id) { +//// MiscUtil.assertNotNull(id, "OnlineApplictionID"); +//// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); +//// +//// List result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID")); +//// //query.setParameter("id", id+"%"); +//// query.setParameter("id", StringEscapeUtils.escapeHtml4(id)); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.debug("No entries found."); +//// return null; +//// } +//// +//// if (result.size() > 1) { +//// Logger.warn("OAIdentifier match to more then one DB-entry!"); +//// return null; +//// } +//// +//// return (OnlineApplication) result.get(0); +//// } +//// +//// public static OnlineApplication getOnlineApplication(String id) { +//// MiscUtil.assertNotNull(id, "OnlineApplictionID"); +//// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); +//// +//// List result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID")); +//// //query.setParameter("id", id+"%"); +//// query.setParameter("id", id); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// +//// if (result.size() > 1) { +//// Logger.warn("OAIdentifier match to more then one DB-entry!"); +//// return null; +//// } +//// +//// return (OnlineApplication) result.get(0); +//// } +//// +//// public static OnlineApplication getOnlineApplication(long dbid) { +//// MiscUtil.assertNotNull(dbid, "OnlineApplictionID"); +//// Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); +//// +//// List result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithDBID")); +//// //query.setParameter("id", id+"%"); +//// query.setParameter("id", dbid); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// +//// return (OnlineApplication) result.get(0); +//// } +//// +//// @JsonProperty("getMOAIDConfiguration") +//// public static MOAIDConfiguration getMOAIDConfiguration() { +//// Logger.trace("Load MOAID Configuration from database."); +//// +//// List<MOAIDConfiguration> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getMOAIDConfiguration")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found. Create fresh instance."); +//// return null; +//// } +//// +//// return (MOAIDConfiguration) result.get(0); +//// } +//// +//// @JsonProperty("getAllOnlineApplications") +//// public static List<OnlineApplication> getAllOnlineApplications() { +//// Logger.trace("Get All OnlineApplications from database."); +//// +//// List<OnlineApplication> result = null; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOnlineApplications")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return result; +//// } +//// +//// public static List<OnlineApplication> getAllNewOnlineApplications() { +//// Logger.trace("Get All OnlineApplications from database."); +//// +//// List<OnlineApplication> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewOnlineApplications")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return result; +//// } +//// +//// @JsonProperty("getAllUsers") +//// public static List<UserDatabase> getAllUsers() { +//// Logger.trace("Get All OnlineApplications from database."); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllUsers")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return result; +//// } +//// +//// public static List<OnlineApplication> getAllActiveOnlineApplications() { +//// Logger.trace("Get All active OnlineApplications from database."); +//// +//// List<OnlineApplication> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllActiveOnlineApplications")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// result = new ArrayList<OnlineApplication>(); +//// +//// } +//// return result; +//// } +//// +//// @SuppressWarnings("rawtypes") +//// public static List<OnlineApplication> searchOnlineApplications(String id) { +//// MiscUtil.assertNotNull(id, "OnlineApplictionID"); +//// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); +//// +//// List<OnlineApplication> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsWithID")); +//// query.setParameter("id", "%" + id + "%"); +//// +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// +//// return result; +//// } +//// +//// public static UserDatabase getUserWithID(long id) { +//// MiscUtil.assertNotNull(id, "UserID"); +//// Logger.trace("Getting Userinformation with ID " + id + " from database."); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserID")); +//// query.setParameter("id", id); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return (UserDatabase) result.get(0); +//// } +//// +//// public static UserDatabase getUsersWithOADBID(long id) { +//// MiscUtil.assertNotNull(id, "OADBID"); +//// Logger.trace("Getting Userinformation with OADBID " + id + " from database."); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getUsersWithOADBID")); +//// query.setParameter("id", id); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return (UserDatabase) result.get(0); +//// } +//// +//// public static UserDatabase getUserWithUserName(String username) { +//// MiscUtil.assertNotNull(username, "UserName"); +//// Logger.trace("Getting Userinformation with ID " + username + " from database."); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserUsername")); +//// query.setParameter("username", username); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return (UserDatabase) result.get(0); +//// } +//// +//// public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { +//// MiscUtil.assertNotNull(bpkwbpk, "bpk/wbpk"); +//// Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserBPKWBPK")); +//// query.setParameter("bpk", bpkwbpk); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return (UserDatabase) result.get(0); +//// } +//// +//// public static UserDatabase getNewUserWithTokken(String tokken) { +//// MiscUtil.assertNotNull(tokken, "bpk/wbpk"); +//// Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getNewUserWithUserTokken")); +//// query.setParameter("tokken", tokken); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return (UserDatabase) result.get(0); +//// } +//// +//// public static List<UserDatabase> getAllNewUsers() { +//// Logger.trace("Get all new Users from Database"); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewUsers")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return result; +//// } +//// +//// public static List<UserDatabase> getAllOpenUsersRequests() { +//// Logger.trace("Get all new Users from Database"); +//// +//// List<UserDatabase> result; +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// +//// javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOpenUsersRequests")); +//// result = query.getResultList(); +//// +//// Logger.trace("Found entries: " + result.size()); +//// +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// return result; +//// } +//} diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java index d9f0267df..7f996cca7 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java @@ -1,233 +1,233 @@ -/******************************************************************************* - * 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.db; - -import java.util.Properties; - -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.EntityTransaction; -import javax.persistence.Persistence; - -import org.hibernate.HibernateException; - -import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.logging.Logger; - -public final class ConfigurationDBUtils { - - private static EntityManagerFactory entitymanagerfactory; - - @SuppressWarnings("rawtypes") - private static final ThreadLocal THREAD_LOCAL_CONFIG = new ThreadLocal(); - private static boolean automaticSessionHandling = false; - - protected ConfigurationDBUtils() { } - - public static void initHibernate(Properties props) throws MOADatabaseException { - - try { - - Logger.debug("Creating initial session factory..."); - - entitymanagerfactory = - Persistence.createEntityManagerFactory("at.gv.egovernment.moa.id.commons.db.dao.config", - props); - - Logger.debug("Initial ConfigDB session factory successfully created."); - - - } catch (Throwable ex) { - Logger.error("Initial session factory creation failed: " + ex.getMessage()); - throw new MOADatabaseException("Initialization of Configuration Hibernate session factory failed.",ex); - } - } - - -// /** -// * Checks if a session factory is currently available. If necessary a new -// * session factory is created. -// * -// * @return current (or new) session factory -// * @throws HibernateException -// * thrown if a hibernate error occurs -// */ -// public static EntityManager getCurrentSession() { -// if (automaticSessionHandling) { -// -// return entitymanagerfactory.createEntityManager(); -// } -// -// EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); -// -// if (session != null && session.isOpen()) { +///******************************************************************************* +// * 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.db; // -// //maybe a hack, but sometimes we do not know if the session is closed (session already closed but isOpen()=true) -// try { -// javax.persistence.Query query = session.createQuery("select userdatabase from UserDatabase userdatabase"); -// query.getResultList(); -// -// } catch (Throwable e) { -// Logger.warn("JPA Session Handling Warning!!!! - This error should not occur."); -// session = getNewSession(); -// } -// -// } else -// session = getNewSession(); -// -// return session; -// } +//import java.util.Properties; // -// @SuppressWarnings("unchecked") -// public static EntityManager getNewSession() { -// if (automaticSessionHandling) { -// Logger.warn("Session is being automatically handled by hibernate. Therefore this session maybe not being newly created. Use HibernateUtil.getCurrentSession() instead."); -// return entitymanagerfactory.createEntityManager(); -// } -// EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); -// if (session != null ) { -// Logger.warn("Previous session has not been closed; closing ConfigDB session now."); -// closeSession(); -// } -// Logger.debug("Opening new ConfigDB hibernate session..."); -// try { -// session = entitymanagerfactory.createEntityManager(); -// THREAD_LOCAL_CONFIG.set(session); -// } catch (HibernateException hex) { -// Logger.error(hex.getMessage()); -// } -// return session; -// } - - /** - * Closes the current session. - * - * @throws HibernateException - * thrown if session is already closed or a hibernate error - * occurs. - * - * @deprecated - */ -@SuppressWarnings("unchecked") -public static void closeSession() { - -} - -// /** -// * Closes the current session. -// * -// * @throws HibernateException -// * thrown if session is already closed or a hibernate error -// * occurs. -// */ -// @SuppressWarnings("unchecked") -// public static void closeSession() { -// if (automaticSessionHandling) { -// Logger.warn("Session is being automatically handled by hibernate. Therefore the current session cannot be closed on demand."); -// return; -// } -// Logger.debug("Closing current ConfigDB hibernate session..."); -// EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); -// THREAD_LOCAL_CONFIG.set(null); -// if (session != null) { -// try { -// session.close(); -// -// } catch (HibernateException hex) { -// Logger.error(hex.getMessage()); -// } -// } +//import javax.persistence.EntityManager; +//import javax.persistence.EntityManagerFactory; +//import javax.persistence.EntityTransaction; +//import javax.persistence.Persistence; +// +//import org.hibernate.HibernateException; +// +//import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +//import at.gv.egovernment.moa.logging.Logger; +// +//public final class ConfigurationDBUtils { +// +// private static EntityManagerFactory entitymanagerfactory; +// +// @SuppressWarnings("rawtypes") +// private static final ThreadLocal THREAD_LOCAL_CONFIG = new ThreadLocal(); +// private static boolean automaticSessionHandling = false; +// +// protected ConfigurationDBUtils() { } +// +// public static void initHibernate(Properties props) throws MOADatabaseException { +// +//// try { +//// +//// Logger.debug("Creating initial session factory..."); +//// +//// entitymanagerfactory = +//// Persistence.createEntityManagerFactory("at.gv.egovernment.moa.id.commons.db.dao.config", +//// props); +//// +//// Logger.debug("Initial ConfigDB session factory successfully created."); +//// +//// +//// } catch (Throwable ex) { +//// Logger.error("Initial session factory creation failed: " + ex.getMessage()); +//// throw new MOADatabaseException("Initialization of Configuration Hibernate session factory failed.",ex); +//// } // } // -// public static boolean save(Object dbo) throws MOADatabaseException { -// EntityTransaction tx = null; -// -// try { -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// tx = session.getTransaction(); -// -// synchronized (session) { -// tx.begin(); -// session.merge(dbo); -// tx.commit(); -// -// session.clear(); -// } -// return true; -// -// } catch(HibernateException e) { -// Logger.warn("Error during Config database saveOrUpdate. Rollback.", e); -// tx.rollback(); -// throw new MOADatabaseException(e); -// } -// } // +//// /** +//// * Checks if a session factory is currently available. If necessary a new +//// * session factory is created. +//// * +//// * @return current (or new) session factory +//// * @throws HibernateException +//// * thrown if a hibernate error occurs +//// */ +//// public static EntityManager getCurrentSession() { +//// if (automaticSessionHandling) { +//// +//// return entitymanagerfactory.createEntityManager(); +//// } +//// +//// EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); +//// +//// if (session != null && session.isOpen()) { +//// +//// //maybe a hack, but sometimes we do not know if the session is closed (session already closed but isOpen()=true) +//// try { +//// javax.persistence.Query query = session.createQuery("select userdatabase from UserDatabase userdatabase"); +//// query.getResultList(); +//// +//// } catch (Throwable e) { +//// Logger.warn("JPA Session Handling Warning!!!! - This error should not occur."); +//// session = getNewSession(); +//// } +//// +//// } else +//// session = getNewSession(); +//// +//// return session; +//// } +//// +//// @SuppressWarnings("unchecked") +//// public static EntityManager getNewSession() { +//// if (automaticSessionHandling) { +//// Logger.warn("Session is being automatically handled by hibernate. Therefore this session maybe not being newly created. Use HibernateUtil.getCurrentSession() instead."); +//// return entitymanagerfactory.createEntityManager(); +//// } +//// EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); +//// if (session != null ) { +//// Logger.warn("Previous session has not been closed; closing ConfigDB session now."); +//// closeSession(); +//// } +//// Logger.debug("Opening new ConfigDB hibernate session..."); +//// try { +//// session = entitymanagerfactory.createEntityManager(); +//// THREAD_LOCAL_CONFIG.set(session); +//// } catch (HibernateException hex) { +//// Logger.error(hex.getMessage()); +//// } +//// return session; +//// } +// +// /** +// * Closes the current session. +// * +// * @throws HibernateException +// * thrown if session is already closed or a hibernate error +// * occurs. +// * +// * @deprecated +// */ +//@SuppressWarnings("unchecked") +//public static void closeSession() { +// +//} +// +//// /** +//// * Closes the current session. +//// * +//// * @throws HibernateException +//// * thrown if session is already closed or a hibernate error +//// * occurs. +//// */ +//// @SuppressWarnings("unchecked") +//// public static void closeSession() { +//// if (automaticSessionHandling) { +//// Logger.warn("Session is being automatically handled by hibernate. Therefore the current session cannot be closed on demand."); +//// return; +//// } +//// Logger.debug("Closing current ConfigDB hibernate session..."); +//// EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get(); +//// THREAD_LOCAL_CONFIG.set(null); +//// if (session != null) { +//// try { +//// session.close(); +//// +//// } catch (HibernateException hex) { +//// Logger.error(hex.getMessage()); +//// } +//// } +//// } +//// +//// public static boolean save(Object dbo) throws MOADatabaseException { +//// EntityTransaction tx = null; +//// +//// try { +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// tx = session.getTransaction(); +//// +//// synchronized (session) { +//// tx.begin(); +//// session.merge(dbo); +//// tx.commit(); +//// +//// session.clear(); +//// } +//// return true; +//// +//// } catch(HibernateException e) { +//// Logger.warn("Error during Config database saveOrUpdate. Rollback.", e); +//// tx.rollback(); +//// throw new MOADatabaseException(e); +//// } +//// } +//// +//// +//// public static boolean saveOrUpdate(Object dbo) throws MOADatabaseException { +//// EntityTransaction tx = null; +//// +//// try { +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// tx = session.getTransaction(); +//// +//// synchronized (session) { +//// tx.begin(); +//// +//// session.merge(dbo); +//// session.flush(); +//// +//// tx.commit(); +//// +//// //session.clear(); +//// } +//// return true; +//// +//// } catch(HibernateException e) { +//// Logger.warn("Error during Config database saveOrUpdate. Rollback.", e); +//// tx.rollback(); +//// throw new MOADatabaseException(e); +//// } +//// } +//// +//// public static boolean delete(Object dbo) { +//// EntityTransaction tx = null; +//// try { +//// EntityManager session = ConfigurationDBUtils.getCurrentSession(); +//// tx = session.getTransaction(); +//// +//// synchronized (session) { +//// tx.begin(); +//// session.remove(session.contains(dbo) ? dbo : session.merge(dbo)); +//// tx.commit(); +//// } +//// +//// return true; +//// +//// } catch(HibernateException e) { +//// Logger.warn("Error during Config database delete. Rollback.", e); +//// tx.rollback(); +//// return false; +//// } +//// } // -// public static boolean saveOrUpdate(Object dbo) throws MOADatabaseException { -// EntityTransaction tx = null; -// -// try { -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// tx = session.getTransaction(); -// -// synchronized (session) { -// tx.begin(); -// -// session.merge(dbo); -// session.flush(); -// -// tx.commit(); -// -// //session.clear(); -// } -// return true; -// -// } catch(HibernateException e) { -// Logger.warn("Error during Config database saveOrUpdate. Rollback.", e); -// tx.rollback(); -// throw new MOADatabaseException(e); -// } -// } -// -// public static boolean delete(Object dbo) { -// EntityTransaction tx = null; -// try { -// EntityManager session = ConfigurationDBUtils.getCurrentSession(); -// tx = session.getTransaction(); -// -// synchronized (session) { -// tx.begin(); -// session.remove(session.contains(dbo) ? dbo : session.merge(dbo)); -// tx.commit(); -// } -// -// return true; -// -// } catch(HibernateException e) { -// Logger.warn("Error during Config database delete. Rollback.", e); -// tx.rollback(); -// return false; -// } -// } - -} +//} 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 8f6100f84..41c7008e9 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,450 +1,450 @@ -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 extends Iterable<?>> T nullGuard(T item) { - if (item == null) { - return (T) Collections.emptyList(); - } else { - return item; - } - - } - - public static Map<String, String> 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<UserDatabase> 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 extends Iterable<?>> T nullGuard(T item) { +// if (item == null) { +// return (T) Collections.emptyList(); +// } else { +// return item; +// } +// +// } +// +// public static Map<String, String> 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<UserDatabase> getAllUsers() { +// Logger.trace("Get All Users from database."); +// +//// // select userdatabase from UserDatabase userdatabase +//// List<UserDatabase> result = conf.getList("getAllUsers", UserDatabase.class); +//// if (result.size() == 0) { +//// Logger.trace("No entries found."); +//// return null; +//// } +//// +//// return result; +// +// //TODO!!! +// return null; +// } +// +// /** +// * +// * @return +// */ +// public static List<OnlineApplication> getAllOnlineApplications() { +// Logger.trace("Get All OnlineApplications from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +//// return conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); +// +// //TODO!!! +// return null; +// +// } +// +// /** +// * +// * @return +// */ +// public static List<OnlineApplication> getAllNewOnlineApplications() { +// Logger.trace("Get All New OnlineApplications from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' +// List<OnlineApplication> result = new ArrayList<OnlineApplication>(); +// List<OnlineApplication> 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<GenericConfiguration> genericConfigurations = (List<GenericConfiguration>) 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<OnlineApplication> getAllActiveOnlineApplications() { +// Logger.trace("Get All New OnlineApplications from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.isActive = '1' +// List<OnlineApplication> result = new ArrayList<OnlineApplication>(); +// List<OnlineApplication> 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<OnlineApplication> 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<OnlineApplication> 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<OnlineApplication> 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<OnlineApplication> searchOnlineApplications(String id) { +// Logger.trace("Getting OnlineApplication with ID " + id + " from database."); +// +// // select onlineapplication from OnlineApplication onlineapplication +// // where onlineapplication.friendlyName like :id +// List<OnlineApplication> result = new ArrayList<OnlineApplication>(); +// List<OnlineApplication> 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<UserDatabase> getAllOpenUsersRequests() { +// Logger.trace("Get all new Users from Database"); +// // // select userdatabase from UserDatabase userdatabase -// List<UserDatabase> result = conf.getList("getAllUsers", UserDatabase.class); +// // where userdatabase.userRequestTokken is not null +// // and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0' +// List<UserDatabase> result = new ArrayList<UserDatabase>(); +// List<UserDatabase> 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; - - //TODO!!! - return null; - } - - /** - * - * @return - */ - public static List<OnlineApplication> getAllOnlineApplications() { - Logger.trace("Get All OnlineApplications from database."); - - // select onlineapplication from OnlineApplication onlineapplication -// return conf.getList(MOAIDConfigurationConstants.ONLINE_APPLICATIONS_KEY, OnlineApplication.class); - - //TODO!!! - return null; - - } - - /** - * - * @return - */ - public static List<OnlineApplication> getAllNewOnlineApplications() { - Logger.trace("Get All New OnlineApplications from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1' - List<OnlineApplication> result = new ArrayList<OnlineApplication>(); - List<OnlineApplication> 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; - } - +// } +// +// /** +// * +// * @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<UserDatabase> 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<UserDatabase> 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 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<GenericConfiguration> genericConfigurations = (List<GenericConfiguration>) 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); +// 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<UserDatabase> allUsers = getAllUsers(); +// +// for (UserDatabase user : nullGuard(allUsers)) { +// if (user.getHjid() == id) { +// result = user; +// break; +// } +// } // // return result; // } - - /** - * - * @return - */ - public static List<OnlineApplication> getAllActiveOnlineApplications() { - Logger.trace("Get All New OnlineApplications from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.isActive = '1' - List<OnlineApplication> result = new ArrayList<OnlineApplication>(); - List<OnlineApplication> 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<OnlineApplication> 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<OnlineApplication> 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<OnlineApplication> 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<OnlineApplication> searchOnlineApplications(String id) { - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); - - // select onlineapplication from OnlineApplication onlineapplication - // where onlineapplication.friendlyName like :id - List<OnlineApplication> result = new ArrayList<OnlineApplication>(); - List<OnlineApplication> 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<UserDatabase> 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<UserDatabase> result = new ArrayList<UserDatabase>(); - List<UserDatabase> 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<UserDatabase> 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<UserDatabase> 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<UserDatabase> 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<UserDatabase> 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<UserDatabase> allUsers = getAllUsers(); - - for (UserDatabase user : nullGuard(allUsers)) { - if (user.getBpk().equals(bpkwbpk)) { - 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<UserDatabase> 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<UserDatabase> 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 f47b0c9e2..f62d2514f 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 @@ -165,7 +165,7 @@ public class DatabaseConfigPropertyImpl extends AbstractConfigurationImpl { 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); + log.trace("Found configuration property {}.", result); } else { log.debug("Unable to find configuration property for key '{}'.", 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 6325ada5f..1f7efd589 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 @@ -5,11 +5,6 @@ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> - <persistence-unit name="at.gv.egovernment.moa.id.commons.db.dao.config" transaction-type="RESOURCE_LOCAL"> - <provider>org.hibernate.ejb.HibernatePersistence</provider> - <class>at.gv.egovernment.moa.id.commons.config.persistence.dal.SOME_CLASS</class> - </persistence-unit> - <persistence-unit name="config" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty</class> diff --git a/id/server/moa-id-commons/src/main/resources/bindings.xjb b/id/server/moa-id-commons/src/main/resources/bindings.xjb index 21714849b..9d017d02e 100644 --- a/id/server/moa-id-commons/src/main/resources/bindings.xjb +++ b/id/server/moa-id-commons/src/main/resources/bindings.xjb @@ -1,4 +1,4 @@ -<jaxb:bindings version="2.1" +<!-- <jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" @@ -32,4 +32,4 @@ </hj:many-to-many> </jaxb:bindings> -</jaxb:bindings>
\ No newline at end of file +</jaxb:bindings> -->
\ No newline at end of file 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 deleted file mode 100644 index d4686bd5e..000000000 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_3.0.xsd +++ /dev/null @@ -1,1057 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Mit XMLSpy v2013 sp1 (http://www.altova.com) von Thomas Lenz (Graz University of Technology IAIK) bearbeitet --> -<xsd:schema xmlns="http://www.buergerkarte.at/namespaces/moaconfig#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" targetNamespace="http://www.buergerkarte.at/namespaces/moaconfig#" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0.0" jaxb:extensionBindingPrefixes="xjc hj" jaxb:version="2.0"> - <xsd:complexType name="OnlineApplication"> - <xsd:complexContent> - <xsd:extension base="OnlineApplicationType"> - <xsd:attribute name="publicURLPrefix" type="xsd:anyURI" use="required"/> - <xsd:attribute name="keyBoxIdentifier" type="MOAKeyBoxSelector" use="optional" default="SecureSignatureKeypair"/> - <xsd:attribute name="type" use="optional" default="publicService"> - <xsd:simpleType> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="businessService"/> - <xsd:enumeration value="publicService"/> - <xsd:enumeration value="storkService"/> - </xsd:restriction> - </xsd:simpleType> - </xsd:attribute> - <xsd:attribute name="calculateHPI" type="xsd:boolean" use="optional" default="false"/> - <xsd:attribute name="friendlyName" type="xsd:string" use="optional"/> - <xsd:attribute name="target" type="xsd:string" use="optional"/> - <xsd:attribute name="targetFriendlyName" type="xsd:string" use="optional"/> - <xsd:attribute name="storkSPTargetCountry" type="xsd:string" use="optional"/> - <xsd:attribute name="removeBPKFromAuthBlock" type="xsd:boolean" use="optional" default="false"/> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="Configuration"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="LoginType" type="LoginType" default="stateful"/> - <xsd:element name="Binding" minOccurs="0"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="full"/> - <xsd:enumeration value="userName"/> - <xsd:enumeration value="none"/> - </xsd:restriction> - </xsd:simpleType> - </xsd:element> - <xsd:choice> - <xsd:element ref="ParamAuth"/> - <xsd:element ref="BasicAuth"/> - <xsd:element ref="HeaderAuth"/> - </xsd:choice> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <!-- ### Identification elements ### --> - <xsd:complexType name="AbstractSimpleIdentificationType"> - <xsd:simpleContent> - <xsd:extension base="xsd:string"/> - </xsd:simpleContent> - </xsd:complexType> - <xsd:element name="AbstractSimpleIdentification" type="AttributeProviderPlugin"> - <xsd:annotation> - <xsd:documentation>possibility to include common austrian primary - keys in human readable way, english translation not available - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <!-- ### DSIG imports ### --> - <xsd:complexType name="X509IssuerSerialType"> - <xsd:sequence> - <xsd:element name="X509IssuerName" type="xsd:string"/> - <xsd:element name="X509SerialNumber" type="xsd:integer"/> - </xsd:sequence> - </xsd:complexType> - <!-- ### Imported STORK resources ### --> - <xsd:simpleType name="QualityAuthenticationAssuranceLevelType"> - <xsd:restriction base="xsd:integer"> - <xsd:minInclusive value="1"/> - <xsd:maxInclusive value="4"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:element name="QualityAuthenticationAssuranceLevel" type="QualityAuthenticationAssuranceLevelType"/> - <xsd:element name="AttributeValue" type="xsd:anyType"/> - <xsd:simpleType name="CountryCodeType"> - <xsd:restriction base="xsd:token"> - <xsd:pattern value="[A-Z]{2}"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:complexType name="StorkAttribute"> - <xsd:sequence> - <xsd:element name="name" type="xsd:string"/> - <xsd:element name="mandatory" type="xsd:boolean"/> - </xsd:sequence> - </xsd:complexType> - <xsd:simpleType name="LoginType"> - <xsd:restriction base="xsd:token"> - <xsd:enumeration value="stateless"/> - <xsd:enumeration value="stateful"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:element name="ParamAuth"> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="Parameter" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="Parameter"> - <xsd:complexType> - <xsd:attribute name="Name" type="xsd:token" use="required"/> - <xsd:attribute name="Value" type="MOAAuthDataType" use="required"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="BasicAuth"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="UserID" type="MOAAuthDataType"/> - <xsd:element name="Password" type="MOAAuthDataType"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="HeaderAuth"> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="Header" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="Header"> - <xsd:complexType> - <xsd:attribute name="Name" type="xsd:token" use="required"/> - <xsd:attribute name="Value" type="MOAAuthDataType" use="required"/> - </xsd:complexType> - </xsd:element> - <xsd:simpleType name="MOAAuthDataType"> - <xsd:restriction base="xsd:token"> - <xsd:enumeration value="MOAGivenName"/> - <xsd:enumeration value="MOAFamilyName"/> - <xsd:enumeration value="MOADateOfBirth"/> - <xsd:enumeration value="MOABPK"/> - <xsd:enumeration value="MOAWBPK"/> - <xsd:enumeration value="MOAPublicAuthority"/> - <xsd:enumeration value="MOABKZ"/> - <xsd:enumeration value="MOAQualifiedCertificate"/> - <xsd:enumeration value="MOAStammzahl"/> - <xsd:enumeration value="MOAIdentificationValueType"/> - <xsd:enumeration value="MOAIPAddress"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="MOAKeyBoxSelector"> - <xsd:restriction base="xsd:token"> - <xsd:enumeration value="SecureSignatureKeypair"/> - <xsd:enumeration value="CertifiedKeypair"/> - </xsd:restriction> - </xsd:simpleType> - <!--Konfiguration für Authentisierungs- und Proxy-Komponente und Online-Applikation --> - <xsd:element name="MOA-IDConfiguration"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="AuthComponent_General" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>enthält Parameter der - Authentisierungs-Komponente - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:complexContent> - <xsd:extension base="AuthComponentType"/> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="OnlineApplication" type="OnlineApplication" maxOccurs="unbounded"> - <xsd:annotation> - <xsd:documentation>enthält Parameter für die OA - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name="ChainingModes" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>spezifiziert den Algorithmus ("pkix" oder - "chaining") für die Zertifikatspfadvalidierung - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence minOccurs="0" maxOccurs="unbounded"> - <xsd:element name="TrustAnchor"> - <xsd:annotation> - <xsd:documentation>ein vom SystemDefaultMode abweichender - ChiningMode kann für jeden TrustAnchor gesetzt werden - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:complexContent> - <xsd:extension base="X509IssuerSerialType"> - <xsd:attribute name="mode" type="ChainingModeType" use="required"/> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="systemDefaultMode" type="ChainingModeType" use="optional" default="pkix"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="TrustedCACertificates" type="xsd:anyURI" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>verweist auf ein Verzeichnis, das - vertrauenswürdige CA (Zwischen-CA, Wurzel-CA) Zertifikate - enthält. - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name="GenericConfiguration" minOccurs="0" maxOccurs="unbounded"> - <xsd:complexType> - <xsd:attribute name="name" use="required"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="DirectoryCertStoreParameters.RootDir"/> - <xsd:enumeration value="AuthenticationSession.TimeOut"/> - <xsd:enumeration value="AuthenticationData.TimeOut"/> - <xsd:enumeration value="TrustManager.RevocationChecking"/> - <xsd:enumeration value="FrontendServlets.EnableHTTPConnection"/> - <xsd:enumeration value="FrontendServlets.DataURLPrefix"/> - <xsd:enumeration value="AuthenticationServer.KeepAssertion"/> - <xsd:enumeration value="AuthenticationServer.WriteAssertionToFile"/> - <xsd:enumeration value="AuthenticationServer.SourceID"/> - </xsd:restriction> - </xsd:simpleType> - </xsd:attribute> - <xsd:attribute name="value" type="xsd:string" use="required"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="DefaultBKUs"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="OnlineBKU" type="xsd:anyURI" minOccurs="0"/> - <xsd:element name="HandyBKU" type="xsd:anyURI"/> - <xsd:element name="LocalBKU" type="xsd:anyURI"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="SLRequestTemplates"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="OnlineBKU" type="xsd:anyURI"/> - <xsd:element name="HandyBKU" type="xsd:anyURI"/> - <xsd:element name="LocalBKU" type="xsd:anyURI"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="timestamp" type="xsd:dateTime"/> - <xsd:attribute name="pvp2refresh" type="xsd:dateTime"/> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="AuthComponentType"> - <xsd:sequence> - <xsd:element ref="GeneralConfiguration"/> - <xsd:element name="Protocols"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="SAML1" minOccurs="0"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="SourceID" type="xsd:string" minOccurs="0" maxOccurs="1"/> - </xsd:sequence> - <xsd:attribute name="isActive" type="xsd:boolean" default="false"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="PVP2" minOccurs="0"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="PublicURLPrefix" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/> - <xsd:element name="IssuerName" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/> - <xsd:element name="Organization"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="Name" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="DisplayName" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="URL" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element ref="Contact" minOccurs="1" maxOccurs="unbounded"/> - </xsd:sequence> - <xsd:attribute name="isActive" type="xsd:boolean" default="true"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="OAuth" minOccurs="0"> - <xsd:complexType> - <xsd:attribute name="isActive" type="xsd:boolean" default="true"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="LegacyAllowed"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="ProtocolName" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="SSO"> - <xsd:complexType> - <xsd:choice> - <xsd:element name="target" type="xsd:string"/> - <xsd:element ref="IdentificationNumber" minOccurs="1"/> - </xsd:choice> - <xsd:attribute name="PublicURL" type="xsd:string"/> - <xsd:attribute name="FriendlyName" type="xsd:string"/> - <xsd:attribute name="SpecialText" type="xsd:string"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="SecurityLayer"> - <xsd:annotation> - <xsd:documentation>enthält Parameter für die Kommunikation mit dem - Security-Layer - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="TransformsInfo" type="TransformsInfoType" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="MOA-SP"> - <xsd:annotation> - <xsd:documentation>enthaelt Konfiguratiosnparameter für die - Kommunikation mit dem MOA SP Modul - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="ConnectionParameter" type="ConnectionParameterClientAuthType" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>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 - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name="VerifyIdentityLink"> - <xsd:annotation> - <xsd:documentation>enthält Parameter für die Überprüfung der - Personenbindung - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="TrustProfileID"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="VerifyAuthBlock"> - <xsd:annotation> - <xsd:documentation>enthält Parameter für die Überprüfung des - AUTH-Blocks - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="TrustProfileID"/> - <xsd:element name="VerifyTransformsInfoProfileID" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="IdentityLinkSigners" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>enthält Informationen über akzeptierte Signers - des IdentityLinks - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="X509SubjectName" type="xsd:string" maxOccurs="unbounded"> - <xsd:annotation> - <xsd:documentation>akzeptierte Signer des IdentityLinks werden - per X509SubjectName (Kodierung nach RFC 2253) identifiziert - </xsd:documentation> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="ForeignIdentities" minOccurs="0"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="ConnectionParameter" type="ConnectionParameterClientAuthType"> - <xsd:annotation> - <xsd:documentation>Verbindungsparameter zum SZR-Gateway - (GetIdentityLink) - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element ref="STORK" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>Verbindungsparameter zu den Country-PEPS - (C-PEPS) - </xsd:documentation> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="OnlineMandates" minOccurs="0"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="ConnectionParameter" type="ConnectionParameterClientAuthType"> - <xsd:annotation> - <xsd:documentation>Verbindungsparameter zum - Online-Vollmachten-Service - </xsd:documentation> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="TransformsInfoType"> - <xsd:annotation> - <xsd:documentation>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 - </xsd:documentation> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="transformation" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - <xsd:attribute name="filename" type="xsd:anyURI" use="required"/> - </xsd:complexType> - <xsd:complexType name="TemplatesType"> - <xsd:sequence> - <xsd:element name="Template" type="TemplateType" minOccurs="0" maxOccurs="3"/> - <xsd:element name="AditionalAuthBlockText" type="xsd:string" minOccurs="0"/> - <xsd:element name="BKUSelectionCustomization" type="BKUSelectionCustomizationType" minOccurs="0" maxOccurs="1"/> - <xsd:element name="BKUSelectionTemplate" type="TransformsInfoType" minOccurs="0" maxOccurs="1"/> - <xsd:element name="SendAssertionTemplate" type="TransformsInfoType" minOccurs="0" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="TemplateType"> - <xsd:annotation> - <xsd:documentation>das Attribut URL spezifiziert die Lage des - Templates - </xsd:documentation> - </xsd:annotation> - <xsd:attribute name="URL" type="xsd:anyURI" use="required"/> - </xsd:complexType> - <xsd:complexType name="VerifyInfoboxesType"> - <xsd:annotation> - <xsd:documentation>Verifikation zusaetzlicher Infoboxen - </xsd:documentation> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="DefaultTrustProfile" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>Optionales DefaultTrustprofil für die - Überprüfung aller weiteren Infoboxen - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="TrustProfileID"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="SchemaLocationType"> - <xsd:annotation> - <xsd:documentation>Spezifiziert die Lage von XML Schemas - </xsd:documentation> - </xsd:annotation> - <xsd:sequence> - <xsd:element name="Schema" maxOccurs="unbounded"> - <xsd:complexType> - <xsd:attribute name="namespace" type="xsd:anyURI" use="required"/> - <xsd:attribute name="schemaLocation" type="xsd:anyURI" use="required"/> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="InterfederationGatewayType"> - <xsd:sequence> - <xsd:element name="forwardIDPIdentifier" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="forwardProtocolIdentifer" type="xsd:string" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="InterfederationIDPType"> - <xsd:sequence> - <xsd:element name="attributeQueryURL" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="storeSSOSession" type="xsd:boolean" default="true" minOccurs="1" maxOccurs="1"/> - <xsd:element name="performPassivRequest" type="xsd:boolean" default="true" minOccurs="1" maxOccurs="1"/> - <xsd:element name="performLocalAuthenticationOnError" type="xsd:boolean" default="true" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - <xsd:attribute name="inboundSSO" type="xsd:boolean" default="true"/> - <xsd:attribute name="outboundSSO" type="xsd:boolean" default="true"/> - </xsd:complexType> - <xsd:complexType name="OnlineApplicationType"> - <xsd:sequence> - <xsd:element name="isNew" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"> - <xsd:annotation> - <xsd:appinfo> - <hj:ignored/> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="isActive" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/> - <xsd:element name="isAdminRequired" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isInterfederationIDP" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="InterfederationIDP" type="InterfederationIDPType" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isInterfederationGateway" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="InterfederationGateway" type="InterfederationGatewayType" minOccurs="0" maxOccurs="1"/> - <xsd:element name="AuthComponent_OA" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>enthält Parameter über die OA, die die - Authentisierungs-Komponente betreffen - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="BKUURLS"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="OnlineBKU" type="xsd:anyURI" minOccurs="1"/> - <xsd:element name="HandyBKU" type="xsd:anyURI" minOccurs="1"/> - <xsd:element name="LocalBKU" type="xsd:anyURI" minOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element ref="IdentificationNumber" minOccurs="0"/> - <xsd:element name="Templates" type="TemplatesType" minOccurs="0"/> - <xsd:element name="TransformsInfo" type="TransformsInfoType" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="Mandates" minOccurs="0"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="Profiles" type="xsd:string"/> - <xsd:element name="ProfileName" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="testCredentials" minOccurs="0" maxOccurs="1"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="credentialOID" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - <xsd:attribute name="enableTestCredentials" type="xsd:boolean" default="false"/> - </xsd:complexType> - </xsd:element> - <xsd:element ref="OA_STORK" minOccurs="0"/> - <xsd:element name="OA_SSO" minOccurs="0"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="UseSSO" type="xsd:boolean"/> - <xsd:element name="AuthDataFrame" type="xsd:boolean" default="true"/> - <xsd:element name="SingleLogOutURL" type="xsd:anyURI"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element ref="OA_SAML1" minOccurs="0"/> - <xsd:element ref="OA_PVP2" minOccurs="0"/> - <xsd:element ref="OA_OAUTH20" minOccurs="0"/> - <xsd:element ref="EncBPKInformation" minOccurs="0" maxOccurs="1"/> - </xsd:sequence> - <!--xsd:element ref="pr:AbstractSimpleIdentification" minOccurs="0" - maxOccurs="1"/ --> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:element name="EncBPKInformation"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="bPKDecryption" minOccurs="0" maxOccurs="1"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="keyInformation" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/> - <xsd:element name="iv" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/> - <xsd:element name="keyStoreFileName" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="keyAlias" type="xsd:string" minOccurs="0" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="bPKEncryption" minOccurs="0" maxOccurs="unbounded"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="publicKey" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/> - <xsd:element name="target" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="vkz" type="xsd:string" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="ConnectionParameterServerAuthType"> - <xsd:sequence> - <xsd:element name="AcceptedServerCertificates" type="xsd:anyURI" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>URL zu einem Verzeichnis, das akzeptierte - Server-Zertifikate der TLS-Verbindung enthält (keine - CA-Zertifikate) - </xsd:documentation> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="URL" type="xsd:anyURI" use="required"/> - </xsd:complexType> - <xsd:complexType name="ConnectionParameterClientAuthType"> - <xsd:complexContent> - <xsd:extension base="ConnectionParameterServerAuthType"> - <xsd:sequence> - <xsd:element name="ClientKeyStore" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>URL zu einem KeyStore, der den privaten - Schlüssel, der für die TLS-Client-Authentisierung verwendet - wird, enthält - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:anyURI"> - <xsd:attribute name="password" type="xsd:string" use="optional"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - </xsd:sequence> - </xsd:extension> - </xsd:complexContent> - </xsd:complexType> - <xsd:element name="TrustProfileID" type="xsd:string"/> - <xsd:simpleType name="ChainingModeType"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="chaining"/> - <xsd:enumeration value="pkix"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="BKUSelectionType"> - <xsd:restriction base="xsd:token"> - <xsd:enumeration value="HTMLComplete"/> - <xsd:enumeration value="HTMLSelect"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:element name="CompatibilityMode" default="false"> - <xsd:simpleType> - <xsd:restriction base="xsd:boolean"/> - </xsd:simpleType> - </xsd:element> - <xsd:element name="EnableInfoboxValidator" default="true"> - <xsd:simpleType> - <xsd:restriction base="xsd:boolean"/> - </xsd:simpleType> - </xsd:element> - <xsd:element name="AlwaysShowForm" default="false"> - <xsd:annotation> - <xsd:documentation>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 - </xsd:documentation> - </xsd:annotation> - <xsd:simpleType> - <xsd:restriction base="xsd:boolean"/> - </xsd:simpleType> - </xsd:element> - <xsd:complexType name="InputProcessorType"> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute name="template" type="xsd:anyURI" use="optional"> - <xsd:annotation> - <xsd:documentation>Das Attribut spezifiziert die Lage des - Templates, welches der InputProcessor zur Darstellung des - Eingabeformulars nutzen soll - </xsd:documentation> - </xsd:annotation> - </xsd:attribute> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - <xsd:complexType name="PartyRepresentationType"> - <xsd:sequence> - <xsd:element name="InputProcessor" type="InputProcessorType" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>Default InputProcessor. Konfiguration eines vom - Standardprozess abweichenden Verarbeitungsvorgangs bei der - beruflichen Parteienvertretung. Der Wert dieses Elements ist der - vollständige Klassenname des InputProzessors - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element ref="AlwaysShowForm" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>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 - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name="ConnectionParameter" type="ConnectionParameterClientAuthType" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>Default Verbindungsparameter zum SZR-Gateway - (für den EGIZ-Demonstrator im internen Netzwerk: - https://129.27.142.5:8443/szr-gateway/services/MandateCreation) - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element name="PartyRepresentative" type="PartyRepresentativeType" minOccurs="0" maxOccurs="unbounded"> - <xsd:annotation> - <xsd:documentation>Falls keine speziellen beruflichen - ParteienvertreterInnen definiert sind (Element kommt nicht vor), - werden ausschließlich standardisierte Vollmachten mit einer - MandateID="*" akzeptiert - </xsd:documentation> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="PartyRepresentativeType"> - <xsd:sequence> - <xsd:element name="InputProcessor" type="InputProcessorType" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>Konfiguration eines vom Standardprozess - abweichenden Verarbeitungsvorgangs bei der beruflichen - Parteienvertretung. Der Wert dieses Elements ist der vollständige - Klassenname des InputProzessors - </xsd:documentation> - </xsd:annotation> - </xsd:element> - <xsd:element ref="AlwaysShowForm" minOccurs="0"/> - <xsd:element name="ConnectionParameter" type="ConnectionParameterClientAuthType" minOccurs="0"> - <xsd:annotation> - <xsd:documentation>Optionale Verbindungsparameter zu speziellem - (SZR-)Gateway - </xsd:documentation> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - <xsd:attribute name="oid" use="required"> - <xsd:annotation> - <xsd:documentation>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 - </xsd:documentation> - </xsd:annotation> - </xsd:attribute> - <xsd:attribute name="representPhysicalParty" use="optional" default="false"> - <xsd:annotation> - <xsd:documentation>Legt fest, ob berufliche Parteienvertretung für - natürliche Personen erlaubt ist - </xsd:documentation> - </xsd:annotation> - <xsd:simpleType> - <xsd:restriction base="xsd:boolean"/> - </xsd:simpleType> - </xsd:attribute> - <xsd:attribute name="representCorporateParty" use="optional" default="false"> - <xsd:annotation> - <xsd:documentation>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) - </xsd:documentation> - </xsd:annotation> - <xsd:simpleType> - <xsd:restriction base="xsd:boolean"/> - </xsd:simpleType> - </xsd:attribute> - <xsd:attribute name="representationText" use="optional"> - <xsd:annotation> - <xsd:documentation>Beschreibender Text, der an Stelle des - Standardtexts bei der Signatur der Anmeldedaten im Falle einer - vorliegenden beruflichen Parteienvertretung zur Signatur vorgelegt - wird - </xsd:documentation> - </xsd:annotation> - </xsd:attribute> - </xsd:complexType> - <xsd:complexType name="SignatureCreationParameterType"> - <xsd:annotation> - <xsd:documentation>Enthaelt Informationen zu einem KeyStore bzw. Key - zur STORK SAML AuthnRequest Signaturerstellung - </xsd:documentation> - </xsd:annotation> - <xsd:sequence> - <xsd:element ref="KeyStore"/> - <xsd:element ref="KeyName"/> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="SignatureVerificationParameterType"> - <xsd:annotation> - <xsd:documentation>Enthaelt Informationen zur Verfikation von - Signaturen einer STORK SAML Response - </xsd:documentation> - </xsd:annotation> - <xsd:sequence> - <xsd:element ref="TrustProfileID"/> - </xsd:sequence> - </xsd:complexType> - <xsd:element name="SAMLSigningParameter"> - <xsd:annotation> - <xsd:documentation>Enthält Informationen zur Erstellung und - Verifikation von STORK SAML Messages - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="SignatureCreationParameter" type="SignatureCreationParameterType"/> - <xsd:element name="SignatureVerificationParameter" type="SignatureVerificationParameterType"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="KeyStore"> - <xsd:annotation> - <xsd:documentation>URL zu einem KeyStore, der den privaten Schlüssel - zum Erstellen einer Signatur enthält - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:anyURI"> - <xsd:attribute name="password" type="xsd:string" use="optional"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="KeyName"> - <xsd:annotation> - <xsd:documentation>Name zum Key eines KeyStores, der den privaten - Schlüssel zum Erstellen einer Signatur darstellt - - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute name="password" type="xsd:string" use="optional"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="C-PEPS"> - <xsd:annotation> - <xsd:documentation>Enthält Informationen zu einem Citizen Country - PEPS (C-PEPS) - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="AttributeValue" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element ref="OA_STORK" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - <xsd:attribute name="countryCode" type="CountryCodeType" use="required"/> - <xsd:attribute name="URL" type="xsd:anyURI" use="required"/> - <xsd:attribute name="supportsXMLSignature" type="xsd:boolean" default="true"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="STORK"> - <xsd:annotation> - <xsd:documentation>Contains STORK related information - </xsd:documentation> - </xsd:annotation> - <xsd:complexType> - <xsd:choice> - <xsd:sequence> - <xsd:element ref="C-PEPS" maxOccurs="unbounded"/> - <xsd:element ref="SAMLSigningParameter"/> - </xsd:sequence> - <xsd:sequence> - <xsd:element ref="QualityAuthenticationAssuranceLevel" minOccurs="0"/> - </xsd:sequence> - <xsd:sequence> - <xsd:element ref="Attributes" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:choice> - </xsd:complexType> - </xsd:element> - <xsd:element name="OA_SAML1"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="isActive" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="provideStammzahl" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/> - <xsd:element name="provideAUTHBlock" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/> - <xsd:element name="provideIdentityLink" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/> - <xsd:element name="provideCertificate" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/> - <xsd:element name="provideFullMandatorData" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/> - <xsd:element name="useCondition" type="xsd:boolean" minOccurs="0" maxOccurs="1"/> - <xsd:element name="conditionLength" type="xsd:integer" minOccurs="0" maxOccurs="1"/> - <xsd:element name="sourceID" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="provideAllErrors" type="xsd:boolean" default="true" minOccurs="0" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="OA_PVP2"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="metadataURL" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/> - <xsd:element name="certificate" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/> - <xsd:element name="updateRequired" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="GeneralConfiguration"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="TimeOuts"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="Assertion" type="xsd:integer" minOccurs="1" maxOccurs="1"/> - <xsd:element name="MOASessionCreated" type="xsd:integer" minOccurs="1" maxOccurs="1"/> - <xsd:element name="MOASessionUpdated" type="xsd:integer" minOccurs="1" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="AlternativeSourceID" type="xsd:string"/> - <xsd:element name="CertStoreDirectory" type="xsd:anyURI"/> - <xsd:element name="TrustManagerRevocationChecking" type="xsd:boolean" default="true"/> - <xsd:element name="PublicURLPreFix" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="OA_OAUTH20"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="oAuthClientId" type="xsd:string"/> - <xsd:element name="oAuthClientSecret" type="xsd:string"/> - <xsd:element name="oAuthRedirectUri" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="IdentificationNumber"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="Type" type="xsd:string"/> - <xsd:element name="Value" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="OA_STORK"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="StorkLogonEnabled" type="xsd:boolean" default="true"/> - <xsd:element ref="Qaa" minOccurs="0" maxOccurs="1"/> - <xsd:element ref="OAAttributes" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="VidpEnabled" type="xsd:boolean" default="false"/> - <xsd:element ref="AttributeProviders" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="requireConsent" type="xsd:boolean" default="true"/> - <xsd:element ref="C-PEPS" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="Contact"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="SurName" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="GivenName" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="Mail" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/> - <xsd:element name="Type" minOccurs="1" maxOccurs="1"> - <xsd:simpleType> - <xsd:restriction base="xsd:token"> - <xsd:enumeration value="technical"/> - <xsd:enumeration value="support"/> - <xsd:enumeration value="administrative"/> - <xsd:enumeration value="billing"/> - <xsd:enumeration value="other"/> - </xsd:restriction> - </xsd:simpleType> - </xsd:element> - <xsd:element name="Company" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="Phone" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:complexType name="UserDatabase"> - <xsd:sequence> - <xsd:element name="bpk" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="familyname" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="givenname" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="institut" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="mail" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="phone" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="username" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="password" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="password_salt" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="userRequestTokken" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isActive" type="xsd:boolean" default="true" minOccurs="1" maxOccurs="1"/> - <xsd:element name="isAdmin" type="xsd:boolean" default="true" minOccurs="1" maxOccurs="1"/> - <xsd:element name="isUsernamePasswordAllowed" type="xsd:boolean" default="true" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isMandateUser" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isMailAddressVerified" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isAdminRequest" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - <xsd:element name="isPVP2Generated" type="xsd:boolean" minOccurs="0" maxOccurs="1"/> - <xsd:element name="lastLogin" type="xsd:string" minOccurs="1" maxOccurs="1"/> - <xsd:element name="OnlineApplication" type="OnlineApplication" minOccurs="0" maxOccurs="unbounded"/> - <xsd:element name="onlyBusinessService" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"> - <xsd:annotation> - <xsd:appinfo> - <hj:ignored/> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - <xsd:element name="businessServiceType" type="xsd:string" minOccurs="0" maxOccurs="1"> - <xsd:annotation> - <xsd:appinfo> - <hj:ignored/> - </xsd:appinfo> - </xsd:annotation> - </xsd:element> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="BKUSelectionCustomizationType"> - <xsd:sequence> - <xsd:element name="FontType" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="BackGroundColor" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="FrontColor" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="HeaderBackGroundColor" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="HeaderFrontColor" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="HeaderText" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="ButtonBackGroundColor" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="ButtonBackGroundColorFocus" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="ButtonFontColor" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="AppletRedirectTarget" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="AppletHeight" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="AppletWidth" type="xsd:string" minOccurs="0" maxOccurs="1"/> - <xsd:element name="MandateLoginButton" type="xsd:boolean" default="true" minOccurs="0" maxOccurs="1"/> - <xsd:element name="OnlyMandateLoginAllowed" type="xsd:boolean" default="false" minOccurs="0" maxOccurs="1"/> - </xsd:sequence> - </xsd:complexType> - <xsd:complexType name="AttributeProviderPlugin"> - <xsd:sequence> - <xsd:element name="name" type="xsd:string"/> - <xsd:element name="url" type="xsd:anyURI"/> - <xsd:element name="attributes" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - <xsd:element name="AttributeProviders" type="AttributeProviderPlugin"/> - <xsd:element name="Attributes" type="StorkAttribute"/> - <xsd:element name="Qaa" type="QualityAuthenticationAssuranceLevelType"/> - <xsd:complexType name="OAStorkAttribute"> - <xsd:sequence> - <xsd:element name="mandatory" type="xsd:boolean"/> - <xsd:element name="name" type="xsd:string"/> - </xsd:sequence> - </xsd:complexType> - <xsd:element name="OAAttributes" type="OAStorkAttribute"/> -</xsd:schema> diff --git a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml_old b/id/server/moa-id-commons/src/main/resources/configuration.beans.xml_old deleted file mode 100644 index b3e7526d0..000000000 --- a/id/server/moa-id-commons/src/main/resources/configuration.beans.xml_old +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:context="http://www.springframework.org/schema/context" - xmlns:tx="http://www.springframework.org/schema/tx" - xmlns:aop="http://www.springframework.org/schema/aop" - xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - 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"> - - <tx:annotation-driven /> - <context:annotation-config /> - - <context:property-placeholder location="${location}"/> - - - <bean id="configPropertyDao" - class="at.gv.egovernment.moa.id.commons.db.dao.config.DatabaseConfigPropertyImpl" /> - - <bean id="config" class="at.gv.egovernment.moa.id.commons.config.persistence.MOAIDConfigurationImpl"> - <property name="configPropertyDao" ref="configPropertyDao" /> - </bean> - - <bean id="configRead" class="at.gv.egovernment.moa.id.commons.db.NewConfigurationDBRead"/> - - <bean id="configWrite" class="at.gv.egovernment.moa.id.commons.db.NewConfigurationDBWrite"/> - - <bean id="moaidauthconfig" class="at.gv.egovernment.moa.id.config.auth.PropertyBasedAuthConfigurationProvider" - - <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" lazy-init="true" destroy-method="close"> - <aop:scoped-proxy/> - <property name="driverClassName" value="${dataSource.driverClassName}" /> - <property name="url" value="${dataSource.url}"/> - <property name="username" value="${dataSource.username}" /> - <property name="password" value="${dataSource.password}" /> - <property name="testOnBorrow" value="true" /> - <property name="validationQuery" value="SELECT 1" /> - </bean> - - - <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> - <property name="showSql" value="true" /> - <property name="generateDdl" value="${jpaVendorAdapter.generateDdl}" /> - <property name="databasePlatform" value="${jpaVendorAdapter.databasePlatform}" /> - </bean> - - - <bean name="moaidconf" id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> - <property name="dataSource" ref="dataSource" /> - <property name="jpaVendorAdapter" ref="jpaVendorAdapter" /> - <property name="persistenceUnitName" value="config" /> - </bean> - - <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> - <property name="entityManagerFactory" ref="entityManagerFactory" /> - </bean> - -</beans>
\ No newline at end of file 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 index a2961b0f6..a0923c03f 100644 --- 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 @@ -29,11 +29,6 @@ <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="true" /> <property name="generateDdl" value="${jpaVendorAdapter.generateDdl}" /> -<!-- <property name="generateDdl"> - <bean class="java.lang.Boolean"> - <constructor-arg value="${jpaVendorAdapter.generateDdl}"/> - </bean> - </property> --> <property name="databasePlatform" value="${hibernate.dialect}" /> </bean> 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 deleted file mode 100644 index d9adc4394..000000000 --- a/id/server/moa-id-commons/src/main/resources/persistence_template.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd -http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <!-- <persistence-unit name="##generated"> --> - - <persistence-unit name="config" transaction-type="RESOURCE_LOCAL"> - <provider>org.hibernate.ejb.HibernatePersistence</provider> - <class>at.gv.egovernment.moa.id.commons.db.dao.config.ConfigProperty</class> - <properties> - </properties> - </persistence-unit> - <!-- <class>at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase</class> --> - -<!-- <properties> - C3p0 connection pooling configuration - <property name="hibernate.connection.provider_class" value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"/> - <property name="hibernate.connection.provider_class" value="org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider"/> - <property name="acquireRetryDelay" value="5000"/> - <property name="breakAfterAcquireFailure" value="true"/> - <property name="checkoutTimeout" value="1"/> - <property name="testConnectionOnCheckin" value="1" /> - </properties> --> - <!-- </persistence-unit> --> -</persistence> 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 896a26064..563959582 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 @@ -83,7 +83,7 @@ // migrateDatabase(methodNames); // // // close the session with the old database -// ConfigurationDBUtils.closeSession(); +// // } // // @Test |