public class TwitterSource extends Object implements FederatedSource, ConfiguredService
Constructor and Description |
---|
TwitterSource() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
String |
getConfigurationPid()
Returns the PID of the configuration that corresponds to this service
|
String |
getConsumerKey() |
String |
getConsumerSecret() |
Set<ContentType> |
getContentTypes()
Gets the
ContentType s that are currently stored by the Source . |
String |
getDescription()
Returns a description of the describable item.
|
String |
getId()
Returns the name, aka ID, of the describable item.
|
Set<String> |
getOptions(Metacard metacard)
Obtain a set of all options supported by this ResourceReader.
|
String |
getOrganization()
Returns the organization associated with the describable item.
|
Set<String> |
getSupportedSchemes()
|
String |
getTitle()
Returns the title of the describable item.
|
String |
getVersion()
Retrieve the version.
|
void |
init() |
boolean |
isAvailable()
This method states whether this source is available, typically connecting and performing some
sort of simple query or ping to the native catalog.
|
boolean |
isAvailable(SourceMonitor callback)
This method is the same as
Source.isAvailable() but allows a caller to provide a SourceMonitor callback object which is meant to be used as a way for the Source to
dynamically contact the caller with its availability. |
SourceResponse |
query(QueryRequest request) |
ResourceResponse |
retrieveResource(URI uri,
Map<String,Serializable> arguments)
|
void |
setConfigurationPid(String configurationPid)
Sets the PID of this service's corresponding configuration
|
void |
setConsumerKey(String consumerKey) |
void |
setConsumerSecret(String consumerSecret) |
void |
setId(String id) |
void |
setResourceReader(ResourceReader resourceReader) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSecurityAttributes
public void init()
public void destroy()
public ResourceResponse retrieveResource(URI uri, Map<String,Serializable> arguments) throws IOException, ResourceNotFoundException, ResourceNotSupportedException
ResourceReader
retrieveResource
in interface ResourceReader
uri
- A URI
that defines what Resource
to retrieve and how to do it.arguments
- Any additional arguments that should be passed to the ResourceReader.ResourceResponse
containing the retrieved Resource
.IOException
ResourceNotFoundException
ResourceNotSupportedException
public Set<String> getSupportedSchemes()
ResourceReader
URI
schemes that the ResourceReader can accept when doing a Resource
lookup. Custom schemes can be created for a ResourceReader to support.getSupportedSchemes
in interface ResourceReader
Set
of supported schemespublic Set<String> getOptions(Metacard metacard)
ResourceReader
Resource
in a unique way.getOptions
in interface ResourceReader
Set
of all options that this ResourceReader supports. This will be an empty set
if no options are supported.public boolean isAvailable()
Source
This is expected to be an expensive operation, possibly involving network I/O.
Typically only CatalogFramework
implementations will call this and only
periodically.
isAvailable
in interface Source
ddf.catalog.util.SourcePoller
public boolean isAvailable(SourceMonitor callback)
Source
Source.isAvailable()
but allows a caller to provide a SourceMonitor
callback object which is meant to be used as a way for the Source
to
dynamically contact the caller with its availability. The intent is to return a boolean as to
whether the Source
is available at this very moment and also to use the SourceMonitor
object to update the caller of this method if this Source's availability changes
later in the future.isAvailable
in interface Source
callback
- - used to notify the caller of this method when the Source
object wants
to update its availability.public SourceResponse query(QueryRequest request) throws UnsupportedQueryException
query
in interface Source
request
- the query to executeSourceResponse
with query results and query response detailsUnsupportedQueryException
- when the query is not understood, malformed, or not supported
by a Source
public Set<ContentType> getContentTypes()
Source
ContentType
s that are currently stored by the Source
. Notice the
return object is a Set
, meaning it returns all unique content types found in the Source
without duplications.getContentTypes
in interface Source
Set
of ContentType
s currently available from this Source
.public String getVersion()
Describable
getVersion
in interface Describable
public String getId()
Describable
html for a MetacardTransformer
that transforms Metacard
s to HTML
getId
in interface Describable
public void setId(String id)
public String getTitle()
Describable
getTitle
in interface Describable
public String getDescription()
Describable
getDescription
in interface Describable
public String getOrganization()
Describable
getOrganization
in interface Describable
public String getConsumerKey()
public void setConsumerKey(String consumerKey)
public String getConsumerSecret()
public void setConsumerSecret(String consumerSecret)
public void setResourceReader(ResourceReader resourceReader)
public String getConfigurationPid()
ConfiguredService
getConfigurationPid
in interface ConfiguredService
public void setConfigurationPid(String configurationPid)
ConfiguredService
setConfigurationPid
in interface ConfiguredService
configurationPid
- The unique PID of the configuration associated with this serviceThis work is licensed under a Creative Commons Attribution 4.0 International License.