Пример #1
0
 /// <summary>
 /// Updates the audit event.
 /// </summary>
 private void UpdateAuditEvent(AuditEventState instance, EventType eventType, ONEVENTSTRUCT e)
 {
     instance.SetChildValue(m_defaultContext, Opc.Ua.BrowseNames.ActionTimeStamp, instance.Time.Value, false);
     instance.SetChildValue(m_defaultContext, Opc.Ua.BrowseNames.Status, true, false);
     instance.SetChildValue(m_defaultContext, Opc.Ua.BrowseNames.ServerId, m_defaultContext.NamespaceUris.GetString(m_namespaceIndex), false);
     instance.SetChildValue(m_defaultContext, Opc.Ua.BrowseNames.ClientUserId, e.szActorID, false);
 }
        private void OnRaiseSystemEvents(object state)
        {
            try {
                var e = new SystemEventState(null);

                e.Initialize(
                    SystemContext,
                    null,
                    EventSeverity.Medium,
                    new LocalizedText("Raising Events"));

                e.SetChildValue(SystemContext, BrowseNames.SourceNode, ObjectIds.Server, false);
                e.SetChildValue(SystemContext, BrowseNames.SourceName, "Internal", false);

                Server.ReportEvent(e);

                var ae = new AuditEventState(null);

                ae.Initialize(
                    SystemContext,
                    null,
                    EventSeverity.Medium,
                    new LocalizedText("Events Raised"),
                    true,
                    DateTime.UtcNow);

                ae.SetChildValue(SystemContext, BrowseNames.SourceNode, ObjectIds.Server, false);
                ae.SetChildValue(SystemContext, BrowseNames.SourceName, "Internal", false);

                Server.ReportEvent(ae);
            }
            catch (Exception e) {
                Utils.Trace(e, "Unexpected error in OnRaiseSystemEvents");
            }
        }
Пример #3
0
        /// <summary>
        /// Initializes a session audit event.
        /// </summary>
        private void InitializeSessionAuditEvent(ServerSystemContext systemContext, AuditEventState e, TranslationInfo message)
        {
            e.Initialize(
                systemContext,
                null,
                EventSeverity.MediumLow,
                new LocalizedText(message),
                true,
                DateTime.UtcNow);

            e.SetChildValue(systemContext, BrowseNames.SourceNode, m_sessionId, false);
            e.SetChildValue(systemContext, BrowseNames.SourceName, m_sessionName, false);
            e.SetChildValue(systemContext, BrowseNames.SessionId, m_sessionId, false);
            e.SetChildValue(systemContext, BrowseNames.ServerId, m_server.ServerUris.GetString(0), false);
            e.SetChildValue(systemContext, BrowseNames.ClientUserId, m_identity.DisplayName, false);
            e.SetChildValue(systemContext, BrowseNames.ClientAuditEntryId, systemContext.OperationContext.AuditEntryId, false);
        }
 /// <summary>
 /// Initializes a session audit event.
 /// </summary>
 private void InitializeSessionAuditEvent(ServerSystemContext systemContext, AuditEventState e, TranslationInfo message)
 {
     e.Initialize(
         systemContext,
         null,
         EventSeverity.MediumLow,
         new LocalizedText(message),
         true,
         DateTime.UtcNow);
     
     e.SetChildValue(systemContext, BrowseNames.SourceNode, m_sessionId, false);
     e.SetChildValue(systemContext, BrowseNames.SourceName, m_sessionName, false);
     e.SetChildValue(systemContext, BrowseNames.SessionId, m_sessionId, false);
     e.SetChildValue(systemContext, BrowseNames.ServerId, m_server.ServerUris.GetString(0), false);
     e.SetChildValue(systemContext, BrowseNames.ClientUserId, m_identity.DisplayName, false);
     e.SetChildValue(systemContext, BrowseNames.ClientAuditEntryId, systemContext.OperationContext.AuditEntryId, false);
 }