Class YamlEndpoint

  • All Implemented Interfaces:
    Endpoint

    public class YamlEndpoint
    extends java.lang.Object
    implements Endpoint
    Represents a communication endpoint.
    Author:
    Holger Eichelberger, SSE
    • Constructor Summary

      Constructors 
      Constructor Description
      YamlEndpoint()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static boolean containsSafe​(java.lang.String text, java.lang.String target)
      Returns whether text contains target.
      java.lang.String getHostArg()
      Returns the specified command line argument to set the host to communicate with for this relation upon service deployment/execution.
      java.lang.String getHostArg​(java.lang.String hostname)
      Returns the ready-to.use command line argument to set the host to communicate with for this relation upon service deployment/execution.
      java.lang.String getPortArg()
      Returns the specified command line argument to set the communication port for this relation upon service deployment/execution.
      java.lang.String getPortArg​(int port)
      Returns the ready-to-use command line argument to set the communication port for this relation upon service deployment/execution.
      boolean isHostArgGeneric()
      Returns the whether Endpoint.getHostArg() is generic through Endpoint.HOST_PLACEHOLDER.
      boolean isPortArgGeneric()
      Returns the whether Endpoint.getPortArg() is generic through Endpoint.PORT_PLACEHOLDER.
      private java.lang.String replaceSafe​(java.lang.String text, java.lang.String target, java.lang.String replacement)
      Replaces target in text by replacement.
      void setHostArg​(java.lang.String hostArg)
      Defines the command line argument to set the host to communicate with for this relation upon service deployment/execution.
      void setPortArg​(java.lang.String portArg)
      Defines the command line argument to set the communication port for this relation upon service deployment/execution.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • portArg

        private java.lang.String portArg
      • hostArg

        private java.lang.String hostArg
    • Constructor Detail

      • YamlEndpoint

        public YamlEndpoint()
    • Method Detail

      • getPortArg

        public java.lang.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
      • getPortArg

        public java.lang.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 java.lang.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
      • getHostArg

        public java.lang.String getHostArg​(java.lang.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​(java.lang.String text,
                                            java.lang.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 java.lang.String replaceSafe​(java.lang.String text,
                                             java.lang.String target,
                                             java.lang.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​(java.lang.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​(java.lang.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}"