Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.owasp.appsensor.storage.jpa2;
 
 
 
This is a jpa2 implementation of the org.owasp.appsensor.core.storage.EventStore. Implementations of the org.owasp.appsensor.core.listener.EventListener interface can register with this class and be notified when new org.owasp.appsensor.core.Events are added to the data store The implementation stores the org.owasp.appsensor.core.Event in a jpa2 driven DB.

Author(s):
John Melton (jtmelton@gmail.com) http://www.jtmelton.com/
public class Jpa2EventStore extends EventStore {
	private Logger logger;

maintain a repository to read/write org.owasp.appsensor.core.Events from
	public void addEvent(Event event) {
		.warn("Security event " + event.getDetectionPoint().getLabel() + " triggered by user: " + event.getUser().getUsername());
		super.notifyListeners(event);
	}

	public Collection<EventfindEvents(SearchCriteria criteria) {
		// TODO: instead of findAll every time (inefficient), update this to do actual query
		return findEvents(criteria.findAll());
	}
New to GrepCode? Check out our FAQ X