Package io.github.pod4dev.java.service
Interface GenericService
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
PlayerImpl
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Get API client.default StringGetting mapped hostbooleanCheck 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.withRemoveVolumes(boolean doRemoveVolumes) Do volumes cleanup after stopping.
-
Method Details
-
isRunning
boolean isRunning()Check if service is running.- Returns:
- check result.
-
start
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
Stops the pod or container with clearing created volumes.- Throws:
PodmanException
-
withCleanup
Do resources cleanup after stopping.- Parameters:
doCleanup- default is true.- Returns:
- customised container.
-
withRemoveVolumes
Do volumes cleanup after stopping.- Parameters:
doRemoveVolumes- default is true.- Returns:
- customised container.
-
getMappedHost
Getting mapped host- Returns:
- mapped host.
- Throws:
PodmanException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getClient
PodmanClient getClient()Get API client.- Returns:
- API client.
-