Interface GenericService

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
Container, Player
All Known Implementing Classes:
PlayerImpl

public interface GenericService extends AutoCloseable
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    Get API client.
    default String
    Getting mapped host
    boolean
    Check if service is running.
    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.
    withRemoveVolumes(boolean doRemoveVolumes)
    Do volumes cleanup after stopping.
  • Method Details

    • isRunning

      boolean isRunning()
      Check if service is running.
      Returns:
      check result.
    • 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
    • withCleanup

      Player withCleanup(boolean doCleanup)
      Do resources cleanup after stopping.
      Parameters:
      doCleanup - default is true.
      Returns:
      customised container.
    • withRemoveVolumes

      Player withRemoveVolumes(boolean doRemoveVolumes)
      Do volumes cleanup after stopping.
      Parameters:
      doRemoveVolumes - default is true.
      Returns:
      customised container.
    • getMappedHost

      default String getMappedHost() throws PodmanException
      Getting mapped host
      Returns:
      mapped host.
      Throws:
      PodmanException
    • close

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

      PodmanClient getClient()
      Get API client.
      Returns:
      API client.