Package org.apache.cxf.jaxrs.client

Examples of org.apache.cxf.jaxrs.client.ClientConfiguration


    private WebClient setupWebClient( String jiraUrl )
    {
        WebClient client = WebClient.create( jiraUrl );

        ClientConfiguration clientConfiguration = WebClient.getConfig( client );
        HTTPConduit http = clientConfiguration.getHttpConduit();

        if ( getLog().isDebugEnabled() )
        {
            clientConfiguration.getInInterceptors().add( new LoggingInInterceptor(  ) );
            clientConfiguration.getOutInterceptors().add( new LoggingOutInterceptor(  ) );
        }

        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();

        httpClientPolicy.setConnectionTimeout(36000);
View Full Code Here


    private WebClient setupWebClient( String jiraUrl )
    {
        WebClient client = WebClient.create( jiraUrl );

        ClientConfiguration clientConfiguration = WebClient.getConfig( client );
        HTTPConduit http = clientConfiguration.getHttpConduit();
        // MCHANGES-324 - Maintain the client session
        clientConfiguration.getRequestContext().put( Message.MAINTAIN_SESSION, Boolean.TRUE );

        if ( getLog().isDebugEnabled() )
        {
            clientConfiguration.getInInterceptors().add( new LoggingInInterceptor(  ) );
            clientConfiguration.getOutInterceptors().add( new LoggingOutInterceptor(  ) );
        }

        HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();

        httpClientPolicy.setConnectionTimeout( 36000 );
View Full Code Here

                             null);
       
        // The outgoing new Customer data needs to be transformed for
        // the old service to understand it and the response from the old service
        // needs to be transformed for this new client to understand it.
        ClientConfiguration config = WebClient.getConfig(customerService);
        addTransformInterceptors(config.getInInterceptors(),
                                 config.getOutInterceptors(),
                                 true);
       
       
        System.out.println("Using old RESTful CustomerService with new client");
View Full Code Here

        WebClient client = WebClient.create(address, providers);
       
        // The outgoing new Customer data needs to be transformed for
        // the old service to understand it and the response from the old service
        // needs to be transformed for this new client to understand it.
        ClientConfiguration config = WebClient.getConfig(client);
        addTransformInterceptors(config.getInInterceptors(),
                                 config.getOutInterceptors(),
                                 true);
       
       
        System.out.println("Consuming old RESTful CustomerService with new client and XPath");
View Full Code Here

                             null);
       
        // The outgoing old Customer data needs to be transformed for
        // the new service to understand it and the response from the new service
        // needs to be transformed for this old client to understand it.
        ClientConfiguration config = WebClient.getConfig(customerService);
        addTransformInterceptors(config.getInInterceptors(),
                                 config.getOutInterceptors(),
                                 false);
       
       
        System.out.println("Using new RESTful CustomerService with old Client");
View Full Code Here

    replayAll();

    EndpointInfo ei = new EndpointInfo();
    Service service = new org.apache.cxf.service.ServiceImpl();
    Endpoint endpoint = new EndpointImpl(busMock, service, ei);
    ClientConfiguration client = new ClientConfiguration();

    LocatorTargetSelector selector = new LocatorTargetSelector();
    selector.setEndpoint(endpoint);

    client.setConduitSelector(selector);

    LocatorFeature lf = new LocatorFeature();
    lf.setSelectionStrategy("randomSelectionStrategy");

    lf.initialize((ConduitSelectorHolder) client, busMock);

    Assert.assertTrue(((LocatorTargetSelector) client.getConduitSelector())
        .getStrategy() instanceof RandomSelectionStrategy);

  }
View Full Code Here

    replayAll();

    EndpointInfo ei = new EndpointInfo();
    Service service = new org.apache.cxf.service.ServiceImpl();
    Endpoint endpoint = new EndpointImpl(busMock, service, ei);
    ClientConfiguration client = new ClientConfiguration();

    LocatorTargetSelector selector = new LocatorTargetSelector();
    selector.setEndpoint(endpoint);

    client.setConduitSelector(selector);

    LocatorFeature lf = new LocatorFeature();
    lf.setSelectionStrategy("randomSelectionStrategy");

    lf.initialize((InterceptorProvider) client, busMock);

    Assert.assertTrue(((LocatorTargetSelector) client.getConduitSelector())
        .getStrategy() instanceof RandomSelectionStrategy);
  }
View Full Code Here

    }
    bean.setResourceClass(proxyType);
    bean.setProvider(new JacksonJsonProvider(new ApiObjectMapper()));

    T rootResource = bean.create(proxyType);
    ClientConfiguration config = WebClient.getConfig(rootResource);
    HTTPConduit conduit = (HTTPConduit) config.getConduit();
    if (isTlsEnabled) {
      TLSClientParameters tlsParams = new TLSClientParameters();
      if (!validateCerts) {
        tlsParams.setTrustManagers(new TrustManager[] { new AcceptAllTrustManager() });
      }
View Full Code Here

   *
   * @param root The resource returned by the build() method of this
   *             builder class
   */
  public static void closeClient(ApiRootResource root) {
    ClientConfiguration config = WebClient.getConfig(root);
    HTTPConduit conduit = config.getHttpConduit();
    if (conduit == null) {
      throw new IllegalArgumentException(
          "Client is not using the HTTP transport");
    }
    conduit.close();
View Full Code Here

      }
      bean.setResourceClass(proxyType);
      bean.setProvider(new JacksonJsonProvider(new ApiObjectMapper()));

      T rootResource = bean.create(proxyType);
      ClientConfiguration config = WebClient.getConfig(rootResource);
      HTTPConduit conduit = (HTTPConduit) config.getConduit();
      if (isTlsEnabled) {
         TLSClientParameters tlsParams = new TLSClientParameters();
         if (!validateCerts) {
            tlsParams
                  .setTrustManagers(new TrustManager[] { new AcceptAllTrustManager() });
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxrs.client.ClientConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.