Class DockerDefaultBaseImages
- java.lang.Object
-
- com.oracle.bedrock.runtime.docker.options.DockerDefaultBaseImages
-
- All Implemented Interfaces:
com.oracle.bedrock.Option
public class DockerDefaultBaseImages extends Object implements com.oracle.bedrock.Option
A representation of a class hierarchy that mapsApplicationClasses to Docker base images.Note: instances of DockerDefaultBaseImages are immutable so calls to the with(Class, String) method return a new instance of
DockerDefaultBaseImagesthat is a copy of the original instance with the addition applied.Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.- Author:
- Jonathan Knight
-
-
Constructor Summary
Constructors Constructor Description DockerDefaultBaseImages(Class<? extends com.oracle.bedrock.runtime.Application> applicationClass, String baseImageName)Create aDockerDefaultBaseImageswith the specified root application class and base image name to be used for that class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DockerDefaultBaseImagesdefaultImages()Obtain the defaultDockerDefaultBaseImagesthat is used to determine the base images for application classes if no specific overrides have been specified.Class<? extends com.oracle.bedrock.runtime.Application>getApplicationClass()Obtain the root applicationClassfor thisDockerDefaultBaseImages.StringgetBaseImage(Class<? extends com.oracle.bedrock.runtime.Application> applicationClass)Obtain the base image to use for the givenClass.DockerDefaultBaseImageswith(Class<? extends com.oracle.bedrock.runtime.Application> applicationClass, String baseImageName)Add aDockerDefaultBaseImagesto this tree.
-
-
-
Constructor Detail
-
DockerDefaultBaseImages
public DockerDefaultBaseImages(Class<? extends com.oracle.bedrock.runtime.Application> applicationClass, String baseImageName)
Create aDockerDefaultBaseImageswith the specified root application class and base image name to be used for that class.- Parameters:
applicationClass- the application classbaseImageName- the base image to use for classes
-
-
Method Detail
-
getApplicationClass
public Class<? extends com.oracle.bedrock.runtime.Application> getApplicationClass()
Obtain the root applicationClassfor thisDockerDefaultBaseImages.- Returns:
- the root application
Classfor thisDockerDefaultBaseImages
-
with
public DockerDefaultBaseImages with(Class<? extends com.oracle.bedrock.runtime.Application> applicationClass, String baseImageName)
Add aDockerDefaultBaseImagesto this tree.The base image being added should have a root class that is a sub-class of this
DockerDefaultBaseImages's root class.- Parameters:
applicationClass- the application classbaseImageName- the base image to use for classes- Returns:
- a
DockerDefaultBaseImages
-
getBaseImage
public String getBaseImage(Class<? extends com.oracle.bedrock.runtime.Application> applicationClass)
Obtain the base image to use for the givenClass.- Parameters:
applicationClass- theClassto find the base image for- Returns:
- the base image to use for the specified class or null if the specified class is not the same as or a sub class of the root class of this tree
-
defaultImages
public static DockerDefaultBaseImages defaultImages()
Obtain the defaultDockerDefaultBaseImagesthat is used to determine the base images for application classes if no specific overrides have been specified.- Returns:
- the default
DockerDefaultBaseImages
-
-