http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/MinValueConstraint.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/MinValueConstraint.java
 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/MinValueConstraint.java
new file mode 100644
index 0000000..3e5fe3a
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/MinValueConstraint.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.api.plugins;
+
+import java.math.BigDecimal;
+
+import org.apache.logging.log4j.catalog.api.ConstraintType;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+import static org.apache.logging.log4j.catalog.api.util.StringUtils.isBlank;
+import static 
org.apache.logging.log4j.catalog.api.util.StringUtils.appendNewline;
+
+/**
+ *
+ */
+@Plugin(name = "minValue", category = ConstraintType.CATEGORY)
+public class MinValueConstraint implements ConstraintType {
+
+    @Override
+    public void validate(boolean isRequestContext, String name, String value, 
String minValue, StringBuilder error) {
+        if (isBlank(minValue)) {
+            appendNewline(error);
+            if (isRequestContext) {
+                error.append("ThreadContext key ");
+            }
+            error.append(name).append(" has no value for the minimum value 
defined");
+            return;
+        }
+        if (!isBlank(value)) {
+            try {
+                BigDecimal minVal = new BigDecimal(minValue);
+                BigDecimal val = new BigDecimal(value);
+                if (val.compareTo(minVal) < 0) {
+                    appendNewline(error);
+                    if (isRequestContext) {
+                        error.append("ThreadContext key ");
+                    }
+                    error.append(name).append(" is less than 
").append(minValue);
+                }
+            } catch (Exception ex) {
+                appendNewline(error);
+                if (isRequestContext) {
+                    error.append("ThreadContext key ");
+                }
+                error.append(name).append(" encountered an error trying to 
determine the minimum value: ").append(ex.getMessage());
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/PatternConstraint.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/PatternConstraint.java
 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/PatternConstraint.java
new file mode 100644
index 0000000..b983d4b
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/plugins/PatternConstraint.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.api.plugins;
+
+import org.apache.logging.log4j.catalog.api.ConstraintType;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+import static org.apache.logging.log4j.catalog.api.util.StringUtils.*;
+import static 
org.apache.logging.log4j.catalog.api.util.StringUtils.appendNewline;
+
+/**
+ *
+ */
+@Plugin(name = "pattern", category = ConstraintType.CATEGORY)
+public class PatternConstraint implements ConstraintType {
+
+    @Override
+    public void validate(boolean isRequestContext, String name, String value, 
String pattern, StringBuilder error) {
+        if (!isBlank(pattern) && !isBlank(value)) {
+            if (!value.matches(pattern)) {
+                appendNewline(error);
+                if (isRequestContext) {
+                    error.append("ThreadContext key ");
+                }
+                error.append(name).append(" does not match pattern 
").append(pattern);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/service/CatalogService.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/service/CatalogService.java
 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/service/CatalogService.java
new file mode 100644
index 0000000..93a3672
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/service/CatalogService.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.api.service;
+
+import org.apache.logging.log4j.catalog.api.CatalogData;
+
+/**
+ * Catalog Service methods.
+ */
+public interface CatalogService {
+    CatalogData getCatalogData();
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/StringUtils.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/StringUtils.java
 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/StringUtils.java
new file mode 100644
index 0000000..a1d4e70
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/StringUtils.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.api.util;
+
+/**
+ *
+ */
+public final class StringUtils {
+
+    private StringUtils() {
+    }
+
+    public static final boolean isBlank(String value) {
+        return value == null || value.length() == 0;
+    }
+
+    public static void appendNewline(StringBuilder builder) {
+        if (builder.length() > 0) {
+            builder.append("\n");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-git/pom.xml 
b/log4j-catalog/log4j-catalog-git/pom.xml
new file mode 100644
index 0000000..06b291c
--- /dev/null
+++ b/log4j-catalog/log4j-catalog-git/pom.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.logging.log4j</groupId>
+    <artifactId>log4j-catalog</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <artifactId>log4j-catalog-git</artifactId>
+  <packaging>jar</packaging>
+  <name>Log4j Catalog Git DAO</name>
+  <url>http://maven.apache.org</url>
+
+  <dependencies>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-catalog-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-catalog-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context-support</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.json</groupId>
+      <artifactId>json</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.xml.bind</groupId>
+      <artifactId>jaxb-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax</groupId>
+      <artifactId>javaee-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jgit</groupId>
+      <artifactId>org.eclipse.jgit</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.6</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/ServiceConfig.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/ServiceConfig.java
 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/ServiceConfig.java
new file mode 100644
index 0000000..165cd39
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/ServiceConfig.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.git.config;
+
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class ServiceConfig {
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/package-info.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/package-info.java
 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/package-info.java
new file mode 100644
index 0000000..a1cd674
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/config/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+/**
+ * Git configuration classes.
+ */
+package org.apache.logging.log4j.catalog.git.config;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
new file mode 100644
index 0000000..c31cf2d
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.git.dao;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.catalog.api.CatalogData;
+import org.apache.logging.log4j.catalog.api.dao.AbstractCatalogReader;
+import org.apache.logging.log4j.catalog.api.dao.CatalogDao;
+import 
org.apache.logging.log4j.catalog.api.exception.CatalogModificationException;
+import org.apache.logging.log4j.catalog.api.exception.CatalogReadException;
+import org.apache.logging.log4j.catalog.api.exception.CatalogNotFoundException;
+import org.eclipse.jgit.api.CloneCommand;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.PullCommand;
+import org.eclipse.jgit.api.PushCommand;
+import org.eclipse.jgit.api.TransportConfigCallback;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.internal.storage.file.FileRepository;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.CredentialsProvider;
+
+public class GitCatalogDao extends AbstractCatalogReader implements CatalogDao 
{
+    private static final Logger LOGGER = LogManager.getLogger();
+    private static final String DEFAULT_CATALOG_PATH = 
"src/main/resources/catalog.json";
+
+    private final ObjectMapper mapper;
+
+    private CredentialsProvider credentialsProvider = null;
+    private TransportConfigCallback transportConfigCallback = null;
+    private String remoteRepoUri = null;
+    private String localRepoPath = null;
+    private String catalogPath = DEFAULT_CATALOG_PATH;
+
+    private Repository localRepo = null;
+    private Git git = null;
+    private File catalogFile = null;
+
+    public GitCatalogDao() {
+        JsonFactory factory = new JsonFactory();
+        factory.enable(JsonParser.Feature.ALLOW_COMMENTS);
+        mapper = new ObjectMapper(factory);
+    }
+
+    public CredentialsProvider getCredentialsProvider() {
+        return credentialsProvider;
+    }
+
+    public void setCredentialsProvider(CredentialsProvider 
credentialsProvider) {
+        this.credentialsProvider = credentialsProvider;
+    }
+
+    public TransportConfigCallback getTransportConfigCallback() {
+        return transportConfigCallback;
+    }
+
+    public void setTransportConfigCallback(TransportConfigCallback 
transportConfigCallback) {
+        this.transportConfigCallback = transportConfigCallback;
+    }
+
+    public String getRemoteRepoUri() {
+        return remoteRepoUri;
+    }
+
+    public void setRemoteRepoUri(String remoteRepoUri) {
+        this.remoteRepoUri = remoteRepoUri;
+    }
+
+    public String getLocalRepoPath() {
+        return localRepoPath;
+    }
+
+    public void setLocalRepoPath(String localRepoPath) {
+        this.localRepoPath = localRepoPath;
+    }
+
+    public String getCatalogPath() {
+        return catalogPath;
+    }
+
+    public void setCatalogPath(String catalogPath) {
+        this.catalogPath = catalogPath;
+    }
+
+    @Override
+    public synchronized CatalogData read() {
+        updateRepo();
+        if (catalogFile == null || !catalogFile.exists() || 
!catalogFile.canRead()) {
+            throw new IllegalStateException("Catalog " + 
catalogFile.getAbsolutePath() + " is not readable.");
+        }
+
+        try {
+            catalogData = mapper.readValue(catalogFile, CatalogData.class);
+            return catalogData;
+        } catch (IOException ioe) {
+            throw new CatalogReadException("Error reading catalog from " + 
catalogFile.getAbsolutePath());
+        }
+    }
+
+    @Override
+    public void write(CatalogData data) {
+        File localRepoFile = new File(localRepoPath);
+        if (!localRepoFile.exists() || !localRepoFile.canWrite()) {
+            throw new IllegalStateException("Catalog is not writable.");
+        }
+
+        FileWriter writer = null;
+        try {
+            String text = mapper.writeValueAsString(data);
+            writer = new FileWriter(catalogFile);
+            writer.write(text);
+        } catch (IOException ioException) {
+            throw new CatalogModificationException("Unable to write catalog 
file.", ioException);
+        } finally {
+            try { if (writer != null) writer.close(); } catch(Exception 
exception) { }
+        }
+
+        try (Git git = Git.open(catalogFile)) {
+            git.add().addFilepattern(catalogPath).call();
+            git.commit().setMessage("Catalog updated").call();
+            updateRepo();
+            PushCommand pushCommand = git.push();
+            if (credentialsProvider != null) {
+                pushCommand.setCredentialsProvider(credentialsProvider);
+            }
+            if (transportConfigCallback != null) {
+                
pushCommand.setTransportConfigCallback(transportConfigCallback);
+            }
+            pushCommand.call();
+        } catch (GitAPIException | IOException ex) {
+            throw new CatalogModificationException("Unable to modify catalog", 
ex);
+        }
+    }
+
+    @Override
+    public String readCatalog() {
+        return null;
+    }
+
+    private void updateRepo() {
+
+        File localRepoFile = new File(localRepoPath);
+        if (!localRepoFile.exists()) {
+            LOGGER.debug("local git repo {} does not exist - creating it", 
localRepoPath);
+            localRepoFile.getParentFile().mkdirs();
+            CloneCommand cloneCommand = 
Git.cloneRepository().setURI(remoteRepoUri).setDirectory(localRepoFile);
+            if (credentialsProvider != null) {
+                cloneCommand.setCredentialsProvider(credentialsProvider);
+            }
+            if (transportConfigCallback != null) {
+                
cloneCommand.setTransportConfigCallback(transportConfigCallback);
+            }
+            try (Git git = cloneCommand.call()) {
+                catalogFile = new File(localRepoFile, catalogPath);
+            } catch (Exception ex) {
+                throw new CatalogNotFoundException("Unable to clone remote 
catalog at " + remoteRepoUri + " to " + localRepoPath, ex);
+            }
+        } else {
+            try {
+                LOGGER.debug("local git repo {} exists - updating", 
localRepoPath);
+                localRepo = new FileRepository(localRepoPath  + "/.git");
+                catalogFile = new File(localRepoFile, catalogPath);
+                git = new Git(localRepo);
+                PullCommand pullCommand = git.pull();
+                try {
+                    if (credentialsProvider != null) {
+                        
pullCommand.setCredentialsProvider(credentialsProvider);
+                    }
+                    if (transportConfigCallback != null) {
+                        
pullCommand.setTransportConfigCallback(transportConfigCallback);
+                    }
+                    pullCommand.call();
+                } catch (GitAPIException gitApiException) {
+                    LOGGER.error("Exception", gitApiException);
+                }
+            } catch (Exception exception) {
+                throw new CatalogReadException("Unable to pull remote catalog 
at " + remoteRepoUri + " to " + localRepoPath, exception);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogData.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogData.java
 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogData.java
new file mode 100644
index 0000000..48fe71b
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogData.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.git.dao;
+
+import org.apache.logging.log4j.catalog.api.CatalogData;
+
+/**
+ * The Catalog data..
+ */
+public class GitCatalogData extends CatalogData {
+
+    private String lastModification;
+    private String initStatus;
+
+    public String getLastModification() {
+        return lastModification;
+    }
+
+    public void setLastModification(String lastModification) {
+        this.lastModification = lastModification;
+    }
+
+    public void setInitStatus(String status) {
+        this.initStatus = status;
+    }
+
+    public String getInitStatus() {
+        return initStatus;
+    }
+
+    public CatalogData copyOf() {
+        CatalogData catalogData = new CatalogData();
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/package-info.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/package-info.java
 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/package-info.java
new file mode 100644
index 0000000..0f04cd5
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+/**
+ * DAOs to access the Catalog in GIT.
+ */
+package org.apache.logging.log4j.catalog.git.dao;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/package-info.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/package-info.java
 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/package-info.java
new file mode 100644
index 0000000..3d55338
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+/**
+ * Catalog storage and retrieval in GIT.
+ */
+package org.apache.logging.log4j.catalog.git;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/CatalogTest.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/CatalogTest.java
 
b/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/CatalogTest.java
new file mode 100644
index 0000000..ebbe165
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/CatalogTest.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.git;
+
+import org.apache.logging.log4j.catalog.api.CatalogData;
+import org.apache.logging.log4j.catalog.api.dao.CatalogDao;
+import org.apache.logging.log4j.catalog.git.config.ApplicationConfiguration;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.test.context.support.AnnotationConfigContextLoader;
+
+import static org.junit.Assert.*;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(loader = AnnotationConfigContextLoader.class, classes = 
{ApplicationConfiguration.class})
+@ActiveProfiles("lab")
+public class CatalogTest {
+
+    @Autowired
+    private CatalogDao catalogDao;
+
+    @BeforeClass
+    public static void initTest() {
+        try {
+            System.setProperty("environment", "lab");
+            System.setProperty("site", "dev1");
+            System.setProperty("applicationName", "CatalogService");
+        } catch (RuntimeException ex) {
+            throw ex;
+        }
+    }
+
+    @Test
+    public void testRetrieveCatalog() {
+        CatalogData data = catalogDao.read();
+        assertNotNull("No catalog data was returned", data);
+        assertEquals("Incorrect number of products", 1, 
data.getProducts().size());
+        assertEquals("Incorrect number of events", 4, data.getEvents().size());
+        assertEquals("Incorrect number of attributes", 10, 
data.getAttributes().size());
+        assertEquals("Incorrect number of categories", 2, 
data.getCategories().size());
+    }
+
+
+    @Test
+    public void testRetrieveEvents() {
+
+    }
+
+    @Test
+    public void testRetrieveEvent() {
+
+    }
+
+    @Test
+    public void testAddEvent() {
+
+    }
+
+    @Test
+    public void testModifyEvent() {
+
+    }
+
+    @Test
+    public void testDeleteEvent() {
+
+    }
+
+    @Test
+    public void testRetrieveAttributes() {
+    }
+
+    @Test
+    public void testRetrieveAttribute() {
+    }
+
+    @Test
+    public void testAddAttribute() {
+
+    }
+
+    @Test
+    public void testModifyAttribute() {
+    }
+
+    @Test
+    public void testDeleteAttribute() {
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/config/ApplicationConfiguration.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/config/ApplicationConfiguration.java
 
b/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/config/ApplicationConfiguration.java
new file mode 100644
index 0000000..f8ae7b5
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-git/src/test/java/org/apache/logging/log4j/catalog/git/config/ApplicationConfiguration.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.git.config;
+
+import javax.annotation.PreDestroy;
+import java.io.File;
+
+import org.apache.logging.log4j.catalog.git.dao.GitCatalogDao;
+import org.eclipse.jgit.transport.CredentialsProvider;
+import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.FileSystemUtils;
+
+@Configuration
+@ComponentScan(basePackages = { "org.apache.logging.log4j.catalog" })
+public class ApplicationConfiguration {
+
+    private String gitLocalRepoPath;
+
+    private String gitRemoteRepoUri;
+
+    @Bean
+    public GitCatalogDao catalogDao() {
+        String tempDir = System.getProperty("java.io.tmpdir");
+        gitLocalRepoPath = tempDir + "/audit/catalog";
+        gitRemoteRepoUri = 
"https://git-wip-us.apache.org/repos/asf/logging-log4j-audit-sample.git";;
+        File file = new File(gitLocalRepoPath);
+        File parent = file.getParentFile();
+        parent.mkdirs();
+        FileSystemUtils.deleteRecursively(file);
+        GitCatalogDao catalogDao = new GitCatalogDao();
+        catalogDao.setLocalRepoPath(gitLocalRepoPath);
+        catalogDao.setRemoteRepoUri(gitRemoteRepoUri);
+        catalogDao.setCatalogPath("audit-test/catalog.json");
+        //CredentialsProvider credentialsProvider = new 
UsernamePasswordCredentialsProvider("waymirec", "w4ym1r3c");
+        //catalogDao.setCredentialsProvider(credentialsProvider);
+        return catalogDao;
+    }
+
+    @PreDestroy
+    public void destroy() {
+        String tempDir = System.getProperty("java.io.tmpdir");
+        gitLocalRepoPath = tempDir + "/audit/catalog";
+        File file = new File(gitLocalRepoPath);
+        FileSystemUtils.deleteRecursively(file);
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-git/src/test/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-git/src/test/resources/log4j2.xml 
b/log4j-catalog/log4j-catalog-git/src/test/resources/log4j2.xml
new file mode 100644
index 0000000..4ef2c0f
--- /dev/null
+++ b/log4j-catalog/log4j-catalog-git/src/test/resources/log4j2.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  -->
+<Configuration status="ERROR">
+  <properties>
+    <property name="LOG_DIR">target/logs</property>
+  </properties>
+  <MarkerFilter marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{ABSOLUTE} %-5level # %class.%method %m%n" />
+    </Console>
+
+    <RollingFile name="log4j" fileName="${LOG_DIR}/log4j.txt" 
filePattern="${LOG_DIR}/archive/log4j.txt.%d{yyyyMMdd_HH}-%i">
+      <PatternLayout>
+        <MarkerPatternSelector defaultPattern="%d [%t] %-5p %X{loginId, 
userId, ipAddress, corpAcctNumber} %C{1.}.%M:%L - %m%n">
+          <PatternMatch key="FLOW" pattern="%d [%t] %-5p %X{loginId, userId, 
ipAddress, corpAcctNumber} -------- %C{1.}.%M:%L %msg --------%n"/>
+        </MarkerPatternSelector>
+      </PatternLayout>
+      <Policies>
+        <SizeBasedTriggeringPolicy size="30 MB"/>
+      </Policies>
+      <DefaultRolloverStrategy min="1" max="20"/>
+    </RollingFile>
+  </Appenders>
+  <Loggers>
+    <Logger name="com.nextiva.nextivaDriveService" level="debug" 
additivity="false">
+      <AppenderRef ref="log4j"/>
+    </Logger>
+    <Root level="debug">
+      <AppenderRef ref="log4j" />
+    </Root>
+  </Loggers>
+</Configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-jpa/pom.xml 
b/log4j-catalog/log4j-catalog-jpa/pom.xml
new file mode 100644
index 0000000..8b94886
--- /dev/null
+++ b/log4j-catalog/log4j-catalog-jpa/pom.xml
@@ -0,0 +1,257 @@
+<?xml version="1.0"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements. See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.logging.log4j</groupId>
+    <artifactId>log4j-catalog</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <artifactId>log4j-catalog-jpa</artifactId>
+  <packaging>jar</packaging>
+  <name>Log4j Catalog JPA DAO</name>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-catalog-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context-support</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.data</groupId>
+      <artifactId>spring-data-jpa</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-databind</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.json</groupId>
+      <artifactId>json</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.xml.bind</groupId>
+      <artifactId>jaxb-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.mchange</groupId>
+      <artifactId>c3p0</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.mchange</groupId>
+      <artifactId>mchange-commons-java</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hsqldb</groupId>
+      <artifactId>hsqldb</artifactId>
+      <version>${hsqldb.version}</version>
+      <!-- <scope>test</scope> -->
+    </dependency>
+    <dependency>
+      <groupId>javax</groupId>
+      <artifactId>javaee-api</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.modelmapper</groupId>
+      <artifactId>modelmapper</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.modelmapper.extensions</groupId>
+      <artifactId>modelmapper-spring</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.modelmapper.extensions</groupId>
+      <artifactId>modelmapper-jackson</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.google.jimfs</groupId>
+      <artifactId>jimfs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.jgit</groupId>
+      <artifactId>org.eclipse.jgit</artifactId>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.6</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <profiles>
+    <profile>
+      <id>hibernate</id>
+      <activation>
+        <property>
+          <name>hibernate</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate-core</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate-entitymanager</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate-java8</artifactId>
+        </dependency>
+        <dependency>
+          <groupId>org.hibernate</groupId>
+          <artifactId>hibernate-c3p0</artifactId>
+        </dependency>
+      </dependencies>
+    </profile>
+    <profile>
+
+      <!--
+
+      Sets up the build to run the EclipseLink Maven plugin at compile time 
and instrument
+      domain types. This will prevent the need for load-time weaving when 
running the app.
+
+      -->
+
+      <id>eclipseLink</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+        <property>
+          <name>!hibernate</name>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>org.eclipse.persistence</groupId>
+          <artifactId>org.eclipse.persistence.jpa</artifactId>
+        </dependency>
+      </dependencies>
+      <build>
+        <plugins>
+
+          <!-- Static weaver for EclipseLink -->
+          <plugin>
+            <groupId>com.ethlo.persistence.tools</groupId>
+            <artifactId>eclipselink-maven-plugin</artifactId>
+            <version>2.6.4.2</version>
+            <executions>
+              <execution>
+                <phase>process-classes</phase>
+                <goals>
+                  <goal>weave</goal>
+                </goals>
+              </execution>
+            </executions>
+
+            <dependencies>
+              <dependency>
+                <groupId>org.eclipse.persistence</groupId>
+                <artifactId>org.eclipse.persistence.jpa</artifactId>
+                <version>${eclipselink.version}</version>
+              </dependency>
+            </dependencies>
+
+          </plugin>
+        </plugins>
+      </build>
+
+      <repositories>
+        <repository>
+          <id>com.ethlo.eclipselink.tools</id>
+          <url>http://ethlo.com/maven</url>
+        </repository>
+      </repositories>
+
+      <pluginRepositories>
+        <pluginRepository>
+          <id>com.ethlo.eclipselink.tools</id>
+          <url>http://ethlo.com/maven</url>
+        </pluginRepository>
+      </pluginRepositories>
+
+    </profile>
+  </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/ApplicationConfiguration.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/ApplicationConfiguration.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/ApplicationConfiguration.java
new file mode 100644
index 0000000..b6bdb6d
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/ApplicationConfiguration.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.jpa.config;
+
+import org.apache.logging.log4j.catalog.api.service.CatalogService;
+import org.apache.logging.log4j.catalog.jpa.service.CatalogServiceImpl;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+
+@Configuration
+@ComponentScan(basePackages = { "org.apache.logging.log4j.catalog" })
+@Import(HibernatgeDataSourceConfig.class)
+public class ApplicationConfiguration {
+    @Bean
+    public CatalogService catalogService() {
+        return new CatalogServiceImpl();
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/EclipseLinkDataSourceConfig.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/EclipseLinkDataSourceConfig.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/EclipseLinkDataSourceConfig.java
new file mode 100644
index 0000000..cfd3904
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/EclipseLinkDataSourceConfig.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.config;
+
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+
+import java.util.Properties;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
+import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@Configuration
+@EnableJpaRepositories("org.apache.logging.log4j.catalog.jpa.dao")
+@EnableTransactionManagement
+@Profile("default")
+public class EclipseLinkDataSourceConfig {
+
+    @Bean
+    public DataSource dataSource() {
+        System.out.println("Running embedded database builder");
+        return new EmbeddedDatabaseBuilder()
+                .setType(EmbeddedDatabaseType.HSQL)
+                .addScript("classpath:sql/schema.sql")
+                .build();
+    }
+
+    @Bean
+    public EntityManagerFactory entityManagerFactory() {
+        AbstractJpaVendorAdapter vendorAdapter = new 
EclipseLinkJpaVendorAdapter();
+        vendorAdapter.setGenerateDdl(false);
+        LocalContainerEntityManagerFactoryBean factory = new 
LocalContainerEntityManagerFactoryBean();
+        Properties properties = new Properties();
+        properties.setProperty("eclipselink.weaving", "static");
+        factory.setJpaProperties(properties);
+        factory.setJpaVendorAdapter(vendorAdapter);
+        factory.setPackagesToScan("org.apache.logging.log4j.catalog");
+        factory.setDataSource(dataSource());
+        factory.afterPropertiesSet();
+
+        return factory.getObject();
+    }
+
+    @Bean
+    public PlatformTransactionManager transactionManager() {
+        JpaTransactionManager txManager = new JpaTransactionManager();
+        txManager.setEntityManagerFactory(entityManagerFactory());
+        return txManager;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/HibernatgeDataSourceConfig.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/HibernatgeDataSourceConfig.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/HibernatgeDataSourceConfig.java
new file mode 100644
index 0000000..8bdc785
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/HibernatgeDataSourceConfig.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
+import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+
+@Configuration
+@EnableJpaRepositories("org.apache.logging.log4j.catalog.jpa.dao")
+@EnableTransactionManagement
+@Profile("hibernate")
+public class HibernatgeDataSourceConfig {
+
+    @Bean
+    public DataSource dataSource() {
+        System.out.println("Running embedded database builder");
+        return new EmbeddedDatabaseBuilder()
+                .setType(EmbeddedDatabaseType.HSQL)
+                .addScript("classpath:sql/schema.sql")
+                .build();
+    }
+
+    @Bean
+    public EntityManagerFactory entityManagerFactory() {
+        AbstractJpaVendorAdapter vendorAdapter = new 
HibernateJpaVendorAdapter();
+        vendorAdapter.setGenerateDdl(false);
+
+        LocalContainerEntityManagerFactoryBean factory = new 
LocalContainerEntityManagerFactoryBean();
+        factory.setJpaVendorAdapter(vendorAdapter);
+        factory.setPackagesToScan("org.apache.logging.log4j.catalog");
+        factory.setDataSource(dataSource());
+        factory.afterPropertiesSet();
+
+        return factory.getObject();
+    }
+
+    @Bean
+    public PlatformTransactionManager transactionManager() {
+        JpaTransactionManager txManager = new JpaTransactionManager();
+        txManager.setEntityManagerFactory(entityManagerFactory());
+        return txManager;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/package-info.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/package-info.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/package-info.java
new file mode 100644
index 0000000..c95f9ce
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/config/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+/**
+ * Configuration for JPA access to catalog.
+ */
+package org.apache.logging.log4j.catalog.jpa.config;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeConverter.java
new file mode 100644
index 0000000..ba8962d
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeConverter.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.catalog.api.Attribute;
+import org.apache.logging.log4j.catalog.api.Constraint;
+import org.apache.logging.log4j.catalog.jpa.model.AttributeModel;
+import org.apache.logging.log4j.catalog.jpa.model.ConstraintModel;
+import org.apache.logging.log4j.catalog.jpa.service.AttributeService;
+import org.modelmapper.AbstractConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ */
+@Component
+public class AttributeConverter extends AbstractConverter<Attribute, 
AttributeModel> {
+    private static Logger LOGGER = 
LogManager.getLogger(AttributeConverter.class);
+
+    @Autowired
+    private AttributeService attributeService;
+
+    public  AttributeModel convert(Attribute attribute) {
+        LOGGER.traceEntry(attribute.getName());
+        AttributeModel model;
+        if (attribute.getId() != null) {
+            model = 
attributeService.getAttribute(attribute.getId()).orElseGet(AttributeModel::new);
+        } else {
+            model = new AttributeModel();
+        }
+        model.setName(attribute.getName());
+        model.setAliases(attribute.getAliases());
+        model.setDescription(attribute.getDescription());
+        model.setDisplayName(attribute.getDisplayName());
+        model.setDataType(attribute.getDataType());
+        model.setId(attribute.getId());
+        model.setCatalogId(attribute.getCatalogId());
+        model.setIndexed(attribute.isIndexed());
+        model.setRequestContext(attribute.isRequestContext());
+        model.setRequired(attribute.isRequired());
+        model.setSortable(attribute.isSortable());
+        model.setExamples(attribute.getExamples());
+        Set<ConstraintModel> constraintModels = model.getConstraints() != null 
? model.getConstraints() :
+                new HashSet<>();
+        Map<Long, ConstraintModel> constraintMap =
+            
constraintModels.stream().collect(Collectors.toMap(ConstraintModel::getId, 
Function.identity()));
+        if (attribute.getConstraints() != null) {
+            constraintModels.removeIf(a -> 
attribute.getConstraints().stream().noneMatch(b -> 
b.getId().equals(a.getId())));
+            for (Constraint constraint : attribute.getConstraints()) {
+                ConstraintModel constraintModel;
+                if (constraint.getId() != null) {
+                    constraintModel = constraintMap.get(constraint.getId());
+                    
constraintModel.setConstraintType(constraint.getConstraintType().getName());
+                    constraintModel.setValue(constraint.getValue());
+                } else {
+                    constraintModel = new ConstraintModel();
+                    
constraintModel.setConstraintType(constraint.getConstraintType().getName());
+                    constraintModel.setValue(constraint.getValue());
+                    constraintModels.add(constraintModel);
+                }
+            }
+        }
+        model.setConstraints(constraintModels);
+        return LOGGER.traceExit(model);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeModelConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeModelConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeModelConverter.java
new file mode 100644
index 0000000..527bcd4
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/AttributeModelConverter.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.logging.log4j.catalog.api.Attribute;
+import org.apache.logging.log4j.catalog.api.Constraint;
+import org.apache.logging.log4j.catalog.api.plugins.ConstraintPlugins;
+import org.apache.logging.log4j.catalog.jpa.model.AttributeModel;
+import org.apache.logging.log4j.catalog.jpa.model.ConstraintModel;
+import org.modelmapper.AbstractConverter;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ */
+@Component
+public class AttributeModelConverter extends AbstractConverter<AttributeModel, 
Attribute> {
+
+    public  Attribute convert(AttributeModel model) {
+        Attribute attribute = new Attribute();
+        attribute.setName(model.getName());
+        attribute.setDisplayName(model.getDisplayName());
+        attribute.setDescription(model.getDescription());
+        attribute.setAliases(model.getAliases());
+        attribute.setId(model.getId());
+        attribute.setCatalogId(model.getCatalogId());
+        attribute.setIndexed(model.isIndexed());
+        attribute.setSortable(model.isSortable());
+        attribute.setRequestContext(model.isRequestContext());
+        attribute.setRequired(model.isRequired());
+        attribute.setDataType(model.getDataType());
+        Set<ConstraintModel> constraintModels = model.getConstraints();
+        Set<Constraint> constraints = new HashSet<>();
+        if (constraintModels != null) {
+            for (ConstraintModel constraintModel : constraintModels) {
+                Constraint constraint = new Constraint();
+                constraint.setId(constraintModel.getId());
+                
constraint.setConstraintType(ConstraintPlugins.getInstance().findByName(constraintModel.getConstraintType()));
+                constraint.setValue(constraintModel.getValue());
+                constraints.add(constraint);
+            }
+        }
+        attribute.setConstraints(constraints);
+        return attribute;
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/BooleanToStringConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/BooleanToStringConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/BooleanToStringConverter.java
new file mode 100644
index 0000000..1d694f9
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/BooleanToStringConverter.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.jpa.converter;
+
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+
+/**
+ * Converter to convert between a Boolean and a String and vice-versa.
+ * A String of "Y" equates to Boolean.TRUE, and anything else is false.
+ */
+@Converter(autoApply = true)
+public class BooleanToStringConverter implements AttributeConverter<Boolean, 
String> {
+    @Override
+    public String convertToDatabaseColumn(Boolean value) {
+        return (value != null && value) ? "Y" : "N";
+    }
+
+    @Override
+    public Boolean convertToEntityAttribute(String value) {
+        return "Y".equals(value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryConverter.java
new file mode 100644
index 0000000..d946133
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryConverter.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.logging.log4j.catalog.api.Category;
+import org.apache.logging.log4j.catalog.jpa.model.CategoryModel;
+import org.apache.logging.log4j.catalog.jpa.model.EventModel;
+import org.apache.logging.log4j.catalog.jpa.service.EventService;
+import org.modelmapper.AbstractConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CategoryConverter extends AbstractConverter<Category, 
CategoryModel> {
+
+    @Autowired
+    private EventService eventService;
+
+    public CategoryModel convert(Category category) {
+        Map<String, EventModel> eventMap = eventService.getEventMap();
+        CategoryModel model = new CategoryModel();
+        model.setId(category.getId());
+        model.setCatalogId(category.getCatalogId());
+        model.setName(category.getName());
+        model.setDescription(category.getDescription());
+        model.setDisplayName(category.getDisplayName());
+        List<EventModel> events = new ArrayList<>(category.getEvents().size());
+        for (String name : category.getEvents()) {
+            EventModel event = eventMap.get(name);
+            if (event != null) {
+                events.add(event);
+            } else {
+                throw new IllegalArgumentException("Unknown event " + name + " 
for category " + category.getName());
+            }
+        }
+        model.setEvents(events);
+        return model;
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryModelConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryModelConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryModelConverter.java
new file mode 100644
index 0000000..c99ecb9
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/CategoryModelConverter.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.logging.log4j.catalog.api.Category;
+import org.apache.logging.log4j.catalog.jpa.model.CategoryModel;
+import org.apache.logging.log4j.catalog.jpa.model.EventModel;
+import org.apache.logging.log4j.catalog.jpa.service.EventService;
+import org.modelmapper.AbstractConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CategoryModelConverter extends AbstractConverter<CategoryModel, 
Category> {
+
+    @Autowired
+    private EventService eventService;
+
+    public Category convert(CategoryModel categoryModel) {
+        Category category = new Category();
+        category.setId(categoryModel.getId());
+        category.setCatalogId(categoryModel.getCatalogId());
+        category.setName(categoryModel.getName());
+        category.setDisplayName(categoryModel.getDisplayName());
+        category.setDescription(categoryModel.getDescription());
+        List<String> events = new 
ArrayList<>(categoryModel.getEvents().size());
+        for (EventModel event : categoryModel.getEvents()) {
+            events.add(event.getName());
+        }
+        category.setEvents(events);
+        return category;
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DataTypeConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DataTypeConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DataTypeConverter.java
new file mode 100644
index 0000000..e0cdaf5
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DataTypeConverter.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.jpa.converter;
+
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+
+import org.apache.logging.log4j.catalog.api.DataType;
+
+/**
+ * Converter to convert between a DataType and a String.
+ */
+@Converter(autoApply = true)
+public class DataTypeConverter implements AttributeConverter<DataType, String> 
{
+    @Override
+    public String convertToDatabaseColumn(DataType value) {
+        return value != null ? value.getTypeName() : null;
+    }
+
+    @Override
+    public DataType convertToEntityAttribute(String value) {
+        return DataType.fromName(value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DateTimeConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DateTimeConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DateTimeConverter.java
new file mode 100644
index 0000000..9a96bd6
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/DateTimeConverter.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+
+/**
+ * Utility class to convert LocalDate to DB timestamp and vice versa.
+ */
+
+@Converter(autoApply = true)
+public class DateTimeConverter implements AttributeConverter<LocalDateTime, 
Timestamp> {
+
+
+    @Override
+    public Timestamp convertToDatabaseColumn(LocalDateTime localDateTime) {
+        return localDateTime == null ? null : Timestamp.valueOf(localDateTime);
+    }
+
+    @Override
+    public LocalDateTime convertToEntityAttribute(Timestamp timestamp) {
+        return timestamp == null ? null : timestamp.toLocalDateTime();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventConverter.java
new file mode 100644
index 0000000..7c69180
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventConverter.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.catalog.api.Event;
+import org.apache.logging.log4j.catalog.api.EventAttribute;
+import 
org.apache.logging.log4j.catalog.api.exception.CatalogModificationException;
+import org.apache.logging.log4j.catalog.jpa.model.AttributeModel;
+import org.apache.logging.log4j.catalog.jpa.model.EventAttributeModel;
+import org.apache.logging.log4j.catalog.jpa.model.EventModel;
+import org.apache.logging.log4j.catalog.jpa.service.EventService;
+import org.modelmapper.AbstractConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ */
+@Component
+public class EventConverter extends AbstractConverter<Event, EventModel> {
+    private static Logger LOGGER = LogManager.getLogger(EventConverter.class);
+
+    @Autowired
+    private EventService eventService;
+
+    private List<AttributeModel> attributeModels;
+
+    public void setAttributes(List<AttributeModel> attributes) {
+        this.attributeModels = attributes;
+    }
+
+    public  EventModel convert(Event event) {
+        LOGGER.traceEntry(event.getName());
+        EventModel model;
+        if (event.getId() != null) {
+            model = 
eventService.getEvent(event.getId()).orElseGet(EventModel::new);
+        } else {
+            model = new EventModel();
+        }
+        model.setCatalogId(event.getCatalogId());
+        model.setName(event.getName());
+        model.setAliases(event.getAliases());
+        model.setDescription(event.getDescription());
+        model.setDisplayName(event.getDisplayName());
+        if (model.getAttributes() == null) {
+            model.setAttributes(new HashSet<>());
+        }
+        Set<EventAttributeModel> eventAttributeModels = model.getAttributes() 
!= null ? model.getAttributes() :
+                new HashSet<>();
+        List<EventAttribute> eventAttributes = event.getAttributes() != null ? 
event.getAttributes() : new ArrayList<>();
+        if (event.getAttributes() != null) {
+            for (EventAttribute eventAttribute : eventAttributes) {
+                EventAttributeModel eventAttributeModel = 
model.getAttribute(eventAttribute.getName());
+                if (eventAttributeModel != null) {
+                    
eventAttributeModel.setRequired(eventAttribute.isRequired());
+                } else {
+                    Optional<AttributeModel> optional =
+                            attributeModels.stream().filter(a -> 
a.getName().equals(eventAttribute.getName())).findFirst();
+                    if (optional.isPresent()) {
+                        eventAttributeModel = new EventAttributeModel();
+                        
eventAttributeModel.setRequired(eventAttribute.isRequired());
+                        eventAttributeModel.setEvent(model);
+                        eventAttributeModel.setAttribute(optional.get());
+                        eventAttributeModels.add(eventAttributeModel);
+                    } else {
+                        throw new CatalogModificationException("No catalog 
entry for " + eventAttribute.getName());
+                    }
+                }
+            }
+        }
+        eventAttributeModels.removeIf(a -> 
eventAttributes.stream().noneMatch(b -> 
b.getName().equals(a.getAttribute().getName())));
+        model.setAttributes(eventAttributeModels);
+        return LOGGER.traceExit(model);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f0884aeb/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventModelConverter.java
----------------------------------------------------------------------
diff --git 
a/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventModelConverter.java
 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventModelConverter.java
new file mode 100644
index 0000000..4f82621
--- /dev/null
+++ 
b/log4j-catalog/log4j-catalog-jpa/src/main/java/org/apache/logging/log4j/catalog/jpa/converter/EventModelConverter.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * 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.apache.logging.log4j.catalog.jpa.converter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.logging.log4j.catalog.api.Event;
+import org.apache.logging.log4j.catalog.api.EventAttribute;
+import org.apache.logging.log4j.catalog.jpa.model.EventAttributeModel;
+import org.apache.logging.log4j.catalog.jpa.model.EventModel;
+import org.modelmapper.AbstractConverter;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ */
+@Component
+public class EventModelConverter extends AbstractConverter<EventModel, Event> {
+
+    public  Event convert(EventModel model) {
+        Event event = new Event();
+        event.setName(model.getName());
+        event.setDisplayName(model.getDisplayName());
+        event.setDescription(model.getDescription());
+        event.setAliases(model.getAliases());
+        event.setId(model.getId());
+        event.setCatalogId(model.getCatalogId());
+        List<EventAttribute> attributes = new ArrayList<>();
+        if (model.getAttributes() != null) {
+            for (EventAttributeModel eventAttributeModel : 
model.getAttributes()) {
+                EventAttribute eventAttribute = new EventAttribute();
+                
eventAttribute.setName(eventAttributeModel.getAttribute().getName());
+                eventAttribute.setRequired(eventAttributeModel.isRequired());
+                attributes.add(eventAttribute);
+            }
+        }
+        event.setAttributes(attributes);
+        return event;
+    }
+}

Reply via email to