@Test public void testCreateIseClient() throws Exception { ConnectionConfig connectionConfig = new ConnectionConfigBuilder() .setConnectionTimeout(1) .setReadTimeout(2) .build(); final Client iseClient = RestClientFactory.createIseClient(connectionConfig); final Map<String, Object> properties = iseClient.getProperties(); Assert.assertEquals(3, properties.size()); Assert.assertEquals(1, properties.get("com.sun.jersey.client.property.connectTimeout")); Assert.assertEquals(2, properties.get("com.sun.jersey.client.property.readTimeout")); Assert.assertTrue(properties.get(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES) instanceof HTTPSProperties); final HTTPSProperties httpsProperties = (HTTPSProperties) properties.get(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES); Assert.assertTrue(httpsProperties.getHostnameVerifier().verify("xxx", sslSession)); }
public static Client createIseClient(final ConnectionConfig connectionConfig) throws GeneralSecurityException { final DefaultClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getProperties() .put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, connectionConfig.getConnectionTimeout()); clientConfig.getProperties() .put(ClientConfig.PROPERTY_READ_TIMEOUT, connectionConfig.getReadTimeout()); hackInsecureCertificate(clientConfig); return Client.create(clientConfig); }
RestClientFactory { public static Client createIseClient(final ConnectionConfig connectionConfig) throws GeneralSecurityException { final DefaultClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getProperties() .put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, connectionConfig.getConnectionTimeout()); clientConfig.getProperties() .put(ClientConfig.PROPERTY_READ_TIMEOUT, connectionConfig.getReadTimeout()); hackInsecureCertificate(clientConfig); return Client.create(clientConfig); } }
RestClientFactory { public static Client createIseClient(final ConnectionConfig connectionConfig) throws GeneralSecurityException { final DefaultClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getProperties() .put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, connectionConfig.getConnectionTimeout()); clientConfig.getProperties() .put(ClientConfig.PROPERTY_READ_TIMEOUT, connectionConfig.getReadTimeout()); hackInsecureCertificate(clientConfig); return Client.create(clientConfig); } private  RestClientFactory(); }
RestClientFactory { public static Client createIseClient(final ConnectionConfig connectionConfig) throws GeneralSecurityException { final DefaultClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getProperties() .put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, connectionConfig.getConnectionTimeout()); clientConfig.getProperties() .put(ClientConfig.PROPERTY_READ_TIMEOUT, connectionConfig.getReadTimeout()); hackInsecureCertificate(clientConfig); return Client.create(clientConfig); } private  RestClientFactory(); static Client createIseClient(final ConnectionConfig connectionConfig); static WebResource.Builder createRequestBuilder(final WebResource resource, final List<Header> headers,
                                                           final String path); }
RestClientFactory { public static Client createIseClient(final ConnectionConfig connectionConfig) throws GeneralSecurityException { final DefaultClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getProperties() .put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, connectionConfig.getConnectionTimeout()); clientConfig.getProperties() .put(ClientConfig.PROPERTY_READ_TIMEOUT, connectionConfig.getReadTimeout()); hackInsecureCertificate(clientConfig); return Client.create(clientConfig); } private  RestClientFactory(); static Client createIseClient(final ConnectionConfig connectionConfig); static WebResource.Builder createRequestBuilder(final WebResource resource, final List<Header> headers,
                                                           final String path); static final String PATH_ERS_CONFIG_SGT; }