public class TwitterFilterSource extends TwitterSource
TwitterSource
by filter parameters. This extension
enables to filter the twitter stream by user defined parameters.SourceFunction.SourceContext<T>
queue, queueSize
Constructor and Description |
---|
TwitterFilterSource(String authPath) |
Modifier and Type | Method and Description |
---|---|
void |
addPostParameter(String parameter,
String value)
This function sets a post parameter.
|
void |
addPostParameters(Map<String,String> postParameters)
This function sets post parameters.
|
void |
addQueryParameter(String parameter,
String value)
This function sets a query parameter.
|
void |
addQueryParameters(Map<String,String> queryParameters)
This function sets query parameters.
|
void |
filterFollowings(Collection<Long> userIDs)
This function sets which users to follow.
|
void |
filterFollowings(Long userID)
This function sets which user to follow.
|
void |
filterLanguage(String language)
This function sets which language to filter.
|
void |
filterLanguages(Collection<String> languages)
This function sets which languages to filter.
|
void |
filterLocation(com.twitter.hbc.core.endpoint.Location location)
This function sets which location to filter.
|
void |
filterLocations(Collection<com.twitter.hbc.core.endpoint.Location> locations)
This function sets which locations to filter.
|
List<Long> |
getFollowings()
This function tells which users are followed.
|
List<String> |
getLanguages()
This function tells which languages are filtered.
|
List<com.twitter.hbc.core.endpoint.Location> |
getLocations()
This function tells which locations are filtered.
|
Map<String,String> |
getQueryParameters()
This function tells which query parameters are used by the endpoint.
|
List<String> |
getTrackTerms()
This function tells which terms are tracked.
|
protected void |
initializeConnection()
Initialize Hosebird Client to be able to consume Twitter's Streaming API
|
Map<String,String> |
postParameters()
This function tells which post parameters are used by the endpoint.
|
void |
trackTerm(String term)
This function sets which term to track.
|
void |
trackTerms(Collection<String> terms)
This function sets which terms to track.
|
authenticate, cancel, close, getQueueSize, getWaitSec, initializeClient, open, run, setQueueSize, setWaitSec
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
public TwitterFilterSource(String authPath)
protected void initializeConnection()
TwitterSource
initializeConnection
in class TwitterSource
public void trackTerm(String term)
term
- The term to track.public void trackTerms(Collection<String> terms)
terms
- The terms to track.public void filterLanguage(String language)
language
- The language to filter.public void filterLanguages(Collection<String> languages)
languages
- The languages to filter.public void filterFollowings(Long userID)
userID
- The ID of the user to follow.public void filterFollowings(Collection<Long> userIDs)
userIDs
- The IDs of the users to follow.public void filterLocation(com.twitter.hbc.core.endpoint.Location location)
location
- The location to filter.public void filterLocations(Collection<com.twitter.hbc.core.endpoint.Location> locations)
locations
- The locations to filter.public List<com.twitter.hbc.core.endpoint.Location> getLocations()
public void addQueryParameter(String parameter, String value)
parameter
- The name of the query parameter.value
- The value of the query parameter.public void addQueryParameters(Map<String,String> queryParameters)
queryParameters
- The query parameters for the endpoint.public Map<String,String> getQueryParameters()
public void addPostParameter(String parameter, String value)
parameter
- The name of the post parameter.value
- The value of the post parameter.public void addPostParameters(Map<String,String> postParameters)
postParameters
- The post parameters for the endpoint.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.