com.prosysopc.ua.server
Class HistoryManagerAdapter

java.lang.Object
  extended by com.prosysopc.ua.server.HistoryManagerAdapter
All Implemented Interfaces:
HistoryManagerListener

public class HistoryManagerAdapter
extends Object
implements HistoryManagerListener

A default, empty implementation of the HistoryManagerListener. You can use the adapter to enable more flexible implementation of the interface in your applications. Instead of implementing all methods of the interface, you can just override the methods that you wish to react to.

See Also:
HistoryManagerListener

Constructor Summary
HistoryManagerAdapter()
           
 
Method Summary
 Object onBeginHistoryRead(ServiceContext serviceContext, org.opcfoundation.ua.core.HistoryReadDetails details, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[] nodesToRead, HistoryContinuationPoint[] continuationPoints, HistoryResult[] results)
          Called to notify that a HistoryRead is beginning.
 Object onBeginHistoryUpdate(ServiceContext serviceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[] details, org.opcfoundation.ua.core.HistoryUpdateResult[] results, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnosticInfos)
          Called to notify that a HistoryUpdate is beginning.
 void onDeleteAtTimes(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.DateTime[] reqTimes, org.opcfoundation.ua.builtintypes.StatusCode[] operationResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
          Handle a single historyUpdate operation, which is using DeleteAtTimesDetails.
 void onDeleteEvents(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.ByteString[] eventIds, org.opcfoundation.ua.builtintypes.StatusCode[] operationResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
          Notification of a single historyUpdate operation, which is using DeleteEventDetails.
 void onDeleteModified(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime)
          Handle a single historyUpdate operation, which is using DeleteRawModifiedDetails and has the isModified set to true.
 void onDeleteRaw(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime)
          Handle a single historyUpdate operation, which is using DeleteRawModifiedDetails and has the isModified set to false.
 void onEndHistoryRead(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.HistoryReadDetails details, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[] nodesToRead, HistoryContinuationPoint[] continuationPoints, HistoryResult[] results)
          Called to notify the end of a HistoryRead.
 void onEndHistoryUpdate(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.HistoryUpdateDetails[] details, org.opcfoundation.ua.core.HistoryUpdateResult[] results, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnosticInfos)
          Called to notify the end of a HistoryRead.
 Object onReadAtTimes(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, Object continuationPoint, org.opcfoundation.ua.builtintypes.DateTime[] reqTimes, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.HistoryData historyData)
          Handle a single historyRead operation, which is using ReadAtTimeDetails.
 Object onReadEvents(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, Object userContinuationPoint, org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime, org.opcfoundation.ua.builtintypes.UnsignedInteger numValuesPerNode, org.opcfoundation.ua.core.EventFilter filter, org.opcfoundation.ua.core.HistoryEvent historyEvent)
          Handle a single historyRead operation, which is using ReadEventDetails The request us used to read Events from the event history for the specified time domain for one or more event nodes.
 Object onReadModified(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, Object userContinuationPoint, org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime, org.opcfoundation.ua.builtintypes.UnsignedInteger numValuesPerNode, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.HistoryModifiedData historyData)
          Handle a single historyRead operation, which is using ReadRawModifiedDetails and has the isModified set to true.
 Object onReadProcessed(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, Object userContinuationPoint, org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime, Double resampleInterval, org.opcfoundation.ua.builtintypes.NodeId aggregateType, org.opcfoundation.ua.core.AggregateConfiguration aggregateConfiguration, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.HistoryData historyData)
          Handle a single historyRead operation, which is using ReadProcessedDetails The server should return Aggregate values from the node history matching the requested timestamps.
 Object onReadRaw(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, Object userContinuationPoint, org.opcfoundation.ua.builtintypes.DateTime startTime, org.opcfoundation.ua.builtintypes.DateTime endTime, org.opcfoundation.ua.builtintypes.UnsignedInteger numValuesPerNode, Boolean returnBounds, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.HistoryData historyData)
          Handle a single historyRead operation, which is using ReadRawModifiedDetails and has the isModified set to true.
 void onUpdateData(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.DataValue[] updateValues, org.opcfoundation.ua.core.PerformUpdateType performInsertReplace, org.opcfoundation.ua.builtintypes.StatusCode[] operationResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
          Handle a single historyUpdate operation, which is using UpdateDataDetails.
 void onUpdateEvent(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.Variant[] eventFields, org.opcfoundation.ua.core.EventFilter filter, org.opcfoundation.ua.core.PerformUpdateType performInsertReplace, org.opcfoundation.ua.builtintypes.StatusCode[] operationResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
          Handle a single historyUpdate operation, which is using UpdateEventDetails.
 void onUpdateStructureData(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node, org.opcfoundation.ua.builtintypes.DataValue[] updateValues, org.opcfoundation.ua.core.PerformUpdateType performUpdateType, org.opcfoundation.ua.builtintypes.StatusCode[] operationResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
          Handle a single historyUpdate operation, which is using UpdateStructureDataDetails.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryManagerAdapter

public HistoryManagerAdapter()
Method Detail

onBeginHistoryRead

public Object onBeginHistoryRead(ServiceContext serviceContext,
                                 org.opcfoundation.ua.core.HistoryReadDetails details,
                                 org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                                 org.opcfoundation.ua.core.HistoryReadValueId[] nodesToRead,
                                 HistoryContinuationPoint[] continuationPoints,
                                 HistoryResult[] results)
                          throws ServiceException
Description copied from interface: HistoryManagerListener
Called to notify that a HistoryRead is beginning. You can prepare a operationContext corresponding to the specified nodesToRead. The results are typically handled in the various historyRead handlers. Alternatively, you may define all the results here.

If you return a result object, it will be provided in #endHistoryRead, where you can dispose it.

Specified by:
onBeginHistoryRead in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
details - the history read details, which in practice is one of the actual sub types, such as ReadRawModifiedDetails. Should be ignored for nodes that have a continuationPoint, instead the details from the continuationPoint should be used.
timestampsToReturn - defines whether Server, Source or Both time stamps should be returned with every value. Neither is not a valid value (checked already before calling the method). Should be ignored for nodes that have a continuationPoint, instead the timestampsToReturn from the continuationPoint should be used.
nodesToRead - the nodes to be read. Note: The call may contain read requests for several node managers, so if you handle the nodes here, check the namespace of the requested items.
continuationPoints - the continuation points corresponding to the requests. If the continuation points are defined, they should override the details and timestampsToReturn for those nodes. It also contains the user continuation point that was returned for the previous call. Data handling is expected to continue from the continuation point instead of the beginning of the requested history data. The new continuation point should be returned in results, if necessary.
results - the array of results, which you may fill in here or later in the specific read methods. #historyRead will not be called for the nodes for which you provide a result here.
Returns:
a handle to your operationContext object. Return null, if you do not need to refer to the operationContext later on.
Throws:
ServiceException - if you need to return a service call error
See Also:
HistoryManagerListener.onEndHistoryRead(com.prosysopc.ua.server.ServiceContext, java.lang.Object, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[]), HistoryManagerListener.onReadRaw(com.prosysopc.ua.server.ServiceContext, java.lang.Object, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.builtintypes.NodeId, com.prosysopc.ua.nodes.UaNode, java.lang.Object, org.opcfoundation.ua.builtintypes.DateTime, org.opcfoundation.ua.builtintypes.DateTime, org.opcfoundation.ua.builtintypes.UnsignedInteger, java.lang.Boolean, org.opcfoundation.ua.utils.NumericRange, org.opcfoundation.ua.core.HistoryData)

onBeginHistoryUpdate

public Object onBeginHistoryUpdate(ServiceContext serviceContext,
                                   org.opcfoundation.ua.core.HistoryUpdateDetails[] details,
                                   org.opcfoundation.ua.core.HistoryUpdateResult[] results,
                                   org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnosticInfos)
                            throws ServiceException
Description copied from interface: HistoryManagerListener
Called to notify that a HistoryUpdate is beginning. You can prepare, for example, an operationContext corresponding to the specified details. The results are typically handled in the various historyUpdate handlers. Alternatively, you may define all the results here.

If you return a result object, it will be provided in #endHistoryUpdate, where you can dispose it.

Specified by:
onBeginHistoryUpdate in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
details - the history update details, which in practice is one of the actual subtypes, such as DeleteAtTimeDetails
results - and array of results: if you fill the values here, the specific historyRead methods will not be called
diagnosticInfos - possible error diagnostics
Returns:
a handle to your operationContext or some other reference object that you can use later in historyRead and endHistoryRead. Return null, if you do not need to refer to it later on.
Throws:
ServiceException - if you need to return a service call error

onDeleteAtTimes

public void onDeleteAtTimes(ServiceContext serviceContext,
                            Object operationContext,
                            org.opcfoundation.ua.builtintypes.NodeId nodeId,
                            UaNode node,
                            org.opcfoundation.ua.builtintypes.DateTime[] reqTimes,
                            org.opcfoundation.ua.builtintypes.StatusCode[] operationResults,
                            org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
                     throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyUpdate operation, which is using DeleteAtTimesDetails. The request is made to delete samples from the history. the samples to delete are specified with a list of exact timestamps, corresponding to the values to be deleted.

Specified by:
onDeleteAtTimes in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
reqTimes - the specific timestamps for which values are to be deleted
operationResults - list of StatusCodes for the operations to be performed on a Node. The size and order of the list matches the size and order of reqTimes element being reported by this updateResults entry.
operationDiagnostics - list of diagnostic information for the operations to be performed on a Node. Note that the list is null, if no diagnostics was requested.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onDeleteEvents

public void onDeleteEvents(ServiceContext serviceContext,
                           Object operationContext,
                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                           UaNode node,
                           org.opcfoundation.ua.builtintypes.ByteString[] eventIds,
                           org.opcfoundation.ua.builtintypes.StatusCode[] operationResults,
                           org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
                    throws StatusException
Description copied from interface: HistoryManagerListener
Notification of a single historyUpdate operation, which is using DeleteEventDetails. The request is made to delete events from the event history. The events to delete are specified with a list of exact eventIds.

Specified by:
onDeleteEvents in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
eventIds - the specific eventIds for which events are to be deleted
operationResults - list of StatusCodes for the operations to be performed on a Node. The size and order of the list matches the size and order of reqTimes element being reported by this updateResults entry.
operationDiagnostics - list of diagnostic information for the operations to be performed on a Node. Note that the list is null, if no diagnostics was requested.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onDeleteModified

public void onDeleteModified(ServiceContext serviceContext,
                             Object operationContext,
                             org.opcfoundation.ua.builtintypes.NodeId nodeId,
                             UaNode node,
                             org.opcfoundation.ua.builtintypes.DateTime startTime,
                             org.opcfoundation.ua.builtintypes.DateTime endTime)
                      throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyUpdate operation, which is using DeleteRawModifiedDetails and has the isModified set to true. The request is made to delete Modified samples from the history. The samples to delete are specified with an interval of time, corresponding to the values to be deleted.

Both startTime and endTime should be defined. startTime must be less than endTime. Values up to but not including endTime are deleted. startTime may be equal to endTime. The value corresponding to startTime is always deleted.

Modified entries correspond to values that have been modified in the history. There may be several modified values for a single timestamp. All of the modified entries should be deleted.

Specified by:
onDeleteModified in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
startTime - the start of the deletion time interval
endTime - the end of the deletion time interval
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onDeleteRaw

public void onDeleteRaw(ServiceContext serviceContext,
                        Object operationContext,
                        org.opcfoundation.ua.builtintypes.NodeId nodeId,
                        UaNode node,
                        org.opcfoundation.ua.builtintypes.DateTime startTime,
                        org.opcfoundation.ua.builtintypes.DateTime endTime)
                 throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyUpdate operation, which is using DeleteRawModifiedDetails and has the isModified set to false. The request is made to delete raw samples from the history. The samples to delete are specified with an interval of time, corresponding to the values to be deleted.

Both startTime and endTime should be defined. startTime must be less than endTime. Values up to but not including endTime are deleted. startTime may be equal to endTime. The value corresponding to startTime is always deleted.

Specified by:
onDeleteRaw in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
startTime - the start of the deletion time interval
endTime - the end of the deletion time interval
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onEndHistoryRead

public void onEndHistoryRead(ServiceContext serviceContext,
                             Object operationContext,
                             org.opcfoundation.ua.core.HistoryReadDetails details,
                             org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                             org.opcfoundation.ua.core.HistoryReadValueId[] nodesToRead,
                             HistoryContinuationPoint[] continuationPoints,
                             HistoryResult[] results)
                      throws ServiceException
Description copied from interface: HistoryManagerListener
Called to notify the end of a HistoryRead. You can finalize the operationContext prepared in #beginHistoryRead here.

Specified by:
onEndHistoryRead in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext prepared in HistoryManagerListener.onBeginHistoryRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[])
details - the history read details, which in practice is one of the actual sub types, such as ReadRawModifiedDetails. Should be ignored for nodes that have a continuationPoint, instead the details from the continuationPoint should be used.
timestampsToReturn - defines whether Server, Source or Both time stamps should be returned with every value. Neither is not a valid value (checked already before calling the method). Should be ignored for nodes that have a continuationPoint, instead the timestampsToReturn from the continuationPoint should be used.
nodesToRead - the nodes to be read. Note: The call may contain read requests for several node managers, so if you handle the nodes here, check the namespace of the requested items.
continuationPoints - the continuation points used to define where the previous read ended and where this read should continue. If defined, the respective details and timestampsToReturn should be used instead of the ones provided in the call.
results - the array of results as defined in the #beginHistoryRead or #historyRead methods for a reference.
Throws:
ServiceException - if you need to return a service call error

onEndHistoryUpdate

public void onEndHistoryUpdate(ServiceContext serviceContext,
                               Object operationContext,
                               org.opcfoundation.ua.core.HistoryUpdateDetails[] details,
                               org.opcfoundation.ua.core.HistoryUpdateResult[] results,
                               org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnosticInfos)
                        throws ServiceException
Description copied from interface: HistoryManagerListener
Called to notify the end of a HistoryRead. You can finalize the operationContext prepared in #beginHistoryUpdate here.

Specified by:
onEndHistoryUpdate in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext prepared in HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
details - the history update details, which in practice is one of the actual subtypes, such as DeleteAtTimeDetails
results - and array of results
diagnosticInfos - possible error diagnostics
Throws:
ServiceException - if you need to return a service call error * @param serviceContext

onReadAtTimes

public Object onReadAtTimes(ServiceContext serviceContext,
                            Object operationContext,
                            org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                            org.opcfoundation.ua.builtintypes.NodeId nodeId,
                            UaNode node,
                            Object continuationPoint,
                            org.opcfoundation.ua.builtintypes.DateTime[] reqTimes,
                            org.opcfoundation.ua.utils.NumericRange indexRange,
                            org.opcfoundation.ua.core.HistoryData historyData)
                     throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyRead operation, which is using ReadAtTimeDetails. The server should return values from the node history matching the requested timestamps.

The ReadAtTimeDetails structure reads the values and qualities from the history database for the specified timestamps for one or more HistoricalDataNodes. This function is intended to provide values to correlate with other values with a known timestamp. For example, a Client may need to read the values of sensors when lab samples were collected.

The order of the values and qualities returned shall match the order of the time stamps supplied in the request.

When no value exists for a specified timestamp, a value shall be Interpolated from the surrounding values to represent the value at the specified timestamp. The interpolation will follow the same rules as the standard Interpolated Aggregate as outlined in [UA Part 13]

If a value is found for the specified timestamp, the server will set the StatusCode InfoBits to be Raw. If the value is Interpolated from the surrounding values, the server will set the StatusCode InfoBits to be Interpolated.

If the requested timestamp format is not supported for a Node, the operation shall return the Bad_TimestampNotSupported StatusCode.

(OPC UA Spec. Part 11 v 1.01 6.4.5)

If the result set is limited, i.e. processing takes so long that it is better to return a partial result set, the method should return a continuationPoint, which can be used to resume the query with a subsequent request from the client. In the latter case, the next request will have userContinuationPoint defined, and the server should use that as a hint for the first data value to return in the historyData.

Specified by:
onReadAtTimes in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[])
timestampsToReturn - defines whether Server, Source or Both timestamps should be returned with every value. Neither is not a valid value (checked already before calling the method)
nodeId - the nodeId of the node
node - the node object, if available
continuationPoint - a possible continuationPoint from which the historyData should be returned. This indicates a previous result which was only partly returned to the client.
reqTimes - the requested sample times
indexRange - the range of array indexes to use for array values. If null, all values should be returned. The first array element is identified with 0.
historyData - the history values and timestamps to return
Returns:
a new continuation point object of any type, if there are more results than it is possible to provide for the request (i.e. the reqTimes array is "too big"). If all available data is returned the method should return null. Note that the continuationPoint can be any object that is most useful for your application: the SDK will use a reference to this object to return a ByteString-continuationPoint as defined in the OPC UA protocol.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onReadEvents

public Object onReadEvents(ServiceContext serviceContext,
                           Object operationContext,
                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                           UaNode node,
                           Object userContinuationPoint,
                           org.opcfoundation.ua.builtintypes.DateTime startTime,
                           org.opcfoundation.ua.builtintypes.DateTime endTime,
                           org.opcfoundation.ua.builtintypes.UnsignedInteger numValuesPerNode,
                           org.opcfoundation.ua.core.EventFilter filter,
                           org.opcfoundation.ua.core.HistoryEvent historyEvent)
                    throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyRead operation, which is using ReadEventDetails The request us used to read Events from the event history for the specified time domain for one or more event nodes.

The events are filtered using the provided filter.

At least two of StartTime, EndTime and NumValuesPerNode must be defined.

If the result set is limited, i.e. there would be more than NumValuesPerNode to return or processing takes otherwise so long that it is better to return a partial result set, the method should return a continuationPoint, which can be used to resume the query with a subsequent request from the client. In the latter case, the next request will have userContinuationPoint defined, and the server should use that as a hint for the first event to return in the historyData.

Specified by:
onReadEvents in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[])
nodeId - the nodeId of the node
node - the node object, if available
userContinuationPoint - the continuationPoint object corresponding to a previously provided object for the same kind of request.
startTime - the beginning of the time interval
endTime - the end of the time interval. If endTime is less than startTime the data will be returned in reverse order
numValuesPerNode - the maximum number of events to return for a single node. If the value is 0, all values between startTime and endTime are returned.
filter - the event filter to use for selecting which events are to be provided. This corresponds to the EventFilter used for MonitoredEventItem
historyEvent - the structure for the return values
Returns:
a new continuation point object of any type, if there are more results than it is possible to provide for the request (for example due to numValuesPerNode). If all available data is returned the method should return null. Note that the continuationPoint can be any object that is most useful for your application: the SDK will use a reference to this object to return a ByteString-continuationPoint as defined in the OPC UA protocol.
Throws:
StatusException - if the result cannot be provided for some reason.

onReadModified

public Object onReadModified(ServiceContext serviceContext,
                             Object operationContext,
                             org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                             org.opcfoundation.ua.builtintypes.NodeId nodeId,
                             UaNode node,
                             Object userContinuationPoint,
                             org.opcfoundation.ua.builtintypes.DateTime startTime,
                             org.opcfoundation.ua.builtintypes.DateTime endTime,
                             org.opcfoundation.ua.builtintypes.UnsignedInteger numValuesPerNode,
                             org.opcfoundation.ua.utils.NumericRange indexRange,
                             org.opcfoundation.ua.core.HistoryModifiedData historyData)
                      throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyRead operation, which is using ReadRawModifiedDetails and has the isModified set to true. The server should return Modified values from the node history matching the requested timestamps.

The ModificationData in the returned historyData should also be filled in.

Modified entries correspond to values that have been modified in the history. There may be several modified values for a single timestamp. All of the modified entries should be deleted.

If the updateType is INSERT the value is the new value that was inserted. If the updateType is anything else the value is the old value that was changed.

The purpose of this function is to read values from history that have been Modified. The returnBounds parameter must be set to FALSE for this case otherwise the server returns a Bad_ArgumentInvalid StatusCode.

The domain of the request is defined by startTime, endTime, and numValuesPerNode; at least two of these must be specified. If endTime is less than startTime, or endTime and numValuesPerNode alone are specified, the data shall be returned in reverse order, with later data coming first. If all three are specified, the call shall return up to numValuesPerNode results going from StartTime to EndTime, in either ascending or descending order depending on the relative values of StartTime and EndTime. If more than numValuesPerNode values exist within that time range for a given Node, only numValuesPerNode values per Node are returned along with a continuationPoint. When a continuationPoint is returned, Client wanting the next numValuesPerNode values should call ReadRaw again with the continuationPoint set. If numValuesPerNode is 0, then all the values in the range are returned. If the Server cannot return all modified values for a given timestamp in a single response it shall return modified values with the same timestamp in subsequent calls.

If a value has been modified multiple times, all values for the time are returned. This means that a timestamp can appear in the array more than once. The order of the returned values with the same timestamp should be from most recent to oldest modification timestamp, if startTime is less than or equal to endTime. If endTime is less than startTime, the order of the returned values will be from oldest modificfication timestamp to most recent. It is server dependent whether multiple modifications are kept or only the most recent.

A server does not have to create a modification record for data when it is first added to the historical collection. If it does then it shall set the ExtraData bit and the Client can read the modification record using a ReadModified call. . If the data is subsequently modified the server shall create a second modification record which is returned along with the original modification record whenever a Client uses the ReadModified call if the Server supports multiple modification records per timestamp.

If the requested timestamp format is not supported for a Node, the operation shall return the Bad_TimestampNotSupported StatusCode.

(OPC UA Spec. Part 11 v 1.01 6.4.3)

If the result set is limited, i.e. there would be more than NumValuesPerNode to return or processing takes otherwise so long that it is better to return a partial result set, the method should return a continuationPoint, which can be used to resume the query with a subsequent request from the client. In the latter case, the next request will have userContinuationPoint defined, and the server should use that as a hint for the first data value to return in the historyData.

Specified by:
onReadModified in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[])
timestampsToReturn - defines whether Server, Source or Both timestamps should be returned with every value. Neither is not a valid value (checked already before calling the method)
nodeId - the nodeId of the node
node - the node object, if available
userContinuationPoint - a possible continuationPoint from which the historyData should be returned. This indicates a previous result which was only partly returned to the client.
startTime - the beginning of the time interval
endTime - the end of the time interval. If endTime is less than startTime the data will be returned in reverse order
numValuesPerNode - the maximum number of values to return for a single node. If the value is 0, all values between startTime and endTime are returned.
indexRange - the range of array indexes to use for array values. If null, all values should be returned. The first array element is identified with 0.
historyData - the history data to return. Note that the ModificationData in the structure must also be set.
Returns:
a new continuation point object of any type, if there are more results than it is possible to provide for the request (for example due to numValuesPerNode). If all available data is returned the method should return null. Note that the continuationPoint can be any object that is most useful for your application: the SDK will use a reference to this object to return a ByteString-continuationPoint as defined in the OPC UA protocol.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onReadProcessed

public Object onReadProcessed(ServiceContext serviceContext,
                              Object operationContext,
                              org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                              org.opcfoundation.ua.builtintypes.NodeId nodeId,
                              UaNode node,
                              Object userContinuationPoint,
                              org.opcfoundation.ua.builtintypes.DateTime startTime,
                              org.opcfoundation.ua.builtintypes.DateTime endTime,
                              Double resampleInterval,
                              org.opcfoundation.ua.builtintypes.NodeId aggregateType,
                              org.opcfoundation.ua.core.AggregateConfiguration aggregateConfiguration,
                              org.opcfoundation.ua.utils.NumericRange indexRange,
                              org.opcfoundation.ua.core.HistoryData historyData)
                       throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyRead operation, which is using ReadProcessedDetails The server should return Aggregate values from the node history matching the requested timestamps.

This structure is used to compute Aggregate values, qualities, and timestamps from data in the history database for the specified time domain for one or more HistoricalDataNodes. The time domain is divided into Intervals of duration resampleInterval. The specified AggregateType is calculated for each Intervalbeginning with startTime by using the data within the next resampleInterval.

For example, this function can provide hourly statistics such as Maximum, Minimum and Average for each item during the specified time domain when resampleInterval is 1 hour.

The domain of the request is defined by startTime, endTime, and resampleInterval. All three must be specified. If endTime is less than startTime, the data shall be returned in reverse order, with later data coming first. If startTime and endTime are the same, the server shall return Bad_ArgumentInvalid, as there is no meaningful way to interpret such a case.

The aggregateType[] parameter allows Client to request multiple Aggregate calculations per requested NodeId. If multiple Aggregates are requested, then a corresponding number of entries are required in the NodesToRead array.

The aggregateConfiguration parameter allows Client to override the Aggregate configuration settings supplied by the AggregateConfiguration Object on a per call basis. See [UA Part 13] for more information on Aggregate configurations. If the Server does not support the ability to override the Aggregate configuration settings it shall return a StatusCode of Bad_ AggregateConfigurationRejected.If the Aggregate is not valid for the node then the StatusCode shall be Bad_AggregateNotSupported.

The values used in computing the Aggregate for each Interval shall include any value that falls exactly on the timestamp beginning the Interval, but shall not include any value that falls directly on the timestamp ending the Interval. Thus, each value shall be included only once in the calculation. If the time domain is in reverse order, we consider the later timestamp to be the one beginning the subinterval, and the earlier timestamp to be the one ending it. Note that this means that simply swapping the start and end times will not result in getting the same values back in reverse order, as the Intervalbeing requested in the two cases are not the same.

Refer to [UA Part 13] for handling of Aggregate specific cases.

(OPC UA Spec. Part 11 v 1.01 6.4.4)

If the result set is limited, i.e. processing takes so long that it is better to return a partial result set, the method should return a continuationPoint, which can be used to resume the query with a subsequent request from the client. In the latter case, the next request will have userContinuationPoint defined, and the server should use that as a hint for the first data value to return in the historyData.

Specified by:
onReadProcessed in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[])
timestampsToReturn - defines whether Server, Source or Both timestamps should be returned with every value. Neither is not a valid value (checked already before calling the method)
nodeId - the nodeId of the node
node - the node object, if available
userContinuationPoint - a possible continuationPoint starting from which the historyData should be returned. This indicates a previous result which was only partly returned to the client.
startTime - the beginning of the time interval
endTime - the end of the time interval. If endTime is less than startTime the data will be returned in reverse order
resampleInterval - Interval between returned Aggregate values. The value 0 indicates that there is no Interval defined.
aggregateType - The NodeId of the HistoryAggregate object that indicates the the Aggregates to be used when retrieving processed history. See [UA Part 13] for details.
aggregateConfiguration - Aggregate configuration structure
indexRange - the range of array indexes to use for array values. If null, all values should be returned. The first array element is identified with 0.
historyData - the history data to return
Returns:
a new continuation point object of any type, if there are more results than it is possible to provide for the request (for example due to numValuesPerNode). If all available data is returned the method should return null. Note that the continuationPoint can be any object that is most useful for your application: the SDK will use a reference to this object to return a ByteString-continuationPoint as defined in the OPC UA protocol.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onReadRaw

public Object onReadRaw(ServiceContext serviceContext,
                        Object operationContext,
                        org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                        org.opcfoundation.ua.builtintypes.NodeId nodeId,
                        UaNode node,
                        Object userContinuationPoint,
                        org.opcfoundation.ua.builtintypes.DateTime startTime,
                        org.opcfoundation.ua.builtintypes.DateTime endTime,
                        org.opcfoundation.ua.builtintypes.UnsignedInteger numValuesPerNode,
                        Boolean returnBounds,
                        org.opcfoundation.ua.utils.NumericRange indexRange,
                        org.opcfoundation.ua.core.HistoryData historyData)
                 throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyRead operation, which is using ReadRawModifiedDetails and has the isModified set to true. The server should return Raw values from the node history between the requested time interval.

This parameter is intended for use by Client wanting the actual data saved within the historian. The actual data may be compressed or may be all data collected for the item depending on the historian and the storage rules invoked when the item values were saved. When returnBounds is TRUE, the bounding values for the time domain are returned. The optional bounding values are provided to allow Client to interpolate values for the start and end times when trending the actual data on a display.

The time domain of the request is defined by startTime, endTime, and numValuesPerNode; at least two of these must be specified. If endTime is less than startTime, or endTime and numValuesPerNode alone are specified, the data will be returned in reverse order, with later data coming first, as if time were flowing backward. If all three are specified, the call shall return up to numValuesPerNode results going from startTime to endTime, in either ascending or descending order depending on the relative values of startTime and endTime. If numValuesPerNode is 0, then all the values in the range are returned. A default value of DateTime.MIN_VALUE is used to indicate when startTime or endTime is not specified.

It is specifically allowed for the startTime and the endTime to be identical. This allows the Client to request just one value. When the startTime and endTime are identical, time is presumed to be flowing forward. It is specifically not allowed for the server to return a Bad_ArgumentInvalid StatusCode if the requested time domain is outside of the server's range. Such a case shall be treated as an interval in which no data exists.

If bounding values are requested and a non-zero numValuesPerNode was specified, any bounding values returned are included in the numValuesPerNode count. If numValuesPerNode is 1, then only the start bound is returned (the End bound if reverse order is needed). If numValuesPerNode is 2, the start bound and the first data point is returned (the End bound if reverse order is needed).

When bounding values are requested and no bounding value is found, the corresponding StatusCode entry will be set to Bad_BoundNotFound, a timestamp equal to the start or end time, as appropriate, and a value of Null. How far back or forward to look in history for bounding values is server dependent.

For an interval in which no data exists, if bounding values are not requested, the corresponding StatusCode must be Good_NoData. If bounding values are requested and one or both exist, the result code returned is Success and the bounding value(s) are returned.

For cases where there are multiple values for a given timestamp, all but the most recent are considered to be Modified values and the server must return the most recent value. If the server returns a value which hides other values at a timestamp then it must set the ExtraData bit in the StatusCode associated with that value. If the Server contains additional information regarding a value then the ExtraData bit shall also be set. This it indicates that ModifiedValues are available for retrieval.

If the requested timestamp format is not supported for a Node, the operation shall return the Bad_TimestampNotSupported StatusCode.

(OPC UA Spec. Part 11 v 1.01 6.4.3)

If the result set is limited, i.e. there would be more than NumValuesPerNode to return or processing takes otherwise so long that it is better to return a partial result set, the method should return a continuationPoint, which can be used to resume the query with a subsequent request from the client. In the latter case, the next request will have userContinuationPoint defined, and the server should use that as a hint for the first data value to return in the historyData.

Specified by:
onReadRaw in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryRead(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryReadDetails, org.opcfoundation.ua.core.TimestampsToReturn, org.opcfoundation.ua.core.HistoryReadValueId[], com.prosysopc.ua.server.HistoryContinuationPoint[], com.prosysopc.ua.server.HistoryResult[])
timestampsToReturn - defines whether Server, Source or Both timestamps should be returned with every value. Neither is not a valid value (checked already before calling the method)
nodeId - the nodeId of the node
node - the node object, if available
userContinuationPoint - a possible continuationPoint from which the historyData should be returned. This indicates a previous result which was only partly returned to the client.
startTime - the beginning of the time interval
endTime - the end of the time interval. If endTime is less than startTime the data will be returned in reverse order
numValuesPerNode - the maximum number of values to return for a single node. If the value is 0, all values between startTime and endTime are returned.
returnBounds - whether values at the boundaries, corresponding to startTime and endtime, should be included in the result set
indexRange - the range of array indexes to use for array values. If null, all values should be returned. The first array element is identified with 0.
historyData - the history values and timestamps to return
Returns:
a new continuation point object of any type, if there are more results than it is possible to provide for the request (for example due to numValuesPerNode). If all available data is returned the method should return null. Note that the continuationPoint can be any object that is most useful for your application: the SDK will use a reference to this object to return a ByteString-continuationPoint as defined in the OPC UA protocol.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onUpdateData

public void onUpdateData(ServiceContext serviceContext,
                         Object operationContext,
                         org.opcfoundation.ua.builtintypes.NodeId nodeId,
                         UaNode node,
                         org.opcfoundation.ua.builtintypes.DataValue[] updateValues,
                         org.opcfoundation.ua.core.PerformUpdateType performInsertReplace,
                         org.opcfoundation.ua.builtintypes.StatusCode[] operationResults,
                         org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
                  throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyUpdate operation, which is using UpdateDataDetails. The request is made to update samples in the history.

Insert data functionality

Setting performInsertReplace = INSERT_1 inserts entries into the history database at the specified timestamps for one or more HistoricalDataNodes. If an entry exists at the specified timestamp, the new entry shall not be inserted; instead the StatusCode shall indicate Bad_EntryExists.

This function is intended to insert new entries at the specified timestamps; e.g., the insertion of lab data to reflect the time of data collection.

Replace data functionality

Setting performInsertReplace = REPLACE_2 replaces entries in the history database at the specified timestamps for one or more HistoricalDataNodes. If no entry exists at the specified timestamp, the new entry shall not be inserted; otherwise the StatusCode shall indicate Bad_NoEntryExists.

This function is intended to replace existing entries at the specified timestamp; e.g., correct lab data that was improperly processed, but inserted into the history database.

Update data functionality

Setting performInsertReplace = UPDATE_3 inserts or replaces entries in the history database for the specified timestamps for one or more HistoricalDataNodes. If the item has an entry at the specified timestamp, the new entry will replace the old one. If there is no entry at that timestamp, the function will insert the new data.

This function is intended to unconditionally insert/replace values and qualities; e.g., correction of values for bad sensors.

Good as a StatusCode for an individual entry is allowed when the server is unable to say whether there was already a value at that timestamp. If the server can determine whether the new entry replaces an entry that was already there, it should use Good_EntryInserted or Good_EntryReplaced to return that information.

(OPC UA Spec. Part 11 v 1.01 6.7.2)

Specified by:
onUpdateData in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
updateValues - the values to insert or replace
performInsertReplace - determines which action of Insert, Replace or Update is performed. Update equals to "Insert or Replace" depending on whether the variable has an entry for the specified timestamp. For Insert and replace a StatusExceptionwith StatusCode Bad_EntryExists or Bad_NoEntryExists should be set for operationResults, respectively, if there already is an entry which is being inserted or is no entry that could be replaced.
operationResults - list of StatusCodes for the operations to be performed on a Node. The size and order of the list matches the size and order of reqTimes element being reported by this updateResults entry.
operationDiagnostics - list of diagnostic information for the operations to be performed on a Node. Note that the list is null, if no diagnostics was requested.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onUpdateEvent

public void onUpdateEvent(ServiceContext serviceContext,
                          Object operationContext,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          UaNode node,
                          org.opcfoundation.ua.builtintypes.Variant[] eventFields,
                          org.opcfoundation.ua.core.EventFilter filter,
                          org.opcfoundation.ua.core.PerformUpdateType performInsertReplace,
                          org.opcfoundation.ua.builtintypes.StatusCode[] operationResults,
                          org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
                   throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyUpdate operation, which is using UpdateEventDetails. The request is made to update event data in the history. *

This function is intended to insert new entries; e.g., backfilling of historical Events.

Setting performInsertReplace = INSERT_1 inserts entries into the Event history database for one or more HistoricalEventNodes. The whereClause parameter of the EventFilter shall be empty. The SelectClause shall specify the EventType and the Time. The selectClause should specify the SourceNode and the SourceName. If the historian does not support archiving the specified EventType the StatusCode shall indicate Bad_TypeDefinitionInvalid. If the SourceNode is not a valid source for Events the StatusCode shall indicate Bad_SourceNodeIdInvalid. If the Time does not fall within range that can be stored the StatusCode shall indicate Bad_OutOfRange.If the selectClause does not include fields which are mandatory for the EventType the StatusCode shall indicate Bad_ArgumentsMissing. If the selectClause specifies fields which are not valid for the EventType or cannot be saved by the historian the StatusCode shall indicate Good_DataIgnored and the OperationResults array shall specify Bad_NotSupported for each ignored field.

The EventId is a server generated opaque value and a Client cannot assume it knows how to create value EventIds. If a Client does specify the EventId in the selectClause and it matches an existing Event the StatusCode shall indicate Bad_EntryExists. A Client must use a HistoryRead to discover any automatically generated EventIds.

If any errors occur while processing individual fields the StatusCode shall indicate Bad_ArgumentInvalid and the OperationResults array shall specify the exact error for each invalid field. The IndexRange parameter of the SimpleAttributeOperand is not valid for insert operations and the OperationResults shall specify Bad_IndexRangeInvalid if one is specified.

If no errors occur the StatusCode shall indicate Good and the OperationResults array shall be empty. If errors occur OperationResults array will have one element for each field specified in the selectClause.

A Client may instruct the Server to choose a suitable default value for a field by specifying a value of null. If the server is not able to select a suitable default the corresponding entry in the OperationResults array shall be Bad_InvalidArgument.

Replace event functionality

This function is intended to replace fields in existing Event entries; e.g., correct Event data that contained incorrect data due to a bad sensor.

Setting performInsertReplace = REPLACE_2 replaces entries in the Event history database for the specified filter for one or more HistoricalEventNodes. The whereClause parameter of the EventFilter shall specify the EventId Property. If no entry exists matching the specified filter, no updates will be performed, instead the StatusCode shall indicate Bad_NoEntryExists.

If the selectClause specifies fields which are not valid for the EventType or cannot be saved by the historian the StatusCode shall indicate Good_DataIgnored and the OperationResults array shall specify Bad_NotSupported for each ignored field.

If a field is valid for the EventType but cannot be changed the StatusCode shall indicate Good_DataIgnored and the corresponding entry in the OperationResults array shall be Bad_NotWriteable.

If fatal errors occur while processing individual fields the StatusCode shall indicate Bad_ArgumentInvalid and the OperationResults array shall specify the exact error.

If no errors occur the StatusCode shall indicate Good and the OperationResults array shall be empty. If errors occur OperationResults array will have one element for each field specified in the selectClause.

If a Client specifies a value of null for any field the Server shall set the value of the field to null. If a null value is not valid for the corresponding entry in the OperationResults array shall be Bad_InvalidArgument.

Update event functionality

This function is intended to unconditionally insert/replace Events; e.g., synchronizing a backup Event database.

Setting performInsertReplace = UPDATE_3 inserts or replaces entries in the Event history database for the specified filter for one or more HistoricalEventNodes.

The server will, based on its own criteria, attempt to determine if the Event already exists, if it does the existing Event will be deleted and the new Event will be inserted (retaining the EventId). If the event does not exist then a new Event will be inserted, including the generation of a new EventId.

All of the restrictions, behavoirs errors specified for the Insert functionality also apply to this function.

If an existing entry was replaced successfully the StatusCode shall be Good_EntryReplaced. If a new entry was created the StatusCode shall be Good_EntryInserted. If the server cannot determine whether it replaced or inserted an entry it the StatusCode shall be Good.

(OPC UA Spec. Part 11 v 1.01 6.7.4)

Specified by:
onUpdateEvent in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
eventFields - the values of the event fields to insert or update
filter - the filter defines which events the update applies to
performInsertReplace - determines which action of Insert, Replace or Update is performed. Update equals to "Insert or Replace" depending on whether the variable has an entry for the specified timestamp. For Insert and replace a StatusExceptionwith StatusCode Bad_EntryExists or Bad_NoEntryExists should be set for operationResults, respectively, if there already is an entry which is being inserted or is no entry that could be replaced.
operationResults - list of StatusCodes for the operations to be performed on a Node. The size and order of the list matches the size and order of reqTimes element being reported by this updateResults entry.
operationDiagnostics - list of diagnostic information for the operations to be performed on a Node. Note that the list is null, if no diagnostics was requested.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.

onUpdateStructureData

public void onUpdateStructureData(ServiceContext serviceContext,
                                  Object operationContext,
                                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                  UaNode node,
                                  org.opcfoundation.ua.builtintypes.DataValue[] updateValues,
                                  org.opcfoundation.ua.core.PerformUpdateType performUpdateType,
                                  org.opcfoundation.ua.builtintypes.StatusCode[] operationResults,
                                  org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationDiagnostics)
                           throws StatusException
Description copied from interface: HistoryManagerListener
Handle a single historyUpdate operation, which is using UpdateStructureDataDetails. The request is made to update metadata in the history.

Structured History Data provides metadata describing an entry in the history database. The server shall define what uniqueness means for each Structured History Data structure type. For example, a server may only allow one Annotation per timestamp which means the timestamp is the unique key for the structure. Another server may allow for multiple Annotations to exist per user, so a combination username, Timestamp and message may be used as the unique key for the structure. In the following sections the terms "Structured History Data exists" and "at the specificed parameters" means a matching entry has been found at the specified timestamp using the Server's criteria for uniqueness.

In the case where the Client wishes to Replace a parameter that is part of the uniqueness criteria, the resulting StatusCode would be Bad_NoEntryExists. They will have to Remove the existing structure and Insert the new structure.

Insert functionality

Setting performInsertReplace = INSERT_1 inserts Structured History Data such as Annotations, into the history database at the specified parameters for one or more Properties of HistoricalDataNodes

If a Structured History Data entry already exists at the specified parameters the StatusCode shall indicate Bad_EntryExists.

Replace functionality

Setting performInsertReplace = REPLACE_2 replaces Structured History Data such as Annotations in the history database at the specified parameters for one or more Properties of HistoricalDataNodes.

If a Structured History Data entry does not already exist at the specified parameters, the StatusCode shall indicate Bad_NoEntryExists.

Update functionality

Setting performInsertReplace = UPDATE_3 inserts or replaces Structure Data such as Annotations in the history database at the specified parameters for one or more Properties of HistoricalDataNodes.

If a Structure History Data entry already exists at the specified parameters it is deleted and the value provided by the Client is inserted. If no existing entry exists the new entry is inserted.

If an existing entry was replaced successfully the StatusCode shall be Good_EntryReplaced. If a new entry was created the StatusCode shall be Good_EntryInserted. If the server cannot determine whether it replaced or inserted an entry it the StatusCode shall be Good.

Remove functionality

Setting performInsertReplace = REMOVE_4 removes Structure Data such as Annotations from the history database at the specified parameters for one or more Properties of HistoricalDataNodes.

If a Structure History Data entry exists at the specified parameters it is deleted. If Structured History Data does not already exist at the specified parameters, the StatusCode shall indicate Bad_NoEntryExists.

(OPC UA Spec. Part 11 v1.01 6.7.3)

Specified by:
onUpdateStructureData in interface HistoryManagerListener
Parameters:
serviceContext - the client service call context
operationContext - the possible operationContext provided from HistoryManagerListener.onBeginHistoryUpdate(com.prosysopc.ua.server.ServiceContext, org.opcfoundation.ua.core.HistoryUpdateDetails[], org.opcfoundation.ua.core.HistoryUpdateResult[], org.opcfoundation.ua.builtintypes.DiagnosticInfo[])
nodeId - the nodeId of the node
node - the node object, if available
updateValues - the metadata values (e.g. Annotations) to insert or replace, including the timestamps for each
operationResults - list of StatusCodes for the operations to be performed on a Node. The size and order of the list matches the size and order of reqTimes element being reported by this updateResults entry.
operationDiagnostics - list of diagnostic information for the operations to be performed on a Node. Note that the list is null, if no diagnostics was requested.
Throws:
StatusException - in case the operation fails due to invalid arguments or something else. The specific StatusCode should be set accordingly.


Copyright © 2018. All rights reserved.