Class SupportingComponent

java.lang.Object
com.microservices.starter.core.environment.SupportingComponent
All Implemented Interfaces:
DomainAware, EnabledAware, Serializable

public class SupportingComponent extends Object implements Serializable, EnabledAware, DomainAware
Describes a supporting concept in the form of a Docker image. These items are generally not customized at the code level, but their behavior may be customized by environment variable. This generally covers things like database and message brokers, but also includes more microservice specific concepts like gateways and config servers.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    Optionally contribute properties to the Data Module Config Properties.
    Points to the classpath location of a template snippet that contains the necessary docker-compose fragment needed to setup this supporting item.
    Domain (DNS) information used at runtime for dynamic application configuration to negotiate gateway routing and interservice communication appropriately based on the deployed environment.
    Supporting items can sometimes be enabled for direct source editing via this property.
    Whether or not this supporting element is enabled.
    The system will usually determine the image name for project generated components based on convention using a mixture of the component name, and docker related properties found in Docker.
    Optional setting for SupportingComponent to define if any prescribed initialization behavior should be enabled.
    Whether this supporting component should be managed in the project's pom.xml.
    The name used to identify the component.
    Special case field that applies to optional liquibase changelog name modifier.
    A name identifying the specific platform to which this supporting component belongs.
    Container exposed port by key name map.
    Special case field useful for supporting items that provide or require an additional identifying name as part of their usage.
    int
     
    void
    setDataModulePropertyContribution(Map<String,Map<String,String>> dataModulePropertyContribution)
    Optionally contribute properties to the Data Module Config Properties.
    void
    setDescriptor(String descriptor)
    Points to the classpath location of a template snippet that contains the necessary docker-compose fragment needed to setup this supporting item.
    void
    setDomain(Domain domain)
    Domain (DNS) information used at runtime for dynamic application configuration to negotiate gateway routing and interservice communication appropriately based on the deployed environment.
    void
    setEditSource(Boolean editSource)
    Supporting items can sometimes be enabled for direct source editing via this property.
    void
    Whether or not this supporting element is enabled.
    void
    setImageUriOverride(String imageUriOverride)
    The system will usually determine the image name for project generated components based on convention using a mixture of the component name, and docker related properties found in Docker.
    void
    setInit(Init init)
    Optional setting for SupportingComponent to define if any prescribed initialization behavior should be enabled.
    void
    setManagePom(Boolean managePom)
    Whether this supporting component should be managed in the project's pom.xml.
    void
    The name used to identify the component.
    void
    setOption(String option)
    Special case field that applies to optional liquibase changelog name modifier.
    void
    setPlatform(String platform)
    A name identifying the specific platform to which this supporting component belongs.
    void
    Container exposed port by key name map.
    void
    setResourceName(String resourceName)
    Special case field useful for supporting items that provide or require an additional identifying name as part of their usage.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SupportingComponent

      public SupportingComponent()
  • Method Details

    • getName

      public String getName()
      The name used to identify the component. Required.
      Specified by:
      getName in interface DomainAware
      Specified by:
      getName in interface EnabledAware
    • getPlatform

      public String getPlatform()
      A name identifying the specific platform to which this supporting component belongs. For example, the name may be database, but the platform would be more specific - like postgresql. Required.
    • getDescriptor

      public String getDescriptor()
      Points to the classpath location of a template snippet that contains the necessary docker-compose fragment needed to setup this supporting item. Optional.
    • getEnabled

      public Boolean getEnabled()
      Whether or not this supporting element is enabled. This is the primary way you define what database is supported with your application, for example. Required.
      Specified by:
      getEnabled in interface EnabledAware
    • getDomain

      public Domain getDomain()
      Domain (DNS) information used at runtime for dynamic application configuration to negotiate gateway routing and interservice communication appropriately based on the deployed environment. Required.
      Specified by:
      getDomain in interface DomainAware
    • getResourceName

      public String getResourceName()
      Special case field useful for supporting items that provide or require an additional identifying name as part of their usage. This primarily applies to Oracle support processing and the inclusion of the xe SID used as part of the express edition.
    • getOption

      public String getOption()
      Special case field that applies to optional liquibase changelog name modifier. Currently, this is mainly used to reference the `oracle-short` liquibase changelogs, which maintain shorter length object identifiers for older Oracle version compatibility. To leverage the `oracle-short` support, you would specify this option value as `short`.
    • getPorts

      public Map<String,String> getPorts()
      Container exposed port by key name map. The key name represents a template variable in the docker snippet that will be substituted with the port value.
    • getEditSource

      public Boolean getEditSource()
      Supporting items can sometimes be enabled for direct source editing via this property. The assembly zip with the original project source is downloaded and expanded so that it is available for customization. This is a special case and usually applies to the solr docker project only. Optional. False by default.
    • getImageUriOverride

      public String getImageUriOverride()
      The system will usually determine the image name for project generated components based on convention using a mixture of the component name, and docker related properties found in Docker. However, if a non-generated URI is desired to target the appropriate image for the component, it can be specified here. A valid URI would be something like: /my-prefix/my-name. Optional. Generated by default.
    • getManagePom

      public Boolean getManagePom()
      Whether this supporting component should be managed in the project's pom.xml. Some project structure customizations may explicitly set up the pom (e.g. inherited from a parent pom) and it may be necessary to disable automatic inclusion of the resulting dependency. Also, not all supporting components drive a dependency in the pom, in which case, this property has no effect. Optional. True by default.
    • getInit

      public Init getInit()
      Optional setting for SupportingComponent to define if any prescribed initialization behavior should be enabled. If the component supports initialization, this setting will be honored in each environment defined. See Init for more details.
    • getDataModulePropertyContribution

      public Map<String,Map<String,String>> getDataModulePropertyContribution()
      Optionally contribute properties to the Data Module Config Properties. This can be useful if certain components in the overall system might need to impact any seed data that is loaded via the data module. For example, many starter extensions may contribute example data for tenant, application, and auth use cases. For certain, ecosystem setups, it may be beneficial to override the default values (like updating any pre-configured URLs or ports) based on the configuration of a component.

      The key in this map is the Spring Profile for which these data module properties should be loaded and the value consists of a Map of property keys and corresponding values.

      For example: {default:{spring.liquibase.parameters.myAppDefaultRedirectUri:'https://mydomain.com'}}

    • setName

      public void setName(String name)
      The name used to identify the component. Required.
    • setPlatform

      public void setPlatform(String platform)
      A name identifying the specific platform to which this supporting component belongs. For example, the name may be database, but the platform would be more specific - like postgresql. Required.
    • setDescriptor

      public void setDescriptor(String descriptor)
      Points to the classpath location of a template snippet that contains the necessary docker-compose fragment needed to setup this supporting item. Optional.
    • setEnabled

      public void setEnabled(Boolean enabled)
      Whether or not this supporting element is enabled. This is the primary way you define what database is supported with your application, for example. Required.
      Specified by:
      setEnabled in interface EnabledAware
    • setDomain

      public void setDomain(Domain domain)
      Domain (DNS) information used at runtime for dynamic application configuration to negotiate gateway routing and interservice communication appropriately based on the deployed environment. Required.
      Specified by:
      setDomain in interface DomainAware
    • setResourceName

      public void setResourceName(String resourceName)
      Special case field useful for supporting items that provide or require an additional identifying name as part of their usage. This primarily applies to Oracle support processing and the inclusion of the xe SID used as part of the express edition.
    • setOption

      public void setOption(String option)
      Special case field that applies to optional liquibase changelog name modifier. Currently, this is mainly used to reference the `oracle-short` liquibase changelogs, which maintain shorter length object identifiers for older Oracle version compatibility. To leverage the `oracle-short` support, you would specify this option value as `short`.
    • setPorts

      public void setPorts(Map<String,String> ports)
      Container exposed port by key name map. The key name represents a template variable in the docker snippet that will be substituted with the port value.
    • setEditSource

      public void setEditSource(Boolean editSource)
      Supporting items can sometimes be enabled for direct source editing via this property. The assembly zip with the original project source is downloaded and expanded so that it is available for customization. This is a special case and usually applies to the solr docker project only. Optional. False by default.
    • setImageUriOverride

      public void setImageUriOverride(String imageUriOverride)
      The system will usually determine the image name for project generated components based on convention using a mixture of the component name, and docker related properties found in Docker. However, if a non-generated URI is desired to target the appropriate image for the component, it can be specified here. A valid URI would be something like: /my-prefix/my-name. Optional. Generated by default.
    • setManagePom

      public void setManagePom(Boolean managePom)
      Whether this supporting component should be managed in the project's pom.xml. Some project structure customizations may explicitly set up the pom (e.g. inherited from a parent pom) and it may be necessary to disable automatic inclusion of the resulting dependency. Also, not all supporting components drive a dependency in the pom, in which case, this property has no effect. Optional. True by default.
    • setInit

      public void setInit(Init init)
      Optional setting for SupportingComponent to define if any prescribed initialization behavior should be enabled. If the component supports initialization, this setting will be honored in each environment defined. See Init for more details.
    • setDataModulePropertyContribution

      public void setDataModulePropertyContribution(Map<String,Map<String,String>> dataModulePropertyContribution)
      Optionally contribute properties to the Data Module Config Properties. This can be useful if certain components in the overall system might need to impact any seed data that is loaded via the data module. For example, many starter extensions may contribute example data for tenant, application, and auth use cases. For certain, ecosystem setups, it may be beneficial to override the default values (like updating any pre-configured URLs or ports) based on the configuration of a component.

      The key in this map is the Spring Profile for which these data module properties should be loaded and the value consists of a Map of property keys and corresponding values.

      For example: {default:{spring.liquibase.parameters.myAppDefaultRedirectUri:'https://mydomain.com'}}

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object