Class TransportK8S
java.lang.Object
test.de.iip_ecosphere.platform.ecsRuntime.kubernetes.TransportK8S
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate de.iip_ecosphere.platform.support.ServerAddressprivate de.iip_ecosphere.platform.transport.connectors.TransportConnectorprivate static booleanprivate de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyTypeprivate static Stringprivate static Stringprivate static de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.K8SJavaProxy -
Constructor Summary
ConstructorsConstructorDescriptionTransportK8S(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyType proxyType, de.iip_ecosphere.platform.support.ServerAddress addr, String serverIP, String serverPort, boolean tlsCheck) Creates a transport K8S java proxy instance, it will be either MasterProxy or WorkerProxy. -
Method Summary
Modifier and TypeMethodDescriptionde.iip_ecosphere.platform.support.ServerAddressgetAddr()Returns the server address.de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyTypeReturns the proxyType of K8S java proxy.private byte[]getResponseMessage(byte[] responseBody, String formattedHeaderResponse) Prepare the response for each message in the stream.Returns the server IP address.Returns the server port.booleanReturns the Transport stop status.private byte[]sendToK8S(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.TransportMessage received) Asserts thatexpectedand the received value incallbackcontain the same values.private static byte[]sendToMasterTransport(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.TransportMessage received) Asserts thatexpectedand the received value incallbackcontain the same values.private byte[]sendWatchToK8S(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.TransportMessage received, de.iip_ecosphere.platform.transport.connectors.TransportConnector connector) Asserts thatexpectedand the received value incallbackcontain the same values.voidsetAddr(de.iip_ecosphere.platform.support.ServerAddress addr) Set the server address.voidsetProxyType(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyType proxyType) Set the proxyType of K8S java proxy.voidsetServerIP(String serverIP) Set the server IP address.voidsetServerPort(String serverPort) Set the server port.voidsetStopped(boolean isStopped) Set the Transport stop status.voidstart(TransportK8STLS transportK8STLS) The start method to run the server proxy.
-
Field Details
-
serverIP
-
serverPort
-
transportK8SJavaProxy
private static de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.K8SJavaProxy transportK8SJavaProxy -
isStopped
private static boolean isStopped -
addr
private de.iip_ecosphere.platform.support.ServerAddress addr -
proxyType
private de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyType proxyType -
cl1
private de.iip_ecosphere.platform.transport.connectors.TransportConnector cl1
-
-
Constructor Details
-
TransportK8S
public TransportK8S(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyType proxyType, de.iip_ecosphere.platform.support.ServerAddress addr, String serverIP, String serverPort, boolean tlsCheck) Creates a transport K8S java proxy instance, it will be either MasterProxy or WorkerProxy.- Parameters:
proxyType- the type of the proxy (MasterProxy or WorkerProxy)addr- the address of the transport proxyserverIP- the IP Address of the serverserverPort- the port of the servertlsCheck- check to use tls security
-
-
Method Details
-
getAddr
public de.iip_ecosphere.platform.support.ServerAddress getAddr()Returns the server address.- Returns:
- the server address
-
setAddr
public void setAddr(de.iip_ecosphere.platform.support.ServerAddress addr) Set the server address.- Parameters:
addr- the server address
-
getServerIP
Returns the server IP address.- Returns:
- the server IP address
-
setServerIP
Set the server IP address.- Parameters:
serverIP- the server IP address
-
getServerPort
Returns the server port.- Returns:
- the server port
-
setServerPort
Set the server port.- Parameters:
serverPort- the server port
-
getProxyType
public de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyType getProxyType()Returns the proxyType of K8S java proxy.- Returns:
- the proxyType of K8S java proxy
-
setProxyType
public void setProxyType(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.ProxyType proxyType) Set the proxyType of K8S java proxy.- Parameters:
proxyType- the proxyType of K8S java proxy
-
isStopped
public boolean isStopped()Returns the Transport stop status.- Returns:
- the Transport stop status
-
setStopped
Set the Transport stop status.- Parameters:
isStopped- the Transport stop status- Throws:
IOException
-
start
The start method to run the server proxy.- Parameters:
transportK8STLS- the tls security information
-
sendToMasterTransport
private static byte[] sendToMasterTransport(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.TransportMessage received) Asserts thatexpectedand the received value incallbackcontain the same values.- Parameters:
received- transport Message- Returns:
- the response from the master transport
-
sendToK8S
private byte[] sendToK8S(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.TransportMessage received) Asserts thatexpectedand the received value incallbackcontain the same values.- Parameters:
received- transport Message- Returns:
- the response from the K8S apiserver;
-
sendWatchToK8S
private byte[] sendWatchToK8S(de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.TransportMessage received, de.iip_ecosphere.platform.transport.connectors.TransportConnector connector) throws IOException Asserts thatexpectedand the received value incallbackcontain the same values.- Parameters:
received- transport Messageconnector- the connector to send the watch stream messages- Returns:
- the response from the K8S apiserver;
- Throws:
IOException
-
getResponseMessage
Prepare the response for each message in the stream.- Parameters:
responseBody- the response to prepareformattedHeaderResponse- the response header if it is the first response- Returns:
- the responseBody the prepared response to send
-