Java 类com.sun.jersey.api.client.filter.LoggingFilter 实例源码

项目:twitter-java-ads-sdk    文件:ClientServiceImpl.java   
@Override
public WebResource getResource() {
    WebResource webResource = null;
    ClientConfig config = new DefaultClientConfig();
    config.getClasses().add(GsonJerseyProvider.class);
    Client client = Client.create(config);
    OAuthParameters oaParams = new OAuthParameters().signatureMethod("HMAC-SHA1").consumerKey(consumerKey)
            .token(accessToken).version("1.0");
    OAuthSecrets oaSecrets = new OAuthSecrets().consumerSecret(consumerSecret).tokenSecret(accessTokenSecret);

    OAuthClientFilter oAuthFilter = new OAuthClientFilter(client.getProviders(), oaParams, oaSecrets);
    client.addFilter(oAuthFilter);

    if (this.sandbox) {
        webResource = client.resource(Constants.SANDBOX_BASE_API_URL);
    } else if (null!= this.domain){
        webResource = client.resource(this.domain);
    }
    else{
        webResource = client.resource(Constants.BASE_API_URL);
    }


    if (this.trace) {
        webResource.addFilter(new LoggingFilter());
    }
    return webResource;
}
项目:forge-api-java-client    文件:ApiClient.java   
/**
 * Build the Client used to make HTTP requests with the latest settings,
 * i.e. objectMapper and debugging.
 * TODO: better to use the Builder Pattern?
 */
public ApiClient rebuildHttpClient() {
  // Add the JSON serialization support to Jersey
  JacksonJsonProvider jsonProvider = new JacksonJsonProvider(objectMapper);
  DefaultClientConfig conf = new DefaultClientConfig();
  conf.getSingletons().add(jsonProvider);
  Client client = Client.create(conf);
  if (debugging) {
    client.addFilter(new LoggingFilter());
  }

  //to solve the issue of GET:metadata/:guid with accepted encodeing is 'gzip' 
  //in the past, when clients use gzip header, actually it doesn't trigger a gzip encoding... So everything is fine 
  //After the release, the content is return in gzip, while the sdk doesn't handle it correctly
  client.addFilter(new GZIPContentEncodingFilter(false));

  this.httpClient = client;
  return this;
}
项目:eway-rapid-java    文件:RapidClientImpl.java   
/**
 * Fetches and configures a Web Resource to connect to eWAY
 *
 * @return A WebResource
 */
private WebResource getEwayWebResource() {
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    Client client = Client.create(clientConfig);
    client.addFilter(new HTTPBasicAuthFilter(APIKey, password));

    if (this.debug) {
        client.addFilter(new LoggingFilter(System.out));
    }

    // Set additional headers
    RapidClientFilter rapidFilter = new RapidClientFilter();
    rapidFilter.setVersion(apiVersion);
    client.addFilter(rapidFilter);

    WebResource resource = client.resource(webUrl);
    return resource;
}
项目:awaazde-api-client-sdk    文件:XACTRequester.java   
/**
 * Returns jersey client to make any call to webservice 
 * @return
 */
private Client getClient(boolean is_multipart) {
    if(m_client == null) {
        if(is_multipart) {
            ClientConfig config = new DefaultClientConfig();
            config.getClasses().add(MultiPartWriter.class);
            m_client = Client.create(config);
        } else {
            m_client = new Client();
        }

        if(!isTokenbasedAuth) {
            final HTTPBasicAuthFilter authFilter = new HTTPBasicAuthFilter(x_username, x_password);
            m_client.addFilter(authFilter);
            m_client.addFilter(new LoggingFilter());
        } else {
            //TODO for token based authentication
        }
    }

    return m_client;
}
项目:nest-connector    文件:NestConnector.java   
/**
 * Logs in into the NEst service and captures session information
 *
 * @throws ConnectionException if the credentials are incorrect
 * @throws IOException if the response date cannot be parsed
 */
