org.gridbus.broker.util
Class BrokerUtil

java.lang.Object
  extended by org.gridbus.broker.util.BrokerUtil

public class BrokerUtil
extends java.lang.Object

Author:
krishna

Constructor Summary
BrokerUtil()
           
 
Method Summary
static java.lang.String combinePath(java.lang.String[] paths)
          combine list of paths
static java.lang.String combinePath(java.lang.String path1, java.lang.String path2)
          Combines the two input strings to produce a valid path.
static java.lang.String combinePath(java.lang.String path1, java.lang.String path2, java.lang.String pathSeperator)
           
static java.lang.String findClassName(java.lang.String fullName)
          Gets the class name from a fully qualified package.class name.
static java.lang.String getFileName(java.lang.String path)
          Get the last file name of a path
static java.lang.String getFilePath(java.lang.String pathAndFilename)
          Get the last directory name of a path, without the file name
static java.lang.String getHHMMSS(long elapsedTimeMillis)
          Converts a long value (elapsed time) to the format hh:mm:ss.SSS
static java.lang.String getResultFromInputStream(java.io.InputStream in, long timeout)
          Reads the given inputstream till the end and returns the result.
static java.lang.String getSummaryStatistics(java.lang.String applicationId, BrokerBase store)
           
static java.lang.String join(java.lang.String[] array, java.lang.String delim)
           
static java.lang.StringBuffer join(java.lang.String[] array, java.lang.String delim, java.lang.StringBuffer sb)
           
static java.lang.String makeKey(java.lang.String objectName, java.lang.String applicationID)
          Creates unique keys for each objectName in an application
static java.lang.String pad(java.lang.String s, int n)
          Pads a string s, with n spaces
static java.lang.String padAll(java.lang.String[] s, int n)
          Pads all the strings in the string array s with n spaces each.
static java.lang.String parseHostname(java.lang.String serviceURL)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerUtil

public BrokerUtil()
Method Detail

getHHMMSS

public static java.lang.String getHHMMSS(long elapsedTimeMillis)
Converts a long value (elapsed time) to the format hh:mm:ss.SSS

Parameters:
elapsedTimeMillis - (in milliseconds)
Returns:
time formatted as hh:mm:ss.SSS

findClassName

public static java.lang.String findClassName(java.lang.String fullName)
Gets the class name from a fully qualified package.class name. For example, an input: org.gridbus.broker.MyClass will give output: MyClass

Parameters:
fullName -
Returns:
className

getFileName

public static java.lang.String getFileName(java.lang.String path)
Get the last file name of a path

Parameters:
path -
Returns:

getFilePath

public static java.lang.String getFilePath(java.lang.String pathAndFilename)
Get the last directory name of a path, without the file name

Parameters:
path -
Returns:

join

public static java.lang.String join(java.lang.String[] array,
                                    java.lang.String delim)
Parameters:
array -
delim -
Returns:

join

public static java.lang.StringBuffer join(java.lang.String[] array,
                                          java.lang.String delim,
                                          java.lang.StringBuffer sb)
Parameters:
array -
delim -
sb -
Returns:

combinePath

public static java.lang.String combinePath(java.lang.String[] paths)
combine list of paths

Parameters:
paths -
Returns:

combinePath

public static java.lang.String combinePath(java.lang.String path1,
                                           java.lang.String path2)
Combines the two input strings to produce a valid path.

Parameters:
path1 -
path2 -
Returns:

combinePath

public static java.lang.String combinePath(java.lang.String path1,
                                           java.lang.String path2,
                                           java.lang.String pathSeperator)
Parameters:
path1 -
path2 -
pathSeperator -
Returns:

pad

public static java.lang.String pad(java.lang.String s,
                                   int n)
Pads a string s, with n spaces

Parameters:
s -
n -
Returns:
padded string

padAll

public static java.lang.String padAll(java.lang.String[] s,
                                      int n)
Pads all the strings in the string array s with n spaces each.

Parameters:
s -
n -
Returns:

getResultFromInputStream

public static java.lang.String getResultFromInputStream(java.io.InputStream in,
                                                        long timeout)
                                                 throws java.io.IOException
Reads the given inputstream till the end and returns the result.

Parameters:
timeout -
output -
in -
Throws:
java.io.IOException

makeKey

public static java.lang.String makeKey(java.lang.String objectName,
                                       java.lang.String applicationID)
Creates unique keys for each objectName in an application

Parameters:
objectName -
applicationID -
Returns:
key

getSummaryStatistics

public static final java.lang.String getSummaryStatistics(java.lang.String applicationId,
                                                          BrokerBase store)
                                                   throws GridBrokerException
Throws:
GridBrokerException

parseHostname

public static java.lang.String parseHostname(java.lang.String serviceURL)

Copyright © The University of Melbourne. 2006