org.globus.wsrf.client
Class ServiceURL

java.lang.Object
  extended byorg.globus.wsrf.client.ServiceURL

public class ServiceURL
extends java.lang.Object


Field Summary
private  java.lang.String contactString
           
static java.lang.String DEFAULT_SERVICE_CONTEXT
           
private static int HTTP_PORT
           
private static int HTTPS_PORT
           
private static org.globus.util.I18n i18n
           
private static org.apache.commons.logging.Log logger
           
private  java.lang.String serviceName
           
private  java.net.URL url
           
private static java.lang.String URL_SEPARATOR
           
 
Constructor Summary
ServiceURL(java.lang.String contactString)
          Construct a ServiceURL object from the specified contact string.
ServiceURL(java.lang.String contactString, java.lang.String serviceName)
           
 
Method Summary
static java.lang.String getDefaultHost()
           
static int getDefaultPort()
           
static java.lang.String getDefaultProtocol()
           
 java.lang.String getFullServicePath()
           
 java.lang.String getServiceName()
           
 java.net.URL getURL()
           
static java.net.URL getURL(java.lang.String contactString, java.lang.String serviceName)
          Utility method to get the full URL from a simplified contact string.
 void setServiceName(java.lang.String serviceName)
          Specify the base name of the service, without the service context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i18n

private static org.globus.util.I18n i18n

DEFAULT_SERVICE_CONTEXT

public static final java.lang.String DEFAULT_SERVICE_CONTEXT
See Also:
Constant Field Values

contactString

private java.lang.String contactString

serviceName

private java.lang.String serviceName

url

private java.net.URL url

HTTP_PORT

private static final int HTTP_PORT
See Also:
Constant Field Values

HTTPS_PORT

private static final int HTTPS_PORT
See Also:
Constant Field Values

URL_SEPARATOR

private static final java.lang.String URL_SEPARATOR
See Also:
Constant Field Values

logger

private static org.apache.commons.logging.Log logger
Constructor Detail

ServiceURL

public ServiceURL(java.lang.String contactString)
Construct a ServiceURL object from the specified contact string. Grammar for a non-null contact String:

[protocol://]host[:[port]][/service context/service path]

If contactString is null then defaults will be used for protocol, host and port.

Note: if the service path is not specified in the contact string then the service name MUST be specified using the appropriate setter.

Parameters:
contactString - The contact string.

ServiceURL

public ServiceURL(java.lang.String contactString,
                  java.lang.String serviceName)
Method Detail

getURL

public static java.net.URL getURL(java.lang.String contactString,
                                  java.lang.String serviceName)
                           throws java.net.MalformedURLException
Utility method to get the full URL from a simplified contact string.

Parameters:
contactString - the simplified or complete contact string to infer the service URL from. See documentation of the constructor for the syntax of the contact string.
serviceName - the name of the service without the context
Throws:
java.net.MalformedURLException - if contact string is malformed as a URL even after prepending default protocol if missing.

getFullServicePath

public java.lang.String getFullServicePath()

setServiceName

public void setServiceName(java.lang.String serviceName)
Specify the base name of the service, without the service context. The service name is used to build the service path when it is not found in the URL contructed from the contact string.

Parameters:
serviceName - the name of the service (ex: core/admin/ContainerService)

getServiceName

public java.lang.String getServiceName()

getURL

public java.net.URL getURL()
                    throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException - if contact string is malformed as a URL even after prepending default protocol if missing.

getDefaultProtocol

public static java.lang.String getDefaultProtocol()

getDefaultHost

public static java.lang.String getDefaultHost()

getDefaultPort

public static int getDefaultPort()