eu.emi.dsr.util
Class Utilities

java.lang.Object
  extended by eu.emi.dsr.util.Utilities

public class Utilities
extends Object

tools and utilities

Author:
schuller, demuth

Constructor Summary
protected Utilities()
           
 
Method Summary
static String extractElementTextAsString(org.apache.xmlbeans.XmlObject source)
          extract the text content of an XML element
static String extractServiceName(String url)
           
static String getPhysicalServerAddress()
          return the physical server address
static String newUniqueID()
          returns a new globally unique identifier
static boolean validateIntegerRange(String value, int minValue, int maxValue)
          validate that the given String value (interpreted as an Integer) is in the supplied range
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

protected Utilities()
Method Detail

newUniqueID

public static String newUniqueID()
returns a new globally unique identifier

Returns:

extractServiceName

public static String extractServiceName(String url)

validateIntegerRange

public static boolean validateIntegerRange(String value,
                                           int minValue,
                                           int maxValue)
validate that the given String value (interpreted as an Integer) is in the supplied range

Parameters:
value - - String to be verified
minValue - - minimum
maxValue - - maximum
Returns:
true if the value is within the range, false otherwise

getPhysicalServerAddress

public static String getPhysicalServerAddress()
return the physical server address

Returns:
a URL of the form scheme://host:port where 'scheme' is http or https

extractElementTextAsString

public static String extractElementTextAsString(org.apache.xmlbeans.XmlObject source)
extract the text content of an XML element

Parameters:
source - the xml element
Returns:
the text content, or "" if element has no content


Copyright © 2012. All Rights Reserved.