Exemplo n.º 1
0
# -*- coding: utf8 -*-
'''
 Python SSAP API
 Version 1.5
 
 © Indra Sistemas, S.A.
 2014  SPAIN
  
 All rights reserved
'''
from ssap.utils.enums import enum
from inspect import getargspec
from ssap.exceptions import InvalidSSAPCallback

SSAP_MESSAGE_TYPE = enum("JOIN", "LEAVE", "INSERT", "UPDATE", "DELETE", "QUERY", "SUBSCRIBE", "UNSUBSCRIBE", "INDICATION", "CONFIG", "BULK")

SSAP_QUERY_TYPE = enum("SQLLIKE", "NATIVE", "SIB_DEFINED", "CEP", "HDB", "CDB")

SSAP_MESSAGE_DIRECTION = enum("REQUEST", "RESPONSE", "ERROR")

SSAP_ERROR_CODE = enum("AUTHENTICATION", "AUTHORIZATION", "PROCESSOR", "PERSISTENCE", "PARSE_SQL", "ONTOLOGY_NOT_FOUND",
    "SIB_DEFINED_QUERY_NOT_FOUND", "OTHER")

class BasicSSAPCallback(object):
    '''
    The simplest SSAP callback. It defines an unique handler for all the incoming SSAP messages.
    '''
    
    def onSSAPMessageReceived(self, message):
        '''
        This method will be invoked when a SSAP message is received.
Exemplo n.º 2
0
  
 All rights reserved
'''

from __future__ import print_function
from ssap.core import SSAPEndpoint, SSAP_MESSAGE_TYPE, SSAP_QUERY_TYPE
from ssap.messages.messages import _SSAPMessageFactory, _SSAPMessageParser
from ws4py.client.threadedclient import WebSocketClient
from ssap.utils.logs import LogFactory
from ssap.utils.datastructures import GenericThreadSafeList
from ssap.exceptions import InvalidSSAPOperation, SSAPConnectionError
from ssap.utils.enums import enum
import logging
from time import sleep

_CONNECTION_STATUS = enum("OPENED", "CLOSED")

class WebsocketConnectionData(object):
    '''
    These objects store the configuration data of a websocket-based connection.
    '''
    def __init__(self, server_url):
        '''
        Stores the websocket server URL in the configuration object.
        '''
        self.__server_url = server_url
    
    def getServerUrl(self):
        '''
        Returns the websocket server URL.
        '''
Exemplo n.º 3
0
  
 All rights reserved
'''

from __future__ import print_function
from ssap.core import SSAPEndpoint, SSAP_MESSAGE_TYPE, SSAP_QUERY_TYPE
from ssap.messages.messages import _SSAPMessageFactory, _SSAPMessageParser
from ws4py.client.threadedclient import WebSocketClient
from ssap.utils.logs import LogFactory
from ssap.utils.datastructures import GenericThreadSafeList
from ssap.exceptions import InvalidSSAPOperation, SSAPConnectionError
from ssap.utils.enums import enum
import logging
from time import sleep

_CONNECTION_STATUS = enum("OPENED", "CLOSED")

class WebsocketConnectionData(object):
    '''
    These objects store the configuration data of a websocket-based connection.
    '''
    def __init__(self, server_url):
        '''
        Stores the websocket server URL in the configuration object.
        '''
        self.__server_url = server_url
    
    def getServerUrl(self):
        '''
        Returns the websocket server URL.
        '''