Package org.hobbit.core.mimic
Class DockerBasedMimickingAlg
- java.lang.Object
-
- org.hobbit.core.mimic.DockerBasedMimickingAlg
-
- All Implemented Interfaces:
ContainerStateObserver,MimickingAlgorithmManager
public class DockerBasedMimickingAlg extends Object implements MimickingAlgorithmManager, ContainerStateObserver
This implementation of aMimickingAlgorithmManagercreates a Docker container for executing the mimicking algorithm and assumes that the algorithm will send its data via a RabbitMQ queue. The name of the queue is given as environment variable with the keyConstants.DATA_QUEUE_NAME_KEY. The generated data is written to a file with the given file name.- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
-
Field Summary
Fields Modifier and Type Field Description private PlatformConnectorconnectorThe connector that offers the needed functionality of the Hobbit platform.private StringdockerImageThe name of the image containing the mimicking algorithm.private static org.slf4j.LoggerLOGGERprivate Map<String,SimpleFileReceiver>receivers
-
Constructor Summary
Constructors Constructor Description DockerBasedMimickingAlg(PlatformConnector connector, String dockerImage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontainerStopped(String containerName, int exitCode)voidgenerateData(String outputDirectory, String[] envVariables)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
dockerImage
private String dockerImage
The name of the image containing the mimicking algorithm.
-
connector
private PlatformConnector connector
The connector that offers the needed functionality of the Hobbit platform.
-
receivers
private Map<String,SimpleFileReceiver> receivers
-
-
Constructor Detail
-
DockerBasedMimickingAlg
public DockerBasedMimickingAlg(PlatformConnector connector, String dockerImage)
-
-
Method Detail
-
generateData
public void generateData(String outputDirectory, String[] envVariables) throws Exception
- Specified by:
generateDatain interfaceMimickingAlgorithmManager- Throws:
Exception
-
containerStopped
public void containerStopped(String containerName, int exitCode)
- Specified by:
containerStoppedin interfaceContainerStateObserver
-
-