Class RestServer

java.lang.Object
oracle.kubernetes.operator.rest.RestServer

public class RestServer
extends java.lang.Object
The RestServer runs the WebLogic operator's REST api.

It provides the following ports that host the WebLogic operator's REST api:

  • external http port - this port can be used both inside and outside of a Kubernetes cluster.
  • external https port - this port can be only be used outside of a Kubernetes cluster since its SSL certificate contains the external hostnames for contacting this port.
  • internal https port - this port can only be used inside of a Kubernetes cluster since its SSL certificate contains the the in-cluster hostnames for contacting this port.
  • Method Summary

    Modifier and Type Method Description
    static void create​(RestConfig restConfig)
    Create singleton instance of the WebLogic Operator's RestServer.
    static void destroy()
    Release RestServer singleton instance.
    static RestServer getInstance()
    Accessor for obtaining reference to the RestServer singleton instance.
    void start​(Container container)
    Starts WebLogic operator's REST api.
    void stop()
    Stops WebLogic operator's REST api.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static void create​(RestConfig restConfig)
      Create singleton instance of the WebLogic Operator's RestServer. Should only be called once.
      Parameters:
      restConfig - - the WebLogic Operator's REST configuration. Throws IllegalStateException if instance already created.
    • getInstance

      public static RestServer getInstance()
      Accessor for obtaining reference to the RestServer singleton instance.
      Returns:
      RestServer - Singleton instance of the RestServer
    • destroy

      public static void destroy()
      Release RestServer singleton instance. Should only be called once. Throws IllegalStateException if singleton instance not created.
    • start

      public void start​(Container container) throws java.lang.Exception
      Starts WebLogic operator's REST api.

      If a port has not been configured, then it logs that fact, does not start that port, and continues (v.s. throwing an exception and not starting any ports).

      Parameters:
      container - Container
      Throws:
      java.lang.Exception - if the REST api could not be started for reasons other than a port was not configured. When an exception is thrown, then none of the ports will be leftrunning, however it is still OK to call stop (which will be a no-op).
    • stop

      public void stop()
      Stops WebLogic operator's REST api.

      Since it only stops ports that are running, it is safe to call this even if start threw an exception or didn't start any ports because none were configured.