diff --git a/.gitignore b/.gitignore index 6f5f4b8..30246bf 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,4 @@ ENV/ # Rope project settings .ropeproject .idea/ +*.iml diff --git a/PySiddhi4/DataTypes/DataWrapper.py b/PySiddhi/DataTypes/DataWrapper.py similarity index 93% rename from PySiddhi4/DataTypes/DataWrapper.py rename to PySiddhi/DataTypes/DataWrapper.py index 7b1c04f..ce48496 100644 --- a/PySiddhi4/DataTypes/DataWrapper.py +++ b/PySiddhi/DataTypes/DataWrapper.py @@ -15,9 +15,9 @@ # under the License. -from PySiddhi4 import SiddhiLoader -from PySiddhi4.DataTypes.DoubleType import DoubleType -from PySiddhi4.DataTypes.LongType import LongType +from PySiddhi import SiddhiLoader +from PySiddhi.DataTypes.DoubleType import DoubleType +from PySiddhi.DataTypes.LongType import LongType ''' Data Wrapping is used because python 3 doesn't distinctly support long and double data types @@ -69,7 +69,7 @@ def wrapDataItem(d): :param d: :return: ''' - wrapped_data_proxy = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.DataWrapProxy") + wrapped_data_proxy = SiddhiLoader._loadType("io.siddhi.pythonapi.DataWrapProxy") wrapped_data = None if d is None: # Constructor for null type diff --git a/PySiddhi4/DataTypes/DoubleType.py b/PySiddhi/DataTypes/DoubleType.py similarity index 100% rename from PySiddhi4/DataTypes/DoubleType.py rename to PySiddhi/DataTypes/DoubleType.py diff --git a/PySiddhi4/DataTypes/LongType.py b/PySiddhi/DataTypes/LongType.py similarity index 100% rename from PySiddhi4/DataTypes/LongType.py rename to PySiddhi/DataTypes/LongType.py diff --git a/PySiddhi4/DataTypes/__init__.py b/PySiddhi/DataTypes/__init__.py similarity index 100% rename from PySiddhi4/DataTypes/__init__.py rename to PySiddhi/DataTypes/__init__.py diff --git a/PySiddhi4/SiddhiLoader.py b/PySiddhi/SiddhiLoader.py similarity index 95% rename from PySiddhi4/SiddhiLoader.py rename to PySiddhi/SiddhiLoader.py index 1949abb..e9e6c41 100644 --- a/PySiddhi4/SiddhiLoader.py +++ b/PySiddhi/SiddhiLoader.py @@ -19,7 +19,7 @@ import sys -import PySiddhi4 +import PySiddhi # Instantiate Global Variables siddhi_api_core = None @@ -91,7 +91,7 @@ def loadLibrary(): # at initialization of pyjnius jnius_config.add_options('-Xss1280k') - jnius_config.add_options('-Djava.library.path=' + PySiddhi4.root_path + "/__PySiddhi4Proxy") + jnius_config.add_options('-Djava.library.path=' + PySiddhi.root_path + "/__PySiddhiProxy") # Determine library class path class_paths = ['.', os.path.join(siddhi_home, 'lib', '*')] @@ -117,7 +117,7 @@ def loadLibrary(): # Generate references and store in backup global t_siddhi_api_core, t_siddhi_api_core_inst, t_java_method, t_PythonJavaClass, t_JavaClass - t_siddhi_api_core = autoclass("org.wso2.siddhi.pythonapi.proxy.core.SiddhiAPICoreProxy") + t_siddhi_api_core = autoclass("io.siddhi.pythonapi.proxy.core.SiddhiAPICoreProxy") t_siddhi_api_core_inst = t_siddhi_api_core(sys.version_info[0], sys.version_info[1]) t_java_method = java_method t_PythonJavaClass = PythonJavaClass diff --git a/PySiddhi4/__init__.py b/PySiddhi/__init__.py similarity index 100% rename from PySiddhi4/__init__.py rename to PySiddhi/__init__.py diff --git a/PySiddhi4/core/SiddhiAppRuntime.py b/PySiddhi/core/SiddhiAppRuntime.py similarity index 92% rename from PySiddhi4/core/SiddhiAppRuntime.py rename to PySiddhi/core/SiddhiAppRuntime.py index 5268277..6cc8a25 100644 --- a/PySiddhi4/core/SiddhiAppRuntime.py +++ b/PySiddhi/core/SiddhiAppRuntime.py @@ -14,16 +14,16 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4 import SiddhiLoader -from PySiddhi4.core.debugger.SiddhiDebugger import SiddhiDebugger -from PySiddhi4.core.query.output.callback.QueryCallback import QueryCallback -from PySiddhi4.core.stream.input.InputHandler import InputHandler -from PySiddhi4.core.stream.output.StreamCallback import StreamCallback +from PySiddhi import SiddhiLoader +from PySiddhi.core.debugger.SiddhiDebugger import SiddhiDebugger +from PySiddhi.core.query.output.callback.QueryCallback import QueryCallback +from PySiddhi.core.stream.input.InputHandler import InputHandler +from PySiddhi.core.stream.output.StreamCallback import StreamCallback class SiddhiAppRuntime(object): ''' - Wrapper on org.wso2.core.SiddhiAppRuntime + Wrapper on io.core.SiddhiAppRuntime ''' def __init__(self): diff --git a/PySiddhi4/core/SiddhiManager.py b/PySiddhi/core/SiddhiManager.py similarity index 95% rename from PySiddhi4/core/SiddhiManager.py rename to PySiddhi/core/SiddhiManager.py index bf2bf72..551f7a0 100644 --- a/PySiddhi4/core/SiddhiManager.py +++ b/PySiddhi/core/SiddhiManager.py @@ -14,9 +14,9 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4 import SiddhiLoader -from PySiddhi4.DataTypes import DataWrapper -from PySiddhi4.core.SiddhiAppRuntime import SiddhiAppRuntime +from PySiddhi import SiddhiLoader +from PySiddhi.DataTypes import DataWrapper +from PySiddhi.core.SiddhiAppRuntime import SiddhiAppRuntime class SiddhiManager(object): diff --git a/PySiddhi4/core/__init__.py b/PySiddhi/core/__init__.py similarity index 100% rename from PySiddhi4/core/__init__.py rename to PySiddhi/core/__init__.py diff --git a/PySiddhi4/core/debugger/SiddhiDebugger.py b/PySiddhi/core/debugger/SiddhiDebugger.py similarity index 96% rename from PySiddhi4/core/debugger/SiddhiDebugger.py rename to PySiddhi/core/debugger/SiddhiDebugger.py index 0e34ba3..e2f7c83 100644 --- a/PySiddhi4/core/debugger/SiddhiDebugger.py +++ b/PySiddhi/core/debugger/SiddhiDebugger.py @@ -17,10 +17,10 @@ import threading from time import sleep -from PySiddhi4 import SiddhiLoader -from PySiddhi4.DataTypes.DataWrapper import unwrapHashMap +from PySiddhi import SiddhiLoader +from PySiddhi.DataTypes.DataWrapper import unwrapHashMap from enum import Enum -from PySiddhi4.core.event.ComplexEvent import ComplexEvent +from PySiddhi.core.event.ComplexEvent import ComplexEvent class SiddhiDebugger(object): @@ -36,9 +36,9 @@ class QueryTerminal(Enum): SiddhiDebugger allows to add breakpoints at the beginning and the end of a query. ''' IN = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy")().IN() + "io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy")().IN() OUT = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy")().OUT() + "io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy")().OUT() @classmethod def _map_value(cls, queryTerminalProxy): diff --git a/PySiddhi4/core/debugger/SiddhiDebuggerCallback.py b/PySiddhi/core/debugger/SiddhiDebuggerCallback.py similarity index 92% rename from PySiddhi4/core/debugger/SiddhiDebuggerCallback.py rename to PySiddhi/core/debugger/SiddhiDebuggerCallback.py index fcbe5a5..c22c960 100644 --- a/PySiddhi4/core/debugger/SiddhiDebuggerCallback.py +++ b/PySiddhi/core/debugger/SiddhiDebuggerCallback.py @@ -17,10 +17,10 @@ from abc import ABCMeta, abstractmethod from future.utils import with_metaclass -from PySiddhi4 import SiddhiLoader +from PySiddhi import SiddhiLoader _siddhi_debugger_callback_proxy = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.SiddhiDebuggerCallbackProxy") + "io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.SiddhiDebuggerCallbackProxy") class SiddhiDebuggerCallback(with_metaclass(ABCMeta, object)): diff --git a/PySiddhi4/core/debugger/__init__.py b/PySiddhi/core/debugger/__init__.py similarity index 100% rename from PySiddhi4/core/debugger/__init__.py rename to PySiddhi/core/debugger/__init__.py diff --git a/PySiddhi4/core/event/ComplexEvent.py b/PySiddhi/core/event/ComplexEvent.py similarity index 80% rename from PySiddhi4/core/event/ComplexEvent.py rename to PySiddhi/core/event/ComplexEvent.py index 9443b39..97dbcb4 100644 --- a/PySiddhi4/core/event/ComplexEvent.py +++ b/PySiddhi/core/event/ComplexEvent.py @@ -16,22 +16,22 @@ from enum import Enum -from PySiddhi4 import SiddhiLoader -from PySiddhi4.DataTypes.DataWrapper import unwrapData, wrapData +from PySiddhi import SiddhiLoader +from PySiddhi.DataTypes.DataWrapper import unwrapData, wrapData class ComplexEvent(object): ''' - Wrapper on @org.wso2.siddhi.core.event.ComplexEvent + Wrapper on @io.siddhi.core.event.ComplexEvent ''' class Type(Enum): CURRENT = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().CURRENT(), + "io.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().CURRENT(), EXPIRED = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().EXPIRED(), - TIMER = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().TIMER(), - RESET = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().RESET() + "io.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().EXPIRED(), + TIMER = SiddhiLoader._loadType("io.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().TIMER(), + RESET = SiddhiLoader._loadType("io.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")().RESET() @classmethod def _map_value(cls, type_proxy): @@ -80,13 +80,13 @@ def setNext(self, next_event): def getOutputData(self): complex_event_static_proxy = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.ComplexEventProxy")() + "io.siddhi.pythonapi.proxy.core.event.complex_event.ComplexEventProxy")() output_data = unwrapData(complex_event_static_proxy.getOutputData(self._complex_event_proxy)) return output_data def setOutputData(self, datum, index): complex_event_static_proxy = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.ComplexEventProxy")() + "io.siddhi.pythonapi.proxy.core.event.complex_event.ComplexEventProxy")() complex_event_static_proxy.setOutputData(self._complex_event_proxy, wrapData(datum), index) def getTimestamp(self): @@ -103,7 +103,7 @@ def setAttribute(self, value, position): def getType(self): raw_type_proxy = self._complex_event_proxy.getType() - type_proxy = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")( + type_proxy = SiddhiLoader._loadType("io.siddhi.pythonapi.proxy.core.event.complex_event.TypeProxy")( raw_type_proxy) return ComplexEvent.Type._map_value(type_proxy) diff --git a/PySiddhi4/core/event/Event.py b/PySiddhi/core/event/Event.py similarity index 93% rename from PySiddhi4/core/event/Event.py rename to PySiddhi/core/event/Event.py index afebc09..2dc3e4a 100644 --- a/PySiddhi4/core/event/Event.py +++ b/PySiddhi/core/event/Event.py @@ -14,19 +14,19 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4 import SiddhiLoader +from PySiddhi import SiddhiLoader -from PySiddhi4.DataTypes import DataWrapper -from PySiddhi4.core.event import ComplexEvent +from PySiddhi.DataTypes import DataWrapper +from PySiddhi.core.event import ComplexEvent -_event_class = SiddhiLoader._loadType("org.wso2.siddhi.core.event.Event") -_event_proxy_class = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.event.event.EventProxy") +_event_class = SiddhiLoader._loadType("io.siddhi.core.event.Event") +_event_proxy_class = SiddhiLoader._loadType("io.siddhi.pythonapi.proxy.core.event.event.EventProxy") _event_proxy_class_inst = _event_proxy_class() class Event(object): ''' - Wrapper on @org.wso2.siddhi.core.event.Event + Wrapper on @io.siddhi.core.event.Event ''' @classmethod diff --git a/PySiddhi4/core/event/__init__.py b/PySiddhi/core/event/__init__.py similarity index 100% rename from PySiddhi4/core/event/__init__.py rename to PySiddhi/core/event/__init__.py diff --git a/PySiddhi4/core/query/__init__.py b/PySiddhi/core/query/__init__.py similarity index 100% rename from PySiddhi4/core/query/__init__.py rename to PySiddhi/core/query/__init__.py diff --git a/PySiddhi4/core/query/output/__init__.py b/PySiddhi/core/query/output/__init__.py similarity index 100% rename from PySiddhi4/core/query/output/__init__.py rename to PySiddhi/core/query/output/__init__.py diff --git a/PySiddhi4/core/query/output/callback/QueryCallback.py b/PySiddhi/core/query/output/callback/QueryCallback.py similarity index 84% rename from PySiddhi4/core/query/output/callback/QueryCallback.py rename to PySiddhi/core/query/output/callback/QueryCallback.py index 8281b0a..26fa974 100644 --- a/PySiddhi4/core/query/output/callback/QueryCallback.py +++ b/PySiddhi/core/query/output/callback/QueryCallback.py @@ -18,13 +18,13 @@ from abc import ABCMeta, abstractmethod -from PySiddhi4 import SiddhiLoader -from PySiddhi4.core.event.Event import Event +from PySiddhi import SiddhiLoader +from PySiddhi.core.event.Event import Event from future.utils import with_metaclass _query_callback_proxy = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.query.output.callback.query_callback.QueryCallbackProxy") + "io.siddhi.pythonapi.proxy.core.query.output.callback.query_callback.QueryCallbackProxy") _created_instances = [] # Hold references to prevent python from GCing Callbacks until Java does @@ -32,7 +32,7 @@ class QueryCallback(with_metaclass(ABCMeta, object)): ''' Callback to receive events from SiddhiAppRuntime. Should be extended by child class. - Wrapper on org.wso2.siddhi.core.query.output.callback.QueryCallback + Wrapper on io.siddhi.core.query.output.callback.QueryCallback ''' def __init__(self): @@ -44,10 +44,10 @@ class ReceiveCallback(SiddhiLoader._PythonJavaClass): Innerclass to wrap around Java Interface ''' __javainterfaces__ = [ - "org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy"] + "io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy"] @SiddhiLoader._java_method( - signature='(J[Lorg/wso2/siddhi/core/event/Event;[Lorg/wso2/siddhi/core/event/Event;)V', + signature='(J[Lio/siddhi/core/event/Event;[Lio/siddhi/core/event/Event;)V', name="receive") def receive(self, timestamp, inEvents, outEvents): # _lock.acquire() diff --git a/PySiddhi4/core/query/output/callback/__init__.py b/PySiddhi/core/query/output/callback/__init__.py similarity index 100% rename from PySiddhi4/core/query/output/callback/__init__.py rename to PySiddhi/core/query/output/callback/__init__.py diff --git a/PySiddhi4/core/stream/__init__.py b/PySiddhi/core/stream/__init__.py similarity index 100% rename from PySiddhi4/core/stream/__init__.py rename to PySiddhi/core/stream/__init__.py diff --git a/PySiddhi4/core/stream/input/InputHandler.py b/PySiddhi/core/stream/input/InputHandler.py similarity index 87% rename from PySiddhi4/core/stream/input/InputHandler.py rename to PySiddhi/core/stream/input/InputHandler.py index c7362cc..716215b 100644 --- a/PySiddhi4/core/stream/input/InputHandler.py +++ b/PySiddhi/core/stream/input/InputHandler.py @@ -14,17 +14,17 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4 import SiddhiLoader -from PySiddhi4.DataTypes.DataWrapper import wrapData +from PySiddhi import SiddhiLoader +from PySiddhi.DataTypes.DataWrapper import wrapData input_handler_proxy = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.stream.input.input_handler.InputHandlerProxy") + "io.siddhi.pythonapi.proxy.core.stream.input.input_handler.InputHandlerProxy") class InputHandler(object): ''' Handles input to SiddhiAppRuntime. - Wrapper on org.wso2.siddhi.core.stream.input.InputHandler + Wrapper on io.siddhi.core.stream.input.InputHandler ''' def __init__(self): diff --git a/PySiddhi4/core/stream/input/__init__.py b/PySiddhi/core/stream/input/__init__.py similarity index 100% rename from PySiddhi4/core/stream/input/__init__.py rename to PySiddhi/core/stream/input/__init__.py diff --git a/PySiddhi4/core/stream/output/StreamCallback.py b/PySiddhi/core/stream/output/StreamCallback.py similarity index 84% rename from PySiddhi4/core/stream/output/StreamCallback.py rename to PySiddhi/core/stream/output/StreamCallback.py index 924118a..ac01536 100644 --- a/PySiddhi4/core/stream/output/StreamCallback.py +++ b/PySiddhi/core/stream/output/StreamCallback.py @@ -20,13 +20,13 @@ from abc import ABCMeta, abstractmethod -from PySiddhi4 import SiddhiLoader -from PySiddhi4.core.event.Event import Event +from PySiddhi import SiddhiLoader +from PySiddhi.core.event.Event import Event from future.utils import with_metaclass _stream_callback_proxy = SiddhiLoader._loadType( - "org.wso2.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy") + "io.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy") _lock = RLock() @@ -50,9 +50,9 @@ class ReceiveCallback(SiddhiLoader._PythonJavaClass): Innerclass to wrap around Java Interface ''' __javainterfaces__ = [ - "org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy"] + "io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy"] - @SiddhiLoader._java_method(signature='([Lorg/wso2/siddhi/core/event/Event;)V', name="receive") + @SiddhiLoader._java_method(signature='([Lio/siddhi/core/event/Event;)V', name="receive") def receive(self, events): if events is not None: events = [Event._fromEventProxy(event) for event in events] diff --git a/PySiddhi4/core/stream/output/__init__.py b/PySiddhi/core/stream/output/__init__.py similarity index 100% rename from PySiddhi4/core/stream/output/__init__.py rename to PySiddhi/core/stream/output/__init__.py diff --git a/PySiddhi4/core/util/EventPrinter.py b/PySiddhi/core/util/EventPrinter.py similarity index 82% rename from PySiddhi4/core/util/EventPrinter.py rename to PySiddhi/core/util/EventPrinter.py index ce53b30..b5e482e 100644 --- a/PySiddhi4/core/util/EventPrinter.py +++ b/PySiddhi/core/util/EventPrinter.py @@ -14,9 +14,9 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4 import SiddhiLoader +from PySiddhi import SiddhiLoader -_event_printer_proxy = SiddhiLoader._loadType("org.wso2.siddhi.pythonapi.proxy.core.util.EventPrinterProxy") +_event_printer_proxy = SiddhiLoader._loadType("io.siddhi.pythonapi.proxy.core.util.EventPrinterProxy") def PrintEvent(timestamp, inEvents, outEvents): @@ -34,5 +34,5 @@ def PrintEvent(timestamp, inEvents, outEvents): outEvents = [event._event_proxy for event in outEvents] _event_printer_proxy.printEvent(timestamp, inEvents, outEvents) - # NOTE: We are unable to call org.wso2.siddhi.core.util.EventPrinter.print directly + # NOTE: We are unable to call io.siddhi.core.util.EventPrinter.print directly # because print is a keyword of python diff --git a/PySiddhi4/core/util/__init__.py b/PySiddhi/core/util/__init__.py similarity index 100% rename from PySiddhi4/core/util/__init__.py rename to PySiddhi/core/util/__init__.py diff --git a/PySiddhi4/log4j.xml b/PySiddhi/log4j.xml similarity index 100% rename from PySiddhi4/log4j.xml rename to PySiddhi/log4j.xml diff --git a/PySiddhi4/sp/EventSimulator/AttributeConfiguration.py b/PySiddhi/sp/EventSimulator/AttributeConfiguration.py similarity index 94% rename from PySiddhi4/sp/EventSimulator/AttributeConfiguration.py rename to PySiddhi/sp/EventSimulator/AttributeConfiguration.py index 727c57f..569be19 100644 --- a/PySiddhi4/sp/EventSimulator/AttributeConfiguration.py +++ b/PySiddhi/sp/EventSimulator/AttributeConfiguration.py @@ -16,9 +16,9 @@ from enum import Enum -from PySiddhi4.sp.ObjectMapping.APIObject import APIObject, NotSet -from PySiddhi4.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping -from PySiddhi4.sp.__Util import decodeField, decodeObject +from PySiddhi.sp.ObjectMapping.APIObject import APIObject, NotSet +from PySiddhi.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping +from PySiddhi.sp.__Util import decodeField, decodeObject class AttributeConfiguration(APIObject): diff --git a/PySiddhi4/sp/EventSimulator/EventSimulatorClient.py b/PySiddhi/sp/EventSimulator/EventSimulatorClient.py similarity index 98% rename from PySiddhi4/sp/EventSimulator/EventSimulatorClient.py rename to PySiddhi/sp/EventSimulator/EventSimulatorClient.py index a79e3fc..82afe8a 100644 --- a/PySiddhi4/sp/EventSimulator/EventSimulatorClient.py +++ b/PySiddhi/sp/EventSimulator/EventSimulatorClient.py @@ -17,8 +17,8 @@ import json import logging -from PySiddhi4.sp.__Communication.RestClient import RestClient -from PySiddhi4.sp.EventSimulator.FeedSimulationConfiguration import FeedSimulationConfiguration +from PySiddhi.sp.__Communication.RestClient import RestClient +from PySiddhi.sp.EventSimulator.FeedSimulationConfiguration import FeedSimulationConfiguration from requests.auth import HTTPBasicAuth diff --git a/PySiddhi4/sp/EventSimulator/FeedSimulationConfiguration.py b/PySiddhi/sp/EventSimulator/FeedSimulationConfiguration.py similarity index 86% rename from PySiddhi4/sp/EventSimulator/FeedSimulationConfiguration.py rename to PySiddhi/sp/EventSimulator/FeedSimulationConfiguration.py index 4310915..a9a2715 100644 --- a/PySiddhi4/sp/EventSimulator/FeedSimulationConfiguration.py +++ b/PySiddhi/sp/EventSimulator/FeedSimulationConfiguration.py @@ -14,10 +14,10 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4.sp.EventSimulator.SimulationProperties import SimulationProperties -from PySiddhi4.sp.EventSimulator.SimulationSource import SimulationSource -from PySiddhi4.sp.ObjectMapping.APIObject import APIObject -from PySiddhi4.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping +from PySiddhi.sp.EventSimulator.SimulationProperties import SimulationProperties +from PySiddhi.sp.EventSimulator.SimulationSource import SimulationSource +from PySiddhi.sp.ObjectMapping.APIObject import APIObject +from PySiddhi.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping class FeedSimulationConfiguration(APIObject): diff --git a/PySiddhi4/sp/EventSimulator/SimulationProperties.py b/PySiddhi/sp/EventSimulator/SimulationProperties.py similarity index 92% rename from PySiddhi4/sp/EventSimulator/SimulationProperties.py rename to PySiddhi/sp/EventSimulator/SimulationProperties.py index e083325..d795470 100644 --- a/PySiddhi4/sp/EventSimulator/SimulationProperties.py +++ b/PySiddhi/sp/EventSimulator/SimulationProperties.py @@ -16,9 +16,9 @@ import random -from PySiddhi4.sp.ObjectMapping.APIObject import APIObject, NotSet -from PySiddhi4.sp.ObjectMapping.FieldMapping import FieldMapping -from PySiddhi4.sp.__Util import decodeField +from PySiddhi.sp.ObjectMapping.APIObject import APIObject, NotSet +from PySiddhi.sp.ObjectMapping.FieldMapping import FieldMapping +from PySiddhi.sp.__Util import decodeField ran = random diff --git a/PySiddhi4/sp/EventSimulator/SimulationSource.py b/PySiddhi/sp/EventSimulator/SimulationSource.py similarity index 94% rename from PySiddhi4/sp/EventSimulator/SimulationSource.py rename to PySiddhi/sp/EventSimulator/SimulationSource.py index 14d51dc..c3d4b2c 100644 --- a/PySiddhi4/sp/EventSimulator/SimulationSource.py +++ b/PySiddhi/sp/EventSimulator/SimulationSource.py @@ -16,9 +16,9 @@ from enum import Enum -from PySiddhi4.sp.EventSimulator.AttributeConfiguration import AttributeConfiguration -from PySiddhi4.sp.ObjectMapping.APIObject import APIObject, NotSet -from PySiddhi4.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping, strOrInt +from PySiddhi.sp.EventSimulator.AttributeConfiguration import AttributeConfiguration +from PySiddhi.sp.ObjectMapping.APIObject import APIObject, NotSet +from PySiddhi.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping, strOrInt class SimulationSource(APIObject): diff --git a/PySiddhi4/sp/EventSimulator/SingleSimulationConfiguration.py b/PySiddhi/sp/EventSimulator/SingleSimulationConfiguration.py similarity index 90% rename from PySiddhi4/sp/EventSimulator/SingleSimulationConfiguration.py rename to PySiddhi/sp/EventSimulator/SingleSimulationConfiguration.py index 714320d..7aaa94b 100644 --- a/PySiddhi4/sp/EventSimulator/SingleSimulationConfiguration.py +++ b/PySiddhi/sp/EventSimulator/SingleSimulationConfiguration.py @@ -14,8 +14,8 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4.sp.ObjectMapping.APIObject import APIObject -from PySiddhi4.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping +from PySiddhi.sp.ObjectMapping.APIObject import APIObject +from PySiddhi.sp.ObjectMapping.FieldMapping import FieldMapping, ListFieldMapping class SingleSimulationConfiguration(APIObject): diff --git a/PySiddhi4/sp/EventSimulator/__init__.py b/PySiddhi/sp/EventSimulator/__init__.py similarity index 100% rename from PySiddhi4/sp/EventSimulator/__init__.py rename to PySiddhi/sp/EventSimulator/__init__.py diff --git a/PySiddhi4/sp/ObjectMapping/APIObject.py b/PySiddhi/sp/ObjectMapping/APIObject.py similarity index 98% rename from PySiddhi4/sp/ObjectMapping/APIObject.py rename to PySiddhi/sp/ObjectMapping/APIObject.py index 70a232c..25c88d2 100644 --- a/PySiddhi4/sp/ObjectMapping/APIObject.py +++ b/PySiddhi/sp/ObjectMapping/APIObject.py @@ -17,7 +17,7 @@ from abc import ABCMeta from future.utils import with_metaclass -from PySiddhi4.sp.__Util import decodeField, encodeField +from PySiddhi.sp.__Util import decodeField, encodeField class NotSet(object): diff --git a/PySiddhi4/sp/ObjectMapping/FieldMapping.py b/PySiddhi/sp/ObjectMapping/FieldMapping.py similarity index 96% rename from PySiddhi4/sp/ObjectMapping/FieldMapping.py rename to PySiddhi/sp/ObjectMapping/FieldMapping.py index 302551b..44828ac 100644 --- a/PySiddhi4/sp/ObjectMapping/FieldMapping.py +++ b/PySiddhi/sp/ObjectMapping/FieldMapping.py @@ -14,8 +14,8 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4.sp.ObjectMapping.APIObject import NotSet -from PySiddhi4.sp.__Util import encodeField, decodeField +from PySiddhi.sp.ObjectMapping.APIObject import NotSet +from PySiddhi.sp.__Util import encodeField, decodeField def strOrInt(v): diff --git a/PySiddhi4/sp/ObjectMapping/__init__.py b/PySiddhi/sp/ObjectMapping/__init__.py similarity index 100% rename from PySiddhi4/sp/ObjectMapping/__init__.py rename to PySiddhi/sp/ObjectMapping/__init__.py diff --git a/PySiddhi4/sp/SPClient.py b/PySiddhi/sp/SPClient.py similarity index 88% rename from PySiddhi4/sp/SPClient.py rename to PySiddhi/sp/SPClient.py index 2ff803b..3298831 100644 --- a/PySiddhi4/sp/SPClient.py +++ b/PySiddhi/sp/SPClient.py @@ -14,8 +14,8 @@ # specific language governing permissions and limitations # under the License. -from PySiddhi4.sp.EventSimulator.EventSimulatorClient import EventSimulatorClient -from PySiddhi4.sp.SiddhiAppManagement.SiddhiAppManagementClient import SiddhiAppManagementClient +from PySiddhi.sp.EventSimulator.EventSimulatorClient import EventSimulatorClient +from PySiddhi.sp.SiddhiAppManagement.SiddhiAppManagementClient import SiddhiAppManagementClient class SPClient(object): diff --git a/PySiddhi4/sp/SiddhiAppManagement/SiddhiAppManagementClient.py b/PySiddhi/sp/SiddhiAppManagement/SiddhiAppManagementClient.py similarity index 98% rename from PySiddhi4/sp/SiddhiAppManagement/SiddhiAppManagementClient.py rename to PySiddhi/sp/SiddhiAppManagement/SiddhiAppManagementClient.py index 58ec5f0..21f90be 100644 --- a/PySiddhi4/sp/SiddhiAppManagement/SiddhiAppManagementClient.py +++ b/PySiddhi/sp/SiddhiAppManagement/SiddhiAppManagementClient.py @@ -17,7 +17,7 @@ from enum import Enum from requests.auth import HTTPBasicAuth -from PySiddhi4.sp.__Communication.RestClient import RestClient +from PySiddhi.sp.__Communication.RestClient import RestClient class UpdateAppStatusResponse(Enum): diff --git a/PySiddhi4/sp/SiddhiAppManagement/__init__.py b/PySiddhi/sp/SiddhiAppManagement/__init__.py similarity index 100% rename from PySiddhi4/sp/SiddhiAppManagement/__init__.py rename to PySiddhi/sp/SiddhiAppManagement/__init__.py diff --git a/PySiddhi4/sp/__Communication/RestClient.py b/PySiddhi/sp/__Communication/RestClient.py similarity index 100% rename from PySiddhi4/sp/__Communication/RestClient.py rename to PySiddhi/sp/__Communication/RestClient.py diff --git a/PySiddhi4/sp/__Communication/__init__.py b/PySiddhi/sp/__Communication/__init__.py similarity index 100% rename from PySiddhi4/sp/__Communication/__init__.py rename to PySiddhi/sp/__Communication/__init__.py diff --git a/PySiddhi4/sp/__Util.py b/PySiddhi/sp/__Util.py similarity index 100% rename from PySiddhi4/sp/__Util.py rename to PySiddhi/sp/__Util.py diff --git a/PySiddhi4/sp/__init__.py b/PySiddhi/sp/__init__.py similarity index 100% rename from PySiddhi4/sp/__init__.py rename to PySiddhi/sp/__init__.py diff --git a/README.md b/README.md index 0092920..a22c076 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -# [PySiddhi](https://wso2.github.io/PySiddhi/) +# [PySiddhi](https://siddhi-io.github.io/PySiddhi/) -***PySiddhi*** is a Python wrapper for [Siddhi](https://wso2.github.io/siddhi/). Which can listens to events from data streams, detects complex conditions +***PySiddhi*** is a Python wrapper for [Siddhi](https://siddhi-io.github.io/siddhi/). Which can listens to events from data streams, detects complex conditions described via a ***Streaming SQL language***, and triggers actions. It performs both ***Stream Processing*** and ***Complex Event Processing*** on streaming data. Its Siddhi core is written in Java library. -- PySiddhi4 wraps [Siddhi 4](https://wso2.github.io/siddhi/) -- PySiddhi4 includes a REST Client for [WSO2 Stream Processor(SP) 4.x.x](https://wso2.com/analytics). +- PySiddhi wraps [Siddhi 5](https://siddhi-io.github.io/siddhi/) +- PySiddhi includes a REST Client for [WSO2 Stream Processor(SP) 4.x.x](https://wso2.com/analytics). ## Features -- [x] Basic functionality of Siddhi 4.x.x +- [x] Basic functionality of Siddhi 5.x.x - [x] Siddhi Debugger - [x] Support to Siddhi Extensions Loading - [x] Rest Client on WSO2 SP 4.x.x - Siddhi App Management - [x] Rest Client on WSO2 SP 4.x.x - Event Simulation -For a Quick Demo and documentation refer [PySiddhi Site](https://wso2.github.io/PySiddhi/) +For a Quick Demo and documentation refer [PySiddhi Site](https://siddhi-io.github.io/PySiddhi/) ## Contribution @@ -26,14 +26,14 @@ Email: madhawavidanapathirana@gmail.com Organization: University of Moratuwa, Sri Lanka. ## How to Contribute -* Report issues at GitHub Issue Tracker. -* Feel free to try out the PySiddhi source code and send your contributions as pull requests to the master branch. +* Report issues at GitHub Issue Tracker. +* Feel free to try out the PySiddhi source code and send your contributions as pull requests to the master branch. ## Contact us * Post your questions with the "Siddhi" tag in Stackoverflow. * For more details and support contact us via http://wso2.com/support/ ## Support -* We are committed to ensuring support for [Siddhi](https://wso2.github.io/siddhi/) (with its extensions) and WSO2 Stream Processor from development to production. +* We are committed to ensuring support for [Siddhi](https://siddhi-io.github.io/siddhi/) (with its extensions) and WSO2 Stream Processor from development to production. * Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology. * For more details and to take advantage of this unique opportunity, contact us via http://wso2.com/support/. diff --git a/Tests/SPTests/EventSimulatorTests.py b/Tests/SPTests/EventSimulatorTests.py index 7043b2e..80da4cb 100644 --- a/Tests/SPTests/EventSimulatorTests.py +++ b/Tests/SPTests/EventSimulatorTests.py @@ -20,11 +20,11 @@ import os from time import sleep -from PySiddhi4.sp.SPClient import SPClient -from PySiddhi4.sp.EventSimulator.AttributeConfiguration import AttributeConfiguration -from PySiddhi4.sp.EventSimulator.FeedSimulationConfiguration import FeedSimulationConfiguration -from PySiddhi4.sp.EventSimulator.SimulationSource import SimulationSource -from PySiddhi4.sp.EventSimulator.SingleSimulationConfiguration import SingleSimulationConfiguration +from PySiddhi.sp.SPClient import SPClient +from PySiddhi.sp.EventSimulator.AttributeConfiguration import AttributeConfiguration +from PySiddhi.sp.EventSimulator.FeedSimulationConfiguration import FeedSimulationConfiguration +from PySiddhi.sp.EventSimulator.SimulationSource import SimulationSource +from PySiddhi.sp.EventSimulator.SingleSimulationConfiguration import SingleSimulationConfiguration logging.basicConfig(level=logging.INFO) diff --git a/Tests/SPTests/SiddhiAppManagerTests.py b/Tests/SPTests/SiddhiAppManagerTests.py index 0c2ddc3..e3fb78a 100644 --- a/Tests/SPTests/SiddhiAppManagerTests.py +++ b/Tests/SPTests/SiddhiAppManagerTests.py @@ -20,8 +20,8 @@ import logging from time import sleep -from PySiddhi4.sp.SPClient import SPClient -from PySiddhi4.sp.SiddhiAppManagement.SiddhiAppManagementClient import UpdateAppStatusResponse +from PySiddhi.sp.SPClient import SPClient +from PySiddhi.sp.SiddhiAppManagement.SiddhiAppManagementClient import UpdateAppStatusResponse logging.basicConfig(level=logging.INFO) diff --git a/Tests/SiddhiCoreTests/BasicTest.py b/Tests/SiddhiCoreTests/BasicTest.py index e0d71f2..4590fbb 100644 --- a/Tests/SiddhiCoreTests/BasicTest.py +++ b/Tests/SiddhiCoreTests/BasicTest.py @@ -18,10 +18,10 @@ import unittest import logging from time import sleep -from PySiddhi4.DataTypes.LongType import LongType -from PySiddhi4.core.SiddhiManager import SiddhiManager -from PySiddhi4.core.query.output.callback.QueryCallback import QueryCallback -from PySiddhi4.core.util.EventPrinter import PrintEvent +from PySiddhi.DataTypes.LongType import LongType +from PySiddhi.core.SiddhiManager import SiddhiManager +from PySiddhi.core.query.output.callback.QueryCallback import QueryCallback +from PySiddhi.core.util.EventPrinter import PrintEvent logging.basicConfig(level=logging.INFO) diff --git a/Tests/SiddhiCoreTests/EventTest.py b/Tests/SiddhiCoreTests/EventTest.py index 2602013..e55f7df 100644 --- a/Tests/SiddhiCoreTests/EventTest.py +++ b/Tests/SiddhiCoreTests/EventTest.py @@ -19,8 +19,8 @@ logging.basicConfig(level=logging.INFO) -from PySiddhi4.DataTypes.LongType import LongType -from PySiddhi4.core.event.Event import Event +from PySiddhi.DataTypes.LongType import LongType +from PySiddhi.core.event.Event import Event class BasicTests(unittest.TestCase): diff --git a/Tests/SiddhiCoreTests/ExtensionsTest.py b/Tests/SiddhiCoreTests/ExtensionsTest.py index 3994d33..f09aae8 100644 --- a/Tests/SiddhiCoreTests/ExtensionsTest.py +++ b/Tests/SiddhiCoreTests/ExtensionsTest.py @@ -16,7 +16,7 @@ from subprocess import call import os -from PySiddhi4 import SiddhiLoader +from PySiddhi import SiddhiLoader # Download extension jars @@ -24,10 +24,10 @@ import logging from time import sleep -from PySiddhi4.DataTypes.LongType import LongType -from PySiddhi4.core.SiddhiManager import SiddhiManager -from PySiddhi4.core.query.output.callback.QueryCallback import QueryCallback -from PySiddhi4.core.util.EventPrinter import PrintEvent +from PySiddhi.DataTypes.LongType import LongType +from PySiddhi.core.SiddhiManager import SiddhiManager +from PySiddhi.core.query.output.callback.QueryCallback import QueryCallback +from PySiddhi.core.util.EventPrinter import PrintEvent logging.basicConfig(level=logging.INFO) @@ -41,93 +41,6 @@ def setUp(self): self.eventArrived = False self.count = AtomicInt(0) - def testTimeSeriesSimpleLinearRegression(self): - logging.info("Simple Regression TestCase") - SiddhiLoader.loadLibrary() - - siddhiManager = SiddhiManager() - - siddhiManager.setExtension("timeseries:regress", - "org.wso2.extension.siddhi.execution.timeseries.LinearRegressionStreamProcessor") - - inputStream = "define stream InputStream (y int, x int);" - siddhiApp = "@info(name = 'query1') from InputStream#timeseries:regress(1, 100, 0.95, y, x) " + \ - "select * " + \ - "insert into OutputStream;" - siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(inputStream + siddhiApp) - self.betaZero = 0 - _self_shaddow = self - - class QueryCallbackImpl(QueryCallback): - def receive(self, timestamp, inEvents, outEvents): - PrintEvent(timestamp, inEvents, outEvents) - _self_shaddow.count.addAndGet(len(inEvents)) - _self_shaddow.betaZero = inEvents[len(inEvents) - 1].getData(3) - - siddhiAppRuntime.addCallback("query1", QueryCallbackImpl()) - - inputHandler = siddhiAppRuntime.getInputHandler("InputStream") - siddhiAppRuntime.start() - - inputHandler.send([2500.00, 17.00]) - inputHandler.send([2600.00, 18.00]) - inputHandler.send([3300.00, 31.00]) - inputHandler.send([2475.00, 12.00]) - inputHandler.send([2313.00, 8.00]) - inputHandler.send([2175.00, 26.00]) - inputHandler.send([600.00, 14.00]) - inputHandler.send([460.00, 3.00]) - inputHandler.send([240.00, 1.00]) - inputHandler.send([200.00, 10.00]) - inputHandler.send([177.00, 0.00]) - inputHandler.send([140.00, 6.00]) - inputHandler.send([117.00, 1.00]) - inputHandler.send([115.00, 0.00]) - inputHandler.send([2600.00, 19.00]) - inputHandler.send([1907.00, 13.00]) - inputHandler.send([1190.00, 3.00]) - inputHandler.send([990.00, 16.00]) - inputHandler.send([925.00, 6.00]) - inputHandler.send([365.00, 0.00]) - inputHandler.send([302.00, 10.00]) - inputHandler.send([300.00, 6.00]) - inputHandler.send([129.00, 2.00]) - inputHandler.send([111.00, 1.00]) - inputHandler.send([6100.00, 18.00]) - inputHandler.send([4125.00, 19.00]) - inputHandler.send([3213.00, 1.00]) - inputHandler.send([2319.00, 38.00]) - inputHandler.send([2000.00, 10.00]) - inputHandler.send([1600.00, 0.00]) - inputHandler.send([1394.00, 4.00]) - inputHandler.send([935.00, 4.00]) - inputHandler.send([850.00, 0.00]) - inputHandler.send([775.00, 5.00]) - inputHandler.send([760.00, 6.00]) - inputHandler.send([629.00, 1.00]) - inputHandler.send([275.00, 6.00]) - inputHandler.send([120.00, 0.00]) - inputHandler.send([2567.00, 12.00]) - inputHandler.send([2500.00, 28.00]) - inputHandler.send([2350.00, 21.00]) - inputHandler.send([2317.00, 3.00]) - inputHandler.send([2000.00, 12.00]) - inputHandler.send([715.00, 1.00]) - inputHandler.send([660.00, 9.00]) - inputHandler.send([650.00, 0.00]) - inputHandler.send([260.00, 0.00]) - inputHandler.send([250.00, 1.00]) - inputHandler.send([200.00, 13.00]) - inputHandler.send([180.00, 6.00]) - - sleep(1) - - self.assertEqual(50, self.count.get(), "No of events: ") - self.assertTrue(573.1418421169493 - 0.001 < self.betaZero < 573.1418421169493 + 0.001, - "Beta0: " + str(573.1418421169493 - self.betaZero)) - - siddhiAppRuntime.shutdown() - def testMathRandomFunctionWithSeed(self): logging.info("RandomFunctionExtension TestCase, with seed") diff --git a/Tests/SiddhiCoreTests/Resources/Extensions4/pom.xml b/Tests/SiddhiCoreTests/Resources/Extensions/pom.xml similarity index 91% rename from Tests/SiddhiCoreTests/Resources/Extensions4/pom.xml rename to Tests/SiddhiCoreTests/Resources/Extensions/pom.xml index 92bab9c..b3245cb 100644 --- a/Tests/SiddhiCoreTests/Resources/Extensions4/pom.xml +++ b/Tests/SiddhiCoreTests/Resources/Extensions/pom.xml @@ -22,29 +22,23 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.wso2.siddhi-python-api + io.siddhi.python.api siddhi-python-api-extensions-downloader-for-tests - 1.1.0 + 5.0.0 Downloads extensions (JARS) used by Siddhi Python API Tests pom - org.wso2.extension.siddhi.execution.string + io.siddhi.extension.execution.string siddhi-execution-string - 4.0.1 + 5.0.1 - org.wso2.extension.siddhi.execution.math + io.siddhi.extension.execution.math siddhi-execution-math - 4.0.1 + 5.0.0 - - org.wso2.extension.siddhi.execution.timeseries - siddhi-execution-timeseries - 4.0.1 - - org.apache.commons commons-math3 diff --git a/Tests/SiddhiCoreTests/TestDebugger.py b/Tests/SiddhiCoreTests/TestDebugger.py index 0b6e2ee..f2aa14b 100644 --- a/Tests/SiddhiCoreTests/TestDebugger.py +++ b/Tests/SiddhiCoreTests/TestDebugger.py @@ -23,10 +23,10 @@ from time import sleep from unittest.case import TestCase -from PySiddhi4.core.SiddhiManager import SiddhiManager -from PySiddhi4.core.debugger.SiddhiDebugger import SiddhiDebugger -from PySiddhi4.core.debugger.SiddhiDebuggerCallback import SiddhiDebuggerCallback -from PySiddhi4.core.stream.output.StreamCallback import StreamCallback +from PySiddhi.core.SiddhiManager import SiddhiManager +from PySiddhi.core.debugger.SiddhiDebugger import SiddhiDebugger +from PySiddhi.core.debugger.SiddhiDebuggerCallback import SiddhiDebuggerCallback +from PySiddhi.core.stream.output.StreamCallback import StreamCallback from Tests.Util.AtomicInt import AtomicInt import threading diff --git a/Tests/SiddhiCoreTests/TestOutputStream.py b/Tests/SiddhiCoreTests/TestOutputStream.py index bbc8cde..736ad2f 100644 --- a/Tests/SiddhiCoreTests/TestOutputStream.py +++ b/Tests/SiddhiCoreTests/TestOutputStream.py @@ -23,8 +23,8 @@ from time import sleep from unittest.case import TestCase -from PySiddhi4.core.SiddhiManager import SiddhiManager -from PySiddhi4.core.stream.output.StreamCallback import StreamCallback +from PySiddhi.core.SiddhiManager import SiddhiManager +from PySiddhi.core.stream.output.StreamCallback import StreamCallback from Tests.Util.AtomicInt import AtomicInt diff --git a/__PySiddhi4Proxy/pom.xml b/__PySiddhiProxy/pom.xml similarity index 97% rename from __PySiddhi4Proxy/pom.xml rename to __PySiddhiProxy/pom.xml index 42bd7d1..7d17394 100644 --- a/__PySiddhi4Proxy/pom.xml +++ b/__PySiddhiProxy/pom.xml @@ -22,19 +22,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.wso2.siddhi-python-api - siddhi-python-api-proxy-4 - 1.1.0 + io.siddhi.python.api + siddhi-python-api-proxy + 5.0.0 - org.wso2.siddhi + io.siddhi siddhi-core - 4.3.7 + 5.0.0 - - + platform-windows diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/DataWrapProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/DataWrapProxy.java similarity index 99% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/DataWrapProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/DataWrapProxy.java index 495341d..67706ee 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/DataWrapProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/DataWrapProxy.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.siddhi.pythonapi; +package io.siddhi.pythonapi; import com.sun.org.apache.xpath.internal.operations.Bool; diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/SiddhiAPICoreProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/SiddhiAPICoreProxy.java similarity index 90% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/SiddhiAPICoreProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/SiddhiAPICoreProxy.java index 1ac0d0d..0a3d20a 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/SiddhiAPICoreProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/SiddhiAPICoreProxy.java @@ -17,12 +17,12 @@ */ -package org.wso2.siddhi.pythonapi.proxy.core; +package io.siddhi.pythonapi.proxy.core; -import org.wso2.siddhi.core.SiddhiAppRuntime; -import org.wso2.siddhi.core.SiddhiManager; -import org.wso2.siddhi.pythonapi.proxy.core.query.output.callback.query_callback.QueryCallbackProxy; -import org.wso2.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy; +import io.siddhi.core.SiddhiAppRuntime; +import io.siddhi.core.SiddhiManager; +import io.siddhi.pythonapi.proxy.core.query.output.callback.query_callback.QueryCallbackProxy; +import io.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy; public class SiddhiAPICoreProxy { /** diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger/QueryTerminalProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger/QueryTerminalProxy.java similarity index 89% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger/QueryTerminalProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger/QueryTerminalProxy.java index 80c47ae..30fcd3f 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger/QueryTerminalProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger/QueryTerminalProxy.java @@ -16,12 +16,12 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger; +package io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger; -import org.wso2.siddhi.core.debugger.SiddhiDebugger; +import io.siddhi.core.debugger.SiddhiDebugger; /** - * Proxy on org.wso2.siddhi.core.debugger.SiddhiDebugger.QueryTerminal + * Proxy on io.siddhi.core.debugger.SiddhiDebugger.QueryTerminal */ public class QueryTerminalProxy { public SiddhiDebugger.QueryTerminal IN() { diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/SiddhiDebuggerCallbackProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/SiddhiDebuggerCallbackProxy.java similarity index 69% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/SiddhiDebuggerCallbackProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/SiddhiDebuggerCallbackProxy.java index 30230b0..af84beb 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/SiddhiDebuggerCallbackProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/SiddhiDebuggerCallbackProxy.java @@ -16,20 +16,20 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback; +package io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback; import org.apache.log4j.Logger; -import org.wso2.siddhi.core.debugger.SiddhiDebugger; -import org.wso2.siddhi.core.debugger.SiddhiDebuggerCallback; -import org.wso2.siddhi.core.event.ComplexEvent; -import org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling.EventQueue; -import org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling.QueuedEvent; -import org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy; -import org.wso2.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy; -import org.wso2.siddhi.pythonapi.threadfix.PyThreadFixCaller; +import io.siddhi.core.debugger.SiddhiDebugger; +import io.siddhi.core.debugger.SiddhiDebuggerCallback; +import io.siddhi.core.event.ComplexEvent; +import io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling.EventQueue; +import io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling.QueuedEvent; +import io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy; +import io.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy; +import io.siddhi.pythonapi.threadfix.PyThreadFixCaller; /** - * Proxy on org.wso2.siddhi.core.debugger.SiddhiDebuggerCallback + * Proxy on io.siddhi.core.debugger.SiddhiDebuggerCallback */ public class SiddhiDebuggerCallbackProxy implements SiddhiDebuggerCallback { private static final Logger log = Logger.getLogger(StreamCallbackProxy.class); diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/EventQueue.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/EventQueue.java similarity index 94% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/EventQueue.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/EventQueue.java index ee67bea..6730b16 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/EventQueue.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/EventQueue.java @@ -16,10 +16,10 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling; +package io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling; import org.apache.log4j.Logger; -import org.wso2.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy; +import io.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback.StreamCallbackProxy; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/QueuedEvent.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/QueuedEvent.java similarity index 94% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/QueuedEvent.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/QueuedEvent.java index 971f0d5..b6757ff 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/QueuedEvent.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/debugger/siddhi_debugger_callback/event_polling/QueuedEvent.java @@ -16,12 +16,12 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling; +package io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger_callback.event_polling; import org.apache.log4j.Logger; -import org.wso2.siddhi.core.debugger.SiddhiDebugger; -import org.wso2.siddhi.core.event.ComplexEvent; -import org.wso2.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy; +import io.siddhi.core.debugger.SiddhiDebugger; +import io.siddhi.core.event.ComplexEvent; +import io.siddhi.pythonapi.proxy.core.debugger.siddhi_debugger.QueryTerminalProxy; /** * Event queued in EventQueue diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/complex_event/ComplexEventProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/complex_event/ComplexEventProxy.java similarity index 82% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/complex_event/ComplexEventProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/complex_event/ComplexEventProxy.java index 8fe5244..0e47aac 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/complex_event/ComplexEventProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/complex_event/ComplexEventProxy.java @@ -16,13 +16,13 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.event.complex_event; +package io.siddhi.pythonapi.proxy.core.event.complex_event; -import org.wso2.siddhi.core.event.ComplexEvent; -import org.wso2.siddhi.pythonapi.DataWrapProxy; +import io.siddhi.core.event.ComplexEvent; +import io.siddhi.pythonapi.DataWrapProxy; /** - * Proxy on org.wso2.siddhi.core.event.ComplexEvent + * Proxy on io.siddhi.core.event.ComplexEvent */ public class ComplexEventProxy { public DataWrapProxy[] getOutputData(ComplexEvent target) { diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/complex_event/TypeProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/complex_event/TypeProxy.java similarity index 94% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/complex_event/TypeProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/complex_event/TypeProxy.java index ff902d5..41fba45 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/complex_event/TypeProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/complex_event/TypeProxy.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.event.complex_event; +package io.siddhi.pythonapi.proxy.core.event.complex_event; -import org.wso2.siddhi.core.event.ComplexEvent; +import io.siddhi.core.event.ComplexEvent; /** * Proxy on type of ComplexEvent diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/event/EventProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/event/EventProxy.java similarity index 85% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/event/EventProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/event/EventProxy.java index 92bcfbc..6f65d81 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/event/event/EventProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/event/event/EventProxy.java @@ -16,14 +16,14 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.event.event; +package io.siddhi.pythonapi.proxy.core.event.event; -import org.wso2.siddhi.core.event.ComplexEvent; -import org.wso2.siddhi.core.event.Event; -import org.wso2.siddhi.pythonapi.DataWrapProxy; +import io.siddhi.core.event.ComplexEvent; +import io.siddhi.core.event.Event; +import io.siddhi.pythonapi.DataWrapProxy; /** - * Proxy on org.wso2.siddhi.core.event.Event + * Proxy on io.siddhi.core.event.Event */ public class EventProxy { public Event createEvent(long timeStamp, DataWrapProxy[] data) { diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/QueryCallbackProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/QueryCallbackProxy.java similarity index 82% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/QueryCallbackProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/QueryCallbackProxy.java index e97fa1c..eba2853 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/QueryCallbackProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/QueryCallbackProxy.java @@ -16,15 +16,15 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.query.output.callback.query_callback; +package io.siddhi.pythonapi.proxy.core.query.output.callback.query_callback; import org.apache.log4j.Logger; -import org.wso2.siddhi.core.event.Event; -import org.wso2.siddhi.core.query.output.callback.QueryCallback; -import org.wso2.siddhi.pythonapi.threadfix.PyThreadFixCaller; +import io.siddhi.core.event.Event; +import io.siddhi.core.query.output.callback.QueryCallback; +import io.siddhi.pythonapi.threadfix.PyThreadFixCaller; /** - * Proxy class on org.wso2.siddhi.core.query.output.callback.QueryCallback + * Proxy class on io.siddhi.core.query.output.callback.QueryCallback */ public class QueryCallbackProxy extends QueryCallback { private ReceiveCallbackProxy receiveCallback = null; diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy.java similarity index 78% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy.java index f7c7471..4b1310e 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/query/output/callback/query_callback/ReceiveCallbackProxy.java @@ -16,12 +16,12 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.query.output.callback.query_callback; +package io.siddhi.pythonapi.proxy.core.query.output.callback.query_callback; -import org.wso2.siddhi.core.event.Event; +import io.siddhi.core.event.Event; /** - * Proxy callback on receive method ofz org.wso2.siddhi.core.query.output.callback.QueryCallback + * Proxy callback on receive method of io.siddhi.core.query.output.callback.QueryCallback */ public interface ReceiveCallbackProxy { void receive(long l, Event[] events, Event[] events1); diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/input/input_handler/InputHandlerProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/input/input_handler/InputHandlerProxy.java similarity index 82% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/input/input_handler/InputHandlerProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/input/input_handler/InputHandlerProxy.java index 4aa7d31..4af440d 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/input/input_handler/InputHandlerProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/input/input_handler/InputHandlerProxy.java @@ -16,15 +16,15 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.stream.input.input_handler; +package io.siddhi.pythonapi.proxy.core.stream.input.input_handler; -import org.wso2.siddhi.core.stream.input.InputHandler; -import org.wso2.siddhi.pythonapi.DataWrapProxy; +import io.siddhi.core.stream.input.InputHandler; +import io.siddhi.pythonapi.DataWrapProxy; import java.util.HashMap; /** - * Proxy wrapper on org.wso2.siddhi.core.stream.input.InputHandler + * Proxy wrapper on io.siddhi.core.stream.input.InputHandler */ public class InputHandlerProxy { /** diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy.java similarity index 85% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy.java index 9b953fe..07844db 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/ReceiveCallbackProxy.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback; +package io.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback; -import org.wso2.siddhi.core.event.Event; +import io.siddhi.core.event.Event; public interface ReceiveCallbackProxy { void receive(Event[] events); diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/StreamCallbackProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/StreamCallbackProxy.java similarity index 82% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/StreamCallbackProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/StreamCallbackProxy.java index 62a2f84..3ad9f8d 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/StreamCallbackProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/stream/output/callback/stream_callback/StreamCallbackProxy.java @@ -16,13 +16,13 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback; +package io.siddhi.pythonapi.proxy.core.stream.output.callback.stream_callback; import org.apache.log4j.Logger; -import org.wso2.siddhi.core.event.Event; -import org.wso2.siddhi.core.stream.output.StreamCallback; -import org.wso2.siddhi.pythonapi.threadfix.PyThreadFix; -import org.wso2.siddhi.pythonapi.threadfix.PyThreadFixCaller; +import io.siddhi.core.event.Event; +import io.siddhi.core.stream.output.StreamCallback; +import io.siddhi.pythonapi.threadfix.PyThreadFix; +import io.siddhi.pythonapi.threadfix.PyThreadFixCaller; public class StreamCallbackProxy extends StreamCallback { private ReceiveCallbackProxy receiveCallback = null; diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/util/EventPrinterProxy.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/util/EventPrinterProxy.java similarity index 80% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/util/EventPrinterProxy.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/util/EventPrinterProxy.java index 9846f20..c8b6efe 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/proxy/core/util/EventPrinterProxy.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/proxy/core/util/EventPrinterProxy.java @@ -16,13 +16,13 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.proxy.core.util; +package io.siddhi.pythonapi.proxy.core.util; -import org.wso2.siddhi.core.event.Event; -import org.wso2.siddhi.core.util.EventPrinter; +import io.siddhi.core.event.Event; +import io.siddhi.core.util.EventPrinter; /** - * Proxy class used to interface with org.wso2.siddhi.core.util.EventPrinter + * Proxy class used to interface with io.siddhi.core.util.EventPrinter */ public class EventPrinterProxy { private EventPrinterProxy() { diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/threadfix/PyThreadFix.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/threadfix/PyThreadFix.java similarity index 87% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/threadfix/PyThreadFix.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/threadfix/PyThreadFix.java index 7a07acc..a32bb61 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/threadfix/PyThreadFix.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/threadfix/PyThreadFix.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.threadfix; +package io.siddhi.pythonapi.threadfix; -import org.wso2.siddhi.pythonapi.proxy.core.SiddhiAPICoreProxy; +import io.siddhi.pythonapi.proxy.core.SiddhiAPICoreProxy; public class PyThreadFix { /** @@ -29,7 +29,7 @@ public class PyThreadFix { * The set of Python C API functions required are called in fixThread native method. */ static { - System.loadLibrary("org_wso2_siddhi_pythonapi_threadfix_pythreadfix"); // Load native library at runtime + System.loadLibrary("io_siddhi_pythonapi_threadfix_pythreadfix"); // Load native library at runtime } // The native fixThread method which has necessary C code to fix the threading issue diff --git a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/threadfix/PyThreadFixCaller.java b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/threadfix/PyThreadFixCaller.java similarity index 91% rename from __PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/threadfix/PyThreadFixCaller.java rename to __PySiddhiProxy/src/main/java/io/siddhi/pythonapi/threadfix/PyThreadFixCaller.java index 07537a0..20c4e9a 100644 --- a/__PySiddhi4Proxy/src/main/java/org/wso2/siddhi/pythonapi/threadfix/PyThreadFixCaller.java +++ b/__PySiddhiProxy/src/main/java/io/siddhi/pythonapi/threadfix/PyThreadFixCaller.java @@ -16,9 +16,9 @@ * under the License. */ -package org.wso2.siddhi.pythonapi.threadfix; +package io.siddhi.pythonapi.threadfix; -import org.wso2.siddhi.pythonapi.proxy.core.SiddhiAPICoreProxy; +import io.siddhi.pythonapi.proxy.core.SiddhiAPICoreProxy; /** * A wrapper on ThreadFix Call diff --git a/__PySiddhi4Proxy/src/main/java/org/jnius/NativeInvocationHandler.java b/__PySiddhiProxy/src/main/java/org/jnius/NativeInvocationHandler.java similarity index 100% rename from __PySiddhi4Proxy/src/main/java/org/jnius/NativeInvocationHandler.java rename to __PySiddhiProxy/src/main/java/org/jnius/NativeInvocationHandler.java diff --git a/__PySiddhi4Proxy/src/main/resources/log4j.xml b/__PySiddhiProxy/src/main/resources/log4j.xml similarity index 100% rename from __PySiddhi4Proxy/src/main/resources/log4j.xml rename to __PySiddhiProxy/src/main/resources/log4j.xml diff --git a/__PySiddhi4Proxy/threadfix_c_code/README.MD b/__PySiddhiProxy/threadfix_c_code/README.MD similarity index 55% rename from __PySiddhi4Proxy/threadfix_c_code/README.MD rename to __PySiddhiProxy/threadfix_c_code/README.MD index bd13e07..3a4cff8 100644 --- a/__PySiddhi4Proxy/threadfix_c_code/README.MD +++ b/__PySiddhiProxy/threadfix_c_code/README.MD @@ -1,6 +1,6 @@ threadfix is used in Python 3.4+ to treat a threading related bug introduced in Python 3.4. In Python 3.4+, if a callback is received from a non Python created thread to a Python program, it causes Python Interpreter to fail. -The threadfix_c_code directory contains source code of Native Java Class org.wso2.siddhi.pythonapi.threadfix.PyThreadFix. The above mentioned issue is fixed by the code in method fixThread of Jave Native Class org.wso2.siddhi.pythonapi.threadfix.PyThreadFix. The fixthread method should be called prior to sending callback event from Java to Python in order to avoid the mentioned bug. +The threadfix_c_code directory contains source code of Native Java Class io.siddhi.pythonapi.threadfix.PyThreadFix. The above mentioned issue is fixed by the code in method fixThread of Jave Native Class io.siddhi.pythonapi.threadfix.PyThreadFix. The fixthread method should be called prior to sending callback event from Java to Python in order to avoid the mentioned bug. The above issue does not affect Windows Operating System. Therefore, threadfix code building is skipped in Windows. \ No newline at end of file diff --git a/__PySiddhi4Proxy/threadfix_c_code/build.sh b/__PySiddhiProxy/threadfix_c_code/build.sh similarity index 63% rename from __PySiddhi4Proxy/threadfix_c_code/build.sh rename to __PySiddhiProxy/threadfix_c_code/build.sh index 4ccf910..01f3b34 100755 --- a/__PySiddhi4Proxy/threadfix_c_code/build.sh +++ b/__PySiddhiProxy/threadfix_c_code/build.sh @@ -18,11 +18,11 @@ echo "Compiling C++ Code used for fixing threading issue" echo "Invoking G++ Compiler" if [["$OSTYPE" == "darwin"*]]; then - g++ -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -I "$PYTHONHOME" -shared -fPIC -o liborg_wso2_siddhi_pythonapi_threadfix_pythreadfix.so org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.c + g++ -I "$JAVA_HOME/include" -I "$JAVA_HOME/include/darwin" -I "$PYTHONHOME" -shared -fPIC -o libio_siddhi_pythonapi_threadfix_pythreadfix.so io_siddhi_pythonapi_threadfix_PyThreadFix.c elif [["$OSTYPE" == "linux-gnu"]]; then - g++ -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -I "$PYTHONHOME" -shared -fPIC -o liborg_wso2_siddhi_pythonapi_threadfix_pythreadfix.so org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.c + g++ -I "$JAVA_HOME/include" -I "$JAVA_HOME/include/linux" -I "$PYTHONHOME" -shared -fPIC -o libio_siddhi_pythonapi_threadfix_pythreadfix.so io_siddhi_pythonapi_threadfix_PyThreadFix.c fi echo "Copying output library to ../../../../SiddhiCEP4" -cp liborg_wso2_siddhi_pythonapi_threadfix_pythreadfix.so ../../../liborg_wso2_siddhi_pythonapi_threadfix_pythreadfix.so -echo "All is well!" \ No newline at end of file +cp libio_siddhi_pythonapi_threadfix_pythreadfix.so ../../../libio_siddhi_pythonapi_threadfix_pythreadfix.so +echo "All is well!" diff --git a/__PySiddhi4Proxy/threadfix_c_code/org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.c b/__PySiddhiProxy/threadfix_c_code/io_siddhi_pythonapi_threadfix_PyThreadFix.c similarity index 84% rename from __PySiddhi4Proxy/threadfix_c_code/org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.c rename to __PySiddhiProxy/threadfix_c_code/io_siddhi_pythonapi_threadfix_PyThreadFix.c index 19f9bfd..778f780 100644 --- a/__PySiddhi4Proxy/threadfix_c_code/org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.c +++ b/__PySiddhiProxy/threadfix_c_code/io_siddhi_pythonapi_threadfix_PyThreadFix.c @@ -21,9 +21,9 @@ #include -#include "org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.h" +#include "io_siddhi_pythonapi_threadfix_PyThreadFix.h" -JNIEXPORT void JNICALL Java_org_wso2_siddhi_pythonapi_threadfix_PyThreadFix_fixThread(JNIEnv *env, jobject thisObj) +JNIEXPORT void JNICALL Java_io_siddhi_pythonapi_threadfix_PyThreadFix_fixThread(JNIEnv *env, jobject thisObj) { PyGILState_STATE state; diff --git a/__PySiddhi4Proxy/threadfix_c_code/org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.h b/__PySiddhiProxy/threadfix_c_code/io_siddhi_pythonapi_threadfix_PyThreadFix.h similarity index 70% rename from __PySiddhi4Proxy/threadfix_c_code/org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.h rename to __PySiddhiProxy/threadfix_c_code/io_siddhi_pythonapi_threadfix_PyThreadFix.h index 93e0d57..c1f0e46 100644 --- a/__PySiddhi4Proxy/threadfix_c_code/org_wso2_siddhi_pythonapi_threadfix_PyThreadFix.h +++ b/__PySiddhiProxy/threadfix_c_code/io_siddhi_pythonapi_threadfix_PyThreadFix.h @@ -17,19 +17,19 @@ */ #include -/* Header for class org_wso2_siddhi_pythonapi_threadfix_PyThreadFix */ +/* Header for class io_siddhi_pythonapi_threadfix_PyThreadFix */ -#ifndef _Included_org_wso2_siddhi_pythonapi_threadfix_PyThreadFix -#define _Included_org_wso2_siddhi_pythonapi_threadfix_PyThreadFix +#ifndef _Included_io_siddhi_pythonapi_threadfix_PyThreadFix +#define _Included_io_siddhi_pythonapi_threadfix_PyThreadFix #ifdef __cplusplus extern "C" { #endif /* - * Class: org_wso2_siddhi_pythonapi_threadfix_PyThreadFix + * Class: io_siddhi_pythonapi_threadfix_PyThreadFix * Method: fixThread * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_wso2_siddhi_pythonapi_threadfix_PyThreadFix_fixThread +JNIEXPORT void JNICALL Java_io_siddhi_pythonapi_threadfix_PyThreadFix_fixThread (JNIEnv *, jobject); #ifdef __cplusplus diff --git a/__PySiddhi4Proxy/threadfix_c_code/makefile b/__PySiddhiProxy/threadfix_c_code/makefile similarity index 85% rename from __PySiddhi4Proxy/threadfix_c_code/makefile rename to __PySiddhiProxy/threadfix_c_code/makefile index dc2860a..2115a4a 100644 --- a/__PySiddhi4Proxy/threadfix_c_code/makefile +++ b/__PySiddhiProxy/threadfix_c_code/makefile @@ -16,7 +16,7 @@ # use g++ compiler CC = g++ -CFLAGS = -shared -fPIC -c +CFLAGS = -shared -fPIC # define JAVA_HOME here JAVAHOME = ${JAVA_HOME} @@ -34,15 +34,15 @@ CP = cp #Find include files INCLUDES_LINUX = -I "$(JAVAHOME)/include" -I "$(JAVAHOME)/include/linux" -I "$(LINUX_PYTHON_PATH)" -INCLUDES_MACOS = -I "$(JAVAHOME)/include" -I "$(JAVAHOME)/include/darwin" -I "$(MACOS_PYTHON_PATH)" +INCLUDES_MACOS = -I "$(JAVAHOME)/include" -I "$(JAVAHOME)/include/darwin" -I "$(MACOS_PYTHON_PATH) # build target details -TARGET_SOURCE_NAME = org_wso2_siddhi_pythonapi_threadfix_PyThreadFix -TARGET_OUTPUT_NAME = liborg_wso2_siddhi_pythonapi_threadfix_pythreadfix -TARGET_INSTALL_NAME = liborg_wso2_siddhi_pythonapi_threadfix_pythreadfix +TARGET_SOURCE_NAME = io_siddhi_pythonapi_threadfix_PyThreadFix +TARGET_OUTPUT_NAME = libio_siddhi_pythonapi_threadfix_pythreadfix +TARGET_INSTALL_NAME = libio_siddhi_pythonapi_threadfix_pythreadfix TARGET = threadfix all: install @@ -62,4 +62,4 @@ install: $(TARGET_OUTPUT_NAME).so @echo clean: - $(RM) $(TARGET_OUTPUT_NAME).so \ No newline at end of file + $(RM) $(TARGET_OUTPUT_NAME).so diff --git a/docs/Debugging-Siddhi-Queries.md b/docs/Debugging-Siddhi-Queries.md index e429b9a..eb1c5ab 100644 --- a/docs/Debugging-Siddhi-Queries.md +++ b/docs/Debugging-Siddhi-Queries.md @@ -1,4 +1,4 @@ -# Debug PySiddhi4 +# Debug PySiddhi Siddhi Queries can be debugged at run time via PySiddhi. It suppots following features with its Python APIs. @@ -40,4 +40,4 @@ inputHandler.send(["WSO2", 50.0, 60]) inputHandler.send(["WSO2", 70.0, 40]) ``` -For the complete code on above example and many other examples refer [Siddhi Debugger Tests](https://github.com/wso2/PySiddhi/blob/master/Tests/SiddhiCoreTests/TestDebugger.py). \ No newline at end of file +For the complete code on above example and many other examples refer [Siddhi Debugger Tests](https://github.com/siddhi-io/PySiddhi/blob/master/Tests/SiddhiCoreTests/TestDebugger.py). \ No newline at end of file diff --git a/docs/Event-Simulator-of-SP-4.md b/docs/Event-Simulator-of-SP-4.md index 7d2a389..42505b2 100644 --- a/docs/Event-Simulator-of-SP-4.md +++ b/docs/Event-Simulator-of-SP-4.md @@ -1,6 +1,6 @@ # Event Simulation using PySiddhi Client -Following operations are supported by WSO2 Stream Processor 4 Event Simulator Client of PySiddhi4. +Following operations are supported by WSO2 Stream Processor 4 Event Simulator Client of PySiddhi. * Single Simulations * Saving a simulation configuration @@ -17,7 +17,7 @@ Following operations are supported by WSO2 Stream Processor 4 Event Simulator Cl Refer [Documentation of WSO2 SP 4.0 Event simulator REST API](https://docs.wso2.com/display/SP400/Simulating+Events) for more details. ## Pre-requisites -1. Install _PySiddhi4_ by following [Installation Guide](Installation-Guide). +1. Install _PySiddhi_ by following [Installation Guide](Installation-Guide). 2. WSO2 SP 4.0 must be already installed and running. If not, follow the steps below. - Obtain WSO2 SP 4.x.x binary distribution from https://github.com/wso2/product-sp/releases. - Extract `wso2sp-4.x.x.zip` to a suitable location (say `SP_HOME`). @@ -27,8 +27,8 @@ Refer [Documentation of WSO2 SP 4.0 Event simulator REST API](https://docs.wso2. ### Single Simulations ```python -from PySiddhi4.sp.SPClient import SPClient -from PySiddhi4.sp.EventSimulator.SingleSimulationConfiguration import SingleSimulationConfiguration +from PySiddhi.sp.SPClient import SPClient +from PySiddhi.sp.EventSimulator.SingleSimulationConfiguration import SingleSimulationConfiguration spPythonClient = SPClient('http://localhost:9090') # host URL of SP eventSimulatorClient = spPythonClient.getEventSimulatorClient() @@ -41,10 +41,10 @@ if eventSimulatorClient.simulateSingleEvent(singleSimulationConfiguration, usern ### Saving a Simulation Configuration (Feed Simulation Configuration) ```python -from PySiddhi4.sp.SPClient import SPClient -from PySiddhi4.sp.EventSimulator.AttributeConfiguration import AttributeConfiguration -from PySiddhi4.sp.EventSimulator.FeedSimulationConfiguration import FeedSimulationConfiguration -from PySiddhi4.sp.EventSimulator.SimulationSource import SimulationSource +from PySiddhi.sp.SPClient import SPClient +from PySiddhi.sp.EventSimulator.AttributeConfiguration import AttributeConfiguration +from PySiddhi.sp.EventSimulator.FeedSimulationConfiguration import FeedSimulationConfiguration +from PySiddhi.sp.EventSimulator.SimulationSource import SimulationSource spPythonClient = SPClient('http://localhost:9090') # host URL of SP eventSimulatorClient = spPythonClient.getEventSimulatorClient() @@ -67,4 +67,4 @@ if eventSimulatorClient.saveSimulationFeedConfiguration(svr, username="admin", p print("Successfully Saved Simulation Feed Configuration") ``` -For more examples on Event Simulator, refer [EventSimulatorTests](https://github.com/wso2/PySiddhi/blob/master/Tests/SPTests/EventSimulatorTests.py). \ No newline at end of file +For more examples on Event Simulator, refer [EventSimulatorTests](https://github.com/siddhi-io/PySiddhi/blob/master/Tests/SPTests/EventSimulatorTests.py). \ No newline at end of file diff --git a/docs/Installation-Guide.md b/docs/Installation-Guide.md index f0afae6..d55ba84 100644 --- a/docs/Installation-Guide.md +++ b/docs/Installation-Guide.md @@ -1,9 +1,9 @@ # Installation Guide The current version is tested with Microsoft Windows and Unix/Linux based operating systems. -PySiddhi4 can be installed using one of the following methods. +PySiddhi can be installed using one of the following methods. -## Install PySiddhi4 +## Install PySiddhi ### Prerequisites @@ -37,27 +37,27 @@ PySiddhi4 can be installed using one of the following methods. - Install Visual Studio Build tools _(Only to build from Source)_ - Maven _(Only to build from Source)_ -- Download siddhi-sdk release from [here](https://github.com/wso2/siddhi-sdk/releases) and set the SIDDHISDK_HOME as an environment variable.
`export SIDDHISDK_HOME=""` -- Download siddhi-python-api-proxy-4-1.0.0.jar from [here](https://github.com/wso2/PySiddhi/releases) and copy to `/lib` directory +- Download siddhi-sdk release from [here](https://github.com/siddhi-io/siddhi-sdk/releases) and set the SIDDHISDK_HOME as an environment variable.
`export SIDDHISDK_HOME=""` +- Download siddhi-python-api-proxy-5.0.0.jar from [here](https://github.com/siddhi-io/PySiddhi/releases) and copy to `/lib` directory -###Install PySiddhi4 via Python Package Management +### Install PySiddhi via Python Package Management -PySiddhi4 can be installed via PIP command as bellow. +PySiddhi can be installed via PIP command as bellow. ``` -pip install pysiddhi4 +pip install pysiddhi ``` -### Install PySiddhi4 from Online Code +### Install PySiddhi from Online Code -Using the following PIP command, PySiddhi4 can be directly installed from online code available in GitHub. +Using the following PIP command, PySiddhi can be directly installed from online code available in GitHub. ``` -pip install git+https://github.com/wso2/PySiddhi.git +pip install git+https://github.com/siddhi-io/PySiddhi.git ``` *Note: In case of permission errors, use `sudo`* ### Install from Downloaded Code -Switch to the branch `master` of PySiddhi4. +Switch to the branch `master` of PySiddhi. Navigate to source code root directory and execute the following PIP command. ``` @@ -65,8 +65,8 @@ pip install . ``` *Note the period (.) at end of command. In case of permission errors, use `sudo`* -## Uninstall PySiddhi4 +## Uninstall PySiddhi If the library has been installed as explained above, it could be uninstalled using the following pip command. ``` -pip uninstall pysiddhi4 +pip uninstall pysiddhi ``` diff --git a/docs/Quick-Demo-(SP4).md b/docs/Quick-Demo-(SP4).md index aa3d560..64ae119 100644 --- a/docs/Quick-Demo-(SP4).md +++ b/docs/Quick-Demo-(SP4).md @@ -1,11 +1,11 @@ # Run PySiddhi Client with WSO2 Stream Processor -PySiddhi4 REST Client enable you to manage [WSO2 Stream Processor](https://wso2.com/analytics) using Python. -The detail information on PySiddhi4 client APIs refer: +PySiddhi REST Client enable you to manage [WSO2 Stream Processor](https://wso2.com/analytics) using Python. +The detail information on PySiddhi client APIs refer: * [Client APIs to Manage Siddhi App](Siddhi-App-Management-of-WSO2-SP-4.0) * [Client APIs to Simulate Events](Event-Simulator-WSO2-SP-4.0) -The following steps demonstrate how PySiddhi4 SP Client can manage Siddhi Apps running on WSO2 Stream Processor 4.x.x. +The following steps demonstrate how PySiddhi SP Client can manage Siddhi Apps running on WSO2 Stream Processor 4.x.x. This code retrieves the list of Siddhi Apps published in WSO2SP. **Step 1:** Setup WSO2 Stream Processor @@ -15,7 +15,7 @@ This code retrieves the list of Siddhi Apps published in WSO2SP. **Step 2:** Load Python Imports. ```python -from PySiddhi4.sp.SPClient import SPClient +from PySiddhi.sp.SPClient import SPClient ``` **Step 3:** Connect to WSO2 SP via REST API using the SiddhiApp Management Client. ```python diff --git a/docs/Run-PySiddhi4.md b/docs/Run-PySiddhi.md similarity index 81% rename from docs/Run-PySiddhi4.md rename to docs/Run-PySiddhi.md index b070cf4..4aa8cdf 100644 --- a/docs/Run-PySiddhi4.md +++ b/docs/Run-PySiddhi.md @@ -1,17 +1,17 @@ -# Run PySiddhi4 +# Run PySiddhi -The following is a sample demonstrating how to rung PySiddhi4. +The following is a sample demonstrating how to rung PySiddhi. ## Sample This sample demonstrating how to write a streaming query to detect stock records having volume less than 150. -This code uses Siddhi 4.0 queries with PySiddhi4. +This code uses Siddhi 5.0 queries with PySiddhi. ```python -from PySiddhi4.DataTypes.LongType import LongType -from PySiddhi4.core.SiddhiManager import SiddhiManager -from PySiddhi4.core.query.output.callback.QueryCallback import QueryCallback -from PySiddhi4.core.util.EventPrinter import PrintEvent +from PySiddhi.DataTypes.LongType import LongType +from PySiddhi.core.SiddhiManager import SiddhiManager +from PySiddhi.core.query.output.callback.QueryCallback import QueryCallback +from PySiddhi.core.util.EventPrinter import PrintEvent from time import sleep siddhiManager = SiddhiManager() @@ -54,14 +54,14 @@ Above example is comprehensively described bellow: **Initialize libraries and imports** -Add [this file](https://github.com/wso2/PySiddhi/blob/master/log4j.xml) to working directory in order to enable log4j +Add [this file](https://github.com/siddhi-io/PySiddhi/blob/master/log4j.xml) to working directory in order to enable log4j logging. Log4j is used by PrintEvent to generate output. ```python -from PySiddhi4.DataTypes.LongType import LongType -from PySiddhi4.core.SiddhiManager import SiddhiManager -from PySiddhi4.core.query.output.callback.QueryCallback import QueryCallback -from PySiddhi4.core.util.EventPrinter import PrintEvent +from PySiddhi.DataTypes.LongType import LongType +from PySiddhi.core.SiddhiManager import SiddhiManager +from PySiddhi.core.query.output.callback.QueryCallback import QueryCallback +from PySiddhi.core.util.EventPrinter import PrintEvent from time import sleep ``` @@ -76,7 +76,7 @@ siddhiApp = "define stream cseEventStream (symbol string, price float, volume lo # Generate runtime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp) ``` -For more details on Siddhi Query Language, refer [Siddhi Query Language Guide](https://wso2.github.io/siddhi/documentation/siddhi-4.0/). +For more details on Siddhi Query Language, refer [Siddhi Query Language Guide](https://siddhi-io.github.io/siddhi/documentation/siddhi-4.0/). **Define a listener for filtered events** diff --git a/docs/Siddhi-App-Management-of-WSO2-SP-4.md b/docs/Siddhi-App-Management-of-WSO2-SP-4.md index cf2c84f..a15075f 100644 --- a/docs/Siddhi-App-Management-of-WSO2-SP-4.md +++ b/docs/Siddhi-App-Management-of-WSO2-SP-4.md @@ -1,6 +1,6 @@ # Siddhi App Management using PySiddhi Client -Using _WSO2 SP Client_ in _PySiddhi4_, following operations can be undertaken on _Siddhi App Management_ of _WSO2 SP 4.0_. +Using _WSO2 SP Client_ in _PySiddhi_, following operations can be undertaken on _Siddhi App Management_ of _WSO2 SP 4_. * List all Siddhi Apps. * Retrieve Siddhi App using name. * Retrieve Status of Siddhi App. @@ -9,7 +9,7 @@ Using _WSO2 SP Client_ in _PySiddhi4_, following operations can be undertaken on * Delete a Siddhi App stored in SP. ## Pre-requisites -1. Install _PySiddhi4_ by following [Installation Guide](Installation-Guide.md). +1. Install _PySiddhi_ by following [Installation Guide](Installation-Guide.md). 2. WSO2 SP 4.0 must be already installed and running. If not, follow the steps below. - Obtain WSO2 SP 4.x.x binary distribution from [https://wso2.com/analytics](https://wso2.com/analytics). - Extract `wso2sp-4.x.x.zip` to a suitable location (say `SP_HOME`). @@ -19,7 +19,7 @@ Using _WSO2 SP Client_ in _PySiddhi4_, following operations can be undertaken on ### List all Siddhi Apps ```python -from PySiddhi4.sp.SPClient import SPClient +from PySiddhi.sp.SPClient import SPClient spPythonClient = SPClient('http://localhost:9090') # host URL of SP siddhiAppManagementClient = spPythonClient.getSiddhiAppManagementClient() @@ -28,7 +28,7 @@ print(siddhiAppManagementClient.listSiddhiApps()) # prints a list of siddhi apps ``` ### Retrieve Siddhi App using Name ```python -from PySiddhi4.sp.SPClient import SPClient +from PySiddhi.sp.SPClient import SPClient spPythonClient = SPClient('http://localhost:9090') # host URL of SP siddhiAppManagementClient = spPythonClient.getSiddhiAppManagementClient() @@ -38,7 +38,7 @@ print(app) ### Retrieve Siddhi App Status ```python -from PySiddhi4.sp.SPClient import SPClient +from PySiddhi.sp.SPClient import SPClient spPythonClient = SPClient('http://localhost:9090') # host URL of SP siddhiAppManagementClient = spPythonClient.getSiddhiAppManagementClient() @@ -48,7 +48,7 @@ print (status) # prints status of siddhi app (active) ### Save new Siddhi App ```python -from PySiddhi4.sp.SPClient import SPClient +from PySiddhi.sp.SPClient import SPClient spPythonClient = SPClient('http://localhost:9090') # host URL of SP siddhiAppManagementClient = spPythonClient.getSiddhiAppManagementClient() @@ -64,8 +64,8 @@ if siddhiAppManagementClient.saveSiddhiApp(siddhiApp, username=admin, password=a ``` ### Update a saved Siddhi App ```python -from PySiddhi4.sp.SPClient import SPClient -from PySiddhi4.sp.SiddhiAppManagement.SiddhiAppManagementClient import UpdateAppStatusResponse +from PySiddhi.sp.SPClient import SPClient +from PySiddhi.sp.SiddhiAppManagement.SiddhiAppManagementClient import UpdateAppStatusResponse spPythonClient = SPClient('http://localhost:9090') # Host URL of SP siddhiAppManagementClient = spPythonClient.getSiddhiAppManagementClient() @@ -84,7 +84,7 @@ elif result.name == UpdateAppStatusResponse.updated.name: ``` ### Delete a Siddhi App ```python -from PySiddhi4.sp.SPClient import SPClient +from PySiddhi.sp.SPClient import SPClient spPythonClient = SPClient('http://localhost:9090') # host URL of SP siddhiAppManagementClient = spPythonClient.getSiddhiAppManagementClient() diff --git a/docs/Using-Siddhi-from-Python.md b/docs/Using-Siddhi-from-Python.md index 728de87..78ffc48 100644 --- a/docs/Using-Siddhi-from-Python.md +++ b/docs/Using-Siddhi-from-Python.md @@ -4,28 +4,28 @@ The PySiddhi API is a wrapper on Siddhi Java Library, exposing it's core features to Python. It is important to keep following points in mind when using PySiddhi API. -* __It is a wrapper. Not a port.__ - Whenever you use the PySiddhi API, the [Siddhi Java Library](https://github.com/wso2/siddhi) is loaded in background using Java Virtual Machine. -* __The wrapper is focused on functionality provided by [siddhi-core](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core)__ which is found in package `org.wso2.siddhi.core`. The future versions of API may have the ability to load Siddhi Extensions directly from Java Packages and use them in Siddhi Queries. However, the individual Java classes of extensions will not be wrapped. +* __It is a wrapper. Not a port.__ - Whenever you use the PySiddhi API, the [Siddhi Java Library](https://github.com/siddhi-io/siddhi) is loaded in background using Java Virtual Machine. +* __The wrapper is focused on functionality provided by [siddhi-core](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core)__ which is found in package `io.siddhi.core`. The future versions of API may have the ability to load Siddhi Extensions directly from Java Packages and use them in Siddhi Queries. However, the individual Java classes of extensions will not be wrapped. * __Only the classes that are required for API users are wrapped.__ Classes which are designed to be used by Siddhi Java Library for its internal work will not be wrapped. -* __Python doesn't differentiate _Integer_ from _Long_. But Siddhi do.__ Python 3 does not differentiate _Integer_ and _Long_ Data Types. All Python _Integers_ fed into Siddhi (via _InputHandler_) are converted into Java _Integers_. To feed Java _Long_ to Siddhi (via _InputHandler_), use _[DataTypes.LongType](https://github.com/wso2/PySiddhi/blob/master/PySiddhi4/DataTypes/LongType.py)_. All _Long_ outputs received from Siddhi (via callbacks) will also be converted to _DataTypes.LongType_. +* __Python doesn't differentiate _Integer_ from _Long_. But Siddhi do.__ Python 3 does not differentiate _Integer_ and _Long_ Data Types. All Python _Integers_ fed into Siddhi (via _InputHandler_) are converted into Java _Integers_. To feed Java _Long_ to Siddhi (via _InputHandler_), use _[DataTypes.LongType](https://github.com/siddhi-io/PySiddhi/blob/master/PySiddhi/DataTypes/LongType.py)_. All _Long_ outputs received from Siddhi (via callbacks) will also be converted to _DataTypes.LongType_. - Example: `inputHandler.send(["IBM",700.0,LongType(100)])` * __Clean up everything when you are done.__ Remember to call *shutdown* of *SiddhiManager* and *SiddhiAppRuntime*. # Java Siddhi to PySiddhi Mappings -The PySiddhi wrapper is focused on functionality provided by [siddhi-core](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core). -The classes in Java package `org.wso2.siddhi.core` are mapped to `PySiddhi4.core` using hand written logic. These are not an auto-generated. +The PySiddhi wrapper is focused on functionality provided by [siddhi-core](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core). +The classes in Java package `io.siddhi.core` are mapped to `PySiddhi.core` using hand written logic. These are not an auto-generated. The follow table demonstrates major mappings of PySiddhi. | Java Class | Python Import | | ------------- |---------------------| -| [org.wso2.siddhi.core.SiddhiManager](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/SiddhiManager.java) | ```from PySiddhi4.core.SiddhiManager import SiddhiManager```| -| [org.wso2.siddhi.core.ExecutionPlanRuntime](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/SiddhiAppRuntime.java) | ```from PySiddhi4.core.SiddhiAppRuntime import SiddhiAppRuntime```| -| [org.wso2.siddhi.core.event.Event](https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/event/Event.java)| ```from PySiddhi4.core.event.Event import Event```| -| [org.wso2.siddhi.core.event.ComplexEvent](https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/event/ComplexEvent.java)| ```from PySiddhi4.core.event.ComplexEvent import ComplexEvent```| -| [org.wso2.siddhi.core.stream.input.InputHandler](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/stream/input/InputHandler.java) | ```from PySiddhi4.core.stream.input.InputHandler import InputHandler``` | -| [org.wso2.siddhi.core.stream.output.StreamCallback](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/stream/output/StreamCallback.java) | ```from PySiddhi4.core.stream.output.StreamCallback import StreamCallback```| -|[org.wso2.siddhi.core.query.output.callback.QueryCallback](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/query/output/callback/QueryCallback.java)| ```from PySiddhi4.core.query.output.callback.QueryCallback import QueryCallback``` | -|[org.wso2.siddhi.core.debugger.SiddhiDebugger](https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/debugger/SiddhiDebugger.java)|```from PySiddhi4.core.debugger.SiddhiDebugger import SiddhiDebugger```| -|[org.wso2.siddhi.core.debugger.SiddhiDebuggerCallback](https://github.com/wso2/siddhi/blob/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/debugger/SiddhiDebuggerCallback.java) | ```from PySiddhi4.core.debugger.SiddhiDebuggerCallback import SiddhiDebuggerCallback``` | -|[org.wso2.siddhi.core.util.EventPrinter](https://github.com/wso2/siddhi/tree/master/modules/siddhi-core/src/main/java/org/wso2/siddhi/core/util/EventPrinter.java) | ```import PySiddhi4.core.util.EventPrinter```| \ No newline at end of file +| [io.siddhi.core.SiddhiManager](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core/SiddhiManager.java) | ```from PySiddhi.core.SiddhiManager import SiddhiManager```| +| [io.siddhi.core.ExecutionPlanRuntime](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core/SiddhiAppRuntime.java) | ```from PySiddhi.core.SiddhiAppRuntime import SiddhiAppRuntime```| +| [io.siddhi.core.event.Event](https://github.com/siddhi-io/siddhi/blob/master/modules/siddhi-core/src/main/java/io/siddhi/core/event/Event.java)| ```from PySiddhi.core.event.Event import Event```| +| [io.siddhi.core.event.ComplexEvent](https://github.com/siddhi-io/siddhi/blob/master/modules/siddhi-core/src/main/java/io/siddhi/core/event/ComplexEvent.java)| ```from PySiddhi.core.event.ComplexEvent import ComplexEvent```| +| [io.siddhi.core.stream.input.InputHandler](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core/stream/input/InputHandler.java) | ```from PySiddhi.core.stream.input.InputHandler import InputHandler``` | +| [io.siddhi.core.stream.output.StreamCallback](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core/stream/output/StreamCallback.java) | ```from PySiddhi.core.stream.output.StreamCallback import StreamCallback```| +|[io.siddhi.core.query.output.callback.QueryCallback](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core/query/output/callback/QueryCallback.java)| ```from PySiddhi.core.query.output.callback.QueryCallback import QueryCallback``` | +|[io.siddhi.core.debugger.SiddhiDebugger](https://github.com/siddhi-io/siddhi/blob/master/modules/siddhi-core/src/main/java/io/siddhi/core/debugger/SiddhiDebugger.java)|```from PySiddhi.core.debugger.SiddhiDebugger import SiddhiDebugger```| +|[io.siddhi.core.debugger.SiddhiDebuggerCallback](https://github.com/siddhi-io/siddhi/blob/master/modules/siddhi-core/src/main/java/io/siddhi/core/debugger/SiddhiDebuggerCallback.java) | ```from PySiddhi-3.core.debugger.SiddhiDebuggerCallback import SiddhiDebuggerCallback``` | +|[io.siddhi.core.util.EventPrinter](https://github.com/siddhi-io/siddhi/tree/master/modules/siddhi-core/src/main/java/io/siddhi/core/util/EventPrinter.java) | ```import PySiddhi.core.util.EventPrinter```| \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 7d5eb7c..843c4e8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,18 +1,18 @@ # PySiddhi -***PySiddhi*** is a Python wrapper for [Siddhi](https://wso2.github.io/siddhi/). Which can listens to events from data streams, detects complex conditions +***PySiddhi*** is a Python wrapper for [Siddhi](https://siddhi-io.github.io/siddhi/). Which can listens to events from data streams, detects complex conditions described via a ***Streaming SQL language***, and triggers actions. It performs both ***Stream Processing*** and ***Complex Event Processing*** on streaming data. Its Siddhi core is written in Java library. -- PySiddhi4 wraps [Siddhi 4](https://wso2.github.io/siddhi/) -- PySiddhi4 includes a REST Client for [WSO2 Stream Processor(SP) 4.x.x](https://wso2.com/analytics). +- PySiddhi wraps [Siddhi 5](https://siddhi-io.github.io/siddhi/) +- PySiddhi includes a REST Client for [WSO2 Stream Processor(SP) 4.x.x](https://wso2.com/analytics). ## Content * Introduction and Quick Demo (this page) * [Installation Guide](Installation-Guide.md) -* [Run PySiddhi4](Run-PySiddhi4.md) -* [Debug PySiddhi4](Debugging-Siddhi-Queries.md) +* [Run PySiddhi](Run-PySiddhi.md) +* [Debug PySiddhi](Debugging-Siddhi-Queries.md) * [Advanced Concepts of PySiddhi](Using-Siddhi-from-Python.md) * Using PySiddhi REST Client to Manage WSO2 Stream Processor * [Demo Managing Siddhi Apps on WSO2 SP](Quick-Demo-(SP4).md) @@ -21,16 +21,16 @@ described via a ***Streaming SQL language***, and triggers actions. It performs ## Installation -PySiddhi4 can be installed using pip. +PySiddhi can be installed using pip. ``` -pip install pysiddhi4 +pip install pysiddhi ``` For detail insulation and prerequisite refer section on [Installation Guide](Installation-Guide). ## Quick Demo -Following is a quick demo of how to use PySiddhi4. For comprehensive demo please refer [Quick-Demo-PySiddhi4](Run-PySiddhi4.md) +Following is a quick demo of how to use PySiddhi. For comprehensive demo please refer [Quick-Demo-PySiddhi](Run-PySiddhi.md) **Step 1** - Define filter using Siddhi Query. @@ -46,7 +46,7 @@ siddhiApp = "define stream cseEventStream (symbol string, price float, volume lo # Generate runtime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp) ``` -For more details on Siddhi Query Language, refer [Siddhi Query Language Guide](https://wso2.github.io/siddhi/). +For more details on Siddhi Query Language, refer [Siddhi Query Language Guide](https://siddhi-io.github.io/siddhi/). **Step 2** - Define a listener for filtered events. @@ -101,14 +101,14 @@ Email: madhawavidanapathirana@gmail.com
Organization: University of Moratuwa, Sri Lanka. ## How to Contribute -* Report issues at GitHub Issue Tracker. -* Feel free to try out the PySiddhi source code and send your contributions as pull requests to the master branch. +* Report issues at GitHub Issue Tracker. +* Feel free to try out the PySiddhi source code and send your contributions as pull requests to the master branch. ## Contact us * Post your questions with the "Siddhi" tag in Stackoverflow. * For more details and support contact us via http://wso2.com/support/ ## Support -* We are committed to ensuring support for [Siddhi](https://wso2.github.io/siddhi/) (with its extensions) and WSO2 Stream Processor from development to production. +* We are committed to ensuring support for [Siddhi](https://siddhi-io.github.io/siddhi/) (with its extensions) and WSO2 Stream Processor from development to production. * Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology. * For more details and to take advantage of this unique opportunity, contact us via http://wso2.com/support/. diff --git a/mkdocs.yml b/mkdocs.yml index 1089e56..aa29fce 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,11 +1,11 @@ site_name: PySiddhi site_description: Python Stream Processing and Complex Event Processing Engine site_author: WSO2 -site_url: https://wso2.github.io/PySiddhi/ +site_url: https://siddhi-io.github.io/PySiddhi/ extra_css: - stylesheets/extra.css repo_name: PySiddhi -repo_url: https://github.com/wso2/PySiddhi +repo_url: https://github.com/siddhi-io/PySiddhi copyright: Copyright © 2011 - 2018 WSO2 theme: logo: images/siddhi-logo-w.svg @@ -22,8 +22,8 @@ pages: - Welcome to PySiddhi: index.md - License: license.md - Installation Guide: Installation-Guide.md - - Run PySiddhi4: Run-PySiddhi4.md - - Debug PySiddhi4: Debugging-Siddhi-Queries.md + - Run PySiddhi: Run-PySiddhi.md + - Debug PySiddhi: Debugging-Siddhi-Queries.md - Advanced Concepts of PySiddhi: Using-Siddhi-from-Python.md - PySiddhi Client for WSO2 Stream Processor: - Run PySiddhi Client: Quick-Demo-(SP4).md diff --git a/setup.py b/setup.py index f9ce644..e5124ca 100644 --- a/setup.py +++ b/setup.py @@ -26,10 +26,10 @@ class PostInstallCommand(install): def run(self): # Compile JAVA Code here if os.name == "nt": - check_call("mvn clean install".split(), cwd="__PySiddhi4Proxy", + check_call("mvn clean install".split(), cwd="__PySiddhiProxy", shell=True) # shell=True is necessary for windows else: - check_call("mvn clean install".split(), cwd="__PySiddhi4Proxy") # shell=True should be skipped for linux + check_call("mvn clean install".split(), cwd="__PySiddhiProxy") # shell=True should be skipped for linux install.run(self) @@ -42,26 +42,26 @@ def run(self): filtered_packages.append(package) setup( - name="PySiddhi4", - version="1.1.0", + name="PySiddhi", + version="5.0.0", packages=filtered_packages, - python_requires='>=2.7, ~=3.5', + python_requires='>=2.7, ~=3.7', install_requires=["requests","pyjnius", "future", "enum34 ; python_version<'4'"], package_data={ - "PySiddhi4": ["../__PySiddhi4Proxy/target/lib/*.jar", - "../__PySiddhi4Proxy/target/*.jar", - "../__PySiddhi4Proxy/*.so"] + "PySiddhi": ["../__PySiddhiProxy/target/lib/*.jar", + "../__PySiddhiProxy/target/*.jar", + "../__PySiddhiProxy/*.so"] }, # metadata for upload to PyPI author="WSO2", author_email="dev@wso2.org", - description="Python wrapper for `Siddhi 4.x.x`.", + description="Python wrapper for `Siddhi 5.x.x`.", license="Apache2", cmdclass={ 'install': PostInstallCommand, }, - url="https://github.com/wso2/PySiddhi", + url="https://github.com/siddhi-io/PySiddhi", classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers',