diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-12-10 07:39:27 +0100 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-12-10 07:39:27 +0100 |
commit | e443168b481bb88fecbad73084147e7e8c882908 (patch) | |
tree | 52812f6555c4efaaf84253a3fb068cd73ff08a30 /eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/DAO/eIDASPersonalIdStoreDAO.java | |
parent | 0224cdf7be78cf0778f0b832a42c18c480c4b784 (diff) | |
download | National_eIDAS_Gateway-e443168b481bb88fecbad73084147e7e8c882908.tar.gz National_eIDAS_Gateway-e443168b481bb88fecbad73084147e7e8c882908.tar.bz2 National_eIDAS_Gateway-e443168b481bb88fecbad73084147e7e8c882908.zip |
refactoring to new EGIZ code requirements
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/DAO/eIDASPersonalIdStoreDAO.java')
-rw-r--r-- | eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/DAO/eIDASPersonalIdStoreDAO.java | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/DAO/eIDASPersonalIdStoreDAO.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/DAO/eIDASPersonalIdStoreDAO.java deleted file mode 100644 index ae96f805..00000000 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/DAO/eIDASPersonalIdStoreDAO.java +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* - * Copyright 2018 A-SIT Plus GmbH - * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, - * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "License"); - * You may not use this work except in compliance with the License. - * You may obtain a copy of the License at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * 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.asitplus.eidas.specific.modules.authmodule_eIDASv2.DAO; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import at.gv.egiz.eaaf.core.impl.data.Pair; - -@Deprecated -public class eIDASPersonalIdStoreDAO { - public static final String NAME = "foreigneIDMap"; - - //Enum with all cols of this table - public enum COLS { - timestamp, transactionId, eidasId, eidasSourceCountry, eidasDestinationCountry, ernbId - } - - public enum T { - ID("INTEGER"), - BIGINT("VARCHAR(265)"), - URI("VARCHAR(256)"), - DATE("Long"), - TEXT("TEXT"), - Long("BIGINT"), - Int("INTEGER"), - BLOB("BLOB"), - CC("CHAR(2)"), - BOOL("INTEGER"); - - public String s_; - - private T(String s) { - s_ = s; - } - - @Override - public String toString() { - return s_; - } - } - - //define Cols of the table - public static final List<Pair<String, T>> TABLE_COLS; - static { - List<Pair<String, T>> cols = new ArrayList<Pair<String, T>>(); - cols.add(Pair.newInstance(COLS.timestamp.name(), T.DATE)); - cols.add(Pair.newInstance(COLS.transactionId.name(), T.TEXT)); - cols.add(Pair.newInstance(COLS.eidasId.name(), T.TEXT)); - cols.add(Pair.newInstance(COLS.eidasSourceCountry.name(), T.CC)); - cols.add(Pair.newInstance(COLS.eidasDestinationCountry.name(), T.CC)); - cols.add(Pair.newInstance(COLS.ernbId.name(), T.TEXT)); - - TABLE_COLS = Collections.unmodifiableList(cols); - - } - - public static final String CREATE = "CREATE TABLE " + NAME - + " (" + "id" + " " + T.ID.toString() - + " PRIMARY KEY AUTOINCREMENT, " + buildCreateTableQuery(TABLE_COLS) + ")"; - - public static final String INSERT = "INSERT INTO " + NAME - + "(" + buildInsertQueryKeys(TABLE_COLS) + ")" - + " VALUES (" + buildInsertQueryValues(TABLE_COLS) + ");"; - - public static final String SELECT_BY_ERNB_ID = "SELECT * FROM " + NAME - + " WHERE " + COLS.ernbId.name() + "=?;"; - - public static final String SELECT_BY_EIDAS_RAW_ID = "SELECT * FROM " + NAME - + " WHERE " + COLS.eidasId.name() + "=?" - + " and " + COLS.eidasSourceCountry.name() + "=?" + ";"; - - - /** - * Build a part of a SQL query, which contains the cols of a table that should be created - * - * @param cols List of DB col definitions {@link Pair} - * @return Part of a SQL query, which contains cols that should be created - */ - private static String buildCreateTableQuery(List<Pair<String, T>> cols) { - String sql = ""; - - for (Pair<String, T> el : cols) { - sql += el.getFirst() + " " + el.getSecond().toString() + ","; - - } - - return sql.substring(0, sql.length()-1); - } - - /** - * Build a part of a SQL query, which contains the cols keys of a table for insert operation - * - * @param cols List of DB col definitions {@link Pair} - * @return Part of a SQL query, which contains cols that should be created - */ - protected static String buildInsertQueryKeys(List<Pair<String, T>> cols) { - String sql = ""; - - for (Pair<String, T> el : cols) { - sql += el.getFirst() + ","; - - } - - return sql.substring(0, sql.length()-1); - } - - /** - * Build a part of a SQL query, which contains the cols values of a table for insert operation - * - * @param cols List of DB col definitions {@link Pair} - * @return Part of a SQL query, which contains cols that should be created - */ - protected static String buildInsertQueryValues(List<Pair<String, T>> cols) { - String sql = ""; - - for (Pair<String, T> el : cols) { - sql += "?,"; - - } - - return sql.substring(0, sql.length()-1); - } - -} |