org.restlet.ext.sdc
Class SdcClientHelper

java.lang.Object
  extended by org.restlet.engine.Helper
      extended by org.restlet.engine.RestletHelper<T>
          extended by org.restlet.engine.ConnectorHelper<Client>
              extended by org.restlet.engine.ClientHelper
                  extended by org.restlet.engine.adapter.HttpClientHelper
                      extended by org.restlet.ext.sdc.SdcClientHelper

public class SdcClientHelper
extends HttpClientHelper

SDC tunnel connector. This is a client connector from the Restlet application developer point of view, but internally it launches an SDC tunnel server to allow SDC agents located inside intranet to establish SDC tunnels.

Note that currently all SDC tunnel connections are accepted and are matched with SDC client requests based on the SDC user name, domain and password. Here is a usage example:

 Request request = new Request(Method.GET, "http://www.restlet.org");
 request.setProtocol(Protocol.valueOf("SDC"));
 request.setProxyChallengeResponse(new ChallengeResponse(ChallengeScheme
         .valueOf("SDC"), "myUser@example.com", "myPassword"));
 Response response = sdcClient.handle(request);
 response.getEntity().write(System.out);
 
Here is the list of additional parameters that are supported. They should be set in the Server's context before it is started:
Parameter name Value type Default value Description
serverPort int 4433 The port number of the SDC tunnels server.
enabledCipherSuites String TLS_RSA_WITH_AES_128_CBC_SHA Whitespace-separated list of enabled cipher suites and/or can be specified multiple times.
sslContextFactory String org.restlet.ext.ssl.DefaultSslContextFactory Let you specify a SslContextFactory qualified class name as a parameter, or an instance as an attribute for a more complete and flexible SSL context setting.
For the default SSL parameters see the Javadocs of the DefaultSslContextFactory class.

Author:
Jerome Louvel

Constructor Summary
SdcClientHelper(Client client)
          Constructor.
 
Method Summary
 ClientCall create(Request request)
           
 Map<String,org.restlet.ext.sdc.internal.SdcServerConnection> getConnections()
          Returns the map of SDC tunnel connections.
 String[] getEnabledCipherSuites()
          Returns the list of enabled cipher suites.
 CountDownLatch getLatch()
          Returns the latch that can be used to block until the connector is ready to process requests.
 int getServerPort()
          Returns the port number of the SDC tunnels server.
 ExecutorService getWorkerService()
          Returns the connection worker service.
 void start()
           
 void stop()
           
 
Methods inherited from class org.restlet.engine.adapter.HttpClientHelper
getAdapter, handle, setAdapter
 
Methods inherited from class org.restlet.engine.ClientHelper
getSocketConnectTimeoutMs
 
Methods inherited from class org.restlet.engine.ConnectorHelper
getConnectorService, getContext, getProtocols, update
 
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SdcClientHelper

public SdcClientHelper(Client client)
Constructor.

Parameters:
client - The parent client.
Method Detail

create

public ClientCall create(Request request)
Specified by:
create in class HttpClientHelper

getConnections

public Map<String,org.restlet.ext.sdc.internal.SdcServerConnection> getConnections()
Returns the map of SDC tunnel connections.

Returns:
The map of SDC tunnel connections.

getEnabledCipherSuites

public String[] getEnabledCipherSuites()
Returns the list of enabled cipher suites. By default, this suite is returned: "TLS_RSA_WITH_AES_128_CBC_SHA".

Returns:
The list of enabled cipher suites.

getLatch

public CountDownLatch getLatch()
Returns the latch that can be used to block until the connector is ready to process requests.

Returns:
The latch that can be used to block until the connector is ready to process requests.

getServerPort

public int getServerPort()
Returns the port number of the SDC tunnels server.

Returns:
The port number of the SDC tunnels server.

getWorkerService

public ExecutorService getWorkerService()
Returns the connection worker service.

Returns:
The connection worker service.

start

public void start()
           throws Exception
Overrides:
start in class ConnectorHelper<Client>
Throws:
Exception

stop

public void stop()
          throws Exception
Overrides:
stop in class ConnectorHelper<Client>
Throws:
Exception


Copyright © 2005-2013 Restlet.