Interface GenericContainer

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
KubePlayer

public interface GenericContainer extends AutoCloseable
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    getMappedHost(String serviceName, int exposedPort)
    Getting mapped host for the given service's name and exposed port.
    int
    getMappedPort(String serviceName, int exposedPort)
    Getting mapped port for the given service's name and exposed port.
    void
    Creates the pod or container and immediately starts it.
    void
    Stops the pod or container with clearing created volumes.
    withCleanup(boolean doCleanup)
    Do resources cleanup after stopping.
    withExposedService(String serviceName, int exposedPort)
    Specify service and its port for expose.
  • Method Details

    • start

      void start() throws PodmanException
      Creates the pod or container and immediately starts it. All created resources will be cleared out when a SIGTERM is received or pods exit.
      Throws:
      PodmanException
    • stop

      void stop() throws PodmanException
      Stops the pod or container with clearing created volumes.
      Throws:
      PodmanException
    • withExposedService

      GenericContainer withExposedService(String serviceName, int exposedPort) throws PodmanException
      Specify service and its port for expose.
      Parameters:
      serviceName - name of service to expose.
      exposedPort - port to expose.
      Returns:
      container with exposed services.
      Throws:
      PodmanException
    • withCleanup

      GenericContainer withCleanup(boolean doCleanup)
      Do resources cleanup after stopping.
      Parameters:
      doCleanup - default if true.
      Returns:
      customised container.
    • getMappedHost

      String getMappedHost(String serviceName, int exposedPort) throws PodmanException
      Getting mapped host for the given service's name and exposed port.
      Parameters:
      serviceName - the service name.
      exposedPort - the exposed port.
      Returns:
      mapped host.
      Throws:
      PodmanException
    • getMappedPort

      int getMappedPort(String serviceName, int exposedPort) throws PodmanException
      Getting mapped port for the given service's name and exposed port.
      Parameters:
      serviceName - the service name.
      exposedPort - the exposed port.
      Returns:
      mapped host.
      Throws:
      PodmanException
    • close

      default void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception