brooklyn.entity.container.docker.DockerContainer Maven / Gradle / Ivy
Show all versions of brooklyn-clocker-docker Show documentation
/*
* Copyright 2014-2015 by Cloudsoft Corporation Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package brooklyn.entity.container.docker;
import java.util.List;
import java.util.Map;
import java.util.Set;
import brooklyn.config.ConfigKey;
import brooklyn.entity.Entity;
import brooklyn.entity.annotation.Effector;
import brooklyn.entity.basic.BasicStartable;
import brooklyn.entity.basic.ConfigKeys;
import brooklyn.entity.basic.Lifecycle;
import brooklyn.entity.basic.MethodEffector;
import brooklyn.entity.basic.SoftwareProcess;
import brooklyn.entity.container.DockerAttributes;
import brooklyn.entity.proxying.ImplementedBy;
import brooklyn.entity.trait.HasShortName;
import brooklyn.event.AttributeSensor;
import brooklyn.event.basic.AttributeSensorAndConfigKey;
import brooklyn.event.basic.Sensors;
import brooklyn.location.basic.SshMachineLocation;
import brooklyn.location.docker.DockerContainerLocation;
import brooklyn.location.dynamic.LocationOwner;
import brooklyn.location.jclouds.JcloudsSshMachineLocation;
import brooklyn.util.flags.SetFromFlag;
import brooklyn.util.net.HasNetworkAddresses;
import com.google.common.reflect.TypeToken;
/**
* A Docker container.
*
* This entity controls the {@link DockerContainerLocation} location, and creates
* and the {@link JcloudsSshMachineLocation} that entities communicate with when
* deployed to the {@link DockerInfrastructure}.
*/
@ImplementedBy(DockerContainerImpl.class)
public interface DockerContainer extends BasicStartable, HasNetworkAddresses, HasShortName, LocationOwner {
@SetFromFlag("dockerHost")
AttributeSensorAndConfigKey DOCKER_HOST = ConfigKeys.newSensorAndConfigKey(Entity.class, "docker.host", "The parent Docker host");
@SetFromFlag("infrastructure")
AttributeSensorAndConfigKey DOCKER_INFRASTRUCTURE = DockerHost.DOCKER_INFRASTRUCTURE;
@SetFromFlag("containerName")
AttributeSensorAndConfigKey DOCKER_CONTAINER_NAME = DockerAttributes.DOCKER_CONTAINER_NAME;
@SetFromFlag("managed")
ConfigKey MANAGED = DockerAttributes.MANAGED;
@SetFromFlag("password")
ConfigKey DOCKER_PASSWORD = DockerAttributes.DOCKER_PASSWORD;
@SetFromFlag("imageId")
ConfigKey DOCKER_IMAGE_ID = DockerAttributes.DOCKER_IMAGE_ID.getConfigKey();
@SetFromFlag("imageName")
ConfigKey DOCKER_IMAGE_NAME = DockerAttributes.DOCKER_IMAGE_NAME.getConfigKey();
@SetFromFlag("imageTag")
ConfigKey DOCKER_IMAGE_TAG = DockerAttributes.DOCKER_IMAGE_TAG.getConfigKey();
@SetFromFlag("hardwareId")
ConfigKey DOCKER_HARDWARE_ID = DockerAttributes.DOCKER_HARDWARE_ID.getConfigKey();
@SetFromFlag("useHostDnsName")
ConfigKey DOCKER_USE_HOST_DNS_NAME = DockerAttributes.DOCKER_USE_HOST_DNS_NAME;
@SetFromFlag("cpuShares")
ConfigKey DOCKER_CPU_SHARES = DockerAttributes.DOCKER_CPU_SHARES;
@SetFromFlag("memory")
ConfigKey DOCKER_MEMORY = DockerAttributes.DOCKER_MEMORY;
@SetFromFlag("volumeExports")
ConfigKey> DOCKER_CONTAINER_VOLUME_EXPORT = DockerAttributes.DOCKER_CONTAINER_VOLUME_EXPORT;
@SetFromFlag("environment")
ConfigKey