@Start
public void login() throws ConnectionException, IOException
{
    httpClient.addFilter(new LoggingFilter());
    MultivaluedMap<String, String> map = new MultivaluedMapImpl();
    map.putSingle("username", getUsername());
    map.putSingle("password", getPassword());


    WebResource webResource = httpClient.resource("https://home.nest.com/user/login");

    ClientResponse response = webResource.type("application/x-www-form-urlencoded")
            .post(ClientResponse.class, map);

    if (response.getStatus()> 399)
    {
        throw new ConnectionException(ConnectionExceptionCode.INCORRECT_CREDENTIALS, "unauthorized user", response.toString());
    }
    String res = response.getEntity(String.class);
    System.out.println("Login: " + res);
    login = mapper.readValue(res, Login.class);
    baseUri = login.getUrls().getTransportUrl();

    getMetaData();
}
项目:btc1k    文件:RestClient.java   
public RestClient (URI baseURI)
{
    ObjectMapper mapper = Jackson.newObjectMapper ()
                                 .registerModule (new SupernodeModule ());

    Validator validator = Validation.buildDefaultValidatorFactory ().getValidator ();

    ClientConfig cc = new DefaultClientConfig (JsonProcessingExceptionMapper.class);
    cc.getProperties ().put (ClientConfig.PROPERTY_CONNECT_TIMEOUT, 5000);
    cc.getProperties ().put (ClientConfig.PROPERTY_READ_TIMEOUT, 5000);
    cc.getSingletons ().add (new JacksonMessageBodyProvider (mapper, validator));

    Client client = Client.create (cc);
    client.addFilter (new LoggingFilter ());

    this.client = client;
    this.baseURI = baseURI;
}
项目:hadoop    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetNewApplication() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  rm.start();
  String mediaTypes[] =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String acceptMedia : mediaTypes) {
    testGetNewApplication(acceptMedia);
  }
  rm.stop();
}
项目:hadoop    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetAppQueue() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  boolean isCapacityScheduler =
      rm.getResourceScheduler() instanceof CapacityScheduler;
  rm.start();
  MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
  String[] contentTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String contentType : contentTypes) {
    RMApp app = rm.submitApp(CONTAINER_MB, "", webserviceUserName);
    amNodeManager.nodeHeartbeat(true);
    ClientResponse response =
        this
          .constructWebResource("apps", app.getApplicationId().toString(),
            "queue").accept(contentType).get(ClientResponse.class);
    assertEquals(Status.OK, response.getClientResponseStatus());
    String expectedQueue = "default";
    if(!isCapacityScheduler) {
      expectedQueue = "root." + webserviceUserName;
    }
    if (contentType.equals(MediaType.APPLICATION_JSON)) {
      verifyAppQueueJson(response, expectedQueue);
    } else {
      verifyAppQueueXML(response, expectedQueue);
    }
  }
  rm.stop();
}
项目:hadoop    文件:TestRMWebServicesDelegationTokens.java   
@Test
public void testCreateDelegationToken() throws Exception {
  rm.start();
  this.client().addFilter(new LoggingFilter(System.out));
  final String renewer = "test-renewer";
  String jsonBody = "{ \"renewer\" : \"" + renewer + "\" }";
  String xmlBody =
      "<delegation-token><renewer>" + renewer
          + "</renewer></delegation-token>";
  String[] mediaTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  Map<String, String> bodyMap = new HashMap<String, String>();
  bodyMap.put(MediaType.APPLICATION_JSON, jsonBody);
  bodyMap.put(MediaType.APPLICATION_XML, xmlBody);
  for (final String mediaType : mediaTypes) {
    final String body = bodyMap.get(mediaType);
    for (final String contentType : mediaTypes) {
      if (isKerberosAuth == true) {
        verifyKerberosAuthCreate(mediaType, contentType, body, renewer);
      } else {
        verifySimpleAuthCreate(mediaType, contentType, body);
      }
    }
  }

  rm.stop();
  return;
}
项目:aliyun-oss-hadoop-fs    文件:TestNMWebServicesContainers.java   
public void testNodeHelper(String path, String media) throws JSONException,
    Exception {
  WebResource r = resource();
  Application app = new MockApp(1);
  nmContext.getApplications().put(app.getAppId(), app);
  addAppContainers(app);
  Application app2 = new MockApp(2);
  nmContext.getApplications().put(app2.getAppId(), app2);
  addAppContainers(app2);
  client().addFilter(new LoggingFilter());

  ClientResponse response = r.path("ws").path("v1").path("node").path(path)
      .accept(media).get(ClientResponse.class);
  assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
  JSONObject json = response.getEntity(JSONObject.class);
  JSONObject info = json.getJSONObject("containers");
  assertEquals("incorrect number of elements", 1, info.length());
  JSONArray conInfo = info.getJSONArray("container");
  assertEquals("incorrect number of elements", 4, conInfo.length());

  for (int i = 0; i < conInfo.length(); i++) {
    verifyNodeContainerInfo(
        conInfo.getJSONObject(i),
        nmContext.getContainers().get(
            ConverterUtils.toContainerId(conInfo.getJSONObject(i).getString(
                "id"))));
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestNMWebServicesContainers.java   
@Test
public void testNodeSingleContainerXML() throws JSONException, Exception {
  WebResource r = resource();
  Application app = new MockApp(1);
  nmContext.getApplications().put(app.getAppId(), app);
  HashMap<String, String> hash = addAppContainers(app);
  Application app2 = new MockApp(2);
  nmContext.getApplications().put(app2.getAppId(), app2);
  addAppContainers(app2);
  client().addFilter(new LoggingFilter(System.out));

  for (String id : hash.keySet()) {
    ClientResponse response = r.path("ws").path("v1").path("node")
        .path("containers").path(id).accept(MediaType.APPLICATION_XML)
        .get(ClientResponse.class);
    assertEquals(MediaType.APPLICATION_XML_TYPE, response.getType());
    String xml = response.getEntity(String.class);
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    InputSource is = new InputSource();
    is.setCharacterStream(new StringReader(xml));
    Document dom = db.parse(is);
    NodeList nodes = dom.getElementsByTagName("container");
    assertEquals("incorrect number of elements", 1, nodes.getLength());
    verifyContainersInfoXML(nodes,
        nmContext.getContainers().get(ConverterUtils.toContainerId(id)));

  }
}
项目:aliyun-oss-hadoop-fs    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetNewApplication() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  rm.start();
  String mediaTypes[] =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String acceptMedia : mediaTypes) {
    testGetNewApplication(acceptMedia);
  }
  rm.stop();
}
项目:aliyun-oss-hadoop-fs    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetAppQueue() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  boolean isCapacityScheduler =
      rm.getResourceScheduler() instanceof CapacityScheduler;
  rm.start();
  MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
  String[] contentTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String contentType : contentTypes) {
    RMApp app = rm.submitApp(CONTAINER_MB, "", webserviceUserName);
    amNodeManager.nodeHeartbeat(true);
    ClientResponse response =
        this
          .constructWebResource("apps", app.getApplicationId().toString(),
            "queue").accept(contentType).get(ClientResponse.class);
    assertEquals(Status.OK, response.getClientResponseStatus());
    String expectedQueue = "default";
    if(!isCapacityScheduler) {
      expectedQueue = "root." + webserviceUserName;
    }
    if (contentType.equals(MediaType.APPLICATION_JSON)) {
      verifyAppQueueJson(response, expectedQueue);
    } else {
      verifyAppQueueXML(response, expectedQueue);
    }
  }
  rm.stop();
}
项目:aliyun-oss-hadoop-fs    文件:TestRMWebServicesDelegationTokens.java   
@Test
public void testCreateDelegationToken() throws Exception {
  rm.start();
  this.client().addFilter(new LoggingFilter(System.out));
  final String renewer = "test-renewer";
  String jsonBody = "{ \"renewer\" : \"" + renewer + "\" }";
  String xmlBody =
      "<delegation-token><renewer>" + renewer
          + "</renewer></delegation-token>";
  String[] mediaTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  Map<String, String> bodyMap = new HashMap<String, String>();
  bodyMap.put(MediaType.APPLICATION_JSON, jsonBody);
  bodyMap.put(MediaType.APPLICATION_XML, xmlBody);
  for (final String mediaType : mediaTypes) {
    final String body = bodyMap.get(mediaType);
    for (final String contentType : mediaTypes) {
      if (isKerberosAuth == true) {
        verifyKerberosAuthCreate(mediaType, contentType, body, renewer);
      } else {
        verifySimpleAuthCreate(mediaType, contentType, body);
      }
    }
  }

  rm.stop();
  return;
}
项目:carbon-identity-framework    文件:ApiClient.java   
/**
 * Build the Client used to make HTTP requests with the latest settings,
 * i.e. objectMapper and debugging.
 */
