@SupportsBatching @InputRequirement(value=INPUT_FORBIDDEN) @Tags(value={"twitter","tweets","social media","status","json"}) @CapabilityDescription(value="Pulls status changes from Twitter\'s streaming API") @WritesAttribute(attribute="mime.type", description="Sets mime type to application/json") public class GetTwitter extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
ACCESS_TOKEN |
static PropertyDescriptor |
ACCESS_TOKEN_SECRET |
static PropertyDescriptor |
CONSUMER_KEY |
static PropertyDescriptor |
CONSUMER_SECRET |
static PropertyDescriptor |
ENDPOINT |
static PropertyDescriptor |
FOLLOWING |
static PropertyDescriptor |
LANGUAGES |
static PropertyDescriptor |
LOCATIONS |
static Relationship |
REL_SUCCESS |
static PropertyDescriptor |
TERMS |
Constructor and Description |
---|
GetTwitter() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Collection<ValidationResult> |
customValidate(ValidationContext validationContext)
Allows subclasses to perform their own validation on the already set
properties.
|
java.util.Set<Relationship> |
getRelationships() |
protected PropertyDescriptor |
getSupportedDynamicPropertyDescriptor(java.lang.String propertyDescriptorName)
Used to allow subclasses to determine what PropertyDescriptor if any to
use when a property is requested for which a descriptor is not already
registered.
|
java.util.List<PropertyDescriptor> |
getSupportedPropertyDescriptors()
Allows subclasses to register which property descriptor objects are
supported.
|
protected void |
init(ProcessorInitializationContext context)
Provides subclasses the ability to perform initialization logic
|
void |
onPropertyModified(PropertyDescriptor descriptor,
java.lang.String oldValue,
java.lang.String newValue)
Hook method allowing subclasses to eagerly react to a configuration
change for the given property descriptor.
|
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
void |
shutdownClient() |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, hashCode, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, validate
public static final PropertyDescriptor ENDPOINT
public static final PropertyDescriptor CONSUMER_KEY
public static final PropertyDescriptor CONSUMER_SECRET
public static final PropertyDescriptor ACCESS_TOKEN
public static final PropertyDescriptor ACCESS_TOKEN_SECRET
public static final PropertyDescriptor LANGUAGES
public static final PropertyDescriptor FOLLOWING
public static final PropertyDescriptor LOCATIONS
public static final PropertyDescriptor TERMS
public static final Relationship REL_SUCCESS
protected void init(ProcessorInitializationContext context)
AbstractSessionFactoryProcessor
init
in class AbstractSessionFactoryProcessor
context
- in which to perform initializationpublic java.util.Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public final java.util.List<PropertyDescriptor> getSupportedPropertyDescriptors()
AbstractConfigurableComponent
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
protected PropertyDescriptor getSupportedDynamicPropertyDescriptor(java.lang.String propertyDescriptorName)
AbstractConfigurableComponent
Used to allow subclasses to determine what PropertyDescriptor if any to use when a property is requested for which a descriptor is not already registered. By default this method simply returns a null descriptor. By overriding this method processor implementations can support dynamic properties since this allows them to register properties on demand. It is acceptable for a dynamically generated property to indicate it is required so long as it is understood it is only required once set. Dynamic properties by definition cannot be required until used.
This method should be side effect free in the subclasses in terms of how often it is called for a given property name because there is guarantees how often it will be called for a given property name.
Default is null.
getSupportedDynamicPropertyDescriptor
in class AbstractConfigurableComponent
propertyDescriptorName
- used to lookup if any property descriptors exist for that nameprotected java.util.Collection<ValidationResult> customValidate(ValidationContext validationContext)
AbstractConfigurableComponent
customValidate
in class AbstractConfigurableComponent
validationContext
- provides a mechanism for obtaining externally
managed values, such as property values and supplies convenience methods
for operating on those valuespublic void onPropertyModified(PropertyDescriptor descriptor, java.lang.String oldValue, java.lang.String newValue)
AbstractConfigurableComponent
onPropertyModified
in interface ConfigurableComponent
onPropertyModified
in class AbstractConfigurableComponent
descriptor
- of the modified propertyoldValue
- non-null property value (previous)newValue
- the new property value or if null indicates the property
was removed@OnScheduled public void onScheduled(ProcessContext context) throws java.net.MalformedURLException
java.net.MalformedURLException
@OnStopped public void shutdownClient()
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException