ClientBuilder.hosts
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.twitter.hbc.ClientBuilder.hosts(Showing top 8 results out of 315)

origin: apache/flink

.hosts(properties.getProperty(CLIENT_HOSTS, Constants.STREAM_HOST))
.endpoint(endpoint)
.authentication(auth)
origin: apache/ignite

/**
 * @param tweetQueue tweet Queue.
 * @param hosts Hostes.
 * @param endpoint Endpoint.
 * @return Client.
 */
protected Client buildClient(BlockingQueue<String> tweetQueue, HttpHosts hosts, StreamingEndpoint endpoint) {
  Authentication authentication = new OAuth1(oAuthSettings.getConsumerKey(), oAuthSettings.getConsumerSecret(),
    oAuthSettings.getAccessToken(), oAuthSettings.getAccessTokenSecret());
  ClientBuilder builder = new ClientBuilder()
    .name("Ignite-Twitter-Client")
    .hosts(hosts)
    .authentication(authentication)
    .endpoint(endpoint)
    .processor(new StringDelimitedProcessor(tweetQueue));
  return builder.build();
}
origin: twitter/hbc

public static void run(String username,
            String password,
            String account,
            String label,
            String product) throws InterruptedException {
 BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);
 BasicAuth auth = new BasicAuth(username, password);
 RealTimeEnterpriseStreamingEndpoint endpoint = new RealTimeEnterpriseStreamingEndpoint(account, product, label);
 // Create a new BasicClient. By default gzip is enabled.
 Client client = new ClientBuilder()
     .name("PowerTrackClient-01")
     .hosts(Constants.ENTERPRISE_STREAM_HOST)
     .endpoint(endpoint)
     .authentication(auth)
     .processor(new LineStringProcessor(queue))
     .build();
 // Establish a connection
 client.connect();
 // Do whatever needs to be done with messages
 for (int msgRead = 0; msgRead < 1000; msgRead++) {
  String msg = queue.take();
  System.out.println(msg);
 }
 client.stop();
}
origin: twitter/hbc

.hosts(Constants.SITESTREAM_HOST)
.endpoint(endpoint)
.authentication(auth)
origin: twitter/hbc

.hosts(Constants.STREAM_HOST)
.endpoint(endpoint)
.authentication(auth)
origin: twitter/hbc

.hosts(Constants.STREAM_HOST)
.endpoint(endpoint)
.authentication(auth)
origin: apache/nifi

clientBuilder.hosts(host).endpoint(streamingEndpoint);
client = clientBuilder.build();
client.connect();
origin: twitter/hbc

public static void run(String consumerKey, String consumerSecret, String token, String secret) throws InterruptedException {
 BlockingQueue<String> queue = new LinkedBlockingQueue<String>(10000);
 StatusesFilterEndpoint endpoint = new StatusesFilterEndpoint();
 // add some track terms
 endpoint.trackTerms(Lists.newArrayList("twitterapi", "#yolo"));
 Authentication auth = new OAuth1(consumerKey, consumerSecret, token, secret);
 // Authentication auth = new BasicAuth(username, password);
 // Create a new BasicClient. By default gzip is enabled.
 Client client = new ClientBuilder()
     .hosts(Constants.STREAM_HOST)
     .endpoint(endpoint)
     .authentication(auth)
     .processor(new StringDelimitedProcessor(queue))
     .build();
 // Establish a connection
 client.connect();
 // Do whatever needs to be done with messages
 for (int msgRead = 0; msgRead < 1000; msgRead++) {
  String msg = queue.take();
  System.out.println(msg);
 }
 client.stop();
}
com.twitter.hbcClientBuilderhosts

Popular methods of ClientBuilder

  • <init>
  • authentication
  • build
  • endpoint
  • name
  • processor
  • eventMessageQueue

Popular classes and methods

  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Graphics2D (java.awt)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)