public abstract class AbstractPlatformConnectorComponent extends AbstractCommandReceivingComponent implements PlatformConnector
AbstractCommandReceivingComponent offers some
platform functionalities to other classes by implementing the
PlatformConnector interface.| Modifier and Type | Field and Description |
|---|---|
private Map<String,ContainerStateObserver> |
containerObservers |
cmdChannel, cmdQueueFactory, DEFAULT_CMD_RESPONSE_TIMEOUT, defaultContainerTypeconnectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor and Description |
|---|
AbstractPlatformConnectorComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addContainerObserver(String containerName,
ContainerStateObserver observer) |
String |
createContainer(String imageName,
String[] envVariables,
ContainerStateObserver observer)
This method sends a
Commands.DOCKER_CONTAINER_START command to
create and start an instance of the given image using the given
environment variables. |
RabbitQueueFactory |
getFactoryForIncomingCmdQueues() |
RabbitQueueFactory |
getFactoryForIncomingDataQueues() |
RabbitQueueFactory |
getFactoryForOutgoingCmdQueues() |
RabbitQueueFactory |
getFactoryForOutgoingDataQueues() |
void |
receiveCommand(byte command,
byte[] data)
This method is called if a command is received and might be interesting
for this particular component.
|
void |
stopContainer(String containerName)
This method sends a
Commands.DOCKER_CONTAINER_STOP command to
stop the container with the given id. |
addCommandHeaderId, close, createContainer, createContainer, handleCmd, init, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdprivate Map<String,ContainerStateObserver> containerObservers
public String createContainer(String imageName, String[] envVariables, ContainerStateObserver observer)
PlatformConnectorCommands.DOCKER_CONTAINER_START command to
create and start an instance of the given image using the given
environment variables.createContainer in interface PlatformConnectorimageName - the name of the image of the docker containerenvVariables - environment variables that should be added to the created
containerobserver - the container state observer that is called if the container
terminatespublic void receiveCommand(byte command,
byte[] data)
CommandReceivingComponentreceiveCommand in interface CommandReceivingComponentcommand - the byte encoding the commanddata - additional data that was sent together with the commandpublic void stopContainer(String containerName)
AbstractCommandReceivingComponentCommands.DOCKER_CONTAINER_STOP command to
stop the container with the given id.stopContainer in interface PlatformConnectorstopContainer in class AbstractCommandReceivingComponentcontainerName - the name of the container instance that should be stoppedprotected void addContainerObserver(String containerName, ContainerStateObserver observer)
public RabbitQueueFactory getFactoryForIncomingCmdQueues()
getFactoryForIncomingCmdQueues in interface PlatformConnectorpublic RabbitQueueFactory getFactoryForIncomingDataQueues()
getFactoryForIncomingDataQueues in interface PlatformConnectorpublic RabbitQueueFactory getFactoryForOutgoingCmdQueues()
getFactoryForOutgoingCmdQueues in interface PlatformConnectorpublic RabbitQueueFactory getFactoryForOutgoingDataQueues()
getFactoryForOutgoingDataQueues in interface PlatformConnectorCopyright © 2017–2018. All rights reserved.