[
https://issues.apache.org/jira/browse/NIFI-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15334929#comment-15334929
]
ASF GitHub Bot commented on NIFI-1976:
--------------------------------------
Github user JPercivall commented on a diff in the pull request:
https://github.com/apache/nifi/pull/525#discussion_r67440428
--- Diff:
nifi-nar-bundles/nifi-windows-event-log-bundle/nifi-windows-event-log-processors/src/main/java/org/apache/nifi/processors/windows/event/log/jna/WEvtApi.java
---
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.nifi.processors.windows.event.log.jna;
+
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import com.sun.jna.platform.win32.WinDef;
+import com.sun.jna.platform.win32.WinNT;
+import com.sun.jna.win32.StdCallLibrary;
+import com.sun.jna.win32.W32APIOptions;
+
+/**
+ * JNA will create the instance of this interface with
Native.loadLibrary().
+ * Please see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa385772(v=vs.85).aspx
for documentation on the methods and data structures.
+ */
+public interface WEvtApi extends StdCallLibrary {
+ WEvtApi INSTANCE = (WEvtApi) Native.loadLibrary("wevtapi",
WEvtApi.class, W32APIOptions.DEFAULT_OPTIONS);
+
+ WinNT.HANDLE EvtSubscribe(WinNT.HANDLE session, WinNT.HANDLE
signalEvent, String channelName, String xpathQuery,
+ WinNT.HANDLE bookmark, WinDef.PVOID context,
EVT_SUBSCRIBE_CALLBACK evtSubscribeCallback, int flags);
+
+ boolean EvtRender(WinNT.HANDLE context, WinNT.HANDLE fragment, int
flags, int bufferSize, Pointer buffer, Pointer bufferUsed, Pointer
propertyCount);
+
+ interface EvtSubscribeNotifyAction {
+ int ERROR = 0;
+ int DELIVER = 1;
+ }
+
+ interface EvtSubscribeFlags {
--- End diff --
What is the purpose of this and EvtRenderFlags? Only the
SUBSCRIBE_TO_FUTURE and EVENT_XML values are used.
> JNA-Based Event Log Subscription Processor
> ------------------------------------------
>
> Key: NIFI-1976
> URL: https://issues.apache.org/jira/browse/NIFI-1976
> Project: Apache NiFi
> Issue Type: Sub-task
> Reporter: Bryan Rosander
>
> Using JNA, we should be able to leverage existing Windows APIs to natively
> consume events as they happen. Will look into subscribing to events
> (https://msdn.microsoft.com/en-us/library/windows/desktop/aa385771(v=vs.85).aspx)
> in order to reduce latency.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)