java.lang.Object
de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.AbstractK8SJavaProxy
de.iip_ecosphere.platform.ecsRuntime.kubernetes.proxy.AasK8SJavaProxy
All Implemented Interfaces:
K8SJavaProxy

public class AasK8SJavaProxy extends AbstractK8SJavaProxy
The Implementation of AAS for the Abstract class AbstractK8SJavaProxy. K8S (Kubernetes)
Author:
Ahmad Alamoush, SSE
  • Field Details

    • submodel

      private de.iip_ecosphere.platform.support.aas.Submodel submodel
    • aas

      private de.iip_ecosphere.platform.support.aas.Aas aas
    • watchSubmodel

      private de.iip_ecosphere.platform.support.aas.Submodel watchSubmodel
    • watchAas

      private de.iip_ecosphere.platform.support.aas.Aas watchAas
  • Constructor Details

    • AasK8SJavaProxy

      public AasK8SJavaProxy(ProxyType proxyType, int aasPort, String serverIP, String serverPort, boolean tlsCheck)
      Creates a K8S java proxy instance, it will be either MasterProxy or WorkerProxy. If it is MasterProxy then IP address and port will be to the K8S apiserver address and port If it is WorkerProxy then IP address and port will be to the MasterProxy address and port
      Parameters:
      proxyType - the type of the proxy (MasterProxy or WorkerProxy)
      aasPort - the aas port
      serverIP - the IP Address of the server
      serverPort - the port of the server (either the Aas port or K8S apiserver port)
      tlsCheck - check to use tls security
  • Method Details

    • sendK8SRequest

      public byte[] sendK8SRequest(BufferedOutputStream writer, K8SRequest request) throws IOException
      Description copied from class: AbstractK8SJavaProxy
      Send the K8S request object to the MasterProxy or K8S apiserver.
      Specified by:
      sendK8SRequest in interface K8SJavaProxy
      Overrides:
      sendK8SRequest in class AbstractK8SJavaProxy
      Parameters:
      writer - is the output buffer to send watch request stream
      request - the K8S request object (K8SRequest)
      Returns:
      the response from the MasterProxy or K8S apiserver for sent request
      Throws:
      IOException
    • executeK8SGet

      public byte[] executeK8SGet(BufferedOutputStream writer, K8SRequest request) throws org.apache.http.client.ClientProtocolException, IOException
      Execute GET request and send it to the MasterProxy.
      Parameters:
      writer - is the output buffer to send watch request stream
      request - the K8S request object (K8SRequest)
      Returns:
      the response from the MasterProxy for sent GET request
      Throws:
      IOException
      org.apache.http.client.ClientProtocolException
    • executeK8SPost

      public byte[] executeK8SPost(K8SRequest request) throws org.apache.http.client.ClientProtocolException, IOException
      Execute POST request and send it to the MasterProxy.
      Parameters:
      request - the K8S request object (K8SRequest)
      Returns:
      the response from the MasterProxy for sent POST request
      Throws:
      IOException
      org.apache.http.client.ClientProtocolException
    • executeK8SPut

      public byte[] executeK8SPut(K8SRequest request) throws org.apache.http.client.ClientProtocolException, IOException
      Execute PUT request and send it to the MasterProxy.
      Parameters:
      request - the K8S request object (K8SRequest)
      Returns:
      the response from the MasterProxy for sent PUT request
      Throws:
      IOException
      org.apache.http.client.ClientProtocolException
    • executeK8SPatch

      public byte[] executeK8SPatch(K8SRequest request) throws org.apache.http.client.ClientProtocolException, IOException
      Execute PATCH request and send it to the MasterProxy.
      Parameters:
      request - the K8S request object (K8SRequest)
      Returns:
      the response from the MasterProxy for sent PATCH request
      Throws:
      IOException
      org.apache.http.client.ClientProtocolException
    • executeK8SDelete

      public byte[] executeK8SDelete(K8SRequest request) throws org.apache.http.client.ClientProtocolException, IOException
      Execute DELETE request and send it to the MasterProxy.
      Parameters:
      request - the K8S request object (K8SRequest)
      Returns:
      the response from the MasterProxy for sent DELETE request
      Throws:
      IOException
      org.apache.http.client.ClientProtocolException
    • formatWatchK8SResponse

      public String formatWatchK8SResponse(BufferedWriter writer, K8SRequest request, okhttp3.Response response) throws IOException
      Format the response from K8S apiserver.
      Parameters:
      writer -
      request - the K8S request object (K8SRequest)
      response - the response from the K8S apiserver
      Returns:
      the formated response
      Throws:
      IOException