MOD-DATA-EXPORT migration process to Spring - user stories

Story 1 

Summary 

Replace io.vertx.core.json.JsonObject and io.vertx.core.json.JsonArray with another classes 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then JsonObject and JsonArray based on the Vert.x library are no longer needed as well. 

Requirements/Scope: 

  1. Find io.vertx.core.json.JsonObject and io.vertx.core.json.JsonArray throughout the project and replace them with another classes 

Approach: 

Possible solutions: 

https://github.com/stleary/JSON-java 

https://github.com/google/gson 

https://github.com/FasterXML/jackson 

Acceptance criteria: 

  • Io.vertx.core.json.JsonObject and io.vertx.core.json.JsonArray are not used in the project 

Story 2 

Summary 

Replace org.folio.rest.persist.PostgresClient from domain-models-runtime library with the client from https://github.com/folio-org/folio-spring-base 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then PostgresClient based on the Vert.x library is no longer needed as well. 

Requirements/Scope: 

  1. Replace org.folio.rest.persist.PostgresClient from domain-models-runtime library with the client from the https://github.com/folio-org/folio-spring-base, and make appropriate changes to the classes in the org.folio.dao.impl package 
  2. Create appropriate JPA repositories 

Approach: 

  1. Remove io.vertx.core.Future from the org.folio.dao.ErrorLogDao interface. 
  2. Remove io.vertx.core.Future from the org.folio.dao.FileDefinitionDao interface. 
  3. Remove io.vertx.core.Future from the org.folio.dao.JobExecutionDao interface. 
  4. Remove io.vertx.core.Future from the org.folio.dao.JobProfileDao interface. 
  5. Remove io.vertx.core.Future from the org.folio.dao.MappingProfileDao interface. 
  6. Modify org.folio.dao.impl package

Acceptance criteria: 

  • org.folio.rest.persist.PostgresClient from domain-models-runtime library is not used in the project 

Story 3 

Summary 

Remove proxy services based on the Vert.x library 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then proxy services based on the Vert.x are no longer needed as well. 

Requirements/Scope: 

Approach: 

  1. Remove org.folio.rest.impl.InitAPIImpl class 
  2. Remove org.folio.service.manager.export.ExportManager#create method 
  3. Remove org.folio.service.manager.export.ExportManager#createProxy method 
  4. Remove org.folio.service.manager.export.ExportManager#EXPORT_MANAGER_ADDRESS field 

Acceptance criteria: 

  • Proxy services based on the Vert.x library are removed from the project 

Story 4 

Summary 

Change org.folio.service.manager.export.strategy.ExportStrategy interface and remove blockingPromise parameter from the method. 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Promise is no longer needed as well. 

Requirements/Scope: 

  1. Remove blockingPromise parameter from the org.folio.service.manager.export.strategy.ExportStrategy#export method 
  2. Modify org.folio.service.manager.export.strategy.InstanceExportStrategyImpl appropriately 

Approach: 

Use Optional#isPresent instead of onSuccess, onFailure.  

Acceptance criteria: 

  • Parameter blockingPromise is removed from org.folio.service.manager.export.strategy.ExportStrategy interface 

Story 5 

Remove or replace io.vertx.core.Future in the org.folio.service.profiles.jobprofile.JobProfileService interface. 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well. 

Requirements/Scope: 

  1. Change org.folio.service.profiles.jobprofile.JobProfileService interface and remove/replace io.vertx.core.Future  from return value in all methods. 
  2. Make appropriate changes in org.folio.service.profiles.jobprofile.JobProfileServiceImpl. 

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.profiles.jobprofile.JobProfileService interface 

Story 6 

Remove or replace io.vertx.core.Future in the org.folio.service.profiles.mappingprofile.MappingProfileService interface. 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well. 

Requirements/Scope: 

  1. Change org.folio.service.profiles.mappingprofile.MappingProfileService interface and remove io.vertx.core.Future  from return value in all methods. 
  2. Make appropriate changes in org.folio.service.profiles. mappingprofile. MappingProfileServiceImpl. 

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.profiles. mappingprofile.MappingProfileService interface 

Story 7 

Remove io.vertx.core.Future in the org.folio.service.transformationfields.TransformationFieldsService interface. 

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well. 

Requirements/Scope: 

  1. Change org.folio.service.transformationfields.TransformationFieldsService interface and remove io.vertx.core.Future  from return value in all methods. 
  2. Make appropriate changes in org.folio.service.transformationfields.TransformationFieldsServiceImpl class

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.transformationfields.TransformationFieldsService interface

Story 8

Remove io.vertx.core and proxy methods from the org.folio.service.manager.input package.

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core is no longer needed as well. 

Requirements/Scope:

  1. Remove io.vertx.core.shareddata.Shareable interface implementation from the org.folio.service.manager.input.InputDataContext class 
  2. Remove @ProxyGen annotation from the org.folio.service.manager.input.InputDataManager interface 
  3. Remove create and createProxy methods, as well as INPUT_DATA_MANAGER_ADDRESS field from the  org.folio.service.manager.input.InputDataManager interface 
  4. Remove org.folio.service.manager.input.package-info.java 
  5. Make appropriate changes in org.folio.service.manager.input.InputDataManagerImpl class

Approach: 

Possible solution:

  • use java.util.concurrent.Future instead of io.vertx.core.Future
  • use org.springframework.scheduling.annotation.AsyncResult instead of io.vertx.core.AsyncResult

