Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dispatchEvent(self, event):
if self.services.has_key("adminws"):
self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-netstat", event)
class PgRemoter(DbRemoter):
"""
Implements remoting of PostgreSQL stored procedures.
"""
SERVICENAME = "PostgreSQL Remoter"
LOGID = "PgRemoter"
REMOTERID = "pg"
REMOTE_ID_BASEURI = URI_PGREMOTE
REMOTER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-pgremoter-statechange"
STATS_EVENT_URI = URI_EVENT + "on-pgremoterstat"
def recache(self, txn):
"""
Recache PostgreSQL database remotes.
Recaching is triggered from the following classes:
- PgRemotes
- PgConnects
- AppCreds
"""
log.msg("PgRemoter.recache")
txn.execute("""
SELECT
def dispatchEvent(self, event):
if self.services.has_key("adminws"):
self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-netstat", event)
and RPC forwarding for Ext.Direct.
TODO: Cookies!
"""
USER_AGENT = "crossbar.io"
"""
User agent provided in HTTP header for requests issued.
"""
SERVICENAME = "Ext.Direct Remoter"
REMOTE_ID_BASEURI = URI_EXTDIRECTREMOTE
REMOTER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-extdirectremoter-statechange"
STATS_EVENT_URI = URI_EVENT + "on-extdirectremoterstat"
def startService(self):
Remoter.startService(self)
## HTTP connection pools indexed by Ext.Direct Remote ID.
## Note that we usually do NOT want to recreate those on mere recaches
## since that would unnecessarily drop all currently kept alive connections.
self.httppools = {}
## immedialy cache
self.dbpool.runInteraction(self.recache)
def recache(self, txn):
"""
class PgPusher(DbPusher):
"""
PostgreSQL Pusher Service.
For each PostgreSQL Connect with >0 push rules, spawn 1 background pusher thread.
"""
SERVICENAME = "PostgreSQL Pusher"
LOGID = "PgPusher"
CONNECT_ID_BASEURI = URI_PGCONNECT
PUSHER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-pgpusher-statechange"
STATS_EVENT_URI = URI_EVENT + "on-pgpusherstat"
def makeConnect(self, r):
## called from DbPusher base class to create database connect instances
return PgConnect(r[0], r[1], r[2], r[3], r[4], r[5], r[6])
def makeRule(self, r):
## called from DbPusher base class to create push rule instances
return PgPushRule(r[0], r[1], r[2], r[3], r[4])
def makeClient(self, connect):
## called from DbPusher base class to create background push client instances
return PgPushClient(self, connect, False)
def recache(self, txn):
log.msg("PgPusher.recache")
class HanaPusher(DbPusher):
"""
SAP HANA Pusher Service.
For each SAP HANA Connect with >0 push rules, spawn 1 background pusher thread.
"""
SERVICENAME = "SAP HANA Pusher"
LOGID = "HanaPusher"
CONNECT_ID_BASEURI = URI_HANACONNECT
PUSHER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-hanapusher-statechange"
STATS_EVENT_URI = URI_EVENT + "on-hanapusherstat"
def makeConnect(self, r):
## called from DbPusher base class to create database connect instances
return HanaConnect(r[0], r[1], r[2], r[3], r[4], r[5], r[6])
def makeRule(self, r):
## called from DbPusher base class to create push rule instances
return HanaPushRule(r[0], r[1], r[2], r[3], r[4])
def makeClient(self, connect):
## called from DbPusher base class to create background push client instances
return HanaPushClient(self, connect, False)
def recache(self, txn):
log.msg("HanaPusher.recache")
def publishStats(self):
if self.statsChanged:
self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-restpusherstat", [self.stats])
self.statsChanged = False
self.reactor.callLater(0.2, self.publishStats)
def dispatchEvent(self, event):
if self.services.has_key("adminws"):
self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-vmstat", event)
def dispatchEvent(self, event):
if self.services.has_key("adminws"):
self.services["adminws"].dispatchAdminEvent(URI_EVENT + "on-vmstat", event)
Provides a model cache for REST remotes and actual RPC forwarding for REST.
TODO: Cookies!
"""
USER_AGENT = "crossbar.io"
"""
User agent provided in HTTP header for requests issued.
"""
SERVICENAME = "REST Remoter"
REMOTE_ID_BASEURI = URI_RESTREMOTE
REMOTER_STATE_CHANGE_EVENT_URI = URI_EVENT + "on-restremoter-statechange"
STATS_EVENT_URI = URI_EVENT + "on-restremoterstat"
def startService(self):
Remoter.startService(self)
## HTTP connection pools indexed by Ext.Direct Remote ID.
## Note that we usually do NOT want to recreate those on mere recaches
## since that would unnecessarily drop all currently kept alive connections.
self.httppools = {}
## immediately cache
self.dbpool.runInteraction(self.recache)
def recache(self, txn):
"""