org.jclouds.compute.util
Class ComputeServiceUtils

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

public class ComputeServiceUtils
extends Object

Author:
Adrian Cole

Field Summary
static Pattern DELIMETED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
           
 
Constructor Summary
ComputeServiceUtils()
           
 
Method Summary
static void checkNodeHasIps(NodeMetadata node)
           
static String createExecutionErrorMessage(Map<?,Exception> executionExceptions)
           
static String createNodeErrorMessage(Map<? extends NodeMetadata,? extends Throwable> failedNodes)
           
static Statement execHttpResponse(HttpRequest request)
          build a shell script that invokes the contents of the http request in bash.
static Statement execHttpResponse(URI location)
           
static Statement extractTargzIntoDirectory(HttpRequest targz, String directory)
          build a shell script that invokes the contents of the http request in bash.
static Statement extractTargzIntoDirectory(URI targz, String directory)
           
static Statement extractZipIntoDirectory(HttpRequest zip, String directory)
          build a shell script that invokes the contents of the http request in bash.
static Statement extractZipIntoDirectory(URI zip, String directory)
           
static Iterable<? extends ComputeMetadata> filterByName(Iterable<? extends ComputeMetadata> nodes, String name)
           
static IPSocket findReachableSocketOnNode(RetryIfSocketNotYetOpen socketTester, NodeMetadata node, int port)
           
static double getCores(Hardware input)
           
static double getCoresAndSpeed(Hardware input)
           
static double getSpace(Hardware input)
           
static Iterable<String> getSupportedProviders()
           
static String parseGroupFromName(String from)
           
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

DELIMETED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX

public static final Pattern DELIMETED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
Constructor Detail

ComputeServiceUtils

public ComputeServiceUtils()
Method Detail

execHttpResponse

public static Statement execHttpResponse(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 Statement execHttpResponse(URI location)

extractTargzIntoDirectory

public static Statement extractTargzIntoDirectory(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 Statement extractTargzIntoDirectory(URI targz,
                                                  String directory)

extractZipIntoDirectory

public static Statement extractZipIntoDirectory(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 Statement extractZipIntoDirectory(URI zip,
                                                String directory)

parseGroupFromName

public static String parseGroupFromName(String from)
Returns:
null if group cannot be parsed

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)

getSupportedProviders

public static Iterable<String> getSupportedProviders()

findReachableSocketOnNode

public static IPSocket findReachableSocketOnNode(RetryIfSocketNotYetOpen socketTester,
                                                 NodeMetadata node,
                                                 int port)

checkNodeHasIps

public static void checkNodeHasIps(NodeMetadata node)

parseVersionOrReturnEmptyString

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


Copyright © 2009-2011 jclouds. All Rights Reserved.