[openempi~source-repository:23] Added auditing of all major operations

  • From: odysseas@kenai.com
  • To: commits@openempi.kenai.com
  • Subject: [openempi~source-repository:23] Added auditing of all major operations
  • Date: Fri, 22 Jan 2010 01:29:16 +0000

Project:    openempi
Repository: source-repository
Revision:   23
Author:     odysseas
Date:       2010-01-22 01:29:11 UTC
Link:       

Log Message:
------------
Added auditing of all major operations


Revisions:
----------
23


Modified Paths:
---------------
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/PersonManagerServiceImpl.java
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/context/Context.java
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-dao.xml
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-service.xml


Added Paths:
------------
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/AuditEventService.java
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/service/AuditEventServiceTest.java
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/hibernate/AuditEventDaoHibernate.java
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/AuditEventDao.java
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/AuditEventServiceImpl.java
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/dao/AuditEventDaoTest.java


Diffs:
------
Index: 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/service/AuditEventServiceTest.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/service/AuditEventServiceTest.java
      (revision 0)
+++ 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/service/AuditEventServiceTest.java
      (revision 23)
@@ -0,0 +1,24 @@
+package org.openhie.openempi.service;
+
+import java.util.List;
+
+import org.openhie.openempi.context.Context;
+import org.openhie.openempi.model.AuditEvent;
+import org.openhie.openempi.model.AuditEventType;
+
+public class AuditEventServiceTest extends BaseServiceTestCase
+{
+       public void testAddAuditEvent() {
+               try {
+                       AuditEventService auditService = 
Context.getAuditEventService();
+                       AuditEvent event = 
auditService.saveAuditEvent(AuditEventType.OBTAIN_UNIQUE_IDENTIFIER_DOMAIN_EVENT_TYPE,
 "Testing the audit event service");
+                       System.out.println("Generated the audit event: " + 
event);
+                       List<AuditEvent> events = 
auditService.getAllAuditEvents();
+                       for (AuditEvent auditEvent : events) {
+                               System.out.println("Retrieved the audit 
event: " + auditEvent);
+                       }
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+}

Property changes on: 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/service/AuditEventServiceTest.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/dao/AuditEventDaoTest.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/dao/AuditEventDaoTest.java
      (revision 0)
+++ 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/dao/AuditEventDaoTest.java
      (revision 23)
@@ -0,0 +1,87 @@
+package org.openhie.openempi.dao;
+
+import java.util.List;
+
+import org.openhie.openempi.model.AuditEvent;
+import org.openhie.openempi.model.AuditEventType;
+import org.openhie.openempi.model.User;
+
+public class AuditEventDaoTest extends BaseDaoTestCase
+{
+       private AuditEventDao auditEventDao;
+       private PersonDao personDao;
+       private UserDao userDao;
+       
+       @SuppressWarnings("unchecked")
+       public void testGetAllAuditEventType() {
+               try {
+                       List<AuditEventType> allTypes = 
auditEventDao.getAll(AuditEventType.class);
+                       for (AuditEventType auditEventType : allTypes) {
+                               System.out.println("Found audit event type: " 
+ auditEventType);
+                       }
+               } catch (Throwable e) {
+                       e.printStackTrace();
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       public void testGetAuditEventTypeByCode() {
+               try {
+                       List<AuditEventType> allTypes = 
auditEventDao.getAll(AuditEventType.class);
+                       for (AuditEventType auditEventType : allTypes) {
+                               AuditEventType auditEventTypeFound = 
auditEventDao.getAuditEventTypeByCode(auditEventType.getAuditEventTypeCode());
+                               assertNotNull(auditEventTypeFound);
+                               System.out.println("Found audit event type: " 
+ auditEventTypeFound.getAuditEventTypeName() + " searching by code " + 
+                                               
auditEventType.getAuditEventTypeCode());
+                       }
+               } catch (Throwable e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       public void testAddAuditEvent() {
+               AuditEventType type = 
auditEventDao.getAuditEventTypeByCode(AuditEventType.OBTAIN_UNIQUE_IDENTIFIER_DOMAIN_EVENT_TYPE);
+               User user = (User) userDao.loadUserByUsername("admin");
+               assertNotNull(type);
+               assertNotNull(user);
+               AuditEvent auditEvent = new AuditEvent(new java.util.Date(), 
type, "Testing the generation of an audit event", user);
+               auditEventDao.save(auditEvent);
+               System.out.println("Saved the audit event " + auditEvent);
+               List<AuditEvent> auditEvents = 
auditEventDao.getAll(AuditEvent.class);
+               for (AuditEvent auditEventFound : auditEvents) {
+                       System.out.println("Found the audit event: " + 
auditEventFound.getAuditEventDescription());
+               }
+       }
+       
+       @SuppressWarnings("unchecked")
+       public void testGetAllAuditEvents() {
+               List<AuditEvent> auditEvents = 
auditEventDao.getAll(AuditEvent.class);
+               for (AuditEvent auditEvent : auditEvents) {
+                       System.out.println("Found the audit event: " + 
auditEvent.getAuditEventDescription());
+               }
+       }
+
+       public AuditEventDao getAuditEventDao() {
+               return auditEventDao;
+       }
+
+       public void setAuditEventDao(AuditEventDao auditEventDao) {
+               this.auditEventDao = auditEventDao;
+       }
+
+       public PersonDao getPersonDao() {
+               return personDao;
+       }
+
+       public void setPersonDao(PersonDao personDao) {
+               this.personDao = personDao;
+       }
+
+       public UserDao getUserDao() {
+               return userDao;
+       }
+
+       public void setUserDao(UserDao userDao) {
+               this.userDao = userDao;
+       }
+}

Property changes on: 
branches/2.0.3-development/openempi/core/src/test/java/org/openhie/openempi/dao/AuditEventDaoTest.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/context/Context.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/context/Context.java
    (revision 22)
+++ 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/context/Context.java
    (revision 23)
@@ -24,6 +24,7 @@
 import org.openhie.openempi.configuration.Configuration;
 import org.openhie.openempi.matching.MatchingService;
 import org.openhie.openempi.model.User;
+import org.openhie.openempi.service.AuditEventService;
 import org.openhie.openempi.service.PersonQueryService;
 import org.openhie.openempi.service.PersonManagerService;
 import org.openhie.openempi.service.UserManager;
@@ -38,7 +39,6 @@
 {
        protected static final Log log = LogFactory.getLog(Context.class);
        
-       @SuppressWarnings("unused")
        private static final ThreadLocal<Object[] /* UserContext */> 
userContextHolder = new ThreadLocal<Object[] /* UserContext */>();
        private static ApplicationContext applicationContext;
        private static UserManager userManager;
@@ -48,6 +48,7 @@
        private static Configuration configuration;
        private static MatchingService matchingService;
        private static BlockingService blockingService;
+       private static AuditEventService auditEventService;
        private static StringComparisonService stringComparisonService;
 
        public static void startup() {
@@ -57,7 +58,6 @@
                                "classpath:/applicationContext-service.xml",
                                "classpath:/applicationContext-module*.xml"
                                };
-               @SuppressWarnings("unused")
                AbstractApplicationContext ctx = new 
ClassPathXmlApplicationContext(configFiles);
                ctx.getBean("context");
        }
@@ -161,4 +161,12 @@
        public void setStringComparisonService(StringComparisonService 
stringComparisonService) {
                Context.stringComparisonService = stringComparisonService;
        }
+
+       public static AuditEventService getAuditEventService() {
+               return auditEventService;
+       }
+
+       public void setAuditEventService(AuditEventService auditEventService) 
{
+               Context.auditEventService = auditEventService;
+       }
 }
Index: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/PersonManagerServiceImpl.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/PersonManagerServiceImpl.java
      (revision 22)
+++ 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/PersonManagerServiceImpl.java
      (revision 23)
@@ -29,6 +29,7 @@
 import org.openhie.openempi.dao.PersonDao;
 import org.openhie.openempi.dao.PersonLinkDao;
 import org.openhie.openempi.matching.MatchingService;
+import org.openhie.openempi.model.AuditEventType;
 import org.openhie.openempi.model.IdentifierDomain;
 import org.openhie.openempi.model.IdentifierDomainAttribute;
 import org.openhie.openempi.model.Person;
@@ -37,6 +38,7 @@
 import org.openhie.openempi.model.Record;
 import org.openhie.openempi.model.RecordPair;
 import org.openhie.openempi.model.User;
+import org.openhie.openempi.service.AuditEventService;
 import org.openhie.openempi.service.PersonManagerService;
 import org.openhie.openempi.service.ValidationService;
 import org.openhie.openempi.transformation.TransformingFieldFunction;
@@ -78,6 +80,8 @@
                
                // Now we need to check for matches and if any are found, 
establish links among the aliases
                findAndProcessAddRecordLinks(person);
+
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.ADD_PERSON_EVENT_TYPE,
 "Added a new person record", person);
                
                return person;
        }
@@ -95,6 +99,8 @@
                
                findAndDeleteRecordLinks(personFound);
                deletePerson(personFound);
+               
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.DELETE_PERSON_EVENT_TYPE,
 "Deleted a person record", personFound);
        }
                
        public void mergePersons(PersonIdentifier retiredIdentifier, 
PersonIdentifier survivingIdentifier) throws ApplicationException {
@@ -114,6 +120,8 @@
                        log.warn("While attempting to merge two persons was 
not able to locate a record with the given identifier: " + retiredIdentifier);
                        throw new ApplicationException("Person record to be 
deleted as part of a merge does not exist in the system.");
                }
+               
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.MERGE_PERSON_EVENT_TYPE,
 "Merged two person records", personSurviving, personRetiring);
        }
        
        public void updatePerson(Person person) throws ApplicationException {
@@ -138,6 +146,8 @@
                updatePerson(person, personFound);
                
                findAndUpdateRecordLinks(person);
+
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.UPDATE_PERSON_EVENT_TYPE,
 "Updated an existing person record", person);
        }
        
        
@@ -177,7 +187,7 @@
                populateCustomFields(person);
                
                savePerson(person);
-               
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.IMPORT_PERSON_EVENT_TYPE,
 "Imported person record.", person);
                return person;
        }
 
