Interface WritableDataRoutingService

All Superinterfaces:
AutoCloseable, ClaimsProvider, DataRoutingService, EndpointResolver, NamedImplementation, SafeCloseable, StorageLookup
All Known Subinterfaces:
WritableDataRoutingServiceInternal
All Known Implementing Classes:
DataRoutingServiceKvEtcdImpl, DataRoutingServiceKvImpl, DataRoutingServiceKvInMemImpl

public interface WritableDataRoutingService extends DataRoutingService
Add mutating methods to the DataRoutingService interface.
  • Method Details

    • update

      void update(@NotNull String ymlString, @NotNull String code, @NotNull String comment)
      Replace the existing data routing configuration.
      Parameters:
      ymlString - YAML representation of the new data routing configuration
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      Throws:
      DataRoutingConfigurationException - if the updated routing configuration is invalid in any way
    • addDis

      default void addDis(@NotNull DataImportServiceConfig disConfig, @NotNull String code, @NotNull String comment)
      Add a DataImportServiceConfig to the data routing configuration. The disConfig will be checked as it is added, ensuring that the configuration as a whole is valid.
      Parameters:
      disConfig - the DataImportServiceConfig to add
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      Throws:
      DataRoutingConfigurationException - if the disConfig is already present, or if the updated routing configuration is invalid in any way
    • addDises

      void addDises(@NotNull Collection<DataImportServiceConfig> disConfigs, @NotNull String code, @NotNull String comment)
      Add one or more DataImportServiceConfigs to the data routing configuration. The disConfigs will be checked as they are added, ensuring that the configuration as a whole is valid.
      Parameters:
      disConfigs - the DataImportServiceConfigs to add
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      Throws:
      DataRoutingConfigurationException - if any of the disConfigs are already present, or if the updated routing configuration is invalid in any way
    • updateDis

      default void updateDis(@NotNull DataImportServiceConfig disConfig, @NotNull String code, @NotNull String comment)
      Update a DataImportServiceConfig in the data routing configuration. The disConfig will be checked as it is updated, ensuring that the configuration as a whole is valid.
      Parameters:
      disConfig - the DataImportServiceConfig to update
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      Throws:
      DataRoutingConfigurationException - if the updated routing configuration is invalid in any way
    • updateDises

      void updateDises(@NotNull Collection<DataImportServiceConfig> disConfigs, @NotNull String code, @NotNull String comment)
      Update one or more DataImportServiceConfigs in the data routing configuration. Configurations that do not exist will be added. The disConfigs will be checked as they are updated, ensuring that the configuration as a whole is valid.
      Parameters:
      disConfigs - the DataImportServiceConfigs to update
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      Throws:
      DataRoutingConfigurationException - if the updated routing configuration is invalid in any way
    • replaceConfiguration

      void replaceConfiguration(@Nullable String routingYmlString, @NotNull Collection<DataImportServiceConfig> disConfigs, @NotNull String code, @NotNull String comment, WritableDataRoutingService.Options... options)
      Replace the existing base and set of configurations with the given configurations. Any existing DIS configurations not in disConfigs will be removed.
      Parameters:
      routingYmlString - (optional) YAML representation of the new data routing configuration. If not specified, the existing base configuration will be used.
      disConfigs - the DataImportServiceConfigs to add
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      options - use IGNORE_ERRORS with extreme caution. If set, any errors encountered while adding the dises will be ignored, and it is therefore possible to persist an invalid configuration.
      Throws:
      DataRoutingConfigurationException - if the updated routing configuration is invalid in any way
    • removeDis

      default void removeDis(@NotNull String disName, @NotNull String code, @NotNull String comment)
      Remove a DataImportServiceConfig from the data routing configuration. The named dis must exist, as a separately added configuration (not inline in the main file). The routing configuration will be checked as it is removed, ensuring that the configuration as a whole is valid.
      Parameters:
      disName - the name of the DataImportServiceConfig to remove
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      Throws:
      DataRoutingConfigurationException - if the updated routing configuration is invalid in any way
    • removeDises

      void removeDises(@NotNull Collection<String> disNames, @NotNull String code, @NotNull String comment, WritableDataRoutingService.Options... options)
      Remove one or more DataImportServiceConfigs from the data routing configuration. The named dises must exist, as separately added configurations (not inline in the main file). The routing configuration will be checked as they are removed, ensuring that the configuration as a whole is valid.
      Parameters:
      disNames - the names of the DataImportServiceConfigs to remove
      code - pass-thru to kv persistence, indicates the code source of this update
      comment - pass-thru to kv persistence - a comment for this update
      options - if WritableDataRoutingService.Options.LENIENT is given, it is not considered an error if any of the named dises do not exist. if WritableDataRoutingService.Options.IGNORE_ERRORS is given, any parsing errors encountered while removing the dises will be ignored.
      Throws:
      DataRoutingConfigurationException - if the updated routing configuration is invalid in any way