Commits

Christian Bockermann committed 828d691 Merge with conflicts

Merge branch 'master' of ssh://bitbucket.org/cbockermann/org.jwall.web.audit

Conflicts:
pom.xml

  • Participants
  • Parent commits 51b6cac, d7d1c85

Comments (0)

Files changed (4)

 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.jwall</groupId>
 	<artifactId>org.jwall.web.audit</artifactId>
-	<version>0.6.1-SNAPSHOT</version>
+	<version>0.6.1</version>
 
 	<name>web-audit Library</name>
 	<description>A Java Library for handling ModSecurity audit-log data.</description>
 			<version>0.7.2</version>
 		</dependency>
 		<dependency>
-			<groupId>org.jwall</groupId>
-			<artifactId>stream-runtime</artifactId>
-			<version>1.0</version>
-		</dependency>
-		<dependency>
 			<groupId>net.minidev</groupId>
 			<artifactId>json-smart</artifactId>
 			<version>2.0-RC2</version>
 		</dependency>
+		<dependency>
+			<groupId>org.jwall</groupId>
+			<artifactId>stream-runtime</artifactId>
+			<version>1.0-SNAPSHOT</version>
+		</dependency>
 	</dependencies>
 
 	<issueManagement>
 				<version>2.8</version>
 				<configuration>
 					<!-- switch on dependency-driven aggregation -->
-					<includeDependencySources>true</includeDependencySources>
+					<includeDependencySources>false</includeDependencySources>
 
 					<dependencySourceExcludes>
 						<dependencySourceExclude>org.slf4j:*</dependencySourceExclude>
 					<show>public</show>
 				</configuration>
 			</plugin>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-project-info-reports-plugin</artifactId>
-				<version>2.4</version>
-				<reportSets>
-					<reportSet>
-						<reports>
-							<report>project-team</report>
-							<report>mailing-list</report>
-							<report>scm</report>
-							<report>cim</report>
-							<report>dependencies</report>
-							<!-- <report>issue-tracking</report> <report>license</report> -->
-						</reports>
-					</reportSet>
-				</reportSets>
-			</plugin>
-		</plugins>
-	</reporting>
+                        <plugin>
+                                <groupId>org.apache.maven.plugins</groupId>
+                                <artifactId>maven-project-info-reports-plugin</artifactId>
+                                <version>2.4</version>
+                                <reportSets>
+                                        <reportSet>
+                                                <reports>
+                                                        <report>project-team</report>
+                                                        <report>mailing-list</report>
+                                                        <report>scm</report>
+                                                        <report>cim</report>
+                                                        <report>dependencies</report>
+                                                        <!-- <report>issue-tracking</report> <report>license</report> -->
+                                                </reports>
+                                        </reportSet>
+                                </reportSets>
+                        </plugin>
+                        <plugin>
+                                <groupId>org.apache.maven.plugins</groupId>
+                                <artifactId>maven-surefire-report-plugin</artifactId>
+                                <version>2.11</version>
+                        </plugin>
+                </plugins>
+        </reporting>
 
 	<ciManagement>
 		<system>jenkins</system>

src/main/java/org/jwall/web/audit/io/IronBeeAuditReader.java

 import org.apache.james.mime4j.stream.Field;
 import org.jwall.web.audit.AuditEvent;
 import org.jwall.web.audit.IronBeeAuditEvent;
+import org.jwall.web.audit.util.ProcessContextImpl;
 import org.jwall.web.audit.util.Timestamp;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import stream.StatefulProcessor;
 import stream.data.Data;
 import stream.data.DataFactory;
-import stream.runtime.LocalContext;
 
 public class IronBeeAuditReader implements AuditEventReader {
 	static Logger log = LoggerFactory.getLogger(IronBeeAuditReader.class);
 		processors.add(new Timestamp("RECEIVED", "yyyy-mm-dd'T'hh:mm:ss.SZ",
 				"LOG_TIMESTAMP"));
 
-		final ProcessContext ctx = new LocalContext();
+		final ProcessContext ctx = new ProcessContextImpl();
 
 		for (Processor p : processors) {
 			try {

src/main/java/org/jwall/web/audit/util/ProcessContextImpl.java

+package org.jwall.web.audit.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import stream.ProcessContext;
+import stream.service.Service;
+
+public class ProcessContextImpl implements ProcessContext {
+
+	final Map<String, Service> services = new HashMap<String, Service>();
+	final Map<String, Object> objects = new HashMap<String, Object>();
+
+	@Override
+	public Object resolve(String variable) {
+		return objects.get(variable);
+	}
+
+	@Override
+	public Service lookup(String ref) throws Exception {
+		return services.get(ref);
+	}
+
+	@Override
+	public void register(String ref, Service p) throws Exception {
+		services.put(ref, p);
+	}
+
+	@Override
+	public void unregister(String ref) throws Exception {
+		services.remove(ref);
+	}
+
+	@Override
+	public Object get(String key) {
+		return objects.get(key);
+	}
+
+	@Override
+	public void set(String key, Object o) {
+		objects.put(key, o);
+	}
+}

src/site/site.xml

 	  <item name="Download" href="download.html" />
     </menu>
 	
-	${reports}
-	
+    <menu ref="reports"/>
+
   </body>
   <skin>
     <groupId>org.jwall</groupId>