public abstract class YoutubeProvider extends Object implements StreamsProvider
Modifier and Type | Field and Description |
---|---|
protected YoutubeConfiguration |
config |
protected com.google.api.services.youtube.YouTube |
youtube |
Constructor and Description |
---|
YoutubeProvider()
YoutubeProvider constructor.
|
YoutubeProvider(YoutubeConfiguration config)
YoutubeProvider constructor - uses supplied YoutubeConfiguration.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
protected com.google.api.services.youtube.YouTube |
createYouTubeClient() |
YoutubeConfiguration |
getConfig() |
protected abstract Runnable |
getDataCollector(BackOffStrategy strategy,
BlockingQueue<StreamsDatum> queue,
com.google.api.services.youtube.YouTube youtube,
UserInfo userInfo) |
String |
getId() |
boolean |
isRunning() |
void |
prepare(Object configurationObject) |
StreamsResultSet |
readCurrent() |
StreamsResultSet |
readNew(BigInteger sequence) |
StreamsResultSet |
readRange(org.joda.time.DateTime start,
org.joda.time.DateTime end) |
void |
setConfig(YoutubeConfiguration config) |
void |
setDefaultAfterDate(org.joda.time.DateTime defaultAfterDate)
Set and overwrite the default after date that was read from teh configuration file.
|
void |
setDefaultBeforeDate(org.joda.time.DateTime defaultBeforeDate)
Set and overwrite the default before date that was read from the configuration file.
|
void |
setUserInfoWithAfterDate(Map<String,org.joda.time.DateTime> usersAndAfterDates)
Set and overwrite user into from teh configuration file.
|
void |
setUserInfoWithDefaultDates(Set<String> userIds)
Sets and overwrite the user info from the configuaration file.
|
void |
startStream() |
protected com.google.api.services.youtube.YouTube youtube
protected YoutubeConfiguration config
public YoutubeProvider()
public YoutubeProvider(YoutubeConfiguration config)
config
- YoutubeConfigurationpublic String getId()
getId
in interface StreamsOperation
public void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void startStream()
startStream
in interface StreamsProvider
protected abstract Runnable getDataCollector(BackOffStrategy strategy, BlockingQueue<StreamsDatum> queue, com.google.api.services.youtube.YouTube youtube, UserInfo userInfo)
public StreamsResultSet readCurrent()
readCurrent
in interface StreamsProvider
public StreamsResultSet readNew(BigInteger sequence)
readNew
in interface StreamsProvider
public StreamsResultSet readRange(org.joda.time.DateTime start, org.joda.time.DateTime end)
readRange
in interface StreamsProvider
protected com.google.api.services.youtube.YouTube createYouTubeClient() throws IOException, GeneralSecurityException
IOException
GeneralSecurityException
public void cleanUp()
cleanUp
in interface StreamsOperation
public YoutubeConfiguration getConfig()
public void setConfig(YoutubeConfiguration config)
public void setDefaultBeforeDate(org.joda.time.DateTime defaultBeforeDate)
defaultBeforeDate
- defaultBeforeDatepublic void setDefaultAfterDate(org.joda.time.DateTime defaultAfterDate)
defaultAfterDate
- defaultAfterDatepublic void setUserInfoWithDefaultDates(Set<String> userIds)
userIds
- Set of String userIdspublic void setUserInfoWithAfterDate(Map<String,org.joda.time.DateTime> usersAndAfterDates)
usersAndAfterDates
- usersAndAfterDatespublic boolean isRunning()
isRunning
in interface StreamsProvider
Copyright © 2018 The Apache Software Foundation. All rights reserved.