org.idoox.transport
Interface TransportRepository


public interface TransportRepository

This interface provides access to transport layers. When it's initialized it registers itself to the references context.

Component:
Core

Method Summary
 Transport addServer(Configurable config, boolean startPreloaded)
          Adds new server transport to the repository.
 Transport addTransport(Configurable config, boolean startPreloaded)
          Adds new transport to the repository.
 void addTransport(java.lang.String name, java.lang.String scheme, Transport transport)
          Adds new transport to the repository.
 Endpoint[] getAbsolutePath(java.lang.String path)
          Returns all possible started endpoints for local path.
 java.lang.String getLocalPath(URI endpoint)
          Returns null if the endpoint does not point to any local server accepting incoming messages.
 Transport getTransport(java.lang.String scheme)
          Deprecated. Use getTransportForScheme(java.lang.String) instead.
 Transport getTransportForName(java.lang.String name)
          Gets transport layer from the repository.
 Transport[] getTransportForScheme(java.lang.String scheme)
          Gets transports layer from the repository.
 java.util.Set getTransportNames()
          Gets set of transport names.
 java.lang.String getTransportSchemeForName(java.lang.String name)
          Gets transport scheme for given transport name.
 Transport removeTransport(java.lang.String name)
          Removes transport from the repository.
 ConnectionHandler setHandler(ConnectionHandler handler)
          Sets handler for new incoming connections for all transports.
 

Method Detail

getTransportNames

public java.util.Set getTransportNames()
Gets set of transport names. For client transports these are schemes.

Returns:
set of transport names

getTransportForName

public Transport getTransportForName(java.lang.String name)
Gets transport layer from the repository.

Parameters:
name - the name like jetty
Returns:
the transport layer or null

getTransportSchemeForName

public java.lang.String getTransportSchemeForName(java.lang.String name)
Gets transport scheme for given transport name.

Parameters:
name - the name like jetty
Returns:
the transport scheme or null

getTransport

public Transport getTransport(java.lang.String scheme)
Deprecated. Use getTransportForScheme(java.lang.String) instead.

Gets transports layer from the repository.

Parameters:
scheme - the scheme like http
Returns:
the transport layer or null

getTransportForScheme

public Transport[] getTransportForScheme(java.lang.String scheme)
Gets transports layer from the repository.

Parameters:
scheme - the scheme like http
Returns:
the transport layer or null

addTransport

public void addTransport(java.lang.String name,
                         java.lang.String scheme,
                         Transport transport)
Adds new transport to the repository.

Parameters:
name - the name like jetty
scheme - the scheme like http
transport - added transport

addTransport

public Transport addTransport(Configurable config,
                              boolean startPreloaded)
                       throws TransportStartException
Adds new transport to the repository. This one is created from the configuration.

Parameters:
config - configurable object with transport configuration
startPreloaded - start if it's preloaded transport
Returns:
created transport
Throws:
TransportStartException - if the transport couldn't be started

addServer

public Transport addServer(Configurable config,
                           boolean startPreloaded)
                    throws TransportStartException
Adds new server transport to the repository. This one is created from the configuration with default values from default server configuration.

Parameters:
config - configurable object with transport configuration
startPreloaded - start if it's preloaded transport
Returns:
created transport
Throws:
TransportStartException - if the transport couldn't be started

removeTransport

public Transport removeTransport(java.lang.String name)
Removes transport from the repository.

Parameters:
name - the transport name like jetty
Returns:
removed transport

setHandler

public ConnectionHandler setHandler(ConnectionHandler handler)
Sets handler for new incoming connections for all transports.

Parameters:
handler - the handler
Returns:
previous handler or null

getLocalPath

public java.lang.String getLocalPath(URI endpoint)
Returns null if the endpoint does not point to any local server accepting incoming messages. Returns the local path (i.e. without the WSO2 SOA Enablement Server context) of the endpoint. For example, if WSO2 SOA Enablement Server is deployed to http://localhost:8080/wasp, then call with the endpoint http://localhost:8080/wasp/a returns /a, while http://localhost:8080/wasp1/a or http://localhost/wasp/a (default port for HTTP is 80) returns null.

Parameters:
endpoint - the endpoint being tested
Returns:
the local path of the endpoint

getAbsolutePath

public Endpoint[] getAbsolutePath(java.lang.String path)
                           throws java.net.MalformedURLException
Returns all possible started endpoints for local path.

Parameters:
path - the local path of the endpoint
Returns:
array of endpoints
Throws:
java.net.MalformedURLException