java.lang.Object
de.iip_ecosphere.platform.services.spring.yaml.YamlEndpoint
All Implemented Interfaces:
Endpoint

public class YamlEndpoint extends Object implements Endpoint
Represents a communication endpoint.
Author:
Holger Eichelberger, SSE
  • Field Details

    • portArg

      private String portArg
    • hostArg

      private String hostArg
  • Constructor Details

    • YamlEndpoint

      public YamlEndpoint()
  • Method Details

    • getPortArg

      public String getPortArg()
      Description copied from interface: Endpoint
      Returns the specified command line argument to set the communication port for this relation upon service deployment/execution.
      Specified by:
      getPortArg in interface Endpoint
      Returns:
      the generic port argument
    • isPortArgGeneric

      public boolean isPortArgGeneric()
      Description copied from interface: Endpoint
      Returns the whether Endpoint.getPortArg() is generic through Endpoint.PORT_PLACEHOLDER.
      Specified by:
      isPortArgGeneric in interface Endpoint
      Returns:
      true for generic, false else
    • getPortArg

      public String getPortArg(int port)
      Description copied from interface: Endpoint
      Returns the ready-to-use command line argument to set the communication port for this relation upon service deployment/execution.
      Specified by:
      getPortArg in interface Endpoint
      Parameters:
      port - the actual port number
      Returns:
      the port argument, "${port}" is substituted by port
    • getHostArg

      public String getHostArg()
      Description copied from interface: Endpoint
      Returns the specified command line argument to set the host to communicate with for this relation upon service deployment/execution.
      Specified by:
      getHostArg in interface Endpoint
      Returns:
      the generic host argument
    • isHostArgGeneric

      public boolean isHostArgGeneric()
      Description copied from interface: Endpoint
      Returns the whether Endpoint.getHostArg() is generic through Endpoint.HOST_PLACEHOLDER.
      Specified by:
      isHostArgGeneric in interface Endpoint
      Returns:
      true for generic, false else
    • getHostArg

      public String getHostArg(String hostname)
      Description copied from interface: Endpoint
      Returns the ready-to.use command line argument to set the host to communicate with for this relation upon service deployment/execution.
      Specified by:
      getHostArg in interface Endpoint
      Parameters:
      hostname - the actual hostname, "${host}" is substituted by hostname, may be empty for localhost
      Returns:
      the host argument
    • containsSafe

      private static boolean containsSafe(String text, String target)
      Returns whether text contains target.
      Parameters:
      text - the text to look for
      target - the target to search within text
      Returns:
      if text and target are not null, whether text contains target
    • replaceSafe

      private String replaceSafe(String text, String target, String replacement)
      Replaces target in text by replacement.
      Parameters:
      text - the text to perform the replacement on
      target - the target to search within text
      replacement - the text replacing target
      Returns:
      if text is null then an empty string, if replacement is null text else text with target replaced by replacement
    • setPortArg

      public void setPortArg(String portArg)
      Defines the command line argument to set the communication port for this relation upon service deployment/execution. [Required by SnakeYaml]
      Parameters:
      portArg - the generic port argument, may contain "${port}"
    • setHostArg

      public void setHostArg(String hostArg)
      Defines the command line argument to set the host to communicate with for this relation upon service deployment/execution. [Required by SnakeYaml]
      Parameters:
      hostArg - the host argument, may contain "${host}"