@@ -186,7 +196,11 @@
                ValidationService validationService = 
Context.getValidationService();
                validationService.validate(identifierDomain);
                
-               return 
personDao.addIdentifierDomainAttribute(identifierDomain, attributeName, 
attributeValue);
+               IdentifierDomainAttribute attribute = 
personDao.addIdentifierDomainAttribute(identifierDomain, attributeName, 
attributeValue);
+               
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.ADD_IDENTIFIER_DOMAIN_ATTRIBUTE_EVENT_TYPE,
 "Added attribute " + attributeName + " to identifier domain " + 
identifierDomain.toString());
+               
+               return attribute;
        }
        
        public void updateIdentifierDomainAttribute(IdentifierDomainAttribute 
identifierDomainAttribute) {
@@ -194,7 +208,10 @@
                ValidationService validationService = 
Context.getValidationService();
                validationService.validate(identifierDomainAttribute);
                
-               
personDao.updateIdentifierDomainAttribute(identifierDomainAttribute);         
  
+               
personDao.updateIdentifierDomainAttribute(identifierDomainAttribute);
+               
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.UPDATE_IDENTIFIER_DOMAIN_ATTRIBUTE_EVENT_TYPE,
 "Updated attribute " + identifierDomainAttribute.getAttributeName() + 
+                               " of identifier domain with ID " + 
identifierDomainAttribute.getIdentifierDomainId());
        }
        
        public void removeIdentifierDomainAttribute(IdentifierDomainAttribute 
identifierDomainAttribute) {
@@ -203,6 +220,8 @@
                validationService.validate(identifierDomainAttribute);
                
                
personDao.removeIdentifierDomainAttribute(identifierDomainAttribute);
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.DELETE_IDENTIFIER_DOMAIN_ATTRIBUTE_EVENT_TYPE,
 "Deleted attribute " + identifierDomainAttribute.getAttributeName() + 
+                               " of identifier domain with ID " + 
identifierDomainAttribute.getIdentifierDomainId());
        }
        
        public IdentifierDomain obtainUniqueIdentifierDomain(String 
universalIdentifierTypeCode) {
@@ -214,6 +233,7 @@
                IdentifierDomain identifierDomain = 
generateIdentifierDomainForUniversalIdentifierTypeCode(universalIdentifierTypeCode);
                personDao.addIdentifierDomain(identifierDomain);
                log.trace("Created new identifier domain " + 
identifierDomain);
+               
Context.getAuditEventService().saveAuditEvent(AuditEventType.OBTAIN_UNIQUE_IDENTIFIER_DOMAIN_EVENT_TYPE,
 "Obtained unique identifier domain type for type code " + 
universalIdentifierTypeCode);
                return identifierDomain;
        }
 
