Class PlayerImpl
java.lang.Object
io.github.pod4dev.java.service.impl.PlayerImpl
- All Implemented Interfaces:
GenericService,Player,AutoCloseable
Work with /kube/play API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet API client.getMappedPort(String serviceName, Integer exposedPort) Getting mapped port for the given service's name and exposed port.booleanCheck if service is running.voidstart()Creates the pod or container and immediately starts it.voidstop()Stops the pod or container with clearing created volumes.withCleanup(boolean doCleanup) Do resources cleanup after stopping.withExposedService(String serviceName, Integer exposedPort) Specify service and its port for expose.withRemoveVolumes(boolean doRemoveVolumes) Do volumes cleanup after stopping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.pod4dev.java.service.GenericService
close, getMappedHost
-
Constructor Details
-
PlayerImpl
- Throws:
PodmanException
-
PlayerImpl
- Throws:
PodmanException
-
-
Method Details
-
getClient
Description copied from interface:GenericServiceGet API client.- Specified by:
getClientin interfaceGenericService- Returns:
- API client.
-
isRunning
public boolean isRunning()Description copied from interface:GenericServiceCheck if service is running.- Specified by:
isRunningin interfaceGenericService- Returns:
- check result.
-
withExposedService
public PlayerImpl withExposedService(String serviceName, Integer exposedPort) throws PodmanException Description copied from interface:PlayerSpecify service and its port for expose.- Specified by:
withExposedServicein interfacePlayer- Parameters:
serviceName- name of service to expose.exposedPort- port to expose.- Returns:
- container with exposed services.
- Throws:
PodmanException
-
withCleanup
Description copied from interface:GenericServiceDo resources cleanup after stopping.- Specified by:
withCleanupin interfaceGenericService- Parameters:
doCleanup- default is true.- Returns:
- customised container.
-
withRemoveVolumes
Description copied from interface:GenericServiceDo volumes cleanup after stopping.- Specified by:
withRemoveVolumesin interfaceGenericService- Parameters:
doRemoveVolumes- default is true.- Returns:
- customised container.
-
start
Description copied from interface:GenericServiceCreates the pod or container and immediately starts it. All created resources will be cleared out when a SIGTERM is received or pods exit.- Specified by:
startin interfaceGenericService- Throws:
PodmanException
-
stop
Description copied from interface:GenericServiceStops the pod or container with clearing created volumes.- Specified by:
stopin interfaceGenericService- Throws:
PodmanException
-
getMappedPort
Description copied from interface:PlayerGetting mapped port for the given service's name and exposed port.- Specified by:
getMappedPortin interfacePlayer- Parameters:
serviceName- the service name.exposedPort- the exposed port.- Returns:
- mapped host.
- Throws:
PodmanException
-