Examples of resource()


Examples of com.sun.jersey.api.client.Client.resource()

            baseUrl += "/";
        }
        Client client = Client.create(new DefaultClientConfig());
        setFalconTimeOut(client);
        service = client.resource(UriBuilder.fromUri(baseUrl).build());
        client.resource(UriBuilder.fromUri(baseUrl).build());

        // addHeaders();
    }

    private void setFalconTimeOut(Client client) throws IOException {
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

                        .replace("org.apache.falcon.service.ProcessSubscriberService", ""));
        String store = StartupProperties.get().getProperty("config.store.uri");
        StartupProperties.get().setProperty("config.store.uri", store + System.currentTimeMillis());
        ClientConfig config = new DefaultClientConfig();
        Client client = Client.create(config);
        this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
    }

    public void setCluster(String file) throws Exception {
        cluster = StandAloneCluster.newCluster(file);
        clusterName = cluster.getCluster().getName();
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

    final ClientConfig config = new DefaultClientConfig();
    config.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, true);
    Client client = Client.create(config);
    client.addFilter(new HTTPBasicAuthFilter("joe", "password"));

    final WebResource resource = client.resource(url + "/api/repo/files/children?depth=-1&filter=*");
    final RepositoryFileTreeDto tree = resource.path("").accept(MediaType.APPLICATION_XML_TYPE).get(RepositoryFileTreeDto.class);

    printDebugInfo(tree);

    final List<RepositoryFileTreeDto> children = tree.getChildren();
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

    private WebResource getProvenanceRegistryBaseResource() {
        ClientConfig config = new DefaultClientConfig();
        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
                Boolean.TRUE);
        Client client = Client.create(config);
        WebResource baseWebResource = client.resource(getBaseURI());
        webResource = baseWebResource.path(
                ResourcePathConstants.ProvenanceResourcePathConstants.REGISTRY_API_PROVENANCEREGISTRY);
        return webResource;
    }
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

     * @param additionalResourceUrl url portion past the base to use
     * @return the resource builder to execute
     */
    private WebResource.Builder prepareClient(String additionalResourceUrl) {
        final Client client = Client.create();
        return client.resource(this.adminBaseUrl + additionalResourceUrl).accept(MediaType.APPLICATION_XML_TYPE);
    }

    /**
     * Looks for a successful exit code given the response of the call
     *
 
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

            );
            Client client = Client.create(config);
            client.setConnectTimeout(Integer.parseInt(clientProperties.getProperty("falcon.connect.timeout",
                    "180000")));
            client.setReadTimeout(Integer.parseInt(clientProperties.getProperty("falcon.read.timeout", "180000")));
            service = client.resource(UriBuilder.fromUri(baseUrl).build());
            client.resource(UriBuilder.fromUri(baseUrl).build());
            authenticationToken = getToken(baseUrl);
        } catch (Exception e) {
            throw new FalconCLIException("Unable to initialize Falcon Client object", e);
        }
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

            Client client = Client.create(config);
            client.setConnectTimeout(Integer.parseInt(clientProperties.getProperty("falcon.connect.timeout",
                    "180000")));
            client.setReadTimeout(Integer.parseInt(clientProperties.getProperty("falcon.read.timeout", "180000")));
            service = client.resource(UriBuilder.fromUri(baseUrl).build());
            client.resource(UriBuilder.fromUri(baseUrl).build());
            authenticationToken = getToken(baseUrl);
        } catch (Exception e) {
            throw new FalconCLIException("Unable to initialize Falcon Client object", e);
        }
    }
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

                        public boolean verify(String hostname, SSLSession sslSession) {
                            return true;
                        }
                    }, sslContext));
            Client client = Client.create(config);
            this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
        } catch (Exception e) {
            throw new FalconRuntimException(e);
        }

        try {
View Full Code Here

Examples of com.sun.jersey.api.client.Client.resource()

        ClientConfig config = new DefaultClientConfig();
        Client client = Client.create(config);
        client.setReadTimeout(500000);
        client.setConnectTimeout(500000);
        this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
    }

    public void setCluster(String cName) throws Exception {
        cluster = EmbeddedCluster.newCluster(cName, true);
        this.clusterName = cluster.getCluster().getName();
View Full Code Here

Examples of com.sun.jersey.client.apache.ApacheHttpClient.resource()

        config.getState().setCredentials(null, null, -1, httpBasicAuthUsername, httpBasicAuthPassword);
        config.getProperties().put(ApacheHttpClientConfig.PROPERTY_PREEMPTIVE_AUTHENTICATION, true);
        ApacheHttpClientHandler ahcHandler = new ApacheHttpClientHandler(new HttpClient(new MultiThreadedHttpConnectionManager()), config);
        ApacheHttpClient ahc = new ApacheHttpClient(ahcHandler);
        setClient(ahc);
        wr = ahc.resource(uri);
      }
      else {
        wr = this.client.resource(uri);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.