| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.compute.domain.internal.TemplateBuilderImpl
public class TemplateBuilderImpl
| Field Summary | |
|---|---|
protected  boolean | 
biggest
 | 
protected  com.google.common.base.Supplier<Location> | 
defaultLocation
 | 
protected  javax.inject.Provider<TemplateBuilder> | 
defaultTemplateProvider
 | 
protected  boolean | 
fastest
 | 
protected  String | 
hardwareId
 | 
protected  com.google.common.base.Supplier<Set<? extends Hardware>> | 
hardwares
 | 
protected  String | 
imageDescription
 | 
protected  String | 
imageId
 | 
protected  String | 
imageName
 | 
protected  com.google.common.base.Supplier<Set<? extends Image>> | 
images
 | 
protected  String | 
imageVersion
 | 
protected  Location | 
location
 | 
protected  com.google.common.base.Supplier<Set<? extends Location>> | 
locations
 | 
protected  Logger | 
logger
 | 
protected  double | 
minCores
 | 
protected  int | 
minRam
 | 
protected  TemplateOptions | 
options
 | 
protected  javax.inject.Provider<TemplateOptions> | 
optionsProvider
 | 
protected  Boolean | 
os64Bit
 | 
protected  String | 
osArch
 | 
protected  String | 
osDescription
 | 
protected  OsFamily | 
osFamily
 | 
protected  String | 
osName
 | 
protected  String | 
osVersion
 | 
| Constructor Summary | |
|---|---|
protected  | 
TemplateBuilderImpl(com.google.common.base.Supplier<Set<? extends Location>> locations,
                    com.google.common.base.Supplier<Set<? extends Image>> images,
                    com.google.common.base.Supplier<Set<? extends Hardware>> hardwares,
                    com.google.common.base.Supplier<Location> defaultLocation2,
                    javax.inject.Provider<TemplateOptions> optionsProvider,
                    javax.inject.Provider<TemplateBuilder> defaultTemplateProvider)
 | 
| Method Summary | |
|---|---|
 TemplateBuilder | 
any()
prime this builder with parameters known to work on the current compute provider.  | 
 TemplateBuilder | 
biggest()
configure this template to the largest hardware, based on cores, ram, then disk  | 
 Template | 
build()
Generate an immutable template from the current builder.  | 
protected  void | 
copyTemplateOptions(TemplateOptions from,
                    TemplateOptions to)
 | 
 TemplateBuilder | 
fastest()
configure this template to the fastest hardware, based on cpu  | 
 TemplateBuilder | 
fromHardware(Hardware hardware)
Configure this template to require the minimum hardware of the parameter.  | 
 TemplateBuilder | 
fromImage(Image image)
Configure this template to fuzzy-match on the image parameter  | 
 TemplateBuilder | 
fromTemplate(Template template)
Configure this template to match the resources of the template parameter.  | 
protected  Set<? extends Image> | 
getImages()
 | 
 TemplateBuilder | 
hardwareId(String hardwareId)
Configure this template to require a specific hardwareId.  | 
protected  com.google.common.collect.Ordering<Hardware> | 
hardwareSorter()
 | 
 TemplateBuilder | 
imageDescriptionMatches(String descriptionRegex)
Configure this template to have an image description that matches the regular expression  | 
 TemplateBuilder | 
imageId(String imageId)
Configure this template to require a specific imageId.  | 
 TemplateBuilder | 
imageNameMatches(String nameRegex)
Configure this template to have an image name that matches the regular expression  | 
 TemplateBuilder | 
imageVersionMatches(String imageVersionRegex)
Configure this template to have an image version that matches the regular expression  | 
 TemplateBuilder | 
locationId(String locationId)
Configure this template to start in a specific location  | 
 TemplateBuilder | 
minCores(double minCores)
Configure this template to require the minimum cores below  | 
 TemplateBuilder | 
minRam(int megabytes)
Configure this template to require the minimum ram in megabytes below  | 
 TemplateBuilder | 
options(TemplateOptions options)
options such as inbound ports and run scripts.  | 
 TemplateBuilder | 
os64Bit(boolean is64Bit)
Configure this template to require a 64 bit operating system.  | 
 TemplateBuilder | 
osArchMatches(String osArchitectureRegex)
Configure this template to require a specific architecture.  | 
 TemplateBuilder | 
osDescriptionMatches(String osDescriptionRegex)
Configure this template to have an operating system description that matches the regular expression  | 
 TemplateBuilder | 
osFamily(OsFamily os)
Configure this template to use a specific operating system image.  | 
 TemplateBuilder | 
osNameMatches(String osNameRegex)
Configure this template to have an operating system name that matches the regular expression  | 
 TemplateBuilder | 
