Package com.twitter.hbc.core.endpoint

Examples of com.twitter.hbc.core.endpoint.StatusesSampleEndpoint


    // Create an appropriately sized blocking queue
    BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);

    // Define our endpoint: By default, delimited=length is set (we need this for our processor)
    // and stall warnings are on.
    StatusesSampleEndpoint endpoint = new StatusesSampleEndpoint();
    endpoint.stallWarnings(false);

    Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret);
    //Authentication auth = new com.twitter.hbc.httpclient.auth.BasicAuth(username, password);

    // Create a new BasicClient. By default gzip is enabled.
View Full Code Here


    // Create an appropriately sized blocking queue
    BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);

    // Define our endpoint: By default, delimited=length is set (we need this for our processor)
    // and stall warnings are on.
    StatusesSampleEndpoint endpoint = new StatusesSampleEndpoint();

    Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret);
    // Authentication auth = new BasicAuth(username, password);

    // Create a new BasicClient. By default gzip is enabled.
View Full Code Here

     * Client builder fails to build with no auth specified
     */
    try {
      new ClientBuilder()
              .hosts(new HttpHosts(Constants.STREAM_HOST))
              .endpoint(new StatusesSampleEndpoint())
              .processor(new NullProcessor())
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }

    /**
     * Client builder fails to build with no host specified
     */
    try {
      new ClientBuilder()
              .endpoint(new StatusesSampleEndpoint())
              .processor(new NullProcessor())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }


    /**
     * Client builder fails to build with no endpoint specified
     */
    try {
      new ClientBuilder()
              .hosts(new HttpHosts(Constants.STREAM_HOST))
              .processor(new NullProcessor())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
    }

    /**
     * Client builder fails to build with no processor specified
     */
    try {
      new ClientBuilder()
              .hosts(new HttpHosts(Constants.STREAM_HOST))
              .endpoint(new StatusesSampleEndpoint())
              .authentication(new BasicAuth("username", "password"))
              .build();
      fail();
    } catch (Exception e) {
      // expected
View Full Code Here

  @Test
  public void testBuilderSuccess() {
    new ClientBuilder()
            .hosts(new HttpHosts(Constants.STREAM_HOST))
            .endpoint(new StatusesSampleEndpoint())
            .processor(new NullProcessor())
            .authentication(new BasicAuth("username", "password"))
            .build();

  }
View Full Code Here

      LOG.info("Initializing Twitter Streaming API connection");
    }

    queue = new LinkedBlockingQueue<String>(queueSize);

    StatusesSampleEndpoint endpoint = new StatusesSampleEndpoint();
    endpoint.stallWarnings(false);

    Authentication auth = authenticate();

    initializeClient(endpoint, auth);
View Full Code Here

TOP

Related Classes of com.twitter.hbc.core.endpoint.StatusesSampleEndpoint

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.