Class YamlEndpoint
- java.lang.Object
-
- de.iip_ecosphere.platform.services.spring.yaml.YamlEndpoint
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringhostArgprivate java.lang.StringportArg-
Fields inherited from interface de.iip_ecosphere.platform.services.spring.descriptor.Endpoint
HOST_PLACEHOLDER, PORT_PLACEHOLDER
-
-
Constructor Summary
Constructors Constructor Description YamlEndpoint()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static booleancontainsSafe(java.lang.String text, java.lang.String target)Returns whethertextcontainstarget.java.lang.StringgetHostArg()Returns the specified command line argument to set the host to communicate with for this relation upon service deployment/execution.java.lang.StringgetHostArg(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.StringgetPortArg()Returns the specified command line argument to set the communication port for this relation upon service deployment/execution.java.lang.StringgetPortArg(int port)Returns the ready-to-use command line argument to set the communication port for this relation upon service deployment/execution.booleanisHostArgGeneric()Returns the whetherEndpoint.getHostArg()is generic throughEndpoint.HOST_PLACEHOLDER.booleanisPortArgGeneric()Returns the whetherEndpoint.getPortArg()is generic throughEndpoint.PORT_PLACEHOLDER.private java.lang.StringreplaceSafe(java.lang.String text, java.lang.String target, java.lang.String replacement)Replacestargetintextbyreplacement.voidsetHostArg(java.lang.String hostArg)Defines the command line argument to set the host to communicate with for this relation upon service deployment/execution.voidsetPortArg(java.lang.String portArg)Defines the command line argument to set the communication port for this relation upon service deployment/execution.
-
-
-
Method Detail
-
getPortArg
public java.lang.String getPortArg()
Description copied from interface:EndpointReturns the specified command line argument to set the communication port for this relation upon service deployment/execution.- Specified by:
getPortArgin interfaceEndpoint- Returns:
- the generic port argument
-
isPortArgGeneric
public boolean isPortArgGeneric()
Description copied from interface:EndpointReturns the whetherEndpoint.getPortArg()is generic throughEndpoint.PORT_PLACEHOLDER.- Specified by:
isPortArgGenericin interfaceEndpoint- Returns:
truefor generic,falseelse
-
getPortArg
public java.lang.String getPortArg(int port)
Description copied from interface:EndpointReturns the ready-to-use command line argument to set the communication port for this relation upon service deployment/execution.- Specified by:
getPortArgin interfaceEndpoint- 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:EndpointReturns the specified command line argument to set the host to communicate with for this relation upon service deployment/execution.- Specified by:
getHostArgin interfaceEndpoint- Returns:
- the generic host argument
-
isHostArgGeneric
public boolean isHostArgGeneric()
Description copied from interface:EndpointReturns the whetherEndpoint.getHostArg()is generic throughEndpoint.HOST_PLACEHOLDER.- Specified by:
isHostArgGenericin interfaceEndpoint- Returns:
truefor generic,falseelse
-
getHostArg
public java.lang.String getHostArg(java.lang.String hostname)
Description copied from interface:EndpointReturns the ready-to.use command line argument to set the host to communicate with for this relation upon service deployment/execution.- Specified by:
getHostArgin interfaceEndpoint- Parameters:
hostname- the actual hostname, "${host}" is substituted byhostname, may be empty for localhost- Returns:
- the host argument
-
containsSafe
private static boolean containsSafe(java.lang.String text, java.lang.String target)Returns whethertextcontainstarget.- Parameters:
text- the text to look fortarget- the target to search withintext- Returns:
- if
textandtargetare not null, whethertextcontainstarget
-
replaceSafe
private java.lang.String replaceSafe(java.lang.String text, java.lang.String target, java.lang.String replacement)Replacestargetintextbyreplacement.- Parameters:
text- the text to perform the replacement ontarget- the target to search withintextreplacement- the text replacingtarget- Returns:
- if
textis null then an empty string, ifreplacementis nulltextelsetextwithtargetreplaced byreplacement
-
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}"
-
-