From 91c4afdfdc3a2561e97195ce34494c58b6e2e367 Mon Sep 17 00:00:00 2001 From: Simon Laurenz Date: Wed, 9 Feb 2022 17:12:02 +0100 Subject: [PATCH 01/20] Added sql creation scripts for postgres db --- .../db/sql/001_create_batch_list_table.sql | 21 +++++++++ .../db/sql/002_create_configuration_table.sql | 18 +++++++ ...3_create_last_updated_trigger_function.sql | 19 ++++++++ .../db/sql/004_create_hashes_table.sql | 47 +++++++++++++++++++ .../db/sql/005_create_info_table.sql | 17 +++++++ .../db/sql/006_create_partitions_table.sql | 26 ++++++++++ .../007_create_revocation_list_json_table.sql | 18 +++++++ .../db/sql/008_create_slices_table.sql | 25 ++++++++++ .../db/sql/009_create_coordinate_view.sql | 23 +++++++++ .../resources/db/sql/010_create_kid_view.sql | 40 ++++++++++++++++ .../db/sql/011_create_point_view.sql | 22 +++++++++ .../db/sql/012_create_vector_view.sql | 23 +++++++++ .../sql/013_create_set_new_etag_function.sql | 38 +++++++++++++++ .../sql/014_load_boundries_configuration.sql | 5 ++ .../db/sql/015_create_schedlock_table.sql | 21 +++++++++ .../db/sql/016_create_rd_changelog_table.sql | 28 +++++++++++ .../017_create_rd_changelog_lock_table.sql | 19 ++++++++ 17 files changed, 410 insertions(+) create mode 100644 src/main/resources/db/sql/001_create_batch_list_table.sql create mode 100644 src/main/resources/db/sql/002_create_configuration_table.sql create mode 100644 src/main/resources/db/sql/003_create_last_updated_trigger_function.sql create mode 100644 src/main/resources/db/sql/004_create_hashes_table.sql create mode 100644 src/main/resources/db/sql/005_create_info_table.sql create mode 100644 src/main/resources/db/sql/006_create_partitions_table.sql create mode 100644 src/main/resources/db/sql/007_create_revocation_list_json_table.sql create mode 100644 src/main/resources/db/sql/008_create_slices_table.sql create mode 100644 src/main/resources/db/sql/009_create_coordinate_view.sql create mode 100644 src/main/resources/db/sql/010_create_kid_view.sql create mode 100644 src/main/resources/db/sql/011_create_point_view.sql create mode 100644 src/main/resources/db/sql/012_create_vector_view.sql create mode 100644 src/main/resources/db/sql/013_create_set_new_etag_function.sql create mode 100644 src/main/resources/db/sql/014_load_boundries_configuration.sql create mode 100644 src/main/resources/db/sql/015_create_schedlock_table.sql create mode 100644 src/main/resources/db/sql/016_create_rd_changelog_table.sql create mode 100644 src/main/resources/db/sql/017_create_rd_changelog_lock_table.sql diff --git a/src/main/resources/db/sql/001_create_batch_list_table.sql b/src/main/resources/db/sql/001_create_batch_list_table.sql new file mode 100644 index 0000000..76b83d9 --- /dev/null +++ b/src/main/resources/db/sql/001_create_batch_list_table.sql @@ -0,0 +1,21 @@ +-- Table: public.batch_list + +-- DROP TABLE IF EXISTS public.batch_list; + +CREATE TABLE IF NOT EXISTS public.batch_list +( + batch_id character varying(36) COLLATE pg_catalog."default" NOT NULL, + country character varying(2) COLLATE pg_catalog."default" NOT NULL, + expires timestamp with time zone NOT NULL, + kid character varying(12) COLLATE pg_catalog."default", + type character varying(255) COLLATE pg_catalog."default" NOT NULL, + created_at timestamp with time zone, + CONSTRAINT batch_list_pkey PRIMARY KEY (batch_id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.batch_list + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/002_create_configuration_table.sql b/src/main/resources/db/sql/002_create_configuration_table.sql new file mode 100644 index 0000000..cb5419f --- /dev/null +++ b/src/main/resources/db/sql/002_create_configuration_table.sql @@ -0,0 +1,18 @@ +-- Table: public.configuration + +-- DROP TABLE IF EXISTS public.configuration; + +CREATE TABLE IF NOT EXISTS public.configuration +( + key text COLLATE pg_catalog."default" NOT NULL, + value text COLLATE pg_catalog."default", + value2 text COLLATE pg_catalog."default", + CONSTRAINT configuration_pkey PRIMARY KEY (key) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.configuration + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/003_create_last_updated_trigger_function.sql b/src/main/resources/db/sql/003_create_last_updated_trigger_function.sql new file mode 100644 index 0000000..c46806b --- /dev/null +++ b/src/main/resources/db/sql/003_create_last_updated_trigger_function.sql @@ -0,0 +1,19 @@ +-- FUNCTION: public.set_last_updated_function() + +-- DROP FUNCTION IF EXISTS public.set_last_updated_function(); + +CREATE OR REPLACE FUNCTION public.set_last_updated_function() + RETURNS trigger + LANGUAGE 'plpgsql' + COST 100 + VOLATILE NOT LEAKPROOF +AS $BODY$ +BEGIN + NEW.last_updated := NOW(); + + RETURN NEW; +END; +$BODY$; + +ALTER FUNCTION public.set_last_updated_function() + OWNER TO postgres; diff --git a/src/main/resources/db/sql/004_create_hashes_table.sql b/src/main/resources/db/sql/004_create_hashes_table.sql new file mode 100644 index 0000000..4c180d4 --- /dev/null +++ b/src/main/resources/db/sql/004_create_hashes_table.sql @@ -0,0 +1,47 @@ +-- Table: public.hashes + +-- DROP TABLE IF EXISTS public.hashes; + +CREATE TABLE IF NOT EXISTS public.hashes +( + hash character varying(255) COLLATE pg_catalog."default" NOT NULL, + batch_id character varying(36) COLLATE pg_catalog."default", + kid character varying(12) COLLATE pg_catalog."default", + updated boolean, + x character(1) COLLATE pg_catalog."default" NOT NULL, + y character(1) COLLATE pg_catalog."default" NOT NULL, + z character(1) COLLATE pg_catalog."default" NOT NULL, + last_updated timestamp with time zone DEFAULT now(), + CONSTRAINT hashes_pkey PRIMARY KEY (hash), + CONSTRAINT fk_batch_id FOREIGN KEY (batch_id) + REFERENCES public.batch_list (batch_id) MATCH SIMPLE + ON UPDATE NO ACTION + ON DELETE SET NULL + NOT VALID +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.hashes + OWNER to postgres; +-- Index: fki_fk_batch_id + +-- DROP INDEX IF EXISTS public.fki_fk_batch_id; + +CREATE INDEX IF NOT EXISTS fki_fk_batch_id + ON public.hashes USING btree + (batch_id COLLATE pg_catalog."default" ASC NULLS LAST) + TABLESPACE pg_default; + +-- Trigger: set_last_updated_trigger + +-- DROP TRIGGER IF EXISTS set_last_updated_trigger ON public.hashes; + +CREATE TRIGGER set_last_updated_trigger + BEFORE UPDATE + ON public.hashes + FOR EACH ROW + WHEN (new.updated IS TRUE OR new.batch_id IS NULL) + EXECUTE PROCEDURE public.set_last_updated_function(); \ No newline at end of file diff --git a/src/main/resources/db/sql/005_create_info_table.sql b/src/main/resources/db/sql/005_create_info_table.sql new file mode 100644 index 0000000..26c1a3c --- /dev/null +++ b/src/main/resources/db/sql/005_create_info_table.sql @@ -0,0 +1,17 @@ +-- Table: public.info + +-- DROP TABLE IF EXISTS public.info; + +CREATE TABLE IF NOT EXISTS public.info +( + key text COLLATE pg_catalog."default" NOT NULL, + value text COLLATE pg_catalog."default", + CONSTRAINT info_pkey PRIMARY KEY (key) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.info + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/006_create_partitions_table.sql b/src/main/resources/db/sql/006_create_partitions_table.sql new file mode 100644 index 0000000..bf20564 --- /dev/null +++ b/src/main/resources/db/sql/006_create_partitions_table.sql @@ -0,0 +1,26 @@ +-- Table: public.partitions + +-- DROP TABLE IF EXISTS public.partitions; + +CREATE TABLE IF NOT EXISTS public.partitions +( + db_id bigint NOT NULL DEFAULT nextval('partitions_db_id_seq'::regclass), + etag text COLLATE pg_catalog."default" NOT NULL, + kid text COLLATE pg_catalog."default" NOT NULL, + partition_id text COLLATE pg_catalog."default", + x text COLLATE pg_catalog."default", + y text COLLATE pg_catalog."default", + z text COLLATE pg_catalog."default", + expired timestamp with time zone, + lastupdated timestamp with time zone, + to_be_deleted boolean, + chunks_json_data jsonb, + CONSTRAINT partitions_pkey PRIMARY KEY (db_id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.partitions + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/007_create_revocation_list_json_table.sql b/src/main/resources/db/sql/007_create_revocation_list_json_table.sql new file mode 100644 index 0000000..4afbe7c --- /dev/null +++ b/src/main/resources/db/sql/007_create_revocation_list_json_table.sql @@ -0,0 +1,18 @@ +-- Table: public.revocation_list_json + +-- DROP TABLE IF EXISTS public.revocation_list_json; + +CREATE TABLE IF NOT EXISTS public.revocation_list_json +( + etag text COLLATE pg_catalog."default" NOT NULL, + created_at timestamp with time zone, + json_data jsonb, + CONSTRAINT revocation_list_json_pkey PRIMARY KEY (etag) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.revocation_list_json + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/008_create_slices_table.sql b/src/main/resources/db/sql/008_create_slices_table.sql new file mode 100644 index 0000000..476e6a0 --- /dev/null +++ b/src/main/resources/db/sql/008_create_slices_table.sql @@ -0,0 +1,25 @@ +-- Table: public.slices + +-- DROP TABLE IF EXISTS public.slices; + +CREATE TABLE IF NOT EXISTS public.slices +( + db_id bigint NOT NULL DEFAULT nextval('partitions_db_id_seq'::regclass), + etag text COLLATE pg_catalog."default" NOT NULL, + kid text COLLATE pg_catalog."default" NOT NULL, + partition_id text COLLATE pg_catalog."default", + chunk text COLLATE pg_catalog."default", + hash text COLLATE pg_catalog."default", + expired timestamp with time zone, + lastupdated timestamp with time zone, + to_be_deleted boolean, + slice_binary_data bytea, + CONSTRAINT slices_pkey PRIMARY KEY (db_id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.slices + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/009_create_coordinate_view.sql b/src/main/resources/db/sql/009_create_coordinate_view.sql new file mode 100644 index 0000000..383c1c6 --- /dev/null +++ b/src/main/resources/db/sql/009_create_coordinate_view.sql @@ -0,0 +1,23 @@ +-- View: public.coordinate_view + +-- DROP VIEW public.coordinate_view; + +CREATE OR REPLACE VIEW public.coordinate_view + AS + SELECT row_number() OVER ()::text AS row_id, + hashes.kid, + max(date_trunc('minute'::text, batch_list.expires))::timestamp with time zone AS expired, + max(hashes.last_updated) AS lastupdated, + array_agg(DISTINCT hashes.hash) AS hashes, + hashes.z::text AS chunk, + concat(hashes.x, hashes.y) AS partition_id, + hashes.x::text AS x, + hashes.y::text AS y + FROM hashes + LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text + GROUP BY hashes.kid, hashes.x, hashes.y, hashes.z, (date_trunc('minute'::text, batch_list.expires)) + ORDER BY hashes.kid, (concat(hashes.x, hashes.y)), (hashes.z::text), (date_trunc('minute'::text, batch_list.expires)); + +ALTER TABLE public.coordinate_view + OWNER TO postgres; + diff --git a/src/main/resources/db/sql/010_create_kid_view.sql b/src/main/resources/db/sql/010_create_kid_view.sql new file mode 100644 index 0000000..084a2dd --- /dev/null +++ b/src/main/resources/db/sql/010_create_kid_view.sql @@ -0,0 +1,40 @@ +-- View: public.kid_view + +-- DROP VIEW public.kid_view; + +CREATE OR REPLACE VIEW public.kid_view + AS + WITH configuration AS ( + SELECT + CASE + WHEN configuration_1.key = 'POINTLIMIT'::text THEN 'POINT'::text + WHEN configuration_1.key = 'VECTORLIMIT'::text THEN 'VECTOR'::text + WHEN configuration_1.key = 'COORDINATELIMIT'::text THEN 'COORDINATE'::text + ELSE NULL::text + END AS storage_mode, + to_number(configuration_1.value, '99999'::text) AS minlimit, + to_number(configuration_1.value2, '99999'::text) AS maxlimit + FROM public.configuration configuration_1 + WHERE configuration_1.key = ANY (ARRAY['POINTLIMIT'::text, 'VECTORLIMIT'::text, 'COORDINATELIMIT'::text]) + ) + SELECT a.kid, + a.hashtypes, + configuration.storage_mode, + a.lastupdated, + a.expired, + a.updated + FROM ( SELECT hashes.kid, + count(*) AS c, + array_to_string(array_agg(DISTINCT batch_list.type), ','::text) AS hashtypes, + bool_or(hashes.updated) AS updated, + max(batch_list.expires) AS expired, + max(hashes.last_updated) AS lastupdated + FROM hashes + LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text + GROUP BY hashes.kid) a, + configuration + WHERE a.c::numeric >= configuration.minlimit AND a.c::numeric <= configuration.maxlimit; + +ALTER TABLE public.kid_view + OWNER TO postgres; + diff --git a/src/main/resources/db/sql/011_create_point_view.sql b/src/main/resources/db/sql/011_create_point_view.sql new file mode 100644 index 0000000..d58c89e --- /dev/null +++ b/src/main/resources/db/sql/011_create_point_view.sql @@ -0,0 +1,22 @@ +-- View: public.point_view + +-- DROP VIEW public.point_view; + +CREATE OR REPLACE VIEW public.point_view + AS + SELECT row_number() OVER ()::text AS row_id, + hashes.kid, + max(date_trunc('minute'::text, batch_list.expires))::timestamp with time zone AS expired, + max(hashes.last_updated) AS lastupdated, + array_agg(DISTINCT hashes.hash) AS hashes, + hashes.x::text AS chunk, + NULL::text AS partition_id, + NULL::text AS x, + NULL::text AS y + FROM hashes + LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text + GROUP BY hashes.kid, hashes.x, (date_trunc('minute'::text, batch_list.expires)); + +ALTER TABLE public.point_view + OWNER TO postgres; + diff --git a/src/main/resources/db/sql/012_create_vector_view.sql b/src/main/resources/db/sql/012_create_vector_view.sql new file mode 100644 index 0000000..bfcff4c --- /dev/null +++ b/src/main/resources/db/sql/012_create_vector_view.sql @@ -0,0 +1,23 @@ +-- View: public.vector_view + +-- DROP VIEW public.vector_view; + +CREATE OR REPLACE VIEW public.vector_view + AS + SELECT row_number() OVER ()::text AS row_id, + hashes.kid, + max(date_trunc('minute'::text, batch_list.expires))::timestamp with time zone AS expired, + max(hashes.last_updated) AS lastupdated, + array_agg(DISTINCT hashes.hash) AS hashes, + hashes.y::text AS chunk, + hashes.x::text AS partition_id, + hashes.x::text AS x, + NULL::text AS y + FROM hashes + LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text + GROUP BY hashes.kid, hashes.x, hashes.y, (date_trunc('minute'::text, batch_list.expires)) + ORDER BY hashes.kid, (hashes.x::text), NULL::text, (date_trunc('minute'::text, batch_list.expires)); + +ALTER TABLE public.vector_view + OWNER TO postgres; + diff --git a/src/main/resources/db/sql/013_create_set_new_etag_function.sql b/src/main/resources/db/sql/013_create_set_new_etag_function.sql new file mode 100644 index 0000000..2bdee6f --- /dev/null +++ b/src/main/resources/db/sql/013_create_set_new_etag_function.sql @@ -0,0 +1,38 @@ +-- FUNCTION: public.set_new_etag(text) + +-- DROP FUNCTION IF EXISTS public.set_new_etag(text); + +CREATE OR REPLACE FUNCTION public.set_new_etag( + new_etag text) + RETURNS integer + LANGUAGE 'plpgsql' + COST 100 + VOLATILE PARALLEL UNSAFE +AS $BODY$ + BEGIN + -- Update etag in info table + INSERT INTO info (key, value) + VALUES('CURRENTETAG', new_etag) + ON CONFLICT (key) + DO UPDATE SET value = EXCLUDED.value; + + -- Delete old slices and partitions + DELETE FROM partitions WHERE to_be_deleted=true; + DELETE FROM slices WHERE to_be_deleted=true; + + -- Update etag field of slices and partitions + Update partitions SET etag = new_etag; + Update slices SET etag = new_etag; + + -- Update etag in info table + INSERT INTO info (key, value) + VALUES('CURRENTETAG', new_etag) + ON CONFLICT (key) + DO UPDATE SET value = EXCLUDED.value; + + RETURN 1; + END; +$BODY$; + +ALTER FUNCTION public.set_new_etag(text) + OWNER TO postgres; diff --git a/src/main/resources/db/sql/014_load_boundries_configuration.sql b/src/main/resources/db/sql/014_load_boundries_configuration.sql new file mode 100644 index 0000000..cc5aaf1 --- /dev/null +++ b/src/main/resources/db/sql/014_load_boundries_configuration.sql @@ -0,0 +1,5 @@ +-- Load boundries for different mode types into configuration table + +INSERT INTO public.configuration (key, value, value2) VALUES ('POINTLIMIT', '0', '1000'); +INSERT INTO public.configuration (key, value, value2) VALUES ('VECTORLIMIT', '1001', '16000'); +INSERT INTO public.configuration (key, value, value2) VALUES ('COORDINATELIMIT', '16001', '999999999'); \ No newline at end of file diff --git a/src/main/resources/db/sql/015_create_schedlock_table.sql b/src/main/resources/db/sql/015_create_schedlock_table.sql new file mode 100644 index 0000000..0f87bbd --- /dev/null +++ b/src/main/resources/db/sql/015_create_schedlock_table.sql @@ -0,0 +1,21 @@ +-- Table: public.shedlock_rd + +-- DROP TABLE IF EXISTS public.shedlock_rd; + +CREATE TABLE IF NOT EXISTS public.shedlock_rd +( + id bigint NOT NULL DEFAULT nextval('shedlock_rd_id_seq'::regclass), + lock_until timestamp without time zone NOT NULL, + locked_at timestamp without time zone NOT NULL, + locked_by character varying(255) COLLATE pg_catalog."default" NOT NULL, + name character varying(64) COLLATE pg_catalog."default" NOT NULL, + CONSTRAINT shedlock_rd_pkey PRIMARY KEY (id), + CONSTRAINT uk_2ad9gyjxfy85r5k5yssh63e63 UNIQUE (name) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.shedlock_rd + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/016_create_rd_changelog_table.sql b/src/main/resources/db/sql/016_create_rd_changelog_table.sql new file mode 100644 index 0000000..58cbded --- /dev/null +++ b/src/main/resources/db/sql/016_create_rd_changelog_table.sql @@ -0,0 +1,28 @@ +-- Table: public.rd_changelog + +-- DROP TABLE IF EXISTS public.rd_changelog; + +CREATE TABLE IF NOT EXISTS public.rd_changelog +( + id character varying(255) COLLATE pg_catalog."default" NOT NULL, + author character varying(255) COLLATE pg_catalog."default" NOT NULL, + filename character varying(255) COLLATE pg_catalog."default" NOT NULL, + dateexecuted timestamp without time zone NOT NULL, + orderexecuted integer NOT NULL, + exectype character varying(10) COLLATE pg_catalog."default" NOT NULL, + md5sum character varying(35) COLLATE pg_catalog."default", + description character varying(255) COLLATE pg_catalog."default", + comments character varying(255) COLLATE pg_catalog."default", + tag character varying(255) COLLATE pg_catalog."default", + liquibase character varying(20) COLLATE pg_catalog."default", + contexts character varying(255) COLLATE pg_catalog."default", + labels character varying(255) COLLATE pg_catalog."default", + deployment_id character varying(10) COLLATE pg_catalog."default" +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.rd_changelog + OWNER to postgres; \ No newline at end of file diff --git a/src/main/resources/db/sql/017_create_rd_changelog_lock_table.sql b/src/main/resources/db/sql/017_create_rd_changelog_lock_table.sql new file mode 100644 index 0000000..8faa3ba --- /dev/null +++ b/src/main/resources/db/sql/017_create_rd_changelog_lock_table.sql @@ -0,0 +1,19 @@ +-- Table: public.rd_changelog_lock + +-- DROP TABLE IF EXISTS public.rd_changelog_lock; + +CREATE TABLE IF NOT EXISTS public.rd_changelog_lock +( + id integer NOT NULL, + locked boolean NOT NULL, + lockgranted timestamp without time zone, + lockedby character varying(255) COLLATE pg_catalog."default", + CONSTRAINT rd_changelog_lock_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE IF EXISTS public.rd_changelog_lock + OWNER to postgres; \ No newline at end of file From 03e5a20fde91d8374b07a79616addcedba7d8cde Mon Sep 17 00:00:00 2001 From: Simon Laurenz Date: Wed, 9 Feb 2022 17:21:39 +0100 Subject: [PATCH 02/20] Added file header --- .../client/IssuanceDgciRestClient.java | 4 +-- .../client/IssuanceDgciRestClientConfig.java | 5 ++-- .../config/DgcConfigProperties.java | 4 +-- .../config/ErrorHandler.java | 4 +-- .../config/OpenApiConfig.java | 4 +-- .../config/SchedulerConfig.java | 4 +-- .../config/ShedLockConfig.java | 4 +-- .../controller/LookupController.java | 24 +++++++++++++++--- .../controller/RevocationListController.java | 4 +-- .../dto/ChunkMetaViewDto.java | 20 +++++++++++++++ .../dto/DidAuthentication.java | 4 +-- .../dto/DidDocument.java | 4 +-- .../dto/PartitionChunksJsonItemDto.java | 20 +++++++++++++++ .../dto/PartitionResponseDto.java | 20 +++++++++++++++ .../dto/RevocationCheckTokenPayload.java | 20 +++++++++++++++ .../dto/RevocationListJsonResponseDto.java | 20 +++++++++++++++ .../dto/SliceDataDto.java | 20 +++++++++++++++ .../entity/AbstractChunkMetaViewEntity.java | 20 +++++++++++++++ .../entity/BatchListEntity.java | 20 +++++++++++++++ .../entity/CoordinateViewEntity.java | 20 +++++++++++++++ .../entity/HashesEntity.java | 20 +++++++++++++++ .../entity/InfoEntity.java | 25 +++++++++++++++---- .../entity/KidViewEntity.java | 20 +++++++++++++++ .../entity/PartitionEntity.java | 20 +++++++++++++++ .../entity/PointViewEntity.java | 20 +++++++++++++++ .../entity/RevocationListJsonEntity.java | 20 +++++++++++++++ .../entity/ShedlockEntity.java | 4 +-- .../entity/SliceEntity.java | 20 +++++++++++++++ .../entity/VectorViewEntity.java | 20 +++++++++++++++ .../exception/DataNotFoundException.java | 20 +++++++++++++++ .../PreconditionFailedException.java | 20 +++++++++++++++ .../exception/TokenValidationException.java | 20 +++++++++++++++ .../mapper/CoordinateViewMapper.java | 4 +-- .../mapper/PartitionListMapper.java | 4 +-- .../mapper/PointViewMapper.java | 4 +-- .../mapper/VectorViewMapper.java | 4 +-- .../model/ChangeList.java | 4 +-- .../model/ChangeListItem.java | 4 +-- .../repository/BatchListRepository.java | 20 +++++++++++++++ .../repository/CoordinateViewRepository.java | 20 +++++++++++++++ .../repository/HashesRepository.java | 20 +++++++++++++++ .../repository/InfoRepository.java | 20 +++++++++++++++ .../repository/KidViewRepository.java | 20 +++++++++++++++ .../repository/PartitionRepository.java | 21 +++++++++++++++- .../repository/PointViewRepository.java | 20 +++++++++++++++ .../repository/ReadOnlyRepository.java | 20 +++++++++++++++ .../RevocationListJsonRepository.java | 20 +++++++++++++++ .../repository/SliceRepository.java | 20 +++++++++++++++ .../repository/VectorViewRepository.java | 20 +++++++++++++++ .../service/GeneratorService.java | 20 +++++++++++++++ .../service/InfoService.java | 20 +++++++++++++++ .../service/LookupService.java | 20 +++++++++++++++ .../service/RevocationCheckTokenParser.java | 20 +++++++++++++++ ...ocationListDownloadServiceGatewayImpl.java | 4 +-- .../service/RevocationListService.java | 20 +++++++++++++++ .../service/SliceCalculationService.java | 20 +++++++++++++++ ...liceCalculationServiceBloomFilterImpl.java | 20 +++++++++++++++ .../utils/HelperFunctions.java | 20 +++++++++++++++ 58 files changed, 836 insertions(+), 47 deletions(-) diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java b/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java index 4033947..0362bba 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-validation-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java b/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java index 6cb5346..e81fa10 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-validation-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ * ---license-end */ - package europa.ec.dgc.revocationdistribution.client; import feign.Client; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java b/src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java index 0ae726d..678dc82 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-validation-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java b/src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java index 44ab719..6e4b1aa 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-gateway + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java b/src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java index b95c8bc..75fac2c 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java @@ -1,8 +1,8 @@ /*- * ---license-start - * European Digital COVID Certificate Booking Demo / dgca-booking-demo-backend + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java b/src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java index 1816fc7..3f93a11 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-validation-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java b/src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java index 82bff9f..12b08dc 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-validation-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java b/src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java index ceb5478..35a4f3f 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java @@ -1,7 +1,26 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.controller; import europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; -import europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto; import europa.ec.dgc.revocationdistribution.service.LookupService; import java.security.PublicKey; import java.util.ArrayList; @@ -9,14 +28,11 @@ import javax.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java b/src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java index 92ad29a..cc46d4d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-businessrule-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java index 8068e56..1a013f7 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.dto; import java.time.ZonedDateTime; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java index aa17d86..e8ab735 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Issuance Service / dgca-issuance-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java index 93a9a03..de90212 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Issuance Service / dgca-issuance-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java index 9f584a4..a15de5d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java index 414ee9b..7656a3d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java index ca54e0b..447f78f 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.dto; import java.util.List; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java index c939871..1940c19 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java b/src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java index 11847d2..7e7064b 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.dto; import lombok.AllArgsConstructor; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java index 378c772..bd439e8 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import com.vladmihalcea.hibernate.type.array.StringArrayType; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java index 0b06983..f5db47b 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java index b01c6e8..7fe522c 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Entity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java index 0aa6e4d..b5c8c17 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Column; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java index d38e3df..a62f2a3 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java @@ -1,7 +1,25 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; -import com.vladmihalcea.hibernate.type.array.StringArrayType; -import java.time.ZonedDateTime; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -10,9 +28,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.hibernate.annotations.TypeDef; -import org.hibernate.annotations.TypeDefs; -import org.springframework.data.annotation.Immutable; @Getter @Setter diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java index ac78a09..d02437e 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import java.time.ZonedDateTime; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java index 8a63657..33ec29c 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java index 2177a5e..7664a67 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Column; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java index 08e08d4..b304f5e 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import com.vladmihalcea.hibernate.type.json.JsonBinaryType; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java index 1216873..2738bc6 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-verifier-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java index 3113c36..90c95cd 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import com.fasterxml.jackson.annotation.JsonFormat; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java b/src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java index ce376c9..65f33cc 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Entity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java b/src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java index d44f596..942b569 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.exception; public class DataNotFoundException extends RuntimeException{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java b/src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java index 15c28b8..be7fd50 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.exception; public class PreconditionFailedException extends RuntimeException{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java b/src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java index 24941d1..fde4561 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.exception; public class TokenValidationException extends RuntimeException{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java index 8d24776..c9c0dc1 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-lib + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java index ad801a6..0354807 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-lib + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java index a335292..8b67c0e 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-lib + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java index 75e0c8e..b2dd83d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-lib + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java b/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java index 70862cf..b6564a8 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-lib + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java b/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java index 5a64148..ac20c6e 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java @@ -1,8 +1,8 @@ /*- * ---license-start - * EU Digital Green Certificate Gateway Service / dgc-lib + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java index 8857898..1e52d52 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.BatchListEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java index 0e8a2b6..d2c3304 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.CoordinateViewEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java index 402ea9d..c7ff2f1 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.HashesEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java index ecaa6ce..ecae708 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.InfoEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java index c6ef799..b028493 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.KidViewEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java index cfc32c3..a22e030 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java @@ -1,6 +1,25 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; import europa.ec.dgc.revocationdistribution.entity.PartitionEntity; import java.util.List; import java.util.Optional; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java index 85df66e..16d1373 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.PointViewEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java index 88bf238..9716a19 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import java.util.List; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java index d768904..ca10195 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java index efa99f7..c737f6b 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.SliceEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java b/src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java index 3d35681..73243f6 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.repository; import europa.ec.dgc.revocationdistribution.entity.VectorViewEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index 59ab1f5..39810c3 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java index 5964b6e..baed603 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java index 31d15ef..4ffcef7 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java index e343737..9321e50 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index 8ddb61d..3eec056 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -1,8 +1,8 @@ /*- * ---license-start - * eu-digital-green-certificates / dgca-businessrule-service + * eu-digital-green-certificates / dgca-revocation-distribution-service * --- - * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * Copyright (C) 2022 T-Systems International GmbH and all other contributors * --- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java index f8c8d76..41f34d3 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java index eda4c7a..40ceb1d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; import europa.ec.dgc.revocationdistribution.dto.SliceDataDto; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java b/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java index ad34035..30d2c7f 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.service; import europa.ec.dgc.bloomfilter.BloomFilter; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java b/src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java index f20c259..efecac2 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java +++ b/src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java @@ -1,3 +1,23 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + package europa.ec.dgc.revocationdistribution.utils; import java.security.MessageDigest; From 446c5236107683697f1990caf30497508fa799f7 Mon Sep 17 00:00:00 2001 From: Simon Laurenz Date: Wed, 9 Feb 2022 17:24:34 +0100 Subject: [PATCH 03/20] Removed outdated sql scripts --- .../scripts/create_batch_list_table.sql | 21 --------- .../scripts/create_configuration_table.sql | 18 ------- .../scripts/create_coordinate_view.sql | 22 --------- .../scripts/create_hashes_table.sql | 47 ------------------- local_postgres/scripts/create_info_table | 17 ------- local_postgres/scripts/create_kid_view.sql | 40 ---------------- .../scripts/create_last_updated_trigger.sql | 10 ---- .../scripts/create_partition_table.sql | 23 --------- local_postgres/scripts/create_point_view.sql | 22 --------- .../create_rd_changelog_lock_table.sql | 19 -------- .../scripts/create_rd_changelog_table.sql | 28 ----------- .../scripts/create_revocation_list_json.sql | 18 ------- .../create_set_last_updated_function.sql | 19 -------- .../scripts/create_set_new_etag_function.sql | 38 --------------- .../scripts/create_shedlock_rd_table.sql | 21 --------- local_postgres/scripts/create_vector_view.sql | 22 --------- 16 files changed, 385 deletions(-) delete mode 100644 local_postgres/scripts/create_batch_list_table.sql delete mode 100644 local_postgres/scripts/create_configuration_table.sql delete mode 100644 local_postgres/scripts/create_coordinate_view.sql delete mode 100644 local_postgres/scripts/create_hashes_table.sql delete mode 100644 local_postgres/scripts/create_info_table delete mode 100644 local_postgres/scripts/create_kid_view.sql delete mode 100644 local_postgres/scripts/create_last_updated_trigger.sql delete mode 100644 local_postgres/scripts/create_partition_table.sql delete mode 100644 local_postgres/scripts/create_point_view.sql delete mode 100644 local_postgres/scripts/create_rd_changelog_lock_table.sql delete mode 100644 local_postgres/scripts/create_rd_changelog_table.sql delete mode 100644 local_postgres/scripts/create_revocation_list_json.sql delete mode 100644 local_postgres/scripts/create_set_last_updated_function.sql delete mode 100644 local_postgres/scripts/create_set_new_etag_function.sql delete mode 100644 local_postgres/scripts/create_shedlock_rd_table.sql delete mode 100644 local_postgres/scripts/create_vector_view.sql diff --git a/local_postgres/scripts/create_batch_list_table.sql b/local_postgres/scripts/create_batch_list_table.sql deleted file mode 100644 index c67a745..0000000 --- a/local_postgres/scripts/create_batch_list_table.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Table: public.batch_list - --- DROP TABLE IF EXISTS public.batch_list; - -CREATE TABLE IF NOT EXISTS public.batch_list -( - batch_id character varying(36) COLLATE pg_catalog."default" NOT NULL, - country character varying(2) COLLATE pg_catalog."default" NOT NULL, - expires timestamp without time zone NOT NULL, - kid character varying(12) COLLATE pg_catalog."default", - type character varying(255) COLLATE pg_catalog."default" NOT NULL, - created_at timestamp with time zone, - CONSTRAINT batch_list_pkey PRIMARY KEY (batch_id) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.batch_list - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_configuration_table.sql b/local_postgres/scripts/create_configuration_table.sql deleted file mode 100644 index cb5419f..0000000 --- a/local_postgres/scripts/create_configuration_table.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Table: public.configuration - --- DROP TABLE IF EXISTS public.configuration; - -CREATE TABLE IF NOT EXISTS public.configuration -( - key text COLLATE pg_catalog."default" NOT NULL, - value text COLLATE pg_catalog."default", - value2 text COLLATE pg_catalog."default", - CONSTRAINT configuration_pkey PRIMARY KEY (key) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.configuration - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_coordinate_view.sql b/local_postgres/scripts/create_coordinate_view.sql deleted file mode 100644 index ad66f68..0000000 --- a/local_postgres/scripts/create_coordinate_view.sql +++ /dev/null @@ -1,22 +0,0 @@ --- View: public.coordinate_view - --- DROP VIEW public.coordinate_view; - -CREATE OR REPLACE VIEW public.coordinate_view - AS - SELECT hashes.kid, - max(batch_list.expires) AS expired, - max(hashes.last_updated) AS lastupdated, - array_agg(DISTINCT hashes.hash) AS hashes, - hashes.z::text AS chunk, - concat(hashes.x, hashes.y) AS id, - hashes.x::text AS x, - hashes.y::text AS y - FROM hashes - LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text - GROUP BY hashes.kid, hashes.x, hashes.y, hashes.z, batch_list.expires - ORDER BY hashes.kid, (concat(hashes.x, hashes.y)), (hashes.z::text), batch_list.expires; - -ALTER TABLE public.coordinate_view - OWNER TO postgres; - diff --git a/local_postgres/scripts/create_hashes_table.sql b/local_postgres/scripts/create_hashes_table.sql deleted file mode 100644 index 4c180d4..0000000 --- a/local_postgres/scripts/create_hashes_table.sql +++ /dev/null @@ -1,47 +0,0 @@ --- Table: public.hashes - --- DROP TABLE IF EXISTS public.hashes; - -CREATE TABLE IF NOT EXISTS public.hashes -( - hash character varying(255) COLLATE pg_catalog."default" NOT NULL, - batch_id character varying(36) COLLATE pg_catalog."default", - kid character varying(12) COLLATE pg_catalog."default", - updated boolean, - x character(1) COLLATE pg_catalog."default" NOT NULL, - y character(1) COLLATE pg_catalog."default" NOT NULL, - z character(1) COLLATE pg_catalog."default" NOT NULL, - last_updated timestamp with time zone DEFAULT now(), - CONSTRAINT hashes_pkey PRIMARY KEY (hash), - CONSTRAINT fk_batch_id FOREIGN KEY (batch_id) - REFERENCES public.batch_list (batch_id) MATCH SIMPLE - ON UPDATE NO ACTION - ON DELETE SET NULL - NOT VALID -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.hashes - OWNER to postgres; --- Index: fki_fk_batch_id - --- DROP INDEX IF EXISTS public.fki_fk_batch_id; - -CREATE INDEX IF NOT EXISTS fki_fk_batch_id - ON public.hashes USING btree - (batch_id COLLATE pg_catalog."default" ASC NULLS LAST) - TABLESPACE pg_default; - --- Trigger: set_last_updated_trigger - --- DROP TRIGGER IF EXISTS set_last_updated_trigger ON public.hashes; - -CREATE TRIGGER set_last_updated_trigger - BEFORE UPDATE - ON public.hashes - FOR EACH ROW - WHEN (new.updated IS TRUE OR new.batch_id IS NULL) - EXECUTE PROCEDURE public.set_last_updated_function(); \ No newline at end of file diff --git a/local_postgres/scripts/create_info_table b/local_postgres/scripts/create_info_table deleted file mode 100644 index 26c1a3c..0000000 --- a/local_postgres/scripts/create_info_table +++ /dev/null @@ -1,17 +0,0 @@ --- Table: public.info - --- DROP TABLE IF EXISTS public.info; - -CREATE TABLE IF NOT EXISTS public.info -( - key text COLLATE pg_catalog."default" NOT NULL, - value text COLLATE pg_catalog."default", - CONSTRAINT info_pkey PRIMARY KEY (key) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.info - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_kid_view.sql b/local_postgres/scripts/create_kid_view.sql deleted file mode 100644 index 084a2dd..0000000 --- a/local_postgres/scripts/create_kid_view.sql +++ /dev/null @@ -1,40 +0,0 @@ --- View: public.kid_view - --- DROP VIEW public.kid_view; - -CREATE OR REPLACE VIEW public.kid_view - AS - WITH configuration AS ( - SELECT - CASE - WHEN configuration_1.key = 'POINTLIMIT'::text THEN 'POINT'::text - WHEN configuration_1.key = 'VECTORLIMIT'::text THEN 'VECTOR'::text - WHEN configuration_1.key = 'COORDINATELIMIT'::text THEN 'COORDINATE'::text - ELSE NULL::text - END AS storage_mode, - to_number(configuration_1.value, '99999'::text) AS minlimit, - to_number(configuration_1.value2, '99999'::text) AS maxlimit - FROM public.configuration configuration_1 - WHERE configuration_1.key = ANY (ARRAY['POINTLIMIT'::text, 'VECTORLIMIT'::text, 'COORDINATELIMIT'::text]) - ) - SELECT a.kid, - a.hashtypes, - configuration.storage_mode, - a.lastupdated, - a.expired, - a.updated - FROM ( SELECT hashes.kid, - count(*) AS c, - array_to_string(array_agg(DISTINCT batch_list.type), ','::text) AS hashtypes, - bool_or(hashes.updated) AS updated, - max(batch_list.expires) AS expired, - max(hashes.last_updated) AS lastupdated - FROM hashes - LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text - GROUP BY hashes.kid) a, - configuration - WHERE a.c::numeric >= configuration.minlimit AND a.c::numeric <= configuration.maxlimit; - -ALTER TABLE public.kid_view - OWNER TO postgres; - diff --git a/local_postgres/scripts/create_last_updated_trigger.sql b/local_postgres/scripts/create_last_updated_trigger.sql deleted file mode 100644 index 5bea628..0000000 --- a/local_postgres/scripts/create_last_updated_trigger.sql +++ /dev/null @@ -1,10 +0,0 @@ --- Trigger: set_last_updated_trigger - --- DROP TRIGGER IF EXISTS set_last_updated_trigger ON public.hashes; - -CREATE TRIGGER set_last_updated_trigger - BEFORE UPDATE - ON public.hashes - FOR EACH ROW - WHEN (new.updated IS TRUE OR new.batch_id IS NULL) - EXECUTE PROCEDURE public.set_last_updated_function(); \ No newline at end of file diff --git a/local_postgres/scripts/create_partition_table.sql b/local_postgres/scripts/create_partition_table.sql deleted file mode 100644 index 8cf1c89..0000000 --- a/local_postgres/scripts/create_partition_table.sql +++ /dev/null @@ -1,23 +0,0 @@ --- Table: public.partitions - --- DROP TABLE IF EXISTS public.partitions; - -CREATE TABLE IF NOT EXISTS public.partitions -( - kid text COLLATE pg_catalog."default" NOT NULL, - partition_id text COLLATE pg_catalog."default", - x text COLLATE pg_catalog."default", - y text COLLATE pg_catalog."default", - z text COLLATE pg_catalog."default", - expired timestamp with time zone, - lastupdated timestamp with time zone, - chunks_json_data jsonb, - CONSTRAINT partitions_pkey PRIMARY KEY (kid) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.partitions - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_point_view.sql b/local_postgres/scripts/create_point_view.sql deleted file mode 100644 index d58c89e..0000000 --- a/local_postgres/scripts/create_point_view.sql +++ /dev/null @@ -1,22 +0,0 @@ --- View: public.point_view - --- DROP VIEW public.point_view; - -CREATE OR REPLACE VIEW public.point_view - AS - SELECT row_number() OVER ()::text AS row_id, - hashes.kid, - max(date_trunc('minute'::text, batch_list.expires))::timestamp with time zone AS expired, - max(hashes.last_updated) AS lastupdated, - array_agg(DISTINCT hashes.hash) AS hashes, - hashes.x::text AS chunk, - NULL::text AS partition_id, - NULL::text AS x, - NULL::text AS y - FROM hashes - LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text - GROUP BY hashes.kid, hashes.x, (date_trunc('minute'::text, batch_list.expires)); - -ALTER TABLE public.point_view - OWNER TO postgres; - diff --git a/local_postgres/scripts/create_rd_changelog_lock_table.sql b/local_postgres/scripts/create_rd_changelog_lock_table.sql deleted file mode 100644 index 8faa3ba..0000000 --- a/local_postgres/scripts/create_rd_changelog_lock_table.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Table: public.rd_changelog_lock - --- DROP TABLE IF EXISTS public.rd_changelog_lock; - -CREATE TABLE IF NOT EXISTS public.rd_changelog_lock -( - id integer NOT NULL, - locked boolean NOT NULL, - lockgranted timestamp without time zone, - lockedby character varying(255) COLLATE pg_catalog."default", - CONSTRAINT rd_changelog_lock_pkey PRIMARY KEY (id) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.rd_changelog_lock - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_rd_changelog_table.sql b/local_postgres/scripts/create_rd_changelog_table.sql deleted file mode 100644 index 58cbded..0000000 --- a/local_postgres/scripts/create_rd_changelog_table.sql +++ /dev/null @@ -1,28 +0,0 @@ --- Table: public.rd_changelog - --- DROP TABLE IF EXISTS public.rd_changelog; - -CREATE TABLE IF NOT EXISTS public.rd_changelog -( - id character varying(255) COLLATE pg_catalog."default" NOT NULL, - author character varying(255) COLLATE pg_catalog."default" NOT NULL, - filename character varying(255) COLLATE pg_catalog."default" NOT NULL, - dateexecuted timestamp without time zone NOT NULL, - orderexecuted integer NOT NULL, - exectype character varying(10) COLLATE pg_catalog."default" NOT NULL, - md5sum character varying(35) COLLATE pg_catalog."default", - description character varying(255) COLLATE pg_catalog."default", - comments character varying(255) COLLATE pg_catalog."default", - tag character varying(255) COLLATE pg_catalog."default", - liquibase character varying(20) COLLATE pg_catalog."default", - contexts character varying(255) COLLATE pg_catalog."default", - labels character varying(255) COLLATE pg_catalog."default", - deployment_id character varying(10) COLLATE pg_catalog."default" -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.rd_changelog - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_revocation_list_json.sql b/local_postgres/scripts/create_revocation_list_json.sql deleted file mode 100644 index 4afbe7c..0000000 --- a/local_postgres/scripts/create_revocation_list_json.sql +++ /dev/null @@ -1,18 +0,0 @@ --- Table: public.revocation_list_json - --- DROP TABLE IF EXISTS public.revocation_list_json; - -CREATE TABLE IF NOT EXISTS public.revocation_list_json -( - etag text COLLATE pg_catalog."default" NOT NULL, - created_at timestamp with time zone, - json_data jsonb, - CONSTRAINT revocation_list_json_pkey PRIMARY KEY (etag) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.revocation_list_json - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_set_last_updated_function.sql b/local_postgres/scripts/create_set_last_updated_function.sql deleted file mode 100644 index c46806b..0000000 --- a/local_postgres/scripts/create_set_last_updated_function.sql +++ /dev/null @@ -1,19 +0,0 @@ --- FUNCTION: public.set_last_updated_function() - --- DROP FUNCTION IF EXISTS public.set_last_updated_function(); - -CREATE OR REPLACE FUNCTION public.set_last_updated_function() - RETURNS trigger - LANGUAGE 'plpgsql' - COST 100 - VOLATILE NOT LEAKPROOF -AS $BODY$ -BEGIN - NEW.last_updated := NOW(); - - RETURN NEW; -END; -$BODY$; - -ALTER FUNCTION public.set_last_updated_function() - OWNER TO postgres; diff --git a/local_postgres/scripts/create_set_new_etag_function.sql b/local_postgres/scripts/create_set_new_etag_function.sql deleted file mode 100644 index c9df420..0000000 --- a/local_postgres/scripts/create_set_new_etag_function.sql +++ /dev/null @@ -1,38 +0,0 @@ --- FUNCTION: public.set_new_etag(text) - --- DROP FUNCTION IF EXISTS public.set_new_etag(text); - -CREATE OR REPLACE FUNCTION public.set_new_etag( - new_etag text) - RETURNS integer - LANGUAGE 'plpgsql' - COST 100 - VOLATILE PARALLEL UNSAFE -AS $BODY$ - BEGIN - -- Update etag in info table - INSERT INTO info (key, value) - VALUES('CURRENTETAG', new_etag) - ON CONFLICT (key) - DO UPDATE SET value = EXCLUDED.value; - - -- Delete old slices and partitions - DELETE FROM partitions WHERE to_be_deleted=true; - DELETE FROM slices WHERE to_be_deleted=true; - - -- Update etag field of slices and partitions - Update partitions SET etag = new_etag; - Update slices SET etag = new_etag; - - -- Update etag in info table - INSERT INTO info (key, value) - VALUES('CURRENTETAG', new_etag) - ON CONFLICT (key) - DO UPDATE SET value = EXCLUDED.value; - - RETURN 1; - END; -$BODY$; - -ALTER FUNCTION public.set_new_etag(text) - OWNER TO postgres; diff --git a/local_postgres/scripts/create_shedlock_rd_table.sql b/local_postgres/scripts/create_shedlock_rd_table.sql deleted file mode 100644 index 0f87bbd..0000000 --- a/local_postgres/scripts/create_shedlock_rd_table.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Table: public.shedlock_rd - --- DROP TABLE IF EXISTS public.shedlock_rd; - -CREATE TABLE IF NOT EXISTS public.shedlock_rd -( - id bigint NOT NULL DEFAULT nextval('shedlock_rd_id_seq'::regclass), - lock_until timestamp without time zone NOT NULL, - locked_at timestamp without time zone NOT NULL, - locked_by character varying(255) COLLATE pg_catalog."default" NOT NULL, - name character varying(64) COLLATE pg_catalog."default" NOT NULL, - CONSTRAINT shedlock_rd_pkey PRIMARY KEY (id), - CONSTRAINT uk_2ad9gyjxfy85r5k5yssh63e63 UNIQUE (name) -) -WITH ( - OIDS = FALSE -) -TABLESPACE pg_default; - -ALTER TABLE IF EXISTS public.shedlock_rd - OWNER to postgres; \ No newline at end of file diff --git a/local_postgres/scripts/create_vector_view.sql b/local_postgres/scripts/create_vector_view.sql deleted file mode 100644 index d23a736..0000000 --- a/local_postgres/scripts/create_vector_view.sql +++ /dev/null @@ -1,22 +0,0 @@ --- View: public.vector_view - --- DROP VIEW public.vector_view; - -CREATE OR REPLACE VIEW public.vector_view - AS - SELECT hashes.kid, - max(batch_list.expires) AS expired, - max(hashes.last_updated) AS lastupdated, - array_agg(DISTINCT hashes.hash) AS hashes, - hashes.y::text AS chunk, - hashes.x::text AS id, - hashes.x::text AS x, - NULL::text AS y - FROM hashes - LEFT JOIN batch_list ON hashes.batch_id::text = batch_list.batch_id::text - GROUP BY hashes.kid, hashes.x, hashes.y, batch_list.expires - ORDER BY hashes.kid, (hashes.x::text), NULL::text, batch_list.expires; - -ALTER TABLE public.vector_view - OWNER TO postgres; - From ee28f72071de46f635eeb739556a056dbde3412a Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Thu, 10 Feb 2022 13:47:38 +0100 Subject: [PATCH 04/20] Fixed package naming --- pom.xml | 2 +- .../ec/dgc/bloomfilter/BloomFilter.java | 2 +- .../ec/dgc/bloomfilter/BloomFilterImpl.java | 2 +- ...ocationDistributionServiceApplication.java | 4 +- .../client/IssuanceDgciRestClient.java | 4 +- .../client/IssuanceDgciRestClientConfig.java | 3 +- .../config/DgcConfigProperties.java | 3 +- .../config/ErrorHandler.java | 8 ++-- .../config/OpenApiConfig.java | 2 +- .../config/SchedulerConfig.java | 2 +- .../config/ShedLockConfig.java | 2 +- .../controller/LookupController.java | 6 +-- .../controller/RevocationListController.java | 14 +++--- .../dto/ChunkMetaViewDto.java | 2 +- .../dto/DidAuthentication.java | 2 +- .../dto/DidDocument.java | 2 +- .../dto/PartitionChunksJsonItemDto.java | 7 +-- .../dto/PartitionResponseDto.java | 2 +- .../dto/RevocationCheckTokenPayload.java | 2 +- .../dto/RevocationListJsonResponseDto.java | 2 +- .../dto/SliceDataDto.java | 2 +- .../entity/AbstractChunkMetaViewEntity.java | 4 +- .../entity/BatchListEntity.java | 3 +- .../entity/CoordinateViewEntity.java | 2 +- .../entity/HashesEntity.java | 2 +- .../entity/InfoEntity.java | 2 +- .../entity/KidViewEntity.java | 3 +- .../entity/PartitionEntity.java | 4 +- .../entity/PointViewEntity.java | 6 +-- .../entity/RevocationListJsonEntity.java | 5 +- .../entity/ShedlockEntity.java | 2 +- .../entity/SliceEntity.java | 7 +-- .../entity/VectorViewEntity.java | 2 +- .../exception/DataNotFoundException.java | 2 +- .../PreconditionFailedException.java | 2 +- .../exception/TokenValidationException.java | 2 +- .../mapper/CoordinateViewMapper.java | 6 +-- .../mapper/PartitionListMapper.java | 6 +-- .../mapper/PointViewMapper.java | 6 +-- .../mapper/VectorViewMapper.java | 6 +-- .../model/ChangeList.java | 3 +- .../model/ChangeListItem.java | 6 +-- .../repository/BatchListRepository.java | 4 +- .../repository/CoordinateViewRepository.java | 5 +- .../repository/HashesRepository.java | 5 +- .../repository/InfoRepository.java | 4 +- .../repository/KidViewRepository.java | 4 +- .../repository/PartitionRepository.java | 4 +- .../repository/PointViewRepository.java | 4 +- .../repository/ReadOnlyRepository.java | 2 +- .../RevocationListJsonRepository.java | 4 +- .../repository/SliceRepository.java | 4 +- .../repository/VectorViewRepository.java | 4 +- .../service/GeneratorService.java | 46 +++++++++---------- .../service/InfoService.java | 9 ++-- .../service/LookupService.java | 14 +++--- .../service/RevocationCheckTokenParser.java | 6 +-- ...ocationListDownloadServiceGatewayImpl.java | 2 +- .../service/RevocationListService.java | 28 +++++------ .../service/SliceCalculationService.java | 4 +- ...liceCalculationServiceBloomFilterImpl.java | 12 ++--- .../utils/HelperFunctions.java | 2 +- 62 files changed, 147 insertions(+), 176 deletions(-) rename src/main/java/{ => eu}/europa/ec/dgc/bloomfilter/BloomFilter.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/bloomfilter/BloomFilterImpl.java (99%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java (91%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java (92%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java (92%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java (91%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java (97%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/controller/LookupController.java (92%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/DidDocument.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java (84%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java (97%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java (84%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java (92%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java (90%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java (93%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java (93%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java (96%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java (83%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java (83%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java (83%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java (83%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/model/ChangeList.java (93%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java (88%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java (88%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java (86%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java (89%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java (89%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java (86%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java (92%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java (87%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java (95%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java (89%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java (94%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java (90%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/GeneratorService.java (89%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/InfoService.java (83%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/LookupService.java (91%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java (91%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java (99%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/RevocationListService.java (91%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java (87%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java (88%) rename src/main/java/{ => eu}/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java (97%) diff --git a/pom.xml b/pom.xml index 8133ef2..f3276b7 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ - europa.ec.dgc + eu.europa.ec.dgc dgca-revocation-distribution-service latest dgca-revocation-distribution-service diff --git a/src/main/java/europa/ec/dgc/bloomfilter/BloomFilter.java b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java similarity index 94% rename from src/main/java/europa/ec/dgc/bloomfilter/BloomFilter.java rename to src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java index 6583cb6..c9e8d76 100644 --- a/src/main/java/europa/ec/dgc/bloomfilter/BloomFilter.java +++ b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java @@ -3,7 +3,7 @@ * Author: Paul Ballmann */ -package europa.ec.dgc.bloomfilter; +package eu.europa.ec.dgc.bloomfilter; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/europa/ec/dgc/bloomfilter/BloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java similarity index 99% rename from src/main/java/europa/ec/dgc/bloomfilter/BloomFilterImpl.java rename to src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java index 05a8aa0..c0b8df3 100644 --- a/src/main/java/europa/ec/dgc/bloomfilter/BloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 T-Systems International GmbH and all other contributors * Author: Paul Ballmann/Steffen Schulze */ -package europa.ec.dgc.bloomfilter; +package eu.europa.ec.dgc.bloomfilter; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java similarity index 91% rename from src/main/java/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java index 29ef150..c6dae48 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution; +package eu.europa.ec.dgc.revocationdistribution; -import europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; +import eu.europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java similarity index 92% rename from src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java index 0362bba..fc911e9 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.client; +package eu.europa.ec.dgc.revocationdistribution.client; -import europa.ec.dgc.revocationdistribution.dto.DidDocument; +import eu.europa.ec.dgc.revocationdistribution.dto.DidDocument; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java similarity index 94% rename from src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java index e81fa10..8dab5b8 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.client; +package eu.europa.ec.dgc.revocationdistribution.client; import feign.Client; import feign.Logger; @@ -34,7 +34,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; @Configuration @RequiredArgsConstructor diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java similarity index 92% rename from src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java index 678dc82..f64516c 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java @@ -18,11 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.config; +package eu.europa.ec.dgc.revocationdistribution.config; import lombok.Getter; import lombok.Setter; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; @Getter diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java similarity index 91% rename from src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java index 6e4b1aa..24459d2 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ErrorHandler.java @@ -18,11 +18,11 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.config; +package eu.europa.ec.dgc.revocationdistribution.config; -import europa.ec.dgc.revocationdistribution.exception.DataNotFoundException; -import europa.ec.dgc.revocationdistribution.exception.PreconditionFailedException; -import europa.ec.dgc.revocationdistribution.exception.TokenValidationException; +import eu.europa.ec.dgc.revocationdistribution.exception.DataNotFoundException; +import eu.europa.ec.dgc.revocationdistribution.exception.PreconditionFailedException; +import eu.europa.ec.dgc.revocationdistribution.exception.TokenValidationException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java similarity index 97% rename from src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java index 75fac2c..d52dc1a 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.config; +package eu.europa.ec.dgc.revocationdistribution.config; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java index 3f93a11..f6d5727 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/SchedulerConfig.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.config; +package eu.europa.ec.dgc.revocationdistribution.config; import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java index 12b08dc..cd8ce85 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.config; +package eu.europa.ec.dgc.revocationdistribution.config; import static net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider.Configuration.builder; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java similarity index 92% rename from src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java index 35a4f3f..bf21233 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/controller/LookupController.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java @@ -18,10 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.controller; +package eu.europa.ec.dgc.revocationdistribution.controller; -import europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; -import europa.ec.dgc.revocationdistribution.service.LookupService; +import eu.europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; +import eu.europa.ec.dgc.revocationdistribution.service.LookupService; import java.security.PublicKey; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java index cc46d4d..1e7c960 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java @@ -18,15 +18,15 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.controller; +package eu.europa.ec.dgc.revocationdistribution.controller; import com.nimbusds.jose.util.Base64URL; -import europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; -import europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto; -import europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; -import europa.ec.dgc.revocationdistribution.exception.PreconditionFailedException; -import europa.ec.dgc.revocationdistribution.service.InfoService; -import europa.ec.dgc.revocationdistribution.service.RevocationListService; +import eu.europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; +import eu.europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto; +import eu.europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; +import eu.europa.ec.dgc.revocationdistribution.exception.PreconditionFailedException; +import eu.europa.ec.dgc.revocationdistribution.service.InfoService; +import eu.europa.ec.dgc.revocationdistribution.service.RevocationListService; import java.time.ZonedDateTime; import java.time.format.DateTimeParseException; import java.util.Base64; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java index 1a013f7..bd55139 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import java.time.ZonedDateTime; import lombok.AllArgsConstructor; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java similarity index 94% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java index e8ab735..3739dcb 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/DidAuthentication.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.databind.JsonNode; import lombok.Data; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/DidDocument.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/DidDocument.java index de90212..038bd42 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/DidDocument.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/DidDocument.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java similarity index 84% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java index a15de5d..521821d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java @@ -18,14 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; -import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serializable; -import java.time.ZonedDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java index 7656a3d..d56e19f 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.annotation.JsonFormat; import java.time.ZonedDateTime; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java similarity index 94% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java index 447f78f..087cc6e 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationCheckTokenPayload.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import java.util.List; import lombok.Data; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java index 1940c19..405b41a 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serializable; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java index 7e7064b..945b492 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/SliceDataDto.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.dto; +package eu.europa.ec.dgc.revocationdistribution.dto; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java index bd439e8..d8d00b1 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java @@ -18,16 +18,14 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import com.vladmihalcea.hibernate.type.array.StringArrayType; import java.time.ZonedDateTime; -import java.util.List; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import lombok.Getter; -import org.hibernate.annotations.RowId; import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import org.springframework.data.annotation.Immutable; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java index f5db47b..4794b1a 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import java.time.ZonedDateTime; @@ -27,7 +27,6 @@ import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Id; -import javax.persistence.Lob; import javax.persistence.PrePersist; import javax.persistence.Table; import lombok.AllArgsConstructor; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java similarity index 94% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java index 7fe522c..c989060 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/CoordinateViewEntity.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Entity; import javax.persistence.Table; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java similarity index 97% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java index b5c8c17..5be0c78 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java index a62f2a3..7939d63 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/InfoEntity.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java index d02437e..e2e9155 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java @@ -18,13 +18,12 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Set; import java.util.stream.Collectors; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java index 33ec29c..9c66561 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java @@ -18,11 +18,11 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import com.fasterxml.jackson.annotation.JsonFormat; import com.vladmihalcea.hibernate.type.json.JsonBinaryType; -import europa.ec.dgc.revocationdistribution.dto.PartitionChunksJsonItemDto; +import eu.europa.ec.dgc.revocationdistribution.dto.PartitionChunksJsonItemDto; import java.time.ZonedDateTime; import java.util.Map; import javax.persistence.Column; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java similarity index 84% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java index 7664a67..ae0c0ce 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PointViewEntity.java @@ -18,15 +18,11 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; -import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Id; import javax.persistence.Table; -import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.Setter; @Getter diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java similarity index 92% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java index b304f5e..04e9eb0 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java @@ -18,13 +18,12 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import com.vladmihalcea.hibernate.type.json.JsonBinaryType; -import europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto; +import eu.europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto; import java.time.ZonedDateTime; import java.util.List; -import java.util.UUID; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java index 2738bc6..f08d2ce 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/ShedlockEntity.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import java.util.Date; import javax.persistence.Column; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java similarity index 90% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java index 90c95cd..66dd12a 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java @@ -18,13 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import com.fasterxml.jackson.annotation.JsonFormat; -import com.vladmihalcea.hibernate.type.json.JsonBinaryType; -import europa.ec.dgc.revocationdistribution.dto.PartitionChunksJsonItemDto; import java.time.ZonedDateTime; -import java.util.Map; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -35,8 +32,6 @@ import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.hibernate.annotations.Type; -import org.hibernate.annotations.TypeDef; @Getter @Setter diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java similarity index 94% rename from src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java index 65f33cc..cf28853 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/VectorViewEntity.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.entity; +package eu.europa.ec.dgc.revocationdistribution.entity; import javax.persistence.Entity; import javax.persistence.Table; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java similarity index 93% rename from src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java index 942b569..4a69166 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.exception; +package eu.europa.ec.dgc.revocationdistribution.exception; public class DataNotFoundException extends RuntimeException{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java similarity index 93% rename from src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java index be7fd50..966bb6d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.exception; +package eu.europa.ec.dgc.revocationdistribution.exception; public class PreconditionFailedException extends RuntimeException{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java similarity index 96% rename from src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java index fde4561..79f4a0c 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.exception; +package eu.europa.ec.dgc.revocationdistribution.exception; public class TokenValidationException extends RuntimeException{ public int getStatus() { diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java similarity index 83% rename from src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java index c9c0dc1..d839955 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/CoordinateViewMapper.java @@ -18,10 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.mapper; +package eu.europa.ec.dgc.revocationdistribution.mapper; -import europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; -import europa.ec.dgc.revocationdistribution.entity.CoordinateViewEntity; +import eu.europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; +import eu.europa.ec.dgc.revocationdistribution.entity.CoordinateViewEntity; import java.util.List; import org.mapstruct.Mapper; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java similarity index 83% rename from src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java index 0354807..7927480 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/PartitionListMapper.java @@ -18,10 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.mapper; +package eu.europa.ec.dgc.revocationdistribution.mapper; -import europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; -import europa.ec.dgc.revocationdistribution.entity.PartitionEntity; +import eu.europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; +import eu.europa.ec.dgc.revocationdistribution.entity.PartitionEntity; import java.util.List; import org.mapstruct.Mapper; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java similarity index 83% rename from src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java index 8b67c0e..66e1034 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/PointViewMapper.java @@ -18,10 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.mapper; +package eu.europa.ec.dgc.revocationdistribution.mapper; -import europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; -import europa.ec.dgc.revocationdistribution.entity.PointViewEntity; +import eu.europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; +import eu.europa.ec.dgc.revocationdistribution.entity.PointViewEntity; import java.util.List; import org.mapstruct.Mapper; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java similarity index 83% rename from src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java index b2dd83d..1507db3 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/mapper/VectorViewMapper.java @@ -18,10 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.mapper; +package eu.europa.ec.dgc.revocationdistribution.mapper; -import europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; -import europa.ec.dgc.revocationdistribution.entity.VectorViewEntity; +import eu.europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; +import eu.europa.ec.dgc.revocationdistribution.entity.VectorViewEntity; import java.util.List; import org.mapstruct.Mapper; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeList.java similarity index 93% rename from src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeList.java index b6564a8..407e235 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeList.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeList.java @@ -18,11 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.model; +package eu.europa.ec.dgc.revocationdistribution.model; import java.util.ArrayList; import java.util.List; -import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java similarity index 88% rename from src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java index ac20c6e..3dd8a17 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java @@ -18,13 +18,11 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.model; +package eu.europa.ec.dgc.revocationdistribution.model; -import europa.ec.dgc.revocationdistribution.entity.KidViewEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.KidViewEntity; import java.time.ZonedDateTime; -import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.NoArgsConstructor; import lombok.Setter; @Getter diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java similarity index 88% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java index 1e52d52..6535a2b 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/BatchListRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.BatchListEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.BatchListEntity; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java similarity index 86% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java index d2c3304..8b3cb82 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java @@ -18,10 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.CoordinateViewEntity; -import europa.ec.dgc.revocationdistribution.entity.VectorViewEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.CoordinateViewEntity; import java.util.List; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java similarity index 89% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java index c7ff2f1..c2ff89b 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/HashesRepository.java @@ -18,11 +18,10 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.HashesEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.HashesEntity; import java.util.List; -import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java similarity index 89% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java index ecae708..4dbe9b6 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/InfoRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.InfoEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.InfoEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.query.Procedure; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java similarity index 86% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java index b028493..bf2e0e7 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.KidViewEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.KidViewEntity; public interface KidViewRepository extends ReadOnlyRepository{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java similarity index 92% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java index a22e030..d55e98f 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.PartitionEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.PartitionEntity; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java similarity index 87% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java index 16d1373..0c43a93 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.PointViewEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.PointViewEntity; import java.util.List; public interface PointViewRepository extends ReadOnlyRepository{ diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java similarity index 95% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java index 9716a19..78012ab 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/ReadOnlyRepository.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; import java.util.List; import java.util.Optional; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java similarity index 89% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java index ca10195..b48f359 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/RevocationListJsonRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java similarity index 94% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java index c737f6b..4281362 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.SliceEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.SliceEntity; import java.util.List; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java similarity index 90% rename from src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java index 73243f6..44c730d 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.repository; +package eu.europa.ec.dgc.revocationdistribution.repository; -import europa.ec.dgc.revocationdistribution.entity.VectorViewEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.VectorViewEntity; import java.util.List; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java similarity index 89% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index 39810c3..9d61462 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -18,29 +18,29 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; - - -import europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; -import europa.ec.dgc.revocationdistribution.dto.PartitionChunksJsonItemDto; -import europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto.RevocationListJsonResponseItemDto; -import europa.ec.dgc.revocationdistribution.dto.SliceDataDto; -import europa.ec.dgc.revocationdistribution.entity.KidViewEntity; -import europa.ec.dgc.revocationdistribution.entity.PartitionEntity; -import europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; -import europa.ec.dgc.revocationdistribution.entity.SliceEntity; -import europa.ec.dgc.revocationdistribution.mapper.CoordinateViewMapper; -import europa.ec.dgc.revocationdistribution.mapper.PointViewMapper; -import europa.ec.dgc.revocationdistribution.mapper.VectorViewMapper; -import europa.ec.dgc.revocationdistribution.model.ChangeList; -import europa.ec.dgc.revocationdistribution.model.ChangeListItem; -import europa.ec.dgc.revocationdistribution.repository.CoordinateViewRepository; -import europa.ec.dgc.revocationdistribution.repository.KidViewRepository; -import europa.ec.dgc.revocationdistribution.repository.PartitionRepository; -import europa.ec.dgc.revocationdistribution.repository.PointViewRepository; -import europa.ec.dgc.revocationdistribution.repository.SliceRepository; -import europa.ec.dgc.revocationdistribution.repository.VectorViewRepository; -import europa.ec.dgc.revocationdistribution.utils.HelperFunctions; +package eu.europa.ec.dgc.revocationdistribution.service; + + +import eu.europa.ec.dgc.revocationdistribution.dto.ChunkMetaViewDto; +import eu.europa.ec.dgc.revocationdistribution.dto.PartitionChunksJsonItemDto; +import eu.europa.ec.dgc.revocationdistribution.dto.RevocationListJsonResponseDto.RevocationListJsonResponseItemDto; +import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; +import eu.europa.ec.dgc.revocationdistribution.entity.KidViewEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.PartitionEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.SliceEntity; +import eu.europa.ec.dgc.revocationdistribution.mapper.CoordinateViewMapper; +import eu.europa.ec.dgc.revocationdistribution.mapper.PointViewMapper; +import eu.europa.ec.dgc.revocationdistribution.mapper.VectorViewMapper; +import eu.europa.ec.dgc.revocationdistribution.model.ChangeList; +import eu.europa.ec.dgc.revocationdistribution.model.ChangeListItem; +import eu.europa.ec.dgc.revocationdistribution.repository.CoordinateViewRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.KidViewRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.PartitionRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.PointViewRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.SliceRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.VectorViewRepository; +import eu.europa.ec.dgc.revocationdistribution.utils.HelperFunctions; import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.HashMap; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java similarity index 83% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java index baed603..e7dcd29 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/InfoService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java @@ -18,14 +18,11 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; -import europa.ec.dgc.revocationdistribution.entity.InfoEntity; -import europa.ec.dgc.revocationdistribution.entity.KidViewEntity; -import europa.ec.dgc.revocationdistribution.repository.InfoRepository; -import europa.ec.dgc.revocationdistribution.repository.KidViewRepository; -import java.util.List; +import eu.europa.ec.dgc.revocationdistribution.entity.InfoEntity; +import eu.europa.ec.dgc.revocationdistribution.repository.InfoRepository; import java.util.Optional; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java similarity index 91% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java index 4ffcef7..45866ea 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/LookupService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java @@ -18,18 +18,18 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; import com.nimbusds.jose.JOSEException; import com.nimbusds.jose.jwk.ECKey; import com.nimbusds.jose.util.Base64URL; -import europa.ec.dgc.revocationdistribution.client.IssuanceDgciRestClient; -import europa.ec.dgc.revocationdistribution.dto.DidAuthentication; -import europa.ec.dgc.revocationdistribution.dto.DidDocument; -import europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; -import europa.ec.dgc.revocationdistribution.exception.TokenValidationException; -import europa.ec.dgc.revocationdistribution.repository.HashesRepository; +import eu.europa.ec.dgc.revocationdistribution.client.IssuanceDgciRestClient; +import eu.europa.ec.dgc.revocationdistribution.dto.DidAuthentication; +import eu.europa.ec.dgc.revocationdistribution.dto.DidDocument; +import eu.europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; +import eu.europa.ec.dgc.revocationdistribution.exception.TokenValidationException; +import eu.europa.ec.dgc.revocationdistribution.repository.HashesRepository; import feign.FeignException; import io.jsonwebtoken.Claims; import java.security.PublicKey; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java similarity index 91% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java index 9321e50..e4110d5 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java @@ -18,12 +18,12 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; -import europa.ec.dgc.revocationdistribution.exception.TokenValidationException; +import eu.europa.ec.dgc.revocationdistribution.dto.RevocationCheckTokenPayload; +import eu.europa.ec.dgc.revocationdistribution.exception.TokenValidationException; import io.jsonwebtoken.Jwt; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureException; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java similarity index 99% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index 3eec056..a3e6f38 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; import eu.europa.ec.dgc.gateway.connector.DgcGatewayRevocationListDownloadConnector; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java similarity index 91% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java index 41f34d3..ffd2a5c 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/RevocationListService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java @@ -18,23 +18,23 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; import eu.europa.ec.dgc.gateway.connector.dto.RevocationBatchDto; -import europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; -import europa.ec.dgc.revocationdistribution.entity.BatchListEntity; -import europa.ec.dgc.revocationdistribution.entity.HashesEntity; -import europa.ec.dgc.revocationdistribution.entity.PartitionEntity; -import europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; -import europa.ec.dgc.revocationdistribution.entity.SliceEntity; -import europa.ec.dgc.revocationdistribution.exception.DataNotFoundException; -import europa.ec.dgc.revocationdistribution.mapper.PartitionListMapper; -import europa.ec.dgc.revocationdistribution.repository.BatchListRepository; -import europa.ec.dgc.revocationdistribution.repository.HashesRepository; -import europa.ec.dgc.revocationdistribution.repository.PartitionRepository; -import europa.ec.dgc.revocationdistribution.repository.RevocationListJsonRepository; -import europa.ec.dgc.revocationdistribution.repository.SliceRepository; +import eu.europa.ec.dgc.revocationdistribution.dto.PartitionResponseDto; +import eu.europa.ec.dgc.revocationdistribution.entity.BatchListEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.HashesEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.PartitionEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.RevocationListJsonEntity; +import eu.europa.ec.dgc.revocationdistribution.entity.SliceEntity; +import eu.europa.ec.dgc.revocationdistribution.exception.DataNotFoundException; +import eu.europa.ec.dgc.revocationdistribution.mapper.PartitionListMapper; +import eu.europa.ec.dgc.revocationdistribution.repository.BatchListRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.HashesRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.PartitionRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.RevocationListJsonRepository; +import eu.europa.ec.dgc.revocationdistribution.repository.SliceRepository; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java similarity index 87% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java index 40ceb1d..1feaa75 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java @@ -18,9 +18,9 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; -import europa.ec.dgc.revocationdistribution.dto.SliceDataDto; +import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; public interface SliceCalculationService { diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java similarity index 88% rename from src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java index 30d2c7f..09603e4 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java @@ -18,13 +18,13 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.service; +package eu.europa.ec.dgc.revocationdistribution.service; -import europa.ec.dgc.bloomfilter.BloomFilter; -import europa.ec.dgc.bloomfilter.BloomFilterImpl; -import europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; -import europa.ec.dgc.revocationdistribution.dto.SliceDataDto; -import europa.ec.dgc.revocationdistribution.utils.HelperFunctions; +import eu.europa.ec.dgc.bloomfilter.BloomFilter; +import eu.europa.ec.dgc.bloomfilter.BloomFilterImpl; +import eu.europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; +import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; +import eu.europa.ec.dgc.revocationdistribution.utils.HelperFunctions; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.security.NoSuchAlgorithmException; diff --git a/src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java similarity index 97% rename from src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java index efecac2..43bb6de 100644 --- a/src/main/java/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java @@ -18,7 +18,7 @@ * ---license-end */ -package europa.ec.dgc.revocationdistribution.utils; +package eu.europa.ec.dgc.revocationdistribution.utils; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; From c99bfe31240fe1fea7b82f7fba82e82ff2c93d11 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Thu, 10 Feb 2022 13:50:47 +0100 Subject: [PATCH 05/20] Improve error handling for wrong token format --- .../service/RevocationCheckTokenParser.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java index e4110d5..f0d65c7 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java @@ -63,6 +63,12 @@ public RevocationCheckTokenPayload parseToken(String jwtCompact, PublicKey publi */ public Jwt extractPayload(String jwtCompact) { String[] splitToken = jwtCompact.split("\\."); + + if (splitToken.length < 2 ) { + throw new TokenValidationException("Failed to parse revocation check token. Wrong format.", + HttpStatus.BAD_REQUEST.value()); + } + String unsignedToken = splitToken[0] + "." + splitToken[1] + "."; return Jwts.parser().parse(unsignedToken); } From c178866a90c6666b4e53862275f32e157d279039 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Fri, 11 Feb 2022 12:01:57 +0100 Subject: [PATCH 06/20] Reformat code and adjust public key lookup --- README.md | 2 +- .../ec/dgc/bloomfilter/BloomFilter.java | 10 ++- .../ec/dgc/bloomfilter/BloomFilterImpl.java | 73 +++++++++---------- .../client/IssuanceDgciRestClient.java | 2 +- .../config/DgcConfigProperties.java | 1 - .../config/OpenApiConfig.java | 14 ++-- .../config/ShedLockConfig.java | 4 +- .../controller/LookupController.java | 7 +- .../controller/RevocationListController.java | 55 +++++++------- .../dto/ChunkMetaViewDto.java | 2 +- .../dto/PartitionChunksJsonItemDto.java | 8 +- .../dto/PartitionResponseDto.java | 4 +- .../dto/RevocationListJsonResponseDto.java | 2 +- .../entity/AbstractChunkMetaViewEntity.java | 4 +- .../entity/BatchListEntity.java | 6 +- .../entity/HashesEntity.java | 6 +- .../entity/KidViewEntity.java | 6 +- .../entity/PartitionEntity.java | 8 +- .../entity/RevocationListJsonEntity.java | 6 +- .../entity/SliceEntity.java | 6 +- .../exception/DataNotFoundException.java | 2 +- .../PreconditionFailedException.java | 2 +- .../exception/TokenValidationException.java | 2 +- .../model/ChangeListItem.java | 2 +- .../repository/CoordinateViewRepository.java | 4 +- .../repository/KidViewRepository.java | 2 +- .../repository/PartitionRepository.java | 2 +- .../repository/PointViewRepository.java | 2 +- .../repository/SliceRepository.java | 2 +- .../repository/VectorViewRepository.java | 4 +- .../service/GeneratorService.java | 70 +++++++++--------- .../service/InfoService.java | 2 +- .../service/LookupService.java | 20 +++-- .../service/RevocationCheckTokenParser.java | 9 ++- ...ocationListDownloadServiceGatewayImpl.java | 21 +++--- .../service/RevocationListService.java | 4 +- .../service/SliceCalculationService.java | 2 +- ...liceCalculationServiceBloomFilterImpl.java | 8 +- .../utils/HelperFunctions.java | 5 +- 39 files changed, 204 insertions(+), 187 deletions(-) diff --git a/README.md b/README.md index 44efa27..cf97411 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

EU Digital COVID Certificate Revocation Distribution Service - +

diff --git a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java index c9e8d76..21afd77 100644 --- a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java +++ b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java @@ -12,13 +12,21 @@ public interface BloomFilter { float getP(); + int getK(); + long getM(); + int getN(); + int getCurrentN(); + void add(byte[] element) throws NoSuchAlgorithmException, IOException; + boolean mightContain(byte[] element) throws NoSuchAlgorithmException, IOException; + void readFrom(InputStream inputStream); + void writeTo(OutputStream outputStream) throws IOException; - + } diff --git a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java index c0b8df3..8476e98 100644 --- a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java @@ -30,8 +30,8 @@ public class BloomFilterImpl implements BloomFilter, Serializable { private float probRate; private AtomicIntegerArray data; private final static int NUM_BITS = 8; - private final static byte NUM_BYTES=Integer.BYTES; - private final static byte NUM_BIT_FORMAT = (NUM_BYTES*NUM_BITS); + private final static byte NUM_BYTES = Integer.BYTES; + private final static byte NUM_BIT_FORMAT = (NUM_BYTES * NUM_BITS); //@Serial private static final long serialVersionUID = 7526472295622776147L; @@ -43,10 +43,10 @@ public BloomFilterImpl(InputStream inputStream) { this.readFromStream(dis); } - public BloomFilterImpl(int size, byte numberOfHashes,int numberOfElements) { + public BloomFilterImpl(int size, byte numberOfHashes, int numberOfElements) { super(); - if (numberOfHashes <= 0 || size<=0) { + if (numberOfHashes <= 0 || size <= 0) { throw new IllegalArgumentException("numberOfElements <=0, numberOfHashes <= 0, probRate <= 1"); } @@ -54,49 +54,49 @@ public BloomFilterImpl(int size, byte numberOfHashes,int numberOfElements) { throw new IllegalArgumentException("numberOfHashes cannot be 0"); } - size = (size / NUM_BYTES)+(size % NUM_BYTES); + size = (size / NUM_BYTES) + (size % NUM_BYTES); long heapFreeSize = Runtime.getRuntime().freeMemory(); - if(heapFreeSize<(long)size*NUM_BYTES) { + if (heapFreeSize < (long) size * NUM_BYTES) { throw new IllegalArgumentException("Heap size not big enough"); } this.definedElementAmount = numberOfElements; - this.numBits = (long)size*NUM_BIT_FORMAT; + this.numBits = (long) size * NUM_BIT_FORMAT; this.numberOfHashes = numberOfHashes; - this.probRate = (float) Math.pow(1 - Math.exp(-numberOfHashes / (float)( (float)(this.numBits / NUM_BITS) / numberOfElements)), numberOfHashes); + this.probRate = (float) Math.pow(1 - Math.exp(-numberOfHashes / ((float) (this.numBits / NUM_BITS) / numberOfElements)), numberOfHashes); this.data = new AtomicIntegerArray(size); } public BloomFilterImpl(int numberOfElements, float probRate) { super(); - if (numberOfElements <= 0 || probRate > 1 || probRate <= 0) { + if (numberOfElements <= 0 || probRate > 1 || probRate <= 0) { throw new IllegalArgumentException("numberOfElements <=0, probRate <= 1"); } // n: numberOfElements // m: numberOfBits -> ceil((n * log(p)) / log(1 / pow(2, log(2)))); - this.numBits = (long) (Math.ceil((numberOfElements * Math.log((double)probRate)) / Math.log(1 / Math.pow(2, Math.log(2))))); - - int bytes = (int)(this.numBits / NUM_BITS)+1; - int size = (bytes / NUM_BYTES)+(bytes % NUM_BYTES); + this.numBits = (long) (Math.ceil((numberOfElements * Math.log(probRate)) / Math.log(1 / Math.pow(2, Math.log(2))))); + + int bytes = (int) (this.numBits / NUM_BITS) + 1; + int size = (bytes / NUM_BYTES) + (bytes % NUM_BYTES); this.numBits = size * NUM_BIT_FORMAT; long heapFreeSize = Runtime.getRuntime().freeMemory(); - if (size<=0) { + if (size <= 0) { throw new IllegalArgumentException("Size can not be 0"); } - if (heapFreeSize < (long)size*NUM_BYTES) { + if (heapFreeSize < (long) size * NUM_BYTES) { throw new IllegalArgumentException("Heap size not big enough"); } - + this.definedElementAmount = numberOfElements; - this.numberOfHashes = (byte)Math.max(1, (int) Math.round((double) this.numBits / numberOfElements * Math.log(2))); - - if(numberOfHashes<0) { + this.numberOfHashes = (byte) Math.max(1, (int) Math.round((double) this.numBits / numberOfElements * Math.log(2))); + + if (numberOfHashes < 0) { throw new IllegalArgumentException("Number of Hashes to high. Please check the Probalistic Rate (limit arround 1.0E-38)"); } - + this.probRate = probRate; this.data = new AtomicIntegerArray(size); } @@ -108,16 +108,16 @@ public AtomicIntegerArray getData() { @Override public void add(byte[] element) throws NoSuchAlgorithmException, IOException { for (int i = 0; i < this.numberOfHashes; i++) { - long index = this.calcIndex(element, i,this.numBits).longValue(); - int bytepos = (int)index/NUM_BIT_FORMAT; + long index = this.calcIndex(element, i, this.numBits).longValue(); + int bytepos = (int) index / NUM_BIT_FORMAT; index -= bytepos * NUM_BIT_FORMAT; - Integer pattern = Integer.MIN_VALUE>>>index-1; - this.data.set(bytepos,this.data.get(bytepos) | pattern); + Integer pattern = Integer.MIN_VALUE >>> index - 1; + this.data.set(bytepos, this.data.get(bytepos) | pattern); } currentElementAmount++; - - if(currentElementAmount >= definedElementAmount) { - Logger.getGlobal().warning("Filter is filled. All other Elements may result in a higher False Positve Rate than defined!"); + + if (currentElementAmount >= definedElementAmount) { + Logger.getGlobal().warning("Filter is filled. All other Elements may result in a higher False Positve Rate than defined!"); } } @@ -125,15 +125,14 @@ public void add(byte[] element) throws NoSuchAlgorithmException, IOException { public boolean mightContain(byte[] element) throws NoSuchAlgorithmException, IOException { boolean result = true; for (int i = 0; i < this.numberOfHashes; i++) { - long index = this.calcIndex(element, i,this.numBits).longValue(); - int bytepos = (int)index/NUM_BIT_FORMAT; + long index = this.calcIndex(element, i, this.numBits).longValue(); + int bytepos = (int) index / NUM_BIT_FORMAT; index -= bytepos * NUM_BIT_FORMAT; - long pattern = Integer.MIN_VALUE>>>index-1; + long pattern = Integer.MIN_VALUE >>> index - 1; if ((this.data.get(bytepos) & pattern) == pattern) { - result&=true; - } - else { - result &=false; + result &= true; + } else { + result &= false; break; } } @@ -178,7 +177,7 @@ public void writeTo(OutputStream outputStream) throws IOException { dataOutputStream.writeFloat(this.probRate); dataOutputStream.writeInt(this.definedElementAmount); dataOutputStream.writeInt(this.currentElementAmount); - dataOutputStream.writeInt(this.getData().length()); + dataOutputStream.writeInt(this.getData().length()); for (int i = 0; i < this.getData().length(); i++) { dataOutputStream.writeInt(this.getData().get(i)); } @@ -258,13 +257,13 @@ public int hashCode() { } private void readObject( - ObjectInputStream inputStream + ObjectInputStream inputStream ) throws ClassNotFoundException, IOException { inputStream.defaultReadObject(); } private void writeObject( - ObjectOutputStream outputStream + ObjectOutputStream outputStream ) throws IOException { outputStream.defaultWriteObject(); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java index fc911e9..7c36f14 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java @@ -38,7 +38,7 @@ public interface IssuanceDgciRestClient { /** * Gets the the dgci for a given hash value. * - * @param hash The hash value of the dgci + * @param hash The hash value of the dgci * @return dgci values as DidDocument. */ @GetMapping(value = "/dgci/{hash}", produces = MediaType.APPLICATION_JSON_VALUE) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java index f64516c..4ef12a2 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java @@ -33,7 +33,6 @@ public class DgcConfigProperties { private final BloomFilterConfig bloomFilter = new BloomFilterConfig(); - @Getter @Setter public static class GatewayDownload { diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java index d52dc1a..2e97bb7 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/OpenApiConfig.java @@ -56,12 +56,12 @@ public OpenAPI openApi() { version = "dev"; } return new OpenAPI() - .info(new Info() - .title("EU Digital COVID Certificate Revocation Distribution Service") - .description("The API provides the endpoints for retrieving the revocation list") - .version(version) - .license(new License() - .name("Apache 2.0") - .url("https://www.apache.org/licenses/LICENSE-2.0"))); + .info(new Info() + .title("EU Digital COVID Certificate Revocation Distribution Service") + .description("The API provides the endpoints for retrieving the revocation list") + .version(version) + .license(new License() + .name("Apache 2.0") + .url("https://www.apache.org/licenses/LICENSE-2.0"))); } } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java index cd8ce85..5874fd8 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/ShedLockConfig.java @@ -20,8 +20,6 @@ package eu.europa.ec.dgc.revocationdistribution.config; -import static net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider.Configuration.builder; - import javax.sql.DataSource; import net.javacrumbs.shedlock.core.LockProvider; import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider; @@ -29,6 +27,8 @@ import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.core.JdbcTemplate; +import static net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider.Configuration.builder; + @Configuration public class ShedLockConfig { diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java index bf21233..7f4fccb 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/LookupController.java @@ -46,12 +46,13 @@ public class LookupController { /** * Http Method for getting the revocation list. + * * @return */ @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity> lockupRevocation( - @Valid @RequestBody(required = false) List revocationCheckTokenList - ){ + @Valid @RequestBody(required = false) List revocationCheckTokenList + ) { if (revocationCheckTokenList.isEmpty()) { return ResponseEntity.ok(new ArrayList<>()); } @@ -63,7 +64,7 @@ public ResponseEntity> lockupRevocation( return ResponseEntity.ok(result); } - @GetMapping(path= "/key", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(path = "/key", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity getKey() { PublicKey result; String hash = "Pu3LWoDPQv3lH53fcYmCOb12mHPd354tAXdWJDQns1U%3d"; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java index 1e7c960..76fb2fa 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/controller/RevocationListController.java @@ -62,6 +62,7 @@ public class RevocationListController { /** * Http Method for getting the revocation list. + * * @return */ @GetMapping(path = "lists", produces = MediaType.APPLICATION_JSON_VALUE) @@ -75,7 +76,7 @@ public ResponseEntity revocationListJsonEntity = revocationListService.getRevocationListJsonData(currentEtag); - if(!revocationListJsonEntity.isPresent()) { + if (!revocationListJsonEntity.isPresent()) { return ResponseEntity.notFound().build(); } @@ -85,6 +86,7 @@ public ResponseEntity> getPartitionListForKid( @RequestHeader(value = HttpHeaders.IF_MATCH, required = true) String ifMatch, @RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) String ifModifiedSince ) { - + kid = transformBase64Url(kid); String currentEtag = checkEtag(ifMatch); @@ -121,6 +123,7 @@ public ResponseEntity> getPartitionListForKid( /** * Http Method for getting the a partition of a kid. + * * @return */ @GetMapping(path = "lists/{kid}/partitions/{id}", produces = MediaType.APPLICATION_JSON_VALUE) @@ -132,7 +135,7 @@ public ResponseEntity getPartitionForKid( ) { kid = transformBase64Url(kid); - + String currentEtag = checkEtag(ifMatch); PartitionResponseDto result; @@ -144,7 +147,7 @@ public ResponseEntity getPartitionForKid( } catch (DateTimeParseException e) { return ResponseEntity.status(HttpStatus.BAD_REQUEST).build(); } - result = revocationListService.getPartitionsByKidAndId(currentEtag, kid, id );// ifModifiedDateTime); + result = revocationListService.getPartitionsByKidAndId(currentEtag, kid, id);// ifModifiedDateTime); } else { result = revocationListService.getPartitionsByKidAndId(currentEtag, kid, id); } @@ -156,29 +159,29 @@ public ResponseEntity getPartitionForKid( /** * Http Method for getting the data of a partition. + * * @return gzip file containing data */ @PostMapping(path = "lists/{kid}/partitions/{id}/slices", consumes = MediaType.APPLICATION_JSON_VALUE, - produces ="application/gzip") + produces = "application/gzip") public ResponseEntity getPartitionChunksData( @PathVariable String kid, @PathVariable String id, @RequestHeader(value = HttpHeaders.IF_MATCH, required = true) String ifMatch, - @Valid @RequestBody(required = false) List reqestedChunksList + @Valid @RequestBody(required = false) List reqestedChunksList ) { kid = transformBase64Url(kid); - + String currentEtag = checkEtag(ifMatch); byte[] result; - if (reqestedChunksList == null){ + if (reqestedChunksList == null) { result = revocationListService.getAllChunkDataFromPartition(currentEtag, kid, id); - } - else { + } else { result = revocationListService.getAllChunkDataFromPartitionWithFilter(currentEtag, kid, id, reqestedChunksList); } @@ -187,22 +190,22 @@ public ResponseEntity getPartitionChunksData( /** * Http Method for getting the slice data. + * * @return gzip file containing slice data */ - @GetMapping(path = "lists/{kid}/partitions/{id}/chunks/{cid}/slices", produces ="application/gzip") + @GetMapping(path = "lists/{kid}/partitions/{id}/chunks/{cid}/slices", produces = "application/gzip") public ResponseEntity getChunk( @PathVariable String kid, @PathVariable String id, @PathVariable String cid, @RequestHeader(value = HttpHeaders.IF_MATCH, required = true) String ifMatch ) { - + kid = transformBase64Url(kid); String currentEtag = checkEtag(ifMatch); - byte[] result = revocationListService.getChunkData(currentEtag, kid, id, cid); return ResponseEntity.ok(result); @@ -210,29 +213,29 @@ public ResponseEntity getChunk( /** * Http Method for getting the data of a partition. + * * @return gzip file containing data */ @PostMapping(path = "lists/{kid}/partitions/{id}/chunks/{cid}/slices", consumes = MediaType.APPLICATION_JSON_VALUE, - produces ="application/gzip") + produces = "application/gzip") public ResponseEntity getPartitionChunks( @PathVariable String kid, @PathVariable String id, @PathVariable String cid, @RequestHeader(value = HttpHeaders.IF_MATCH, required = true) String ifMatch, - @Valid @RequestBody(required = false) List reqestedSliceList + @Valid @RequestBody(required = false) List reqestedSliceList ) { - + kid = transformBase64Url(kid); String currentEtag = checkEtag(ifMatch); byte[] result; - if (reqestedSliceList == null){ + if (reqestedSliceList == null) { result = revocationListService.getChunkData(currentEtag, kid, id, cid); - } - else { + } else { result = revocationListService.getAllSliceDataForChunkWithFilter(currentEtag, kid, id, cid, reqestedSliceList); } @@ -240,13 +243,13 @@ public ResponseEntity getPartitionChunks( } - /** * Http Method for getting the slice data. + * * @return gzip file containing slice data */ @GetMapping(path = "lists/{kid}/partitions/{id}/chunks/{cid}/slices/{sid}", - produces ="application/gzip") + produces = "application/gzip") public ResponseEntity getSlice( @PathVariable String kid, @PathVariable String id, @@ -255,21 +258,21 @@ public ResponseEntity getSlice( @RequestHeader(value = HttpHeaders.IF_MATCH, required = true) String ifMatch, @RequestHeader(value = HttpHeaders.IF_MODIFIED_SINCE, required = false) String ifModifiedSince ) { - + kid = transformBase64Url(kid); String currentEtag = checkEtag(ifMatch); byte[] result = revocationListService.getSliceData(currentEtag, kid, id, cid, sid); - if (result== null) { + if (result == null) { return ResponseEntity.status(HttpStatus.NOT_FOUND).build(); } return ResponseEntity.ok(result); } - - /** + + /** * Method to transform a base64url object * returns a base64 object from a base64url object */ @@ -278,8 +281,8 @@ private String transformBase64Url(String kid) { } /** - * * Method to check Etag Header + * * @param etag to check * @return etag without quotes * @throws PreconditionFailedException diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java index bd55139..d4d7387 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/ChunkMetaViewDto.java @@ -27,7 +27,7 @@ @Value @AllArgsConstructor -public class ChunkMetaViewDto { +public class ChunkMetaViewDto { String rowId; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java index 521821d..9dd855f 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionChunksJsonItemDto.java @@ -28,12 +28,12 @@ @Data @AllArgsConstructor @NoArgsConstructor -public class PartitionChunksJsonItemDto implements Serializable{ +public class PartitionChunksJsonItemDto implements Serializable { - private String type; + private String type; - private String version; + private String version; - private String hash; + private String hash; } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java index d56e19f..834134d 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/PartitionResponseDto.java @@ -42,8 +42,8 @@ public class PartitionResponseDto { ZonedDateTime lastUpdated; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "UTC") - ZonedDateTime expired; + ZonedDateTime expired; - Map> chunks; + Map> chunks; } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java index 405b41a..bf5cd48 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/dto/RevocationListJsonResponseDto.java @@ -29,7 +29,7 @@ import lombok.NoArgsConstructor; @Data -public class RevocationListJsonResponseDto implements Serializable{ +public class RevocationListJsonResponseDto implements Serializable { List items; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java index d8d00b1..4e9e108 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/AbstractChunkMetaViewEntity.java @@ -83,13 +83,13 @@ public abstract class AbstractChunkMetaViewEntity { private String chunk; /** - * The creation date of the entity. + * The creation date of the entity. */ @Column(name = "lastupdated") private ZonedDateTime lastUpdated; /** - * The expiration date of the entity. + * The expiration date of the entity. */ @Column(name = "expired") private ZonedDateTime expired; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java index 4794b1a..43de033 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/BatchListEntity.java @@ -77,15 +77,15 @@ public class BatchListEntity { private String kid; /** - * The creation date of the entity + * The creation date of the entity */ @Column(name = "created_at") private ZonedDateTime createdAt; @PrePersist - private void prePersistFunction(){ + private void prePersistFunction() { - if(createdAt == null){ + if (createdAt == null) { createdAt = ZonedDateTime.now(); } } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java index 5be0c78..6957e0c 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/HashesEntity.java @@ -54,19 +54,19 @@ public class HashesEntity { /** * The first byte of the hash */ - @Column(name = "x", nullable = false, length=1, columnDefinition="CHAR") + @Column(name = "x", nullable = false, length = 1, columnDefinition = "CHAR") private char x; /** * The second byte of the hash */ - @Column(name = "y", nullable = false, length=1, columnDefinition="CHAR") + @Column(name = "y", nullable = false, length = 1, columnDefinition = "CHAR") private char y; /** * The third byte of the hash */ - @Column(name = "z", nullable = false, length=1, columnDefinition="CHAR") + @Column(name = "z", nullable = false, length = 1, columnDefinition = "CHAR") private char z; /** diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java index e2e9155..3cf753f 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/KidViewEntity.java @@ -41,7 +41,7 @@ @Immutable public class KidViewEntity { - public static final List TYPES_NAMES = new ArrayList<>(List.of( "UCI", "SIGNATURE", "COUNTRYCODEUCI")); + public static final List TYPES_NAMES = new ArrayList<>(List.of("UCI", "SIGNATURE", "COUNTRYCODEUCI")); /** * The KID of the Key used to sign the CMS. @@ -63,13 +63,13 @@ public class KidViewEntity { private String storageMode; /** - * The creation date of the entity + * The creation date of the entity */ @Column(name = "lastupdated") private ZonedDateTime lastUpdated; /** - * The expiration date of the entity + * The expiration date of the entity */ @Column(name = "expired") private ZonedDateTime expired; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java index 9c66561..17955e7 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/PartitionEntity.java @@ -90,14 +90,14 @@ public class PartitionEntity { private String z; /** - * The creation date of the entity. + * The creation date of the entity. */ @Column(name = "lastupdated") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "UTC") private ZonedDateTime lastUpdated; /** - * The expiration date of the entity. + * The expiration date of the entity. */ @Column(name = "expired") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "UTC") @@ -108,12 +108,12 @@ public class PartitionEntity { */ @Type(type = "jsonb") @Column(name = "chunks_json_data", columnDefinition = "jsonb") - private Map> chunks; + private Map> chunks; /** * Indicates if the partition needs to be deleted on etag change. */ - @Column(name= "to_be_deleted") + @Column(name = "to_be_deleted") private boolean toBeDeleted; } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java index 04e9eb0..2a33ae4 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/RevocationListJsonEntity.java @@ -55,15 +55,15 @@ public class RevocationListJsonEntity { /** - * The creation date of the entity + * The creation date of the entity */ @Column(name = "created_at") private ZonedDateTime createdAt; @PrePersist - private void prePersistFunction(){ + private void prePersistFunction() { - if(createdAt == null){ + if (createdAt == null) { createdAt = ZonedDateTime.now(); } } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java index 66dd12a..2a2373e 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/entity/SliceEntity.java @@ -78,14 +78,14 @@ public class SliceEntity { private String hash; /** - * The creation date of the entity. + * The creation date of the entity. */ @Column(name = "lastupdated") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "UTC") private ZonedDateTime lastUpdated; /** - * The expiration date of the entity. + * The expiration date of the entity. */ @Column(name = "expired") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXXX", timezone = "UTC") @@ -100,7 +100,7 @@ public class SliceEntity { /** * Indicates if the slice needs to be deleted on etag change. */ - @Column(name= "to_be_deleted") + @Column(name = "to_be_deleted") private boolean toBeDeleted; } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java index 4a69166..fdece28 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/DataNotFoundException.java @@ -20,6 +20,6 @@ package eu.europa.ec.dgc.revocationdistribution.exception; -public class DataNotFoundException extends RuntimeException{ +public class DataNotFoundException extends RuntimeException { } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java index 966bb6d..54c2cff 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/PreconditionFailedException.java @@ -20,6 +20,6 @@ package eu.europa.ec.dgc.revocationdistribution.exception; -public class PreconditionFailedException extends RuntimeException{ +public class PreconditionFailedException extends RuntimeException { } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java index 79f4a0c..93a9990 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/exception/TokenValidationException.java @@ -20,7 +20,7 @@ package eu.europa.ec.dgc.revocationdistribution.exception; -public class TokenValidationException extends RuntimeException{ +public class TokenValidationException extends RuntimeException { public int getStatus() { return status; } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java index 3dd8a17..64d0bf0 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/ChangeListItem.java @@ -29,7 +29,7 @@ @Setter public class ChangeListItem { - public ChangeListItem (KidViewEntity kve, String oldStorageMode){ + public ChangeListItem(KidViewEntity kve, String oldStorageMode) { this.kidId = kve.getKid(); this.lastUpdated = kve.getLastUpdated(); this.expired = kve.getExpired(); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java index 8b3cb82..abb040e 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/CoordinateViewRepository.java @@ -25,10 +25,10 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -public interface CoordinateViewRepository extends ReadOnlyRepository{ +public interface CoordinateViewRepository extends ReadOnlyRepository { List findAllByKidAndId(String kid, String id); @Query("SELECT DISTINCT c.id FROM CoordinateViewEntity c WHERE c.kid = :kid") - List findDistinctIdsByKid(@Param("kid") String kId); + List findDistinctIdsByKid(@Param("kid") String kid); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java index bf2e0e7..2df389c 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/KidViewRepository.java @@ -22,6 +22,6 @@ import eu.europa.ec.dgc.revocationdistribution.entity.KidViewEntity; -public interface KidViewRepository extends ReadOnlyRepository{ +public interface KidViewRepository extends ReadOnlyRepository { } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java index d55e98f..d3ff5f3 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PartitionRepository.java @@ -35,7 +35,7 @@ public interface PartitionRepository extends JpaRepository kIds); + void setToBeDeletedForKids(@Param("kids") List kids); Optional findOneByEtagAndKidAndId(String etag, String kid, String id); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java index 0c43a93..2de4a78 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/PointViewRepository.java @@ -23,7 +23,7 @@ import eu.europa.ec.dgc.revocationdistribution.entity.PointViewEntity; import java.util.List; -public interface PointViewRepository extends ReadOnlyRepository{ +public interface PointViewRepository extends ReadOnlyRepository { List findAllByKid(String kid); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java index 4281362..34c5287 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/SliceRepository.java @@ -41,7 +41,7 @@ public interface SliceRepository extends JpaRepository { @Modifying @Query("UPDATE SliceEntity s SET s.toBeDeleted = true WHERE s.kid in :kids") - void setToBeDeletedForKids(@Param("kids") List kIds); + void setToBeDeletedForKids(@Param("kids") List kids); List findAllByEtagAndKidAndId(String etag, String kid, String id); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java index 44c730d..44ac86d 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/repository/VectorViewRepository.java @@ -25,11 +25,11 @@ import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; -public interface VectorViewRepository extends ReadOnlyRepository{ +public interface VectorViewRepository extends ReadOnlyRepository { List findAllByKidAndId(String kid, String id); @Query("SELECT DISTINCT v.id FROM VectorViewEntity v WHERE v.kid = :kid") - List findDistinctIdsByKid(@Param("kid") String kId); + List findDistinctIdsByKid(@Param("kid") String kid); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index 9d61462..a5b461e 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -95,7 +95,9 @@ public class GeneratorService { @PostConstruct private void postConstruct() { etag = infoService.getValueForKey(InfoService.CURRENT_ETAG); - if (etag == null) { etag = ""; } + if (etag == null) { + etag = ""; + } } public void generateNewDataSet() { @@ -131,12 +133,12 @@ private ChangeList generateList() { //Update Items kidViewEntityList.stream().forEach(kve -> { - if (kve.getTypes().isEmpty() && kve.getExpired() == null ) { - log.debug("Delete kid entry : {} ",kve.getKid()); - if ( itemsMap.remove(kve.getKid()) != null ) { - changeList.getDeleted().add( new ChangeListItem(kve, null)); + if (kve.getTypes().isEmpty() && kve.getExpired() == null) { + log.debug("Delete kid entry : {} ", kve.getKid()); + if (itemsMap.remove(kve.getKid()) != null) { + changeList.getDeleted().add(new ChangeListItem(kve, null)); } - }else{ + } else { if (kve.isUpdated()) { RevocationListJsonResponseItemDto oldItem; RevocationListJsonResponseItemDto item; @@ -148,9 +150,9 @@ private ChangeList generateList() { item.setExpires(kve.getExpired()); oldItem = itemsMap.put(item.getKid(), item); if (oldItem != null) { - changeList.getUpdated().add( new ChangeListItem(kve, oldItem.getMode())); + changeList.getUpdated().add(new ChangeListItem(kve, oldItem.getMode())); } else { - changeList.getCreated().add( new ChangeListItem(kve,null)); + changeList.getCreated().add(new ChangeListItem(kve, null)); } } } @@ -168,13 +170,13 @@ private ChangeList generateList() { private void handleChangeList(ChangeList changeList) { //handle deleted kIds - ListdeletedKids = + List deletedKids = changeList.getDeleted().stream().map(ChangeListItem::getKidId).collect(Collectors.toList()); markDataForRemoval(deletedKids); //handle updated kIds - ListupdatedKids = + List updatedKids = changeList.getUpdated().stream().map(ChangeListItem::getKidId).collect(Collectors.toList()); markDataForRemoval(updatedKids); @@ -186,8 +188,8 @@ private void handleChangeList(ChangeList changeList) { } - private void markDataForRemoval(List kIds){ - if(!kIds.isEmpty()) { + private void markDataForRemoval(List kIds) { + if (!kIds.isEmpty()) { partitionRepository.setToBeDeletedForKids(kIds); sliceRepository.setToBeDeletedForKids(kIds); } @@ -196,14 +198,14 @@ private void markDataForRemoval(List kIds){ private void generatePattern(List changeListItems) { - for(ChangeListItem changeItem : changeListItems) { - switch(changeItem.getNewStorageMode()){ + for (ChangeListItem changeItem : changeListItems) { + switch (changeItem.getNewStorageMode()) { case "POINT": { log.debug("Create pattern for kid {} in POINT mode.", changeItem.getKidId()); generatePartitionsForKidInPointMode(changeItem); break; } - case "VECTOR":{ + case "VECTOR": { log.debug("Create pattern for kid {} in VECTOR mode.", changeItem.getKidId()); generatePartitionsForKidInVectorMode(changeItem); break; @@ -221,7 +223,7 @@ private void generatePattern(List changeListItems) { } } - private void generatePartitionsForKidInPointMode(ChangeListItem changeItem){ + private void generatePartitionsForKidInPointMode(ChangeListItem changeItem) { List entities = pointViewRepository.findAllByKid(changeItem.getKidId()).stream() .map(pointViewMapper::map).collect(Collectors.toList()); @@ -231,17 +233,17 @@ private void generatePartitionsForKidInPointMode(ChangeListItem changeItem){ } - private void generatePartitionsForKidInVectorMode(ChangeListItem changeItem){ + private void generatePartitionsForKidInVectorMode(ChangeListItem changeItem) { //get all ids for kId List partitionIds = vectorViewRepository.findDistinctIdsByKid(changeItem.getKidId()); - log.debug("PartionIds {}",partitionIds); + log.debug("PartionIds {}", partitionIds); - for (String partitionId : partitionIds ){ + for (String partitionId : partitionIds) { List entities = vectorViewRepository.findAllByKidAndId(changeItem.getKidId(), partitionId).stream() - .map(vectorViewMapper::map).collect(Collectors.toList()); + .map(vectorViewMapper::map).collect(Collectors.toList()); generatePartition(entities, changeItem.getKidId(), partitionId); @@ -249,14 +251,14 @@ private void generatePartitionsForKidInVectorMode(ChangeListItem changeItem){ } - private void generatePartitionsForKidInCoordinateMode(ChangeListItem changeItem){ + private void generatePartitionsForKidInCoordinateMode(ChangeListItem changeItem) { //get all ids for kId List partitionIds = coordinateViewRepository.findDistinctIdsByKid(changeItem.getKidId()); - log.debug("PartionIds {}",partitionIds); + log.debug("PartionIds {}", partitionIds); - for (String partitionId : partitionIds ){ + for (String partitionId : partitionIds) { List entities = coordinateViewRepository.findAllByKidAndId(changeItem.getKidId(), partitionId).stream() .map(coordinateViewMapper::map).collect(Collectors.toList()); @@ -275,19 +277,18 @@ private void generatePartition(List entities, ZonedDateTime lastUpdated = ZonedDateTime.parse("2021-06-01T00:00:00Z"); ZonedDateTime expired = ZonedDateTime.parse("2021-06-01T00:00:00Z"); - if (entities.isEmpty()){ + if (entities.isEmpty()) { log.info("No Entries found in Point View for kid: {} id: {} x: {} y: {}", kid, id); return; } - Map> chunksJson = new HashMap<>(); + Map> chunksJson = new HashMap<>(); for (ChunkMetaViewDto mve : entities) { - if ( !Objects.equals(mve.getKid(), kid) || !Objects.equals(mve.getId(), id)) { - log.error("Kid and/or id does not match: kid: {} , {} id {}, {}",kid , mve.getKid() , id , mve.getId()); - } - else { + if (!Objects.equals(mve.getKid(), kid) || !Objects.equals(mve.getId(), id)) { + log.error("Kid and/or id does not match: kid: {} , {} id {}, {}", kid, mve.getKid(), id, mve.getId()); + } else { SliceDataDto sliceDataDto = sliceCalculationService.calculateChunk(mve.getHashes()); if (sliceDataDto != null) { @@ -340,9 +341,9 @@ private void saveSlice(String kid, String id, String chunk, String hash, } - private void savePartition(String kid, String id, String x, String y, String z, + private void savePartition(String kid, String id, String x, String y, String z, ZonedDateTime lastUpdated, ZonedDateTime expired, - Map> chunksJson){ + Map> chunksJson) { PartitionEntity partitionEntity = new PartitionEntity(); @@ -362,11 +363,9 @@ private void savePartition(String kid, String id, String x, String y, String z, } - - private List getRevocationListData(String etag) { - Optional optionalData = revocationListService.getRevocationListJsonData(etag); - if(optionalData.isPresent()) { + Optional optionalData = revocationListService.getRevocationListJsonData(etag); + if (optionalData.isPresent()) { return optionalData.get().getJsonData(); } @@ -386,5 +385,4 @@ private void cleanupData() { } - } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java index e7dcd29..446502b 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/InfoService.java @@ -41,7 +41,7 @@ public class InfoService { public String getValueForKey(String key) { Optional optionalValue = infoRepository.findById(key); - if(optionalValue.isPresent() && !optionalValue.isEmpty()) { + if (optionalValue.isPresent() && !optionalValue.isEmpty()) { return optionalValue.get().getValue(); } else { return null; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java index 45866ea..626dbdf 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java @@ -32,16 +32,16 @@ import eu.europa.ec.dgc.revocationdistribution.repository.HashesRepository; import feign.FeignException; import io.jsonwebtoken.Claims; +import io.jsonwebtoken.Jwt; import java.security.PublicKey; import java.text.ParseException; import java.time.Instant; import java.util.ArrayList; -import java.util.Base64; import java.util.List; -import io.jsonwebtoken.Jwt; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.bouncycastle.util.encoders.Hex; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -58,7 +58,6 @@ public class LookupService { private final HashesRepository hashesRepository; - public List validateRevocationCheckTokens(List revocationCheckTokens) throws TokenValidationException { List tokenPayloads = new ArrayList<>(); @@ -95,23 +94,30 @@ public List checkForRevocation(List tokenPa List hashes = tokenPayloads.stream().map(RevocationCheckTokenPayload::getPayload) .flatMap(List::stream).collect(Collectors.toList()); - return hashesRepository.getHashesPresentInListAndDb(hashes); + return hashesRepository.getHashesPresentInListAndDb(hashes); } - public PublicKey downloadPublicKey(String hash){ + public PublicKey downloadPublicKey(String hash) { ResponseEntity responseEntity; DidDocument didDocument; try { - String urlEncodedHash = Base64URL.encode(Base64.getDecoder().decode(hash)).toString(); + String urlEncodedHash = Base64URL.encode(Hex.decode(hash)).toString(); responseEntity = issuanceDgciRestClient.getDgciByHash(urlEncodedHash); } catch (IllegalArgumentException e) { log.error("Encoding of dgci hash for public key request failed."); throw new TokenValidationException("Token verification failed: Wrong format of DGCI hash for public key", HttpStatus.BAD_REQUEST.value()); } catch (FeignException e) { + if (e.status() == HttpStatus.NOT_FOUND.value()) { + log.error("Download of dgdi failed. {}", + e.status()); + throw new TokenValidationException("Token verification failed: Public key not found.", + HttpStatus.BAD_REQUEST.value()); + } + log.error("Download of dgdi failed. {}", e.status()); throw new TokenValidationException("Token verification failed due to Server Error", @@ -133,7 +139,7 @@ public PublicKey downloadPublicKey(String hash){ DidAuthentication didAuth = didDocument.getAuthentication().get(0); try { - return ECKey.parse(didAuth.getPublicKeyJsw().toString()).toPublicKey(); + return ECKey.parse(didAuth.getPublicKeyJsw().toString()).toPublicKey(); } catch (ParseException | JOSEException e) { log.error("Parsing of publicKey failed. {}", e); throw new TokenValidationException("Token verification failed: Public key could not be parsed", diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java index f0d65c7..570f9e1 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java @@ -28,17 +28,20 @@ import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureException; import java.security.PublicKey; +import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; @Service +@Slf4j public class RevocationCheckTokenParser { private final ObjectMapper objectMapper = new ObjectMapper(); /** * parse Token. + * * @param jwtCompact jwtCompact - * @param publicKey publicKey + * @param publicKey publicKey * @return RevocationCheckTokenPayload */ public RevocationCheckTokenPayload parseToken(String jwtCompact, PublicKey publicKey) { @@ -51,6 +54,7 @@ public RevocationCheckTokenPayload parseToken(String jwtCompact, PublicKey publi throw new TokenValidationException("Failed to parse revocation check token", HttpStatus.BAD_REQUEST.value()); } catch (SignatureException e) { + log.warn("Signature check failed for revocation check token: {}", e.getMessage()); throw new TokenValidationException("Signature check failed for revocation check token", HttpStatus.BAD_REQUEST.value()); } @@ -58,13 +62,14 @@ public RevocationCheckTokenPayload parseToken(String jwtCompact, PublicKey publi /** * extract payload. + * * @param jwtCompact jwtCompact * @return JWT */ public Jwt extractPayload(String jwtCompact) { String[] splitToken = jwtCompact.split("\\."); - if (splitToken.length < 2 ) { + if (splitToken.length < 2) { throw new TokenValidationException("Failed to parse revocation check token. Wrong format.", HttpStatus.BAD_REQUEST.value()); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index a3e6f38..2a72a94 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -51,7 +51,7 @@ @ConditionalOnProperty("dgc.gateway.connector.enabled") public class RevocationListDownloadServiceGatewayImpl { - private final DgcGatewayRevocationListDownloadConnector dgcGatewayRevocationListDownloadConnector; + private final DgcGatewayRevocationListDownloadConnector dgcGatewayRevocationListDownloadConnector; private final InfoService infoService; @@ -60,7 +60,6 @@ public class RevocationListDownloadServiceGatewayImpl { private final GeneratorService generatorService; - private ZonedDateTime lastUpdatedBatchDate; @@ -72,7 +71,7 @@ private void postConstruct() { if (lastUpdatedString != null) try { lastUpdatedBatchDate = ZonedDateTime.parse(lastUpdatedString); - }catch(DateTimeParseException e) { + } catch (DateTimeParseException e) { log.error("Could not parse loaded last Updated timestamp: {}", lastUpdatedString); } } @@ -89,22 +88,22 @@ public void downloadRevocationList() { DgcGatewayRevocationListDownloadIterator revocationListIterator; - if(lastUpdatedBatchDate != null) { + if (lastUpdatedBatchDate != null) { revocationListIterator = dgcGatewayRevocationListDownloadConnector.getRevocationListDownloadIterator(lastUpdatedBatchDate); - } else{ + } else { revocationListIterator = dgcGatewayRevocationListDownloadConnector.getRevocationListDownloadIterator(); } List deletedBatchIds = new ArrayList<>(); List goneBatchIds = new ArrayList<>(); - while(revocationListIterator.hasNext()) { - List batchListItems = revocationListIterator.next(); + while (revocationListIterator.hasNext()) { + List batchListItems = revocationListIterator.next(); log.info(batchListItems.toString()); - for(RevocationBatchListDto.RevocationBatchListItemDto batchListItem : batchListItems) { + for (RevocationBatchListDto.RevocationBatchListItemDto batchListItem : batchListItems) { if (batchListItem.getDeleted()) { deletedBatchIds.add(batchListItem.getBatchId()); } else { @@ -115,7 +114,7 @@ public void downloadRevocationList() { log.info(revocationBatchDto.toString()); revocationListservice.updateRevocationListBatch(batchListItem.getBatchId(), revocationBatchDto); - } catch(RevocationBatchGoneException e) { + } catch (RevocationBatchGoneException e) { goneBatchIds.add(batchListItem.getBatchId()); } catch (RevocationBatchDownloadException | RevocationBatchParseException e) { log.error("Batch download failed"); @@ -138,8 +137,8 @@ public void downloadRevocationList() { log.info("Revocation list download finished"); } - private void saveLastUpdated(){ - log.info("Save last updated date: {}",lastUpdatedBatchDate); + private void saveLastUpdated() { + log.info("Save last updated date: {}", lastUpdatedBatchDate); DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX"); infoService.setValueForKey(InfoService.LAST_UPDATED_KEY, dateTimeFormatter.format(lastUpdatedBatchDate)); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java index ffd2a5c..6be8434 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java @@ -156,7 +156,6 @@ public List getPartitionsByKid(String etag, String kid) { } - public PartitionResponseDto getPartitionsByKidAndId(String etag, String kid, String id) throws DataNotFoundException { Optional partition; @@ -168,7 +167,7 @@ public PartitionResponseDto getPartitionsByKidAndId(String etag, String kid, Str partition = partitionRepository.findOneByEtagAndKidAndId(etag, kid, id); } - if(!partition.isPresent()) { + if (!partition.isPresent()) { throw new DataNotFoundException(); } return partitionListMapper.map(partition.get()); @@ -313,5 +312,4 @@ private byte[] createTarForSlices(List sliceEntityList) { } - } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java index 1feaa75..235a2bf 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java @@ -24,6 +24,6 @@ public interface SliceCalculationService { - public SliceDataDto calculateChunk(String[] hashes); + SliceDataDto calculateChunk(String[] hashes); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java index 09603e4..3602b7b 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java @@ -47,7 +47,7 @@ public SliceDataDto calculateChunk(String[] hashes) { if (hashes.length <= 0) return null; - BloomFilter bloomFilter = new BloomFilterImpl(hashes.length,properties.getBloomFilter().getProbRate()); + BloomFilter bloomFilter = new BloomFilterImpl(hashes.length, properties.getBloomFilter().getProbRate()); SliceDataDto sliceDataDto = new SliceDataDto(); @@ -59,7 +59,7 @@ public SliceDataDto calculateChunk(String[] hashes) { byte[] hashBytes = helperFunctions.getBytesFromHexString(hash); bloomFilter.add(hashBytes); } catch (NoSuchAlgorithmException | IOException | DecoderException e) { - log.error("Could not add hash to bloom filter: {}",hash); + log.error("Could not add hash to bloom filter: {}", hash); } } @@ -67,7 +67,7 @@ public SliceDataDto calculateChunk(String[] hashes) { try { bloomFilter.writeTo(baos); - } catch (IOException e){ + } catch (IOException e) { log.error("Could not get bloom filter binary data."); return null; } @@ -76,7 +76,7 @@ public SliceDataDto calculateChunk(String[] hashes) { try { sliceDataDto.getMetaData().setHash(helperFunctions.calculateHash(sliceDataDto.getBinaryData())); - } catch (NoSuchAlgorithmException e){ + } catch (NoSuchAlgorithmException e) { log.error("Could calculate hash for binary data."); return null; } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java index 43bb6de..e00ae43 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/utils/HelperFunctions.java @@ -37,7 +37,7 @@ public class HelperFunctions { DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX"); - public String getDateTimeString(ZonedDateTime dateTime){ + public String getDateTimeString(ZonedDateTime dateTime) { return dateTimeFormatter.withZone(ZoneId.of("UTC")).format(dateTime); } @@ -54,11 +54,12 @@ public String calculateHash(byte[] data) throws NoSuchAlgorithmException { /** * Gets the byte array from a hex representation string. + * * @param hex * @return the byte data. */ public byte[] getBytesFromHexString(String hex) { - return Hex.decode(hex); + return Hex.decode(hex); } } From a1472ff4cadfefb7cb4a5e7385ca1511e73ffedf Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:19:51 +0100 Subject: [PATCH 07/20] Update jjwt version --- pom.xml | 22 ++++++++++++++----- .../service/RevocationCheckTokenParser.java | 10 +++++++-- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index f3276b7..8a437ed 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 2.1.210 1.7.32 2.17.1 - 0.9.1 + 0.11.2 3.1.2 3.9.0.2155 @@ -299,8 +299,20 @@ io.jsonwebtoken - jjwt - ${jjwt.version} + jjwt-api + 0.11.2 + + + io.jsonwebtoken + jjwt-impl + 0.11.2 + runtime + + + io.jsonwebtoken + jjwt-jackson + 0.11.2 + runtime @@ -382,7 +394,7 @@ - +--> org.jacoco jacoco-maven-plugin diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java index 570f9e1..3a68ad4 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationCheckTokenParser.java @@ -26,7 +26,7 @@ import eu.europa.ec.dgc.revocationdistribution.exception.TokenValidationException; import io.jsonwebtoken.Jwt; import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.SignatureException; +import io.jsonwebtoken.security.SignatureException; import java.security.PublicKey; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; @@ -45,8 +45,14 @@ public class RevocationCheckTokenParser { * @return RevocationCheckTokenPayload */ public RevocationCheckTokenPayload parseToken(String jwtCompact, PublicKey publicKey) { + + + try { - Jwt token = Jwts.parser().setSigningKey(publicKey).parse(jwtCompact); + + + Jwt token = Jwts.parserBuilder().setSigningKey(publicKey).build().parseClaimsJws(jwtCompact); + String payloadJson = objectMapper.writeValueAsString(token.getBody()); return objectMapper.readValue(payloadJson, RevocationCheckTokenPayload.class); From a6d4fac6f2e28fe7bf8cea9739d7cc492f3b5c4c Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:20:29 +0100 Subject: [PATCH 08/20] Refactored method name --- .../ec/dgc/revocationdistribution/service/GeneratorService.java | 2 +- .../revocationdistribution/service/SliceCalculationService.java | 2 +- .../service/SliceCalculationServiceBloomFilterImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index a5b461e..6ea8237 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -290,7 +290,7 @@ private void generatePartition(List entities, log.error("Kid and/or id does not match: kid: {} , {} id {}, {}", kid, mve.getKid(), id, mve.getId()); } else { - SliceDataDto sliceDataDto = sliceCalculationService.calculateChunk(mve.getHashes()); + SliceDataDto sliceDataDto = sliceCalculationService.calculateSlice(mve.getHashes()); if (sliceDataDto != null) { Map chunkItemsMap; diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java index 235a2bf..3b2ebda 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java @@ -24,6 +24,6 @@ public interface SliceCalculationService { - SliceDataDto calculateChunk(String[] hashes); + SliceDataDto calculateSlice(String[] hashes); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java index 3602b7b..788acc5 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java @@ -43,7 +43,7 @@ public class SliceCalculationServiceBloomFilterImpl implements SliceCalculationS private final HelperFunctions helperFunctions; @Override - public SliceDataDto calculateChunk(String[] hashes) { + public SliceDataDto calculateSlice(String[] hashes) { if (hashes.length <= 0) return null; From 6a5f5a8e414427164370adf605a62674973ee091 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Mon, 14 Feb 2022 13:39:43 +0100 Subject: [PATCH 09/20] Moved Bloomfilter implementation to external lib --- pom.xml | 6 + .../ec/dgc/bloomfilter/BloomFilter.java | 32 -- .../ec/dgc/bloomfilter/BloomFilterImpl.java | 297 ------------------ ...liceCalculationServiceBloomFilterImpl.java | 12 +- 4 files changed, 13 insertions(+), 334 deletions(-) delete mode 100644 src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java delete mode 100644 src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java diff --git a/pom.xml b/pom.xml index 8a437ed..8438144 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ 4.30.0 9.9.2 1.1.12 + 0.0.0-09cb38e 3.57.0 2.1.210 1.7.32 @@ -170,6 +171,11 @@ dgc-lib ${dgc.lib.version} + + eu.europa.ec.dgc + bloomfilter + ${dgc.bloomfilter.version} + org.springframework.boot spring-boot-starter diff --git a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java deleted file mode 100644 index 21afd77..0000000 --- a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilter.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH and all other contributors - * Author: Paul Ballmann - */ - -package eu.europa.ec.dgc.bloomfilter; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.security.NoSuchAlgorithmException; - -public interface BloomFilter { - float getP(); - - int getK(); - - long getM(); - - int getN(); - - int getCurrentN(); - - void add(byte[] element) throws NoSuchAlgorithmException, IOException; - - boolean mightContain(byte[] element) throws NoSuchAlgorithmException, IOException; - - void readFrom(InputStream inputStream); - - void writeTo(OutputStream outputStream) throws IOException; - -} diff --git a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java deleted file mode 100644 index 8476e98..0000000 --- a/src/main/java/eu/europa/ec/dgc/bloomfilter/BloomFilterImpl.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2022 T-Systems International GmbH and all other contributors - * Author: Paul Ballmann/Steffen Schulze - */ -package eu.europa.ec.dgc.bloomfilter; - -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.OutputStream; -import java.io.Serializable; -import java.math.BigInteger; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.HashMap; -import java.util.Objects; -import java.util.concurrent.atomic.AtomicIntegerArray; -import java.util.logging.Logger; - -public class BloomFilterImpl implements BloomFilter, Serializable { - private long numBits; - private byte numberOfHashes; - private int currentElementAmount = 0; - private int definedElementAmount = 0; - private byte usedHashFunction = 0; - private float probRate; - private AtomicIntegerArray data; - private final static int NUM_BITS = 8; - private final static byte NUM_BYTES = Integer.BYTES; - private final static byte NUM_BIT_FORMAT = (NUM_BYTES * NUM_BITS); - - //@Serial - private static final long serialVersionUID = 7526472295622776147L; - private static final short version = 1; - - public BloomFilterImpl(InputStream inputStream) { - super(); - DataInputStream dis = new DataInputStream(inputStream); - this.readFromStream(dis); - } - - public BloomFilterImpl(int size, byte numberOfHashes, int numberOfElements) { - super(); - - if (numberOfHashes <= 0 || size <= 0) { - throw new IllegalArgumentException("numberOfElements <=0, numberOfHashes <= 0, probRate <= 1"); - } - - if (numberOfHashes == 0) { - throw new IllegalArgumentException("numberOfHashes cannot be 0"); - } - - size = (size / NUM_BYTES) + (size % NUM_BYTES); - - long heapFreeSize = Runtime.getRuntime().freeMemory(); - - if (heapFreeSize < (long) size * NUM_BYTES) { - throw new IllegalArgumentException("Heap size not big enough"); - } - this.definedElementAmount = numberOfElements; - this.numBits = (long) size * NUM_BIT_FORMAT; - this.numberOfHashes = numberOfHashes; - this.probRate = (float) Math.pow(1 - Math.exp(-numberOfHashes / ((float) (this.numBits / NUM_BITS) / numberOfElements)), numberOfHashes); - this.data = new AtomicIntegerArray(size); - } - - public BloomFilterImpl(int numberOfElements, float probRate) { - super(); - if (numberOfElements <= 0 || probRate > 1 || probRate <= 0) { - throw new IllegalArgumentException("numberOfElements <=0, probRate <= 1"); - } - // n: numberOfElements - // m: numberOfBits -> ceil((n * log(p)) / log(1 / pow(2, log(2)))); - this.numBits = (long) (Math.ceil((numberOfElements * Math.log(probRate)) / Math.log(1 / Math.pow(2, Math.log(2))))); - - int bytes = (int) (this.numBits / NUM_BITS) + 1; - int size = (bytes / NUM_BYTES) + (bytes % NUM_BYTES); - this.numBits = size * NUM_BIT_FORMAT; - long heapFreeSize = Runtime.getRuntime().freeMemory(); - - if (size <= 0) { - throw new IllegalArgumentException("Size can not be 0"); - } - - if (heapFreeSize < (long) size * NUM_BYTES) { - throw new IllegalArgumentException("Heap size not big enough"); - } - - this.definedElementAmount = numberOfElements; - this.numberOfHashes = (byte) Math.max(1, (int) Math.round((double) this.numBits / numberOfElements * Math.log(2))); - - if (numberOfHashes < 0) { - throw new IllegalArgumentException("Number of Hashes to high. Please check the Probalistic Rate (limit arround 1.0E-38)"); - } - - this.probRate = probRate; - this.data = new AtomicIntegerArray(size); - } - - public AtomicIntegerArray getData() { - return data; - } - - @Override - public void add(byte[] element) throws NoSuchAlgorithmException, IOException { - for (int i = 0; i < this.numberOfHashes; i++) { - long index = this.calcIndex(element, i, this.numBits).longValue(); - int bytepos = (int) index / NUM_BIT_FORMAT; - index -= bytepos * NUM_BIT_FORMAT; - Integer pattern = Integer.MIN_VALUE >>> index - 1; - this.data.set(bytepos, this.data.get(bytepos) | pattern); - } - currentElementAmount++; - - if (currentElementAmount >= definedElementAmount) { - Logger.getGlobal().warning("Filter is filled. All other Elements may result in a higher False Positve Rate than defined!"); - } - } - - @Override - public boolean mightContain(byte[] element) throws NoSuchAlgorithmException, IOException { - boolean result = true; - for (int i = 0; i < this.numberOfHashes; i++) { - long index = this.calcIndex(element, i, this.numBits).longValue(); - int bytepos = (int) index / NUM_BIT_FORMAT; - index -= bytepos * NUM_BIT_FORMAT; - long pattern = Integer.MIN_VALUE >>> index - 1; - if ((this.data.get(bytepos) & pattern) == pattern) { - result &= true; - } else { - result &= false; - break; - } - } - return result; - } - - public BigInteger calcIndex(byte[] element, int i, long bits) throws NoSuchAlgorithmException, IOException { - BigInteger bi = new BigInteger(this.hash(element, (char) i)); - return bi.mod(BigInteger.valueOf(bits)); - } - - private byte[] hash(byte[] toHash, char seed) throws NoSuchAlgorithmException, IOException { - MessageDigest md = MessageDigest.getInstance("SHA-256"); - // concat byte[] and seed - byte charAsByte = (byte) seed; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - outputStream.write(toHash); - outputStream.write(charAsByte); - return md.digest(outputStream.toByteArray()); - } - - - //region Streams - - /** - * Writes the filter to an output stream in a structured manner - * 0 byte -> k (numberOfHashes) - * 1 - 4 byte -> p (probRate) - * 5 byte -> unsigned length of the data - * 6 - x byte -> data as utf8 - * - * @param outputStream - * @throws IOException - */ - public void writeTo(OutputStream outputStream) throws IOException { - // k = 1 (numberOfHashes), p = 4 (probRate), - // 0 = k, 1 = p, 5 = filter - DataOutputStream dataOutputStream = new DataOutputStream(outputStream); - dataOutputStream.writeShort(version); - dataOutputStream.writeByte(usedHashFunction); - dataOutputStream.writeByte(this.numberOfHashes); - dataOutputStream.writeFloat(this.probRate); - dataOutputStream.writeInt(this.definedElementAmount); - dataOutputStream.writeInt(this.currentElementAmount); - dataOutputStream.writeInt(this.getData().length()); - for (int i = 0; i < this.getData().length(); i++) { - dataOutputStream.writeInt(this.getData().get(i)); - } - - } - - private void readFromStream(DataInputStream dis) { - try { - int version = dis.readShort(); // for later compatibility - this.numberOfHashes = dis.readByte(); - this.usedHashFunction = dis.readByte(); - this.probRate = dis.readFloat(); - this.definedElementAmount = dis.readInt(); - this.currentElementAmount = dis.readInt(); - int dataLength = dis.readInt(); - int[] data = new int[dataLength]; - for (int i = 0; i < dataLength; i++) { - data[i] = dis.readInt(); - } - this.data = new AtomicIntegerArray(data); - this.numBits = data.length * NUM_BIT_FORMAT; - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Will try to read data from the input stream to constrcut a new bloomFilter from - * * 0 byte -> k (numberOfHashes) - * * 1 - 4 byte -> p (probRate) - * * 5 - x byte -> data as utf8 - * - * @param inputStream - * @throws IOException - */ - public void readFrom(InputStream inputStream) { - DataInputStream dataInputStream = new DataInputStream(inputStream); - this.readFromStream(dataInputStream); - } - //endregion - - //region Utility - - /** - * Indicates whether some other object is "equal to" this one. - * - * @param obj the reference object with which to compare. - * @return {@code true} if this object is the same as the obj - * argument; {@code false} otherwise. - * @see #hashCode() - * @see HashMap - */ - @Override - public boolean equals(Object obj) { - return super.equals(obj); - } - - /** - * Creates and returns a copy of this object. The precise meaning - * of "copy" may depend on the class of the object. - * - * @return a clone of this instance. - * @throws CloneNotSupportedException if the object's class does not - * support the {@code Cloneable} interface. Subclasses - * that override the {@code clone} method can also - * throw this exception to indicate that an instance cannot - * be cloned. - * @see Cloneable - */ - @Override - protected Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public int hashCode() { - return Objects.hashCode(new Object[]{this.numBits, this.numberOfHashes, this.getData()}); - } - - private void readObject( - ObjectInputStream inputStream - ) throws ClassNotFoundException, IOException { - inputStream.defaultReadObject(); - } - - private void writeObject( - ObjectOutputStream outputStream - ) throws IOException { - outputStream.defaultWriteObject(); - } - //endregion - - @Override - public float getP() { - return this.probRate; - } - - @Override - public int getK() { - return this.numberOfHashes; - } - - @Override - public long getM() { - return this.numBits; - } - - @Override - public int getN() { - return this.definedElementAmount; - } - - @Override - public int getCurrentN() { - return this.definedElementAmount; - } - -} diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java index 788acc5..08d894b 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java @@ -20,8 +20,10 @@ package eu.europa.ec.dgc.revocationdistribution.service; + import eu.europa.ec.dgc.bloomfilter.BloomFilter; import eu.europa.ec.dgc.bloomfilter.BloomFilterImpl; +import eu.europa.ec.dgc.bloomfilter.exception.FilterException; import eu.europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; import eu.europa.ec.dgc.revocationdistribution.utils.HelperFunctions; @@ -58,8 +60,8 @@ public SliceDataDto calculateSlice(String[] hashes) { try { byte[] hashBytes = helperFunctions.getBytesFromHexString(hash); bloomFilter.add(hashBytes); - } catch (NoSuchAlgorithmException | IOException | DecoderException e) { - log.error("Could not add hash to bloom filter: {}", hash); + } catch (NoSuchAlgorithmException | IOException | DecoderException | FilterException e) { + log.error("Could not add hash to bloom filter: {} , {}", hash, e.getMessage()); } } @@ -67,8 +69,8 @@ public SliceDataDto calculateSlice(String[] hashes) { try { bloomFilter.writeTo(baos); - } catch (IOException e) { - log.error("Could not get bloom filter binary data."); + } catch (IOException | FilterException e) { + log.error("Could not get bloom filter binary data: {}", e.getMessage()); return null; } @@ -77,7 +79,7 @@ public SliceDataDto calculateSlice(String[] hashes) { try { sliceDataDto.getMetaData().setHash(helperFunctions.calculateHash(sliceDataDto.getBinaryData())); } catch (NoSuchAlgorithmException e) { - log.error("Could calculate hash for binary data."); + log.error("Could not calculate hash for binary data."); return null; } From 1ebe5eec646f175150fac2b0c7b98eb24b717d63 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:15:16 +0100 Subject: [PATCH 10/20] start refactoring SliceCalculation --- .../config/DgcConfigProperties.java | 11 ++++++++++- .../service/GeneratorService.java | 8 +++++--- ...eCalculationService.java => SliceCalculation.java} | 2 +- ...Impl.java => SliceCalculationBloomFilterImpl.java} | 5 +++-- 4 files changed, 19 insertions(+), 7 deletions(-) rename src/main/java/eu/europa/ec/dgc/revocationdistribution/service/{SliceCalculationService.java => SliceCalculation.java} (95%) rename src/main/java/eu/europa/ec/dgc/revocationdistribution/service/{SliceCalculationServiceBloomFilterImpl.java => SliceCalculationBloomFilterImpl.java} (93%) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java index 4ef12a2..f484454 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/config/DgcConfigProperties.java @@ -31,6 +31,7 @@ public class DgcConfigProperties { private final GatewayDownload revocationListDownload = new GatewayDownload(); private final BloomFilterConfig bloomFilter = new BloomFilterConfig(); + private final HashListConfig hashList = new HashListConfig(); @Getter @@ -44,8 +45,16 @@ public static class GatewayDownload { @Setter public static class BloomFilterConfig { private boolean enabled; - private String type; + private String type = "bloom_filter"; private String version; private float probRate; } + + @Getter + @Setter + public static class HashListConfig { + private boolean enabled; + private String type = "hash_list"; + private String version; + } } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index 6ea8237..bd40d2f 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -68,7 +68,7 @@ public class GeneratorService { private final InfoService infoService; - private final SliceCalculationService sliceCalculationService; + private final SliceCalculationBloomFilterImpl sliceCalculationService; private final PointViewRepository pointViewRepository; @@ -106,8 +106,6 @@ public void generateNewDataSet() { oldEtag = etag; etag = UUID.randomUUID().toString(); - List kidViewEntityList = kidViewRepository.findAll(); - ChangeList changeList = generateList(); handleChangeList(changeList); @@ -116,6 +114,10 @@ public void generateNewDataSet() { cleanupData(); + if (sliceCalculationServiceHashList.isPresent()){ + log.info("HashListCalculation is active"); + } + log.info("Finished generation of new data set."); } diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculation.java similarity index 95% rename from src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculation.java index 3b2ebda..3171c14 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculation.java @@ -22,7 +22,7 @@ import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; -public interface SliceCalculationService { +public interface SliceCalculation { SliceDataDto calculateSlice(String[] hashes); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationBloomFilterImpl.java similarity index 93% rename from src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java rename to src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationBloomFilterImpl.java index 08d894b..596b2e4 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationServiceBloomFilterImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationBloomFilterImpl.java @@ -26,6 +26,7 @@ import eu.europa.ec.dgc.bloomfilter.exception.FilterException; import eu.europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; +import eu.europa.ec.dgc.revocationdistribution.model.SliceType; import eu.europa.ec.dgc.revocationdistribution.utils.HelperFunctions; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -39,7 +40,7 @@ @Slf4j @RequiredArgsConstructor @Service -public class SliceCalculationServiceBloomFilterImpl implements SliceCalculationService { +public class SliceCalculationBloomFilterImpl implements SliceCalculation { private final DgcConfigProperties properties; private final HelperFunctions helperFunctions; @@ -53,7 +54,7 @@ public SliceDataDto calculateSlice(String[] hashes) { SliceDataDto sliceDataDto = new SliceDataDto(); - sliceDataDto.getMetaData().setType(properties.getBloomFilter().getType()); + sliceDataDto.getMetaData().setType(SliceType.BLOOMFILTER.name()); sliceDataDto.getMetaData().setVersion(properties.getBloomFilter().getVersion()); for (String hash : hashes) { From 0f0c5dee6b1a0c40cab99a42a25f0e04850f9697 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:08:55 +0100 Subject: [PATCH 11/20] Adjust hibernate debug level --- src/main/resources/application.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f5aca66..503a9dc 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,8 +1,8 @@ logging: level: default: TRACE - org.hibernate.SQL: DEBUG - org.hibernate.type.descriptor.sql: TRACE + org.hibernate.SQL: INFO + org.hibernate.type.descriptor.sql: INFO server: port: 8080 spring: From 4934211f748af54fff167705e7a624eaa06671ed Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:09:29 +0100 Subject: [PATCH 12/20] Removed optional check --- .../dgc/revocationdistribution/service/GeneratorService.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index bd40d2f..9f9b483 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -114,9 +114,6 @@ public void generateNewDataSet() { cleanupData(); - if (sliceCalculationServiceHashList.isPresent()){ - log.info("HashListCalculation is active"); - } log.info("Finished generation of new data set."); } From 62dd809c9ee8f36e70a552f881f6fbdfa24f67f2 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:10:42 +0100 Subject: [PATCH 13/20] Add check for downloaded data exist, before calculating data --- .../service/RevocationListDownloadServiceGatewayImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index 2a72a94..7a6e213 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -95,6 +95,11 @@ public void downloadRevocationList() { revocationListIterator = dgcGatewayRevocationListDownloadConnector.getRevocationListDownloadIterator(); } + if (!revocationListIterator.hasNext()) { + log.info("There was no new data loaded from the Gateway. Download finished without calculation of data."); + return; + } + List deletedBatchIds = new ArrayList<>(); List goneBatchIds = new ArrayList<>(); From b5b16ceaf0ad5a5fad14e7ac4a1467ca516f6de3 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Wed, 16 Feb 2022 14:27:58 +0100 Subject: [PATCH 14/20] Fix gateway download. --- pom.xml | 2 +- .../DgcaRevocationDistributionServiceApplication.java | 2 ++ .../client/IssuanceDgciRestClient.java | 2 +- .../client/IssuanceDgciRestClientConfig.java | 5 +---- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 8438144..e6aac52 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 4.9.1 4.30.0 9.9.2 - 1.1.12 + 1.1.13 0.0.0-09cb38e 3.57.0 2.1.210 diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java index c6dae48..5e1668a 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/DgcaRevocationDistributionServiceApplication.java @@ -24,8 +24,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication +@EnableFeignClients @EnableConfigurationProperties({DgcConfigProperties.class}) public class DgcaRevocationDistributionServiceApplication { diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java index 7c36f14..bb72167 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClient.java @@ -28,7 +28,7 @@ import org.springframework.web.bind.annotation.PathVariable; @FeignClient( - name = "business-download-client", + name = "issuance-download-client", url = "${dgc.issuance.dgci.endpoint}", configuration = IssuanceDgciRestClientConfig.class ) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java index 8dab5b8..4ee195f 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/client/IssuanceDgciRestClientConfig.java @@ -31,13 +31,10 @@ import java.security.cert.CertificateException; import lombok.RequiredArgsConstructor; import org.apache.http.impl.client.HttpClientBuilder; -import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -@Configuration + @RequiredArgsConstructor -@EnableFeignClients public class IssuanceDgciRestClientConfig { From 79ee969396e9289aef71f46049922ccfa73eeed7 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Wed, 16 Feb 2022 14:29:05 +0100 Subject: [PATCH 15/20] Save hashes as batch to db --- .../service/GeneratorService.java | 8 ++++-- .../service/LookupService.java | 4 +-- ...ocationListDownloadServiceGatewayImpl.java | 7 +++-- .../service/RevocationListService.java | 27 ++++++++++--------- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java index 9f9b483..43212c8 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/GeneratorService.java @@ -106,12 +106,16 @@ public void generateNewDataSet() { oldEtag = etag; etag = UUID.randomUUID().toString(); + log.info("Generate new List"); ChangeList changeList = generateList(); + log.info("Handle Changes"); handleChangeList(changeList); + log.info("Update Etag"); infoService.setNewEtag(etag); + log.info("Cleanup Data"); cleanupData(); @@ -163,7 +167,7 @@ private ChangeList generateList() { revocationListService.saveRevocationListJson(revocationListJsonEntity); - log.info(itemsMap.values().toString()); + log.trace(itemsMap.values().toString()); return changeList; } @@ -186,7 +190,6 @@ private void handleChangeList(ChangeList changeList) { generatePattern(changeList.getCreated()); } - private void markDataForRemoval(List kIds) { if (!kIds.isEmpty()) { partitionRepository.setToBeDeletedForKids(kIds); @@ -371,6 +374,7 @@ private List getRevocationListData(String eta return new ArrayList<>(); } + @Transactional private void cleanupData() { // set all entries in hashes table to updated false revocationListService.setAllHashesUpdatedStatesToFalse(); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java index 626dbdf..d72c9b9 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/LookupService.java @@ -112,13 +112,13 @@ public PublicKey downloadPublicKey(String hash) { HttpStatus.BAD_REQUEST.value()); } catch (FeignException e) { if (e.status() == HttpStatus.NOT_FOUND.value()) { - log.error("Download of dgdi failed. {}", + log.error("Download of dgci failed. {}", e.status()); throw new TokenValidationException("Token verification failed: Public key not found.", HttpStatus.BAD_REQUEST.value()); } - log.error("Download of dgdi failed. {}", + log.error("Download of dgci failed. {}", e.status()); throw new TokenValidationException("Token verification failed due to Server Error", HttpStatus.INTERNAL_SERVER_ERROR.value()); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index 7a6e213..99edb76 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -97,7 +97,6 @@ public void downloadRevocationList() { if (!revocationListIterator.hasNext()) { log.info("There was no new data loaded from the Gateway. Download finished without calculation of data."); - return; } List deletedBatchIds = new ArrayList<>(); @@ -106,8 +105,6 @@ public void downloadRevocationList() { while (revocationListIterator.hasNext()) { List batchListItems = revocationListIterator.next(); - log.info(batchListItems.toString()); - for (RevocationBatchListDto.RevocationBatchListItemDto batchListItem : batchListItems) { if (batchListItem.getDeleted()) { deletedBatchIds.add(batchListItem.getBatchId()); @@ -116,8 +113,10 @@ public void downloadRevocationList() { RevocationBatchDto revocationBatchDto = dgcGatewayRevocationListDownloadConnector.getRevocationListBatchById(batchListItem.getBatchId()); - log.info(revocationBatchDto.toString()); + log.trace(revocationBatchDto.toString()); + revocationListservice.updateRevocationListBatch(batchListItem.getBatchId(), revocationBatchDto); + log.info("Downloaded batch: {}", batchListItem.getBatchId()); } catch (RevocationBatchGoneException e) { goneBatchIds.add(batchListItem.getBatchId()); diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java index 6be8434..ef03f39 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListService.java @@ -70,13 +70,20 @@ public void updateRevocationListBatch(String batchId, RevocationBatchDto revocat saveBatchList(batchId, revocationBatchDto); + List hashes = new ArrayList<>(); + for (RevocationBatchDto.BatchEntryDto hash : revocationBatchDto.getEntries()) { - saveHash(batchId, hash, revocationBatchDto.getKid()); + try{ + hashes.add(getHashEntity(batchId, hash, revocationBatchDto.getKid())); + } catch (IndexOutOfBoundsException e) { + log.error("Error calculating x,y,z. Hash value length is to short: {}", + hash.getHash().getBytes(StandardCharsets.UTF_8).length); + } } - + hashesRepository.saveAll(hashes); } - @Transactional + private void saveBatchList(String batchId, RevocationBatchDto revocationBatchDto) { BatchListEntity batchListEntity = new BatchListEntity(); @@ -89,9 +96,10 @@ private void saveBatchList(String batchId, RevocationBatchDto revocationBatchDto batchListRepository.save(batchListEntity); } - @Transactional - private void saveHash(String batchId, RevocationBatchDto.BatchEntryDto hash, String kid) { - try { + + private HashesEntity getHashEntity(String batchId, RevocationBatchDto.BatchEntryDto hash, String kid) + throws IndexOutOfBoundsException { + String hexHash = decodeBase64Hash(hash.getHash()); HashesEntity hashesEntity = new HashesEntity(); hashesEntity.setHash(hexHash); @@ -102,12 +110,7 @@ private void saveHash(String batchId, RevocationBatchDto.BatchEntryDto hash, Str hashesEntity.setBatchId(batchId); hashesEntity.setUpdated(true); - hashesRepository.save(hashesEntity); - - } catch (IndexOutOfBoundsException e) { - log.error("Error calculating x,y,z. Hash value length is to short: {}", - hash.getHash().getBytes(StandardCharsets.UTF_8).length); - } + return hashesEntity; } @Transactional From 7287a9c88fd46b38e281721d78ca9ea819604483 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Wed, 16 Feb 2022 14:37:40 +0100 Subject: [PATCH 16/20] Add initial hash calculation files --- .../model/SliceType.java | 6 ++ .../service/SliceCalculationHashListImpl.java | 86 +++++++++++++++++++ .../service/SliceCalculationService.java | 37 ++++++++ 3 files changed, 129 insertions(+) create mode 100644 src/main/java/eu/europa/ec/dgc/revocationdistribution/model/SliceType.java create mode 100644 src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationHashListImpl.java create mode 100644 src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/SliceType.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/SliceType.java new file mode 100644 index 0000000..1def4f7 --- /dev/null +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/model/SliceType.java @@ -0,0 +1,6 @@ +package eu.europa.ec.dgc.revocationdistribution.model; + +public enum SliceType { + BLOOMFILTER, + HASHLIST +} diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationHashListImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationHashListImpl.java new file mode 100644 index 0000000..edb2de1 --- /dev/null +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationHashListImpl.java @@ -0,0 +1,86 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + +package eu.europa.ec.dgc.revocationdistribution.service; + + +import eu.europa.ec.dgc.bloomfilter.BloomFilter; +import eu.europa.ec.dgc.bloomfilter.BloomFilterImpl; +import eu.europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; +import eu.europa.ec.dgc.revocationdistribution.dto.SliceDataDto; +import eu.europa.ec.dgc.revocationdistribution.model.SliceType; +import eu.europa.ec.dgc.revocationdistribution.utils.HelperFunctions; +import java.io.ByteArrayOutputStream; +import java.security.NoSuchAlgorithmException; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.bouncycastle.util.encoders.DecoderException; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Service; + + +@Slf4j +@RequiredArgsConstructor +@Service +@ConditionalOnProperty("dgc.hashList.enabled") +public class SliceCalculationHashListImpl implements SliceCalculation { + + private final DgcConfigProperties properties; + private final HelperFunctions helperFunctions; + private static final int NUMBER_OF_BYTES_TO_STORE = 2; + + @Override + public SliceDataDto calculateSlice(String[] hashes) { + if (hashes.length <= 0) + return null; + + BloomFilter bloomFilter = new BloomFilterImpl(hashes.length, properties.getBloomFilter().getProbRate()); + + SliceDataDto sliceDataDto = new SliceDataDto(); + + sliceDataDto.getMetaData().setType(SliceType.HASHLIST.name()); + sliceDataDto.getMetaData().setVersion(properties.getHashList().getVersion()); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + for (String hash : hashes) { + try { + byte[] hashBytes = helperFunctions.getBytesFromHexString(hash); + baos.write(hashBytes, 0, NUMBER_OF_BYTES_TO_STORE); + } catch ( DecoderException e) { + log.error("Could not add hash to hash list: {} , {}", hash, e.getMessage()); + } + } + + + sliceDataDto.setBinaryData(baos.toByteArray()); + + try { + sliceDataDto.getMetaData().setHash(helperFunctions.calculateHash(sliceDataDto.getBinaryData())); + } catch (NoSuchAlgorithmException e) { + log.error("Could not calculate hash for binary data."); + return null; + } + + return sliceDataDto; + } + + +} diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java new file mode 100644 index 0000000..e63e274 --- /dev/null +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/SliceCalculationService.java @@ -0,0 +1,37 @@ +/*- + * ---license-start + * eu-digital-green-certificates / dgca-revocation-distribution-service + * --- + * Copyright (C) 2022 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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. + * ---license-end + */ + +package eu.europa.ec.dgc.revocationdistribution.service; + + +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@RequiredArgsConstructor +@Service +public class SliceCalculationService { + + private final Optional sliceCalculationServiceHashList; + + +} From ad766305b4f5ec944b1d7132a4adcf7fddf91127 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Wed, 16 Feb 2022 18:38:20 +0100 Subject: [PATCH 17/20] Adjust boundaries configuration --- .../resources/db/sql/014_load_boundries_configuration.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/db/sql/014_load_boundries_configuration.sql b/src/main/resources/db/sql/014_load_boundries_configuration.sql index cc5aaf1..4e13e81 100644 --- a/src/main/resources/db/sql/014_load_boundries_configuration.sql +++ b/src/main/resources/db/sql/014_load_boundries_configuration.sql @@ -1,5 +1,5 @@ -- Load boundries for different mode types into configuration table -INSERT INTO public.configuration (key, value, value2) VALUES ('POINTLIMIT', '0', '1000'); -INSERT INTO public.configuration (key, value, value2) VALUES ('VECTORLIMIT', '1001', '16000'); -INSERT INTO public.configuration (key, value, value2) VALUES ('COORDINATELIMIT', '16001', '999999999'); \ No newline at end of file +INSERT INTO public.configuration (key, value, value2) VALUES ('POINTLIMIT', '0', '100000'); +INSERT INTO public.configuration (key, value, value2) VALUES ('VECTORLIMIT', '100001', '1600000'); +INSERT INTO public.configuration (key, value, value2) VALUES ('COORDINATELIMIT', '1600001', '999999999999'); \ No newline at end of file From e2e0c5cd130fae2c7eaec643a8339450774c574d Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Wed, 16 Feb 2022 21:41:42 +0100 Subject: [PATCH 18/20] Added time limit for batch_download --- .../RevocationListDownloadServiceGatewayImpl.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index 99edb76..2665024 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -28,6 +28,7 @@ import eu.europa.ec.dgc.gateway.connector.exception.RevocationBatchGoneException; import eu.europa.ec.dgc.gateway.connector.exception.RevocationBatchParseException; import eu.europa.ec.dgc.gateway.connector.iterator.DgcGatewayRevocationListDownloadIterator; +import eu.europa.ec.dgc.revocationdistribution.config.DgcConfigProperties; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; @@ -53,6 +54,8 @@ public class RevocationListDownloadServiceGatewayImpl { private final DgcGatewayRevocationListDownloadConnector dgcGatewayRevocationListDownloadConnector; + private final DgcConfigProperties properties; + private final InfoService infoService; private final RevocationListService revocationListservice; @@ -86,6 +89,10 @@ private void postConstruct() { public void downloadRevocationList() { log.info("Revocation list download started"); + int timeInterval = properties.getRevocationListDownload().getTimeInterval(); + + ZonedDateTime abortTime = ZonedDateTime.now().plusSeconds((timeInterval/1000)/2); + DgcGatewayRevocationListDownloadIterator revocationListIterator; if (lastUpdatedBatchDate != null) { @@ -102,7 +109,7 @@ public void downloadRevocationList() { List deletedBatchIds = new ArrayList<>(); List goneBatchIds = new ArrayList<>(); - while (revocationListIterator.hasNext()) { + while (revocationListIterator.hasNext() && abortTime.isAfter(ZonedDateTime.now()) ) { List batchListItems = revocationListIterator.next(); for (RevocationBatchListDto.RevocationBatchListItemDto batchListItem : batchListItems) { @@ -125,6 +132,10 @@ public void downloadRevocationList() { } } lastUpdatedBatchDate = batchListItem.getDate(); + + if (abortTime.isBefore(ZonedDateTime.now())) { + break; + } } } @@ -135,6 +146,8 @@ public void downloadRevocationList() { if (!goneBatchIds.isEmpty()) { revocationListservice.deleteBatchListItemsByIds(goneBatchIds); } + //Delete expired. + saveLastUpdated(); generatorService.generateNewDataSet(); From 97383467a781771dd9a8c3e5925ddd6ad489aa61 Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:11:43 +0100 Subject: [PATCH 19/20] Fixed kid view create script --- src/main/resources/db/sql/010_create_kid_view.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/db/sql/010_create_kid_view.sql b/src/main/resources/db/sql/010_create_kid_view.sql index 084a2dd..c55b5a1 100644 --- a/src/main/resources/db/sql/010_create_kid_view.sql +++ b/src/main/resources/db/sql/010_create_kid_view.sql @@ -12,8 +12,8 @@ CREATE OR REPLACE VIEW public.kid_view WHEN configuration_1.key = 'COORDINATELIMIT'::text THEN 'COORDINATE'::text ELSE NULL::text END AS storage_mode, - to_number(configuration_1.value, '99999'::text) AS minlimit, - to_number(configuration_1.value2, '99999'::text) AS maxlimit + to_number(configuration_1.value, '999999999999'::text) AS minlimit, + to_number(configuration_1.value2, '999999999999'::text) AS maxlimit FROM public.configuration configuration_1 WHERE configuration_1.key = ANY (ARRAY['POINTLIMIT'::text, 'VECTORLIMIT'::text, 'COORDINATELIMIT'::text]) ) From 568270a7ef0255421f61071f274a96ad8a41266c Mon Sep 17 00:00:00 2001 From: slaurenz <82034561+slaurenz@users.noreply.github.com> Date: Fri, 18 Feb 2022 08:10:17 +0100 Subject: [PATCH 20/20] Improve recalculation schedule --- .../service/RevocationListDownloadServiceGatewayImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java index 2665024..421194f 100644 --- a/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java +++ b/src/main/java/eu/europa/ec/dgc/revocationdistribution/service/RevocationListDownloadServiceGatewayImpl.java @@ -104,6 +104,7 @@ public void downloadRevocationList() { if (!revocationListIterator.hasNext()) { log.info("There was no new data loaded from the Gateway. Download finished without calculation of data."); + return; } List deletedBatchIds = new ArrayList<>();