// Path: common/src/main/java/org/artificer/common/audit/AuditItemTypes.java
// public final class AuditItemTypes {
// 
//     public static final String PROPERTY_ADDED    = "property:added";
//     public static final String PROPERTY_CHANGED  = "property:changed";
//     public static final String PROPERTY_REMOVED  = "property:removed";
//     public static final String CLASSIFIERS_ADDED    = "classifier:added";
//     public static final String CLASSIFIERS_REMOVED  = "classifier:removed";
// 
// }
// 
// Path: repository/src/main/java/org/artificer/repository/audit/ArtifactDiff.java
// public class ArtifactDiff {
// 
//     private Map<String, String> addedProperties = new HashMap<String, String>();
//     private Map<String, String> updatedProperties = new HashMap<String, String>();
//     private Set<String> deletedProperties = new HashSet<String>();
//     private Set<String> addedClassifiers = new HashSet<String>();
//     private Set<String> deletedClassifiers = new HashSet<String>();
// 
//     /**
//      * Constructor.
//      */
//     public ArtifactDiff() {
//     }
// 
//     /**
//      * @return the addedProperties
//      */
//     public Map<String, String> getAddedProperties() {
//         return addedProperties;
//     }
// 
//     /**
//      * @return the updatedProperties
//      */
//     public Map<String, String> getUpdatedProperties() {
//         return updatedProperties;
//     }
// 
//     /**
//      * @return the deletedProperties
//      */
//     public Set<String> getDeletedProperties() {
//         return deletedProperties;
//     }
// 
//     /**
//      * @return the addedClassifiers
//      */
//     public Set<String> getAddedClassifiers() {
//         return addedClassifiers;
//     }
// 
//     /**
//      * @return the deletedClassifiers
//      */
//     public Set<String> getDeletedClassifiers() {
//         return deletedClassifiers;
//     }
// 
//     /**
//      * @param addedProperties the addedProperties to set
//      */
//     public void setAddedProperties(Map<String, String> addedProperties) {
//         this.addedProperties = addedProperties;
//     }
// 
//     /**
//      * @param updatedProperties the updatedProperties to set
//      */
//     public void setUpdatedProperties(Map<String, String> updatedProperties) {
//         this.updatedProperties = updatedProperties;
//     }
// 
//     /**
//      * @param deletedProperties the deletedProperties to set
//      */
//     public void setDeletedProperties(Set<String> deletedProperties) {
//         this.deletedProperties = deletedProperties;
//     }
// 
//     /**
//      * @param addedClassifiers the addedClassifiers to set
//      */
//     public void setAddedClassifiers(Set<String> addedClassifiers) {
//         this.addedClassifiers = addedClassifiers;
//     }
// 
//     /**
//      * @param deletedClassifiers the deletedClassifiers to set
//      */
//     public void setDeletedClassifiers(Set<String> deletedClassifiers) {
//         this.deletedClassifiers = deletedClassifiers;
//     }
// 
// }


import org.artificer.common.audit.AuditEntryTypes;
import org.artificer.common.audit.AuditItemTypes;
import org.artificer.repository.audit.ArtifactDiff;
import org.artificer.repository.hibernate.HibernateEntityFactory;
import org.artificer.repository.hibernate.entity.ArtificerArtifact;
import org.jboss.downloads.artificer._2013.auditing.AuditEntry;
import org.jboss.downloads.artificer._2013.auditing.AuditItemType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
            } else {
                diff.getAddedProperties().put(name, newValue);
            }
        }

        for (String newClassifier : newClassifiers) {
            if (!oldClassifiers.contains(newClassifier)) {
                diff.getAddedClassifiers().add(newClassifier);
            }
            // Remove it so that, at the end of this, the classifier set contains only
            // classifiers that were removed.
            oldClassifiers.remove(newClassifier);
        }

        // Process property deletes
        for (Map.Entry<String, String> entry : oldProperties.entrySet()) {
            String name = entry.getKey();
            diff.getDeletedProperties().add(name);
        }

        // Process classifier deletes
        for (String classifier : oldClassifiers) {
            diff.getDeletedClassifiers().add(classifier);
        }

        ArtificerAuditEntry artificerAuditEntry = new ArtificerAuditEntry();
        artificerAuditEntry.setUuid(UUID.randomUUID().toString());
        artificerAuditEntry.setModifiedBy(HibernateEntityFactory.user());
        artificerAuditEntry.setType(AuditEntryTypes.ARTIFACT_UPDATE);

