Class TableDataServiceData

java.lang.Object
com.illumon.iris.db.v2.routing.impl.yaml.TableDataServiceData
All Implemented Interfaces:
DataRoutingService.PropertyProvider, ServiceRegistryConfig, TableDataServiceConfig, NamedImplementation

public class TableDataServiceData extends Object implements TableDataServiceConfig, DataRoutingService.PropertyProvider
Holds raw configuration data for a TDS. This represents several types of TDS - including local, remote, and composite.
  • Field Details

    • FAILOVER_GROUP_PROP

      public static final String FAILOVER_GROUP_PROP
      this property on a TableDataServiceData indicates that the delegates are a failover group
      See Also:
  • Method Details

    • makeRemoteTableDataServiceConfig

      public static TableDataServiceConfig makeRemoteTableDataServiceConfig(@NotNull String name, @Nullable String description, @NotNull List<String> tags, @NotNull Filter filter, @NotNull Map<String,String> properties, @NotNull DataRoutingService.EndpointConfig endpointConfig)
      Construct a TableDataServiceConfig, given the inputs that represent a remote TDS.
      Parameters:
      name - name for this service
      description - description of this service
      tags - tags associated with this service
      filter - the filter
      properties - local configuration properties for this table data service
      endpointConfig - configuration for a remote table data service endpoint.
      Returns:
      a new TableDataServiceConfig
    • makeComposingTableDataServiceConfig

      public static TableDataServiceConfig makeComposingTableDataServiceConfig(@NotNull String name, @Nullable String description, @NotNull List<String> tags, @NotNull Filter filter, @NotNull List<TableDataServiceConfig> sources, @NotNull Map<String,String> properties, @Nullable DataRoutingService.EndpointConfig endpointConfig)
      Construct a TableDataServiceData, given the inputs that represent a composing/delegating TDS.
      Parameters:
      name - name for this service
      description - description of this service
      tags - tags associated with this service
      sources - list of sources
      filter - the filter
      properties - local configuration properties for this table data service
      endpointConfig - optional configuration for a remote table data service endpoint. Some configurations are used for composition (server) and RTDS (client)
      Returns:
      a new TableDataServiceConfig
    • makeLocalTableDataServiceConfig

      public static TableDataServiceConfig makeLocalTableDataServiceConfig(@NotNull String name, @Nullable String description, @NotNull List<String> tags, @NotNull Filter filter, @NotNull StorageData storage, @NotNull Map<String,String> properties, @NotNull DataRoutingService.EndpointConfig endpointConfig)
      Construct a TableDataServiceData, given the inputs that represent a (remote) local table data service.
      Parameters:
      name - name for this service
      description - description of this service
      tags - tags associated with this service
      filter - the filter
      storage - the storage that will be presented by this service
      properties - local configuration properties for this table data service
      endpointConfig - configuration for the remote table data service endpoint
      Returns:
      a new TableDataServiceConfig
    • makeDelegatingTableDataServiceConfig

      public static TableDataServiceConfig makeDelegatingTableDataServiceConfig(@NotNull String sourceName, @Nullable String description, @NotNull Filter filter, @NotNull List<TableDataServiceConfig> delegates)
      Construct a TableDataServiceData, given the inputs that represent local delegation.
      Parameters:
      sourceName - name for this service
      description - description of this service
      filter - the filter
      delegates - the services to be grouped in this TDS
      Returns:
      a new TableDataServiceConfig
    • makeGroupTableDataServiceConfig

      public static TableDataServiceData makeGroupTableDataServiceConfig(@NotNull String sourceName, @Nullable String description, @NotNull Filter filter, @NotNull List<TableDataServiceConfig> delegates)
      Construct a TableDataServiceData, given the inputs that represent a failover group.
      Parameters:
      sourceName - name for this service
      description - description of this service
      filter - the filter
      delegates - the services to be grouped in this TDS
      Returns:
      a new TableDataServiceConfig
    • getServiceRegistryType

      @NotNull public String getServiceRegistryType()
      Description copied from interface: ServiceRegistryConfig
      Returns the value populated for 'serviceregistry' tag under endpoints sub-config.
      Specified by:
      getServiceRegistryType in interface ServiceRegistryConfig
    • getName

      @NotNull public String getName()
      Specified by:
      getName in interface TableDataServiceConfig
    • getEndpointConfig

      @Nullable public DataRoutingService.EndpointConfig getEndpointConfig()
      Specified by:
      getEndpointConfig in interface TableDataServiceConfig
    • getFilter

      @NotNull public Filter getFilter()
      Specified by:
      getFilter in interface TableDataServiceConfig
    • getStorageName

      @Nullable public String getStorageName()
      Specified by:
      getStorageName in interface TableDataServiceConfig
    • getStorageRoot

      @Nullable public String getStorageRoot()
      Specified by:
      getStorageRoot in interface TableDataServiceConfig
    • getDescription

      @Nullable public String getDescription()
      Specified by:
      getDescription in interface TableDataServiceConfig
    • getTags

      @NotNull public Collection<String> getTags()
      Specified by:
      getTags in interface TableDataServiceConfig
    • getDelegates

      @NotNull public Collection<? extends TableDataServiceConfig> getDelegates()
      Specified by:
      getDelegates in interface TableDataServiceConfig
    • getProperties

      @NotNull public Map<String,String> getProperties()
      Description copied from interface: DataRoutingService.PropertyProvider
      Return all properties as a map. This is useful for interactions outside the DB project.
      Specified by:
      getProperties in interface DataRoutingService.PropertyProvider
      Returns:
      a map containing all keys and values for this provider
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isRemote

      public boolean isRemote()
      Specified by:
      isRemote in interface TableDataServiceConfig