osVersionMatches(String osVersionRegex)
Configure this template to have an os version that matches the regular expression  | 
protected  Image | 
resolveImage(Hardware hardware,
             Iterable<? extends Image> supportedImages)
 | 
protected  Hardware | 
resolveSize(com.google.common.collect.Ordering<Hardware> hardwareOrdering,
            Iterable<? extends Image> images)
 | 
 TemplateBuilder | 
smallest()
configure this template to the smallest hardware, based on cores, ram, then disk  | 
 String | 
toString()
 | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
@Named(value="jclouds.compute") protected Logger logger
protected final com.google.common.base.Supplier<Set<? extends Image>> images
protected final com.google.common.base.Supplier<Set<? extends Hardware>> hardwares
protected final com.google.common.base.Supplier<Set<? extends Location>> locations
protected final com.google.common.base.Supplier<Location> defaultLocation
protected final javax.inject.Provider<TemplateOptions> optionsProvider
protected final javax.inject.Provider<TemplateBuilder> defaultTemplateProvider
protected Location location
protected String imageId
protected String hardwareId
protected String imageVersion
protected OsFamily osFamily
protected String osVersion
protected Boolean os64Bit
protected String osName
protected String osDescription
protected String osArch
protected String imageName
protected String imageDescription
protected double minCores
protected int minRam
protected boolean biggest
protected boolean fastest
protected TemplateOptions options
| Constructor Detail | 
|---|
@Inject
protected TemplateBuilderImpl(com.google.common.base.Supplier<Set<? extends Location>> locations,
                                     com.google.common.base.Supplier<Set<? extends Image>> images,
                                     com.google.common.base.Supplier<Set<? extends Hardware>> hardwares,
                                     com.google.common.base.Supplier<Location> defaultLocation2,
                                     javax.inject.Provider<TemplateOptions> optionsProvider,
                                     @Named(value="DEFAULT")
                                     javax.inject.Provider<TemplateBuilder> defaultTemplateProvider)
| Method Detail | 
|---|
public TemplateBuilder fromTemplate(Template template)
fromTemplate in interface TemplateBuilderpublic TemplateBuilder fromHardware(Hardware hardware)
fromHardware in interface TemplateBuilderpublic TemplateBuilder fromImage(Image image)
fromImage in interface TemplateBuilderpublic TemplateBuilder smallest()
smallest in interface TemplateBuilderpublic TemplateBuilder biggest()
biggest in interface TemplateBuilderpublic TemplateBuilder fastest()
fastest in interface TemplateBuilderpublic TemplateBuilder locationId(String locationId)
locationId in interface TemplateBuilderpublic TemplateBuilder osFamily(OsFamily os)
osFamily in interface TemplateBuilderpublic Template build()
build in interface TemplateBuilder
protected Hardware resolveSize(com.google.common.collect.Ordering<Hardware> hardwareOrdering,
                               Iterable<? extends Image> images)
protected com.google.common.collect.Ordering<Hardware> hardwareSorter()
protected Image resolveImage(Hardware hardware,
                             Iterable<? extends Image> supportedImages)
hardware - supportedImages - 
NoSuchElementException - if there's no image that matches the predicateprotected Set<? extends Image> getImages()
public TemplateBuilder imageId(String imageId)
location
imageId in interface TemplateBuilderpublic TemplateBuilder imageNameMatches(String nameRegex)
imageNameMatches in interface TemplateBuilderpublic TemplateBuilder imageDescriptionMatches(String descriptionRegex)
imageDescriptionMatches in interface TemplateBuilderpublic TemplateBuilder imageVersionMatches(String imageVersionRegex)
imageVersionMatches in interface TemplateBuilderpublic TemplateBuilder osVersionMatches(String osVersionRegex)
osVersionMatches in interface TemplateBuilderpublic TemplateBuilder osArchMatches(String osArchitectureRegex)
osArchMatches in interface TemplateBuilderpublic TemplateBuilder minCores(double minCores)
minCores in interface TemplateBuilderpublic TemplateBuilder minRam(int megabytes)
minRam in interface TemplateBuilderpublic TemplateBuilder osNameMatches(String osNameRegex)
osNameMatches in interface TemplateBuilderpublic TemplateBuilder osDescriptionMatches(String osDescriptionRegex)
osDescriptionMatches in interface TemplateBuilderpublic TemplateBuilder hardwareId(String hardwareId)
hardwareId in interface TemplateBuilderpublic TemplateBuilder options(TemplateOptions options)
options in interface TemplateBuilder
protected void copyTemplateOptions(TemplateOptions from,
                                   TemplateOptions to)
public TemplateBuilder any()
any in interface TemplateBuilderpublic String toString()
toString in class Objectpublic TemplateBuilder os64Bit(boolean is64Bit)
TemplateBuilder
os64Bit in interface TemplateBuilder
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||