// Path: common/src/main/java/org/artificer/common/audit/AuditItemTypes.java
// public final class AuditItemTypes {
// 
//     public static final String PROPERTY_ADDED    = "property:added";
//     public static final String PROPERTY_CHANGED  = "property:changed";
//     public static final String PROPERTY_REMOVED  = "property:removed";
//     public static final String CLASSIFIERS_ADDED    = "classifier:added";
//     public static final String CLASSIFIERS_REMOVED  = "classifier:removed";
// 
// }
// 
// Path: repository/src/main/java/org/artificer/repository/audit/ArtifactDiff.java
// public class ArtifactDiff {
// 
//     private Map<String, String> addedProperties = new HashMap<String, String>();
//     private Map<String, String> updatedProperties = new HashMap<String, String>();
//     private Set<String> deletedProperties = new HashSet<String>();
//     private Set<String> addedClassifiers = new HashSet<String>();
//     private Set<String> deletedClassifiers = new HashSet<String>();
// 
//     /**
//      * Constructor.
//      */
//     public ArtifactDiff() {
//     }
// 
//     /**
//      * @return the addedProperties
//      */
//     public Map<String, String> getAddedProperties() {
//         return addedProperties;
//     }
// 
//     /**
//      * @return the updatedProperties
//      */
//     public Map<String, String> getUpdatedProperties() {
//         return updatedProperties;
//     }
// 
//     /**
//      * @return the deletedProperties
//      */
//     public Set<String> getDeletedProperties() {
//         return deletedProperties;
//     }
// 
//     /**
//      * @return the addedClassifiers
//      */
//     public Set<String> getAddedClassifiers() {
//         return addedClassifiers;
//     }
// 
//     /**
//      * @return the deletedClassifiers
//      */
//     public Set<String> getDeletedClassifiers() {
//         return deletedClassifiers;
//     }
// 
//     /**
//      * @param addedProperties the addedProperties to set
//      */
//     public void setAddedProperties(Map<String, String> addedProperties) {
//         this.addedProperties = addedProperties;
//     }
// 
//     /**
//      * @param updatedProperties the updatedProperties to set
//      */
//     public void setUpdatedProperties(Map<String, String> updatedProperties) {
//         this.updatedProperties = updatedProperties;
//     }
// 
//     /**
//      * @param deletedProperties the deletedProperties to set
//      */
//     public void setDeletedProperties(Set<String> deletedProperties) {
//         this.deletedProperties = deletedProperties;
//     }
// 
//     /**
//      * @param addedClassifiers the addedClassifiers to set
//      */
//     public void setAddedClassifiers(Set<String> addedClassifiers) {
//         this.addedClassifiers = addedClassifiers;
//     }
// 
//     /**
//      * @param deletedClassifiers the deletedClassifiers to set
//      */
//     public void setDeletedClassifiers(Set<String> deletedClassifiers) {
//         this.deletedClassifiers = deletedClassifiers;
//     }
// 
// }


// Path: repository/hibernate/src/main/java/org/artificer/repository/hibernate/audit/HibernateAuditor.java
import org.artificer.common.audit.AuditEntryTypes;
import org.artificer.common.audit.AuditItemTypes;
import org.artificer.repository.audit.ArtifactDiff;
import org.artificer.repository.hibernate.HibernateEntityFactory;
import org.artificer.repository.hibernate.entity.ArtificerArtifact;
import org.jboss.downloads.artificer._2013.auditing.AuditEntry;
import org.jboss.downloads.artificer._2013.auditing.AuditItemType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

            } else {
                diff.getAddedProperties().put(name, newValue);
            }
        }

        for (String newClassifier : newClassifiers) {
            if (!oldClassifiers.contains(newClassifier)) {
                diff.getAddedClassifiers().add(newClassifier);
            }
            // Remove it so that, at the end of this, the classifier set contains only
            // classifiers that were removed.
            oldClassifiers.remove(newClassifier);
        }

        // Process property deletes
        for (Map.Entry<String, String> entry : oldProperties.entrySet()) {
            String name = entry.getKey();
            diff.getDeletedProperties().add(name);
        }

        // Process classifier deletes
        for (String classifier : oldClassifiers) {
            diff.getDeletedClassifiers().add(classifier);
        }

        ArtificerAuditEntry artificerAuditEntry = new ArtificerAuditEntry();
        artificerAuditEntry.setUuid(UUID.randomUUID().toString());
        artificerAuditEntry.setModifiedBy(HibernateEntityFactory.user());
        artificerAuditEntry.setType(AuditEntryTypes.ARTIFACT_UPDATE);

        createAuditItem(artificerAuditEntry, AuditItemTypes.PROPERTY_ADDED, diff.getAddedProperties());