Acceptance criteria: 

  • Vert.x library and proxy methods are not present in the org.folio.service.manager.input package

Story 9

Remove io.vertx.core and proxy methods from the org.folio.service.manager.input package.

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core is no longer needed as well. 

Requirements/Scope:

  1. Remove io.vertx.core.shareddata.Shareable interface implementation from the org.folio.service.manager.input.InputDataContext class 
  2. Remove @ProxyGen annotation from the org.folio.service.manager.input.InputDataManager interface 
  3. Remove create and createProxy methods, as well as INPUT_DATA_MANAGER_ADDRESS field from the  org.folio.service.manager.input.InputDataManager interface 
  4. Remove org.folio.service.manager.input.package-info.java 
  5. Make appropriate changes in org.folio.service.manager.input.InputDataManagerImpl class

Approach: 

Possible solution:

  • use java.util.concurrent.Future instead of io.vertx.core.Future
  • use org.springframework.scheduling.annotation.AsyncResult instead of io.vertx.core.AsyncResult

Acceptance criteria: 

  • Vert.x library and proxy methods are not present in the org.folio.service.manager.input package

Story 10

Implement Swagger API and create required schemas and examples

Purpose/Overview: 

Since domain-models-runtime library is based on the Vert.x, it  should be removed from the project, however API and controllers are still needed. 

Requirements/Scope:

  1. Create package swagger.api in resources
  2. Implement schemas
  3. Implement examples

Approach: 

Acceptance criteria: 

  • Swagger API is implemented, schemas and examples are created

Story 11

Create application.yaml and setup hibernate

Purpose/Overview: 

Since domain-models-runtime library is removed from the project, it needs to introduce another method in order to interact with database

Requirements/Scope:

  1. Create application.yaml
  2. Create hibernate.properties

Approach: 

Acceptance criteria: 

  • application.yaml is created
  • hibernate is setup

Story 12

Modify unit tests

Purpose/Overview: 

Since Vert.x library is removed from the project, it needs to modify all unit tests

Requirements/Scope:

  1. Remove Vert.x library from all tests
  2. Modify tests appropriately

Approach: 

Acceptance criteria: 

  • Vert.x library is not used in the unit tests

Story 13

Replace constants from org.folio.rest.RestVerticle.* (domain-models-runtime library) with constants from another class (or create such constants) 

Purpose/Overview: 

Since domain-models-runtime library is removed from the project, all constants from org.folio.rest.RestVerticle.* should be replaced

Requirements/Scope:

  1. Remove Vert.x library from all tests
  2. Modify tests appropriately

Approach: 

  • Create new class with required constants
  • Add constants to existing class (alternative)

Acceptance criteria: 

  • Constants from org.folio.rest.RestVerticle.* (domain-models-runtime library) is not used in the project

Story 14

Create Spring controllers including Tenant controller

Purpose/Overview: 

Since domain-models-runtime library is removed from the project, all business logic inside org.folio.rest.* package should be changed according to the spring-folio-base library

Requirements/Scope:

  1. Create controller package
  2. Add required Spring controllers
  3. Modify org.folio.rest.* package

Approach: 

  • Create separate package with controllers and remove org.folio.rest.*
  • Preserve org.folio.rest.*, however modify business logic according to the spring-folio-base library (alternative)
  • Create system user permissions
  • Create DTO

Acceptance criteria: 

  • Spring controllers are created

Story 15 

Remove io.vertx.core.Future from the org.folio.service.export.storage.ExportStorageService interface

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well. 

Requirements/Scope: 

  1. Remove io.vertx.core.Future from the org.folio.service.export.storage.ExportStorageService interface
  2. Replace io.vertx.core.Future with java.util.concurrent.Future from the org.folio.service.export.storage.ExportStorageService interface

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.export.storage.ExportStorageService interface 

Story 16

Remove io.vertx.core.Future from the org.folio.service.file.* package

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well

Requirements/Scope:

  1. Remove io.vertx.core.Future from the org.folio.service.file.cleanup.StorageCleanupService interface
  2. Remove io.vertx.core.Future from the org.folio.service.file.definition.FileDefinitionService interface
  3. Remove io.vertx.core.Future from the org.folio.service.file.storage.FileStorage interface
  4. Remove io.vertx.core.Future from the org.folio.service.file.upload.FileUploadService interface
  5. Make appropriate changes to the classes if needed

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.file.* package

Story 17

Remove io.vertx.core.Future from the org.folio.service.job.JobExecutionService interface

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well

Requirements/Scope:

  1. Remove io.vertx.core.Future from the org.folio.service.job.JobExecutionService interface
  2. Use java.util.concurrent.Future (alternative)
  3. Make appropriate changes to the classes if needed

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.job.JobExecutionService interface

Story 18

Remove io.vertx.core.Future from the org.folio.service.logs.ErrorLogService interface

Purpose/Overview: 

Since Vert.x library should be removed from the project, then io.vertx.core.Future is no longer needed as well

Requirements/Scope:

  1. Remove io.vertx.core.Future from the org.folio.service.logs.ErrorLogService interface
  2. Use java.util.concurrent.Future (alternative)
  3. Make appropriate changes to the classes if needed

Approach: 

Possible solution: use java.util.concurrent.Future instead of io.vertx.core.Future 

Acceptance criteria: 

  • Io.vertx.core.Future is removed from the org.folio.service.logs.ErrorLogService interface