Index: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/AuditEventServiceImpl.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/AuditEventServiceImpl.java
 (revision 0)
+++ 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/AuditEventServiceImpl.java
 (revision 23)
@@ -0,0 +1,88 @@
+package org.openhie.openempi.service.impl;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.openhie.openempi.ValidationException;
+import org.openhie.openempi.context.Context;
+import org.openhie.openempi.dao.AuditEventDao;
+import org.openhie.openempi.model.AuditEvent;
+import org.openhie.openempi.model.AuditEventType;
+import org.openhie.openempi.model.Person;
+import org.openhie.openempi.service.AuditEventService;
+import org.openhie.openempi.service.ValidationService;
+
+public class AuditEventServiceImpl extends BaseServiceImpl implements 
AuditEventService
+{
+       private AuditEventDao auditEventDao;
+       
+       private Map<String, AuditEventType> eventTypeMap;
+       
+       public AuditEventServiceImpl() {
+       }
+       
+       @SuppressWarnings("unchecked")
+       public void init() {
+               log.info("Initializing the Audit Event Service.");
+               eventTypeMap = new HashMap<String, AuditEventType>();
+               List<AuditEventType> types = (List<AuditEventType>) 
auditEventDao.getAll(AuditEventType.class);
+               for (AuditEventType auditEventType : types) {
+                       
eventTypeMap.put(auditEventType.getAuditEventTypeCode(), auditEventType);
+               }
+               log.debug("Built the map of audit event types with count of " 
+ types.size());
+       }
+
+       @SuppressWarnings("unchecked")
+       public List<AuditEvent> getAllAuditEvents() {
+               return (List<AuditEvent>) 
auditEventDao.getAll(AuditEvent.class);
+       }
+
+       public AuditEventType getAuditEventTypeByCode(String eventTypeCode) {
+               return eventTypeMap.get(eventTypeCode);
+       }
+
+       public AuditEvent saveAuditEvent(String auditEventTypeCode, String 
auditEventDescription) {
+               return saveAuditEvent(auditEventTypeCode, 
auditEventDescription, null, null);
+       }
+
+       public AuditEvent saveAuditEvent(String auditEventTypeCode, String 
auditEventDescription, Person refPerson) {
+               return saveAuditEvent(auditEventTypeCode, 
auditEventDescription, refPerson, null);
+       }
+
+       public AuditEvent saveAuditEvent(String auditEventTypeCode, String 
auditEventDescription, Person refPerson,
+                       Person altRefPerson) {
+               
+               AuditEventType auditEventType = 
getAuditEventTypeByCode(auditEventTypeCode);
+               if (auditEventType == null) {
+                       log.error("Attempted to audit an event with unknown 
audit event type: " + auditEventTypeCode);
+                       throw new ValidationException("Invalid audit event 
type code " + auditEventTypeCode);
+               }
+               
+               AuditEvent auditEvent = new AuditEvent(new java.util.Date(), 
auditEventType, auditEventDescription, Context.getUserContext().getUser());
+               auditEvent.setRefPerson(refPerson);
+               auditEvent.setAltRefPerson(altRefPerson);
+               
+               log.debug("About to audit the event " + auditEvent);
+               auditEvent = (AuditEvent) auditEventDao.save(auditEvent);
+               return auditEvent;
+       }
+
+       public AuditEvent saveAuditEvent(AuditEvent auditEvent) {
+               
+               ValidationService validationService = 
Context.getValidationService();
+               validationService.validate(auditEvent);
+               
+               return (AuditEvent) auditEventDao.save(auditEvent);
+       }
+
+       public AuditEventDao getAuditEventDao() {
+               return auditEventDao;
+       }
+
+       public void setAuditEventDao(AuditEventDao auditEventDao) {
+               this.auditEventDao = auditEventDao;
+       }
+
+
+}

Property changes on: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/impl/AuditEventServiceImpl.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/AuditEventService.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/AuditEventService.java
  (revision 0)
+++ 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/AuditEventService.java
  (revision 23)
@@ -0,0 +1,39 @@
+/**
+ *
+ *  Copyright (C) 2009 SYSNET International, Inc. <support@sysnetint.com>
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ *  implied. See the License for the specific language governing
+ *  permissions and limitations under the License.
+ *
+ */
+package org.openhie.openempi.service;
+
+import java.util.List;
+
+import org.openhie.openempi.model.AuditEvent;
+import org.openhie.openempi.model.AuditEventType;
+import org.openhie.openempi.model.Person;
+
+public interface AuditEventService
+{
+       public AuditEventType getAuditEventTypeByCode(String eventTypeCode);
+       
+       public AuditEvent saveAuditEvent(AuditEvent auditEvent);
+       
+       public AuditEvent saveAuditEvent(String auditEventType, String 
auditEventDescription);
+
+       public AuditEvent saveAuditEvent(String auditEventType, String 
auditEventDescription, Person refPerson);
+       
+       public AuditEvent saveAuditEvent(String auditEventType, String 
auditEventDescription, Person refPerson, Person altRefPerson);
+       
+       public List<AuditEvent> getAllAuditEvents();
+}

Property changes on: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/service/AuditEventService.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/hibernate/AuditEventDaoHibernate.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/hibernate/AuditEventDaoHibernate.java
       (revision 0)
+++ 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/hibernate/AuditEventDaoHibernate.java
       (revision 23)
@@ -0,0 +1,26 @@
+package org.openhie.openempi.dao.hibernate;
+
+import java.util.List;
+
+import org.openhie.openempi.dao.AuditEventDao;
+import org.openhie.openempi.model.AuditEvent;
+import org.openhie.openempi.model.AuditEventType;
+
+public class AuditEventDaoHibernate extends UniversalDaoHibernate implements 
AuditEventDao
+{
+       public List<AuditEvent> getAuditEventByType(AuditEventType 
auditEventType) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @SuppressWarnings("unchecked")
+       public AuditEventType getAuditEventTypeByCode(String 
auditEventTypeCode) {
+               if (auditEventTypeCode == null || auditEventTypeCode.length() 
== 0) {
+                       return null;
+               }
+               String query = "from AuditEventType aet where 
aet.auditEventTypeCode = '" + auditEventTypeCode + "'";
+        List<AuditEventType> values = getHibernateTemplate().find(query);
+        log.trace("Search for audit event types by type: " + 
auditEventTypeCode + " found " + values.size() + " entries.");
+        return values.get(0);
+       }
+}

Property changes on: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/hibernate/AuditEventDaoHibernate.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/AuditEventDao.java
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/AuditEventDao.java
  (revision 0)
+++ 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/AuditEventDao.java
  (revision 23)
@@ -0,0 +1,13 @@
+package org.openhie.openempi.dao;
+
+import java.util.List;
+
+import org.openhie.openempi.model.AuditEvent;
+import org.openhie.openempi.model.AuditEventType;
+
+public interface AuditEventDao extends UniversalDao
+{
+       public AuditEventType getAuditEventTypeByCode(String 
auditEventTypeCode);
+       
+       public List<AuditEvent> getAuditEventByType(AuditEventType 
auditEventType);
+}

Property changes on: 
branches/2.0.3-development/openempi/core/src/main/java/org/openhie/openempi/dao/AuditEventDao.java
___________________________________________________________________
Added: svn:eol-style
   + native

Index: 
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-service.xml
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-service.xml
  (revision 22)
+++ 
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-service.xml
  (revision 23)
@@ -169,6 +169,7 @@
                <property name="matchingService" 
ref="basicExactMatchingService" />
                <property name="blockingService" ref="blockingService" />
                <property name="stringComparisonService" 
ref="stringComparisonService" />
+               <property name="auditEventService" ref="auditEventService" />
        </bean>
 
        <bean id="personManagerService"
@@ -210,6 +211,11 @@
                <property name="personLinkDao" ref="personLinkDao" />
        </bean>
 
+       <bean id="auditEventService" 
class="org.openhie.openempi.service.impl.AuditEventServiceImpl"
+               init-method="init">
+               <property name="auditEventDao" ref="auditEventDao" />
+       </bean>
+       
        <bean id="validationService" 
class="org.openhie.openempi.service.impl.ValidationServiceImpl">
        </bean>
 
Index: 
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-dao.xml
===================================================================
--- 
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-dao.xml
      (revision 22)
+++ 
branches/2.0.3-development/openempi/core/src/main/resources/applicationContext-dao.xml
      (revision 23)
@@ -79,6 +79,10 @@
         <property name="sessionFactory" ref="sessionFactory"/>
     </bean>
     
+    <bean id="auditEventDao" 
class="org.openhie.openempi.dao.hibernate.AuditEventDaoHibernate">
+        <property name="sessionFactory" ref="sessionFactory"/>
+    </bean>
+    
     <!-- If you want to be able to do simple CRUD for new domain objects 
without 
         having to cast, you don't have create a Dao interface and 
implementation 
         for that domain object, you simply have to do the following.  





[openempi~source-repository:23] Added auditing of all major operations

odysseas 01/22/2010
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close