1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
use std::{
result::Result,
sync::{Arc, RwLock},
};
use opcua_types::*;
use opcua_types::status_code::StatusCode;
use crate::address_space::AddressSpace;
pub struct HistoryServerCapabilities {
pub access_history_data: bool,
pub access_history_events: bool,
pub max_return_data: u32,
pub max_return_events: u32,
pub insert_data: bool,
pub replace_data: bool,
pub update_data: bool,
pub delete_raw: bool,
pub delete_at_time: bool,
pub insert_event: bool,
pub replace_event: bool,
pub update_event: bool,
pub delete_event: bool,
pub insert_annotation: bool,
}
pub trait HistoricalEventProvider {
fn read_event_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: ReadEventDetails, _timestamps_to_return: TimestampsToReturn, _release_continuation_points: bool, _nodes_to_read: &[HistoryReadValueId]) -> Result<Vec<HistoryReadResult>, StatusCode> {
info!("Unimplemented read_event_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn update_event_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: UpdateEventDetails) -> Result<Vec<StatusCode>, StatusCode> {
info!("Unimplemented update_event_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn delete_event_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: DeleteEventDetails) -> Result<Vec<StatusCode>, StatusCode> {
info!("Unimplemented delete_event_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
}
pub enum HistoryRawData {
HistoryData(HistoryData),
HistoryModifiedData(HistoryModifiedData),
}
pub trait HistoricalDataProvider {
fn read_raw_modified_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: ReadRawModifiedDetails, _timestamps_to_return: TimestampsToReturn, _release_continuation_points: bool, _nodes_to_read: &[HistoryReadValueId]) -> Result<Vec<HistoryReadResult>, StatusCode> {
info!("Unimplemented read_raw_modified_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn read_processed_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: ReadProcessedDetails, _timestamps_to_return: TimestampsToReturn, _release_continuation_points: bool, _nodes_to_read: &[HistoryReadValueId]) -> Result<Vec<HistoryReadResult>, StatusCode> {
info!("Unimplemented read_processed_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn read_at_time_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: ReadAtTimeDetails, _timestamps_to_return: TimestampsToReturn, _release_continuation_points: bool, _nodes_to_read: &[HistoryReadValueId]) -> Result<Vec<HistoryReadResult>, StatusCode> {
info!("Unimplemented read_at_time_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn update_data_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: UpdateDataDetails) -> Result<Vec<StatusCode>, StatusCode> {
info!("Unimplemented update_data_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn update_structure_data_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: UpdateStructureDataDetails) -> Result<Vec<StatusCode>, StatusCode> {
info!("Unimplemented update_structure_data_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn delete_raw_modified_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: DeleteRawModifiedDetails) -> Result<Vec<StatusCode>, StatusCode> {
info!("Unimplemented delete_raw_modified_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
fn delete_at_time_details(&self, _address_space: Arc<RwLock<AddressSpace>>, _request: DeleteAtTimeDetails) -> Result<Vec<StatusCode>, StatusCode> {
info!("Unimplemented delete_at_time_details");
Err(StatusCode::BadHistoryOperationUnsupported)
}
}