org.gcube.common.clients.builders
Class AddressingUtils

java.lang.Object
  extended by org.gcube.common.clients.builders.AddressingUtils

public class AddressingUtils
extends Object

Factory methods for addresses of service endpoints and service instances.

Author:
Fabio Simeoni

Field Summary
static String keyElement
           
 
Constructor Summary
AddressingUtils()
           
 
Method Summary
static W3CEndpointReference address(String contextPath, String service, String host, int port)
          Return the HTTP address of a service endpoint.
static W3CEndpointReference address(String protocol, String contextPath, String service, String host, int port)
          Return the address of a service endpoint.
static W3CEndpointReference address(String contextPath, String service, String namespace, String key, String host, int port)
          Returns the address of a service instance.
static W3CEndpointReference address(String protocol, String contextPath, String service, String namespace, String key, String host, int port)
          Returns the address of a service instance.
static W3CEndpointReference address(String contextPath, String service, String namespace, String key, URI address)
          Returns the address of a service instance.
static W3CEndpointReference address(String contextPath, String service, String namespace, String key, URL address)
          Returns the address of a service instance.
static W3CEndpointReference address(String protocol, String contextPath, String service, URL address)
          Return the address of a service endpoint.
static W3CEndpointReference address(String contextPath, String service, URI address)
          Return the address of a service endpoint.
static W3CEndpointReference address(String contextPath, String service, URL address)
          Return the address of a service endpoint.
static Element key(String namespace, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyElement

public static final String keyElement
See Also:
Constant Field Values
Constructor Detail

AddressingUtils

public AddressingUtils()
Method Detail

address

public static W3CEndpointReference address(String contextPath,
                                           String service,
                                           String host,
                                           int port)
                                    throws IllegalArgumentException
Return the HTTP address of a service endpoint.

Parameters:
contextPath - the context path of the service
service - the name of the service
host - the host of the endpoint
port - the port of the endpoint
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String protocol,
                                           String contextPath,
                                           String service,
                                           String host,
                                           int port)
                                    throws IllegalArgumentException
Return the address of a service endpoint.

Parameters:
protocol - the protocol required to contact endpoint (e.g. HTTPS)
contextPath - the context path of the service
service - the name of the service
host - the host of the endpoint
port - the port of the endpoint
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String contextPath,
                                           String service,
                                           URL address)
                                    throws IllegalArgumentException
Return the address of a service endpoint.

Parameters:
contextPath - the context path of the service
service - the name of the service
address - the address of the endpoint as a URL
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String protocol,
                                           String contextPath,
                                           String service,
                                           URL address)
                                    throws IllegalArgumentException
Return the address of a service endpoint.

Parameters:
contextPath - the context path of the service
service - the name of the service
address - the address of the endpoint as a URL
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String contextPath,
                                           String service,
                                           URI address)
                                    throws IllegalArgumentException
Return the address of a service endpoint.

Parameters:
contextPath - the context path of the service
service - the name of the service
address - the address of the endpoint as a URI
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String contextPath,
                                           String service,
                                           String namespace,
                                           String key,
                                           String host,
                                           int port)
                                    throws IllegalArgumentException
Returns the address of a service instance.

Parameters:
contextPath - the context path of the service
service - the name of the service
namespace - the namespace of the service
key - the key of the instance
host - the host of the instance
port - the port of the instance
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String protocol,
                                           String contextPath,
                                           String service,
                                           String namespace,
                                           String key,
                                           String host,
                                           int port)
                                    throws IllegalArgumentException
Returns the address of a service instance.

Parameters:
protocol - the protocol required to contact endpoint (e.g. HTTPS)
contextPath - the context path of the service
service - the name of the service
namespace - the namespace of the service
key - the key of the instance
host - the host of the instance
port - the port of the instance
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String contextPath,
                                           String service,
                                           String namespace,
                                           String key,
                                           URL address)
                                    throws IllegalArgumentException
Returns the address of a service instance.

Parameters:
contextPath - the context path of the service
service - the name of the service
namespace - the namespace of the service
key - the key of the instance
address - the address of the endpoint as a URL.
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

address

public static W3CEndpointReference address(String contextPath,
                                           String service,
                                           String namespace,
                                           String key,
                                           URI address)
                                    throws IllegalArgumentException
Returns the address of a service instance.

Parameters:
contextPath - the context path of the service
service - the name of the service
namespace - the namespace of the service
key - the key of the instance
address - the address of the endpoint as a URI.
Returns:
the address
Throws:
IllegalArgumentException - if an address cannot be derived from the inputs

key

public static Element key(String namespace,
                          String value)


Copyright © 2013. All Rights Reserved.