org.jclouds.compute.util
Class ComputeServiceUtils

java.lang.Object
  extended by org.jclouds.compute.util.ComputeServiceUtils

public class ComputeServiceUtils
extends Object


Field Summary
static Pattern DELIMITED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
           
 
Constructor Summary
ComputeServiceUtils()
           
 
Method Summary
static NodeMetadataBuilder addMetadataAndParseTagsFromCommaDelimitedValue(NodeMetadataBuilder builder, Map<String,String> map)
           
static NodeMetadataBuilder addMetadataAndParseTagsFromValuesOfEmptyString(NodeMetadataBuilder builder, Map<String,String> map)
           
static String createExecutionErrorMessage(Map<?,Exception> executionExceptions)
           
static String createNodeErrorMessage(Map<? extends NodeMetadata,? extends Throwable> failedNodes)
           
static org.jclouds.scriptbuilder.domain.Statement execHttpResponse(org.jclouds.http.HttpRequest request)
          build a shell script that invokes the contents of the http request in bash.
static org.jclouds.scriptbuilder.domain.Statement execHttpResponse(URI location)
           
static org.jclouds.scriptbuilder.domain.Statement extractTargzIntoDirectory(org.jclouds.http.HttpRequest targz, String directory)
          build a shell script that invokes the contents of the http request in bash.
static org.jclouds.scriptbuilder.domain.Statement extractTargzIntoDirectory(URI targz, String directory)
           
static org.jclouds.scriptbuilder.domain.Statement extractZipIntoDirectory(org.jclouds.http.HttpRequest zip, String directory)
          build a shell script that invokes the contents of the http request in bash.
static org.jclouds.scriptbuilder.domain.Statement extractZipIntoDirectory(URI zip, String directory)
           
static Iterable<? extends ComputeMetadata> filterByName(Iterable<? extends ComputeMetadata> nodes, String name)
           
static String formatStatus(ComputeMetadataIncludingStatus<?> resource)
          status as a string which optionally includes the backend status
static double getCores(Hardware input)
           
static double getCoresAndSpeed(Hardware input)
           
static Map<Integer,Integer> getPortRangesFromList(int... ports)
           
static double getSpace(Hardware input)
           
static String groupFromMapOrName(Map<String,String> metadataMap, String nodeName, GroupNamingConvention namingConvention)
           
static Map<String,String> metadataAndTagsAsCommaDelimitedValue(TemplateOptions options)
          For cloud apis that need to namespace tags as the value of the key jclouds.tags
static Map<String,String> metadataAndTagsAsValuesOfEmptyString(TemplateOptions options)
          For cloud apis that have a pattern of using empty strings as tags, return a map that contains that.
static OsFamily parseOsFamilyOrUnrecognized(String in)
           
static String parseVersionOrReturnEmptyString(OsFamily family, String in, Map<OsFamily,Map<String,String>> osVersionMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMITED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX

public static final Pattern DELIMITED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
Constructor Detail

ComputeServiceUtils

public ComputeServiceUtils()
Method Detail

formatStatus

public static String formatStatus(ComputeMetadataIncludingStatus<?> resource)
status as a string which optionally includes the backend status


execHttpResponse

public static org.jclouds.scriptbuilder.domain.Statement execHttpResponse(org.jclouds.http.HttpRequest request)
build a shell script that invokes the contents of the http request in bash.

Returns:
a shell script that will invoke the http request

execHttpResponse

public static org.jclouds.scriptbuilder.domain.Statement execHttpResponse(URI location)

extractTargzIntoDirectory

public static org.jclouds.scriptbuilder.domain.Statement extractTargzIntoDirectory(org.jclouds.http.HttpRequest targz,
                                                                                   String directory)
build a shell script that invokes the contents of the http request in bash.

Returns:
a shell script that will invoke the http request

extractTargzIntoDirectory

public static org.jclouds.scriptbuilder.domain.Statement extractTargzIntoDirectory(URI targz,
                                                                                   String directory)

extractZipIntoDirectory

public static org.jclouds.scriptbuilder.domain.Statement extractZipIntoDirectory(org.jclouds.http.HttpRequest zip,
                                                                                 String directory)
build a shell script that invokes the contents of the http request in bash.

Returns:
a shell script that will invoke the http request

extractZipIntoDirectory

public static org.jclouds.scriptbuilder.domain.Statement extractZipIntoDirectory(URI zip,
                                                                                 String directory)

getCores

public static double getCores(Hardware input)

getCoresAndSpeed

public static double getCoresAndSpeed(Hardware input)

getSpace

public static double getSpace(Hardware input)

parseOsFamilyOrUnrecognized

public static OsFamily parseOsFamilyOrUnrecognized(String in)

createExecutionErrorMessage

public static String createExecutionErrorMessage(Map<?,Exception> executionExceptions)

createNodeErrorMessage

public static String createNodeErrorMessage(Map<? extends NodeMetadata,? extends Throwable> failedNodes)

filterByName

public static Iterable<? extends ComputeMetadata> filterByName(Iterable<? extends ComputeMetadata> nodes,
                                                               String name)

metadataAndTagsAsValuesOfEmptyString

public static Map<String,String> metadataAndTagsAsValuesOfEmptyString(TemplateOptions options)
For cloud apis that have a pattern of using empty strings as tags, return a map that contains that.


addMetadataAndParseTagsFromValuesOfEmptyString

public static NodeMetadataBuilder addMetadataAndParseTagsFromValuesOfEmptyString(NodeMetadataBuilder builder,
                                                                                 Map<String,String> map)
See Also:
metadataAndTagsAsValuesOfEmptyString(org.jclouds.compute.options.TemplateOptions)

metadataAndTagsAsCommaDelimitedValue

public static Map<String,String> metadataAndTagsAsCommaDelimitedValue(TemplateOptions options)
For cloud apis that need to namespace tags as the value of the key jclouds.tags


addMetadataAndParseTagsFromCommaDelimitedValue

public static NodeMetadataBuilder addMetadataAndParseTagsFromCommaDelimitedValue(NodeMetadataBuilder builder,
                                                                                 Map<String,String> map)
See Also:
metadataAndTagsAsCommaDelimitedValue(org.jclouds.compute.options.TemplateOptions)

parseVersionOrReturnEmptyString

public static String parseVersionOrReturnEmptyString(OsFamily family,
                                                     String in,
                                                     Map<OsFamily,Map<String,String>> osVersionMap)

getPortRangesFromList

public static Map<Integer,Integer> getPortRangesFromList(int... ports)

groupFromMapOrName

public static String groupFromMapOrName(Map<String,String> metadataMap,
                                        String nodeName,
                                        GroupNamingConvention namingConvention)


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.