Examples of LoggingFilter


Examples of com.sun.jersey.api.client.filter.LoggingFilter

        if (!hostMap.containsKey(host)) {
            ClientConfig clientConfig = new DefaultClientConfig();
            clientConfig.getClasses().add(MultiPartWriter.class);
            Client client = Client.create(clientConfig);
            if (isDebug) {
                client.addFilter(new LoggingFilter());
            }
            hostMap.put(host, client);
        }
        return hostMap.get(host);
    }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.LoggingFilter

  // to make sure we get back a valid token. Validate token using RM function
  // calls. It should only succeed with the kerberos filter
  @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>";
View Full Code Here

Examples of com.sun.jersey.api.client.filter.LoggingFilter

  // Test to verify renew functionality - create a token and then try to renew
  // it. The renewer should succeed; owner and third user should fail
  @Test
  public void testRenewDelegationToken() throws Exception {
    client().addFilter(new LoggingFilter(System.out));
    rm.start();
    final String renewer = "client2";
    this.client().addFilter(new LoggingFilter(System.out));
    final DelegationToken dummyToken = new DelegationToken();
    dummyToken.setRenewer(renewer);
    String[] mediaTypes =
        { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML };
    for (final String mediaType : mediaTypes) {
View Full Code Here

Examples of com.sun.jersey.api.client.filter.LoggingFilter

  // Test to verify cancel functionality - create a token and then try to cancel
  // it. The owner and renewer should succeed; third user should fail
  @Test
  public void testCancelDelegationToken() throws Exception {
    rm.start();
    this.client().addFilter(new LoggingFilter(System.out));
    if (isKerberosAuth == false) {
      verifySimpleAuthCancel();
      return;
    }
View Full Code Here

Examples of com.sun.jersey.api.client.filter.LoggingFilter

    }
  }
 
  protected void lookup(int duration, String fingerprint) {
    Client client = Client.create();
    client.addFilter(new LoggingFilter(System.out));
    client.addFilter(new GZIPContentEncodingFilter(true));
    WebResource webResource = client.resource(this.ACOUSTID_SERVICE_URL);
   
// DONE: convert this (parameter in url) to form encoded post
//    JSONObject object = webResource.queryParam("client", SERVICE_KEY)
View Full Code Here

Examples of com.sun.jersey.api.client.filter.LoggingFilter

    private void importRelease(Map<String, List<String>> result, Map<String, String> artistCache, Map<String, String> personCache, Map<String, String> labelCache, Map<String, String> genreCache, Map<String, String> styleCache, String discogsReleaseId) throws ParserConfigurationException, IOException, SAXException {
//        String data = Client.create().resource("http://www.discogs.com/release/" + discogsReleaseId + "?f=xml&api_key=" + API_KEY).accept(MediaType.APPLICATION_XML).header("Accept-Encoding", "gzip").header("User-Agent",USER_AGENT).get(String.class);
// Logging version
      Client client = Client.create();
    client.addFilter(new LoggingFilter(System.out));
    WebResource webResource = client.resource("http://www.discogs.com/release/" + discogsReleaseId + "?f=xml&api_key=" + API_KEY);
    String data = webResource.accept(MediaType.APPLICATION_XML).header("Accept-Encoding", "gzip").header("User-Agent",USER_AGENT).get(String.class);
   
        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new ByteArrayInputStream(data.getBytes()));
        NodeList releases = doc.getElementsByTagName("release");
View Full Code Here

Examples of com.sun.jersey.api.client.filter.LoggingFilter

    }
    invoker.setLoggingEnable(enableLogging);
        //initialize the logger if needed
        if(loggingEnabled) {
          if(logger == null) {
            apiClient.addFilter(new LoggingFilter());
          }else{
            apiClient.addFilter(new LoggingFilter(logger));
          }
        }
        apiInvoker = invoker;
        return invoker;
  }
View Full Code Here

Examples of com.sun.jersey.api.container.filter.LoggingFilter

                    RexsterApplication.class, application) {
            });
            rc.getSingletons().add(new InstrumentedResourceMethodDispatchAdapter(application.getMetricRegistry()));

            if (this.debugMode) {
                rc.getContainerRequestFilters().add(new LoggingFilter());
                rc.getContainerResponseFilters().add(new LoggingFilter());
            }

            rc.getContainerResponseFilters().add(new HeaderResponseFilter(defaultCharacterEncoding));

            if (!securityFilterType.equals(Tokens.REXSTER_SECURITY_NONE)) {
View Full Code Here

Examples of org.apache.mina.filter.LoggingFilter

        }
        return res;
    }

    public void addLastLoggingFilter() {
        LoggingFilter f = new LoggingFilter();
        session.getFilterChain().addLast("LoggerLast", f);
    }
View Full Code Here

Examples of org.apache.mina.filter.LoggingFilter

        session.getFilterChain().remove("LoggerLast");
    }

    public void addFirstLoggingFilter() {
        LoggingFilter f = new LoggingFilter();
        session.getFilterChain().addFirst("LoggerFirst", f);
    }
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.