public ApiClient rebuildHttpClient() {
    // Add the JSON serialization support to Jersey
    JacksonJsonProvider jsonProvider = new JacksonJsonProvider(objectMapper);
    DefaultClientConfig conf = new DefaultClientConfig();
    conf.getSingletons().add(jsonProvider);
    Client client = Client.create(conf);
    if (debugging) {
        client.addFilter(new LoggingFilter());
    }
    this.httpClient = client;
    return this;
}
项目:BotDirectlineApp-Java    文件:ApiClient.java   
/**
 * Get an existing client or create a new client to handle HTTP request.
 */
private Client getClient() {
  if(!hostMap.containsKey(basePath)) {
    Client client = Client.create();
    if (debugging)
      client.addFilter(new LoggingFilter());
    hostMap.put(basePath, client);
  }
  return hostMap.get(basePath);
}
项目:big-c    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetNewApplication() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  rm.start();
  String mediaTypes[] =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String acceptMedia : mediaTypes) {
    testGetNewApplication(acceptMedia);
  }
  rm.stop();
}
项目:big-c    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetAppQueue() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  boolean isCapacityScheduler =
      rm.getResourceScheduler() instanceof CapacityScheduler;
  rm.start();
  MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048);
  String[] contentTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String contentType : contentTypes) {
    RMApp app = rm.submitApp(CONTAINER_MB, "", webserviceUserName);
    amNodeManager.nodeHeartbeat(true);
    ClientResponse response =
        this
          .constructWebResource("apps", app.getApplicationId().toString(),
            "queue").accept(contentType).get(ClientResponse.class);
    assertEquals(Status.OK, response.getClientResponseStatus());
    String expectedQueue = "default";
    if(!isCapacityScheduler) {
      expectedQueue = "root." + webserviceUserName;
    }
    if (contentType.equals(MediaType.APPLICATION_JSON)) {
      verifyAppQueueJson(response, expectedQueue);
    } else {
      verifyAppQueueXML(response, expectedQueue);
    }
  }
  rm.stop();
}
项目:big-c    文件:TestRMWebServicesDelegationTokens.java   
@Test
public void testCreateDelegationToken() throws Exception {
  rm.start();
  this.client().addFilter(new LoggingFilter(System.out));
  final String renewer = "test-renewer";
  String jsonBody = "{ \"renewer\" : \"" + renewer + "\" }";
  String xmlBody =
      "<delegation-token><renewer>" + renewer
          + "</renewer></delegation-token>";
  String[] mediaTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  Map<String, String> bodyMap = new HashMap<String, String>();
  bodyMap.put(MediaType.APPLICATION_JSON, jsonBody);
  bodyMap.put(MediaType.APPLICATION_XML, xmlBody);
  for (final String mediaType : mediaTypes) {
    final String body = bodyMap.get(mediaType);
    for (final String contentType : mediaTypes) {
      if (isKerberosAuth == true) {
        verifyKerberosAuthCreate(mediaType, contentType, body, renewer);
      } else {
        verifySimpleAuthCreate(mediaType, contentType, body);
      }
    }
  }

  rm.stop();
  return;
}
项目:twitter-java-ads-sdk    文件:StatusUtils.java   
public static void main(String[] args) throws Exception {

        TwitterAdsClient.setTrace(true);
        TwitterAdsClient.setSandbox(false);
        String domain = "https://ads-api.twitter.com";

        TwitterAdsClient.setDomain(domain);

        WebResource webResource = Resource.getResource();
        webResource.addFilter(new LoggingFilter());

        String resourcePath = "/0/accounts/" + ACCOUNT_ID + "/promoted_tweets";

        MultivaluedMap<String, String> params = new MultivaluedMapImpl();
        params.add("with_deleted", "true");

        List<PromotedTweet> promotedTweets = webResource
                .queryParams(params)
                .path(resourcePath)
                .accept(MediaType.APPLICATION_JSON_TYPE)
                .get(new GenericType<List<PromotedTweet>>() {});


        for (PromotedTweet promotedTweet : promotedTweets) {
            //System.out.println(promotedTweet.toString());
            Long tweetIdL =  Long.parseLong(promotedTweet.getTweet_id());
            System.out.println(tweetIdL);
            Tweet.destroy(tweetIdL);
        }

    }
