@InputRequirement(value=INPUT_FORBIDDEN) @Tags(value={"ingest","event","windows"}) @TriggerSerially @CapabilityDescription(value="Registers a Windows Event Log Subscribe Callback to receive FlowFiles from Events on Windows. These can be filtered via channel and XPath.") @WritesAttributes(value=@WritesAttribute(attribute="mime.type",description="Will set a MIME type value of application/xml.")) public class ConsumeWindowsEventLog extends AbstractSessionFactoryProcessor
| Constructor and Description |
|---|
ConsumeWindowsEventLog()
Framework constructor
|
ConsumeWindowsEventLog(WEvtApi wEvtApi,
com.sun.jna.platform.win32.Kernel32 kernel32)
Constructor that allows injection of JNA interfaces
|
| Modifier and Type | Method and Description |
|---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext validationContext) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
private boolean |
isSubscribed() |
private boolean |
isSubscriptionHandleOpen() |
private com.sun.jna.platform.win32.Kernel32 |
loadKernel32() |
private WEvtApi |
loadWEvtApi() |
void |
onScheduled(ProcessContext context) |
void |
onTrigger(ProcessContext context,
ProcessSessionFactory sessionFactory) |
private int |
processQueue(ProcessSession session)
Create FlowFiles from received logs.
|
void |
stop()
Cleanup
|
private String |
subscribe(ProcessContext context)
Register subscriber via native call
|
private void |
unsubscribe() |
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final String DEFAULT_CHANNEL
public static final String DEFAULT_XPATH
public static final int DEFAULT_MAX_BUFFER
public static final int DEFAULT_MAX_QUEUE_SIZE
public static final PropertyDescriptor CHANNEL
public static final PropertyDescriptor QUERY
public static final PropertyDescriptor MAX_BUFFER_SIZE
public static final PropertyDescriptor MAX_EVENT_QUEUE_SIZE
public static final PropertyDescriptor INACTIVE_DURATION_TO_RECONNECT
public static final List<PropertyDescriptor> PROPERTY_DESCRIPTORS
public static final Relationship REL_SUCCESS
public static final Set<Relationship> RELATIONSHIPS
public static final String APPLICATION_XML
public static final String UNABLE_TO_SUBSCRIBE
public static final String PROCESSOR_ALREADY_SUBSCRIBED
private final WEvtApi wEvtApi
private final com.sun.jna.platform.win32.Kernel32 kernel32
private final ErrorLookup errorLookup
private final String name
private Throwable wEvtApiError
private Throwable kernel32Error
private BlockingQueue<String> renderedXMLs
private WEvtApi.EVT_SUBSCRIBE_CALLBACK evtSubscribeCallback
private com.sun.jna.platform.win32.WinNT.HANDLE subscriptionHandle
private ProcessSessionFactory sessionFactory
private String provenanceUri
private long inactiveDurationToReconnect
private long lastActivityTimestamp
public ConsumeWindowsEventLog()
public ConsumeWindowsEventLog(WEvtApi wEvtApi, com.sun.jna.platform.win32.Kernel32 kernel32)
wEvtApi - event api interfacekernel32 - kernel interfaceprivate WEvtApi loadWEvtApi()
private com.sun.jna.platform.win32.Kernel32 loadKernel32()
private String subscribe(ProcessContext context)
context - the process contextprivate boolean isSubscriptionHandleOpen()
private boolean isSubscribed()
@OnScheduled public void onScheduled(ProcessContext context) throws AlreadySubscribedException
AlreadySubscribedException@OnStopped public void stop()
private void unsubscribe()
public void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
ProcessExceptionprivate int processQueue(ProcessSession session)
protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
customValidate in class AbstractConfigurableComponentprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorCopyright © 2020 Apache NiFi Project. All rights reserved.