dlr-eoc / prosEO

prosEO – A Processing System for Earth Observation Data
GNU General Public License v3.0
14 stars 1 forks source link

Inconsistent naming of S3 storage type in Enums #68

Closed tangobravo62 closed 3 years ago

tangobravo62 commented 4 years ago

The storage type enum for S3 Object Storage should be named "S3" according to the initial data model design. However due to the implementation of the springmvc-raml-plugin, which relies on the Apache Commons StringUtils method splitByCharacterTypeCamelCase(String str), specifying an enum value "S3" in the RAML specification creates an enum constant "S_3". This leads to inconsistencies in the code.

It has to be decided, which of the following resolution approaches shall be applied:

  1. Leave as is.
  2. Replace "S3" by "S_3" in all places, where it occurs (bowing to the dictate of the springmvc-raml-plugin).
  3. Avoid declaring enums in the RAML files and use the string constant "S3" consistently in all API specs.

Apparently a fourth alternative, namely to configure springmvc-raml-plugin in such a way that it creates enums for "S3" as "S3", does not seem to be feasible, as there is no appropriate configuration option available.

tangobravo62 commented 4 years ago

Discussion 2020-06-22: We go with alternative (3) and remove the enum declarations from the RAML files, replacing them by strings, optionally constrained by pattern definitions, which only accept "S3", "POSIX", "ALLUXIO" and "OTHER". Furthermore the StorageType enum shall be factored out from the ProductFile class and put as a class of its own in the psm-common module (package de.dlr.proseo.model.enum).

emelchinger commented 4 years ago

Implemented. RAML spec of storage types changed to:

        type: string
        description: The type of the storage
        pattern: ^(S3|ALLUXIO|POSIX|OTHER)$

New Enum StorageType in package de.dlr.proseo.model.enums implemented as the one definition of storage types.