项目:AdobeSignJavaSdk    文件:ApiClient.java   
/**
 * Get an existing client or create a new client to handle HTTP request.
 */
private Client getClient(String baseUrl) {
  if (!hostMap.containsKey(baseUrl)) {
    Client client = Client.create();
    if (debugging)
      client.addFilter(new LoggingFilter());
    hostMap.put(baseUrl,
        client);
  }
  return hostMap.get(baseUrl);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestRMWebServicesAppsModification.java   
@Test
public void testGetNewApplication() throws Exception {
  client().addFilter(new LoggingFilter(System.out));
  rm.start();
  String mediaTypes[] =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  for (String acceptMedia : mediaTypes) {
    testGetNewApplication(acceptMedia);
  }
  rm.stop();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestRMWebServicesDelegationTokens.java   
@Test
public void testCreateDelegationToken() throws Exception {
  rm.start();
  this.client().addFilter(new LoggingFilter(System.out));
  final String renewer = "test-renewer";
  String jsonBody = "{ \"renewer\" : \"" + renewer + "\" }";
  String xmlBody =
      "<delegation-token><renewer>" + renewer
          + "</renewer></delegation-token>";
  String[] mediaTypes =
      { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
  Map<String, String> bodyMap = new HashMap<String, String>();
  bodyMap.put(MediaType.APPLICATION_JSON, jsonBody);
  bodyMap.put(MediaType.APPLICATION_XML, xmlBody);
  for (final String mediaType : mediaTypes) {
    final String body = bodyMap.get(mediaType);
    for (final String contentType : mediaTypes) {
      if (isKerberosAuth == true) {
        verifyKerberosAuthCreate(mediaType, contentType, body, renewer);
      } else {
        verifySimpleAuthCreate(mediaType, contentType, body);
      }
    }
  }

  rm.stop();
  return;
}
项目:clearbit-java    文件:ApiClient.java   
/**
 * Get an existing client or create a new client to handle HTTP request.
 */
public Client getClient() {
  if(!hostMap.containsKey(basePath)) {
    Client client = Client.create();
    client.setConnectTimeout(10000);
    client.setReadTimeout(20000);
    if (debugging)
      client.addFilter(new LoggingFilter());
    hostMap.put(basePath, client);
  }
  return hostMap.get(basePath);
}
项目:director-sdk    文件:ApiClient.java   
private Client getClient(String host, boolean tlsEnabled, boolean hostnameVerificationEnabled)
  throws NoSuchAlgorithmException {
  if (!hostMap.containsKey(host)) {
    ClientConfig clientConfig = getClientConfig(tlsEnabled, hostnameVerificationEnabled);
    Client client = Client.create(clientConfig);
    if (isDebug) {
      client.addFilter(new LoggingFilter());
    }

    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:director-sdk    文件:ApiClient.java   
private Client getClient(String host, String username, String password, boolean tlsEnabled,
  boolean hostnameVerificationEnabled) throws NoSuchAlgorithmException {
  if (!hostMap.containsKey(host)) {
    ClientConfig clientConfig = getClientConfig(tlsEnabled, hostnameVerificationEnabled);
    Client client = Client.create(clientConfig);
    client.addFilter(new HTTPBasicAuthFilter(username, password));

    if (isDebug) {
      client.addFilter(new LoggingFilter());
    }

    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.Cells-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.Cells-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.Cells-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.Cells-for-Cloud    文件:ApiClient.java   
/**
 * Get an existing client or create a new client to handle HTTP request.
 */
private Client getClient() {
  if(!hostMap.containsKey(basePath)) {
    Client client = Client.create();
    if (debugging)
      client.addFilter(new LoggingFilter());
    hostMap.put(basePath, client);
  }
  return hostMap.get(basePath);
}
项目:Aspose.Tasks-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.Tasks-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.Tasks-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:nlp-api-java-client    文件:ApiClient.java   
/**
 * Get an existing client or create a new client to handle HTTP request.
 */
private Client getClient() {
  if(!hostMap.containsKey(basePath)) {
    Client client = Client.create();
    if (debugging)
      client.addFilter(new LoggingFilter());
    hostMap.put(basePath, client);
  }
  return hostMap.get(basePath);
}
项目:onlineconvert-api-sdk-java    文件:ApiClient.java   
/**
 * Get an existing client or create a new client to handle HTTP request.
 */
private Client getClient() {
  if(!hostMap.containsKey(basePath)) {
    Client client = Client.create();
    if (debugging)
      client.addFilter(new LoggingFilter());
    hostMap.put(basePath, client);
  }
  return hostMap.get(basePath);
}
项目:Aspose.BarCode-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.BarCode-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:Aspose.BarCode-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}
项目:java-client-sdk    文件:ApiInvoker.java   
private Client getClient(String host) {
    if(!hostMap.containsKey(host)) {
        Client client = Client.create();
        client.addFilter(new LoggingFilter());
        hostMap.put(host, client);
    }
    return hostMap.get(host);
}
项目:Aspose.Words-for-Cloud    文件:ApiInvoker.java   
private Client getClient(String host) {
if (!hostMap.containsKey(host)) {
    Client client = Client.create();
    if (isDebug){ 
      client.addFilter(new LoggingFilter());
    }
    hostMap.put(host, client);
  }
  return hostMap.get(host);
}