Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
opcua.server.history_sql.HistorySQLite Class Reference
Inheritance diagram for opcua.server.history_sql.HistorySQLite:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def new_historized_event
def new_historized_node
def read_event_history
def read_node_history
def save_event
def save_node_value
def stop

Public Attributes

 logger

Private Member Functions

def _format_event
def _get_event_columns
def _get_event_fields
def _get_select_clauses
def _get_table_name

Static Private Member Functions

def _get_bounds
def _list_to_sql_str

Private Attributes

 _conn
 _datachanges_period
 _db_file
 _event_fields
 _lock

Detailed Description

history backend which stores data values and object events in a SQLite database
this backend is intended to only be accessed via OPC UA, therefore all UA Variants saved in
the history database are in binary format (SQLite BLOBs)
note that PARSE_DECLTYPES is active so certain data types (such as datetime) will not be BLOBs

Definition at line 13 of file history_sql.py.


Constructor & Destructor Documentation

def opcua.server.history_sql.HistorySQLite.__init__ (   self,
  path = "history.db" 
)

Definition at line 21 of file history_sql.py.


Member Function Documentation

def opcua.server.history_sql.HistorySQLite._format_event (   self,
  event 
) [private]
Convert an event object triggered by the subscription into ordered lists for the SQL insert string

Args:
    event: The event returned by the subscription

Returns: List of event fields (SQL column names), List of '?' placeholders, Tuple of variant binaries

Definition at line 283 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite._get_bounds (   start,
  end,
  nb_values 
) [static, private]

Definition at line 258 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite._get_event_columns (   self,
  ev_fields 
) [private]

Definition at line 309 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite._get_event_fields (   self,
  evtypes 
) [private]
Get all fields from the event types that are to be historized
Args:
    evtypes: List of event type nodes

Returns: List of fields for all event types

Definition at line 238 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite._get_select_clauses (   self,
  source_id,
  evfilter 
) [private]

Definition at line 315 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite._get_table_name (   self,
  node_id 
) [private]

Definition at line 235 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite._list_to_sql_str (   ls,
  quotes = True 
) [static, private]

Definition at line 333 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite.new_historized_event (   self,
  source_id,
  evtypes,
  period,
  count = 0 
)
Called when historization of events is enabled on server side
Returns None

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 135 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite.new_historized_node (   self,
  node_id,
  period,
  count = 0 
)
Called when a new node is to be historized
Returns None

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 30 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite.read_event_history (   self,
  source_id,
  start,
  end,
  nb_values,
  evfilter 
)
Called when a client make a history read request for events
Start time and end time are inclusive
Returns a list of Events and a continuation point which
is None if all events are read or the ServerTimeStamp of the last rejected event

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 196 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite.read_node_history (   self,
  node_id,
  start,
  end,
  nb_values 
)
Called when a client make a history read request for a node
if start or end is missing then nb_values is used to limit query
nb_values is the max number of values to read. Ignored if 0
Start time and end time are inclusive
Returns a list of DataValues and a continuation point which
is None if all nodes are read or the ServerTimeStamp of the last rejected DataValue

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 100 of file history_sql.py.

Called when a new event has been generated ans should be saved in history
Returns None

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 161 of file history_sql.py.

def opcua.server.history_sql.HistorySQLite.save_node_value (   self,
  node_id,
  datavalue 
)
Called when the value of a historized node has changed and should be saved in history
Returns None

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 54 of file history_sql.py.

Called when the server shuts down
Can be used to close database connections etc.

Reimplemented from opcua.server.history.HistoryStorageInterface.

Definition at line 342 of file history_sql.py.


Member Data Documentation

Definition at line 21 of file history_sql.py.

Definition at line 21 of file history_sql.py.

Definition at line 21 of file history_sql.py.

Definition at line 21 of file history_sql.py.

Definition at line 21 of file history_sql.py.

Definition at line 21 of file history_sql.py.


The documentation for this class was generated from the following file:


ros_opcua_impl_python_opcua
Author(s): Denis Štogl , Daniel Draper
autogenerated on Sat Jun 8 2019 18:26:24