1 package org.simantics.event.util;
3 import java.util.ArrayList;
4 import java.util.Collection;
7 import org.simantics.db.ReadGraph;
8 import org.simantics.db.Resource;
9 import org.simantics.db.common.request.ObjectsWithType;
10 import org.simantics.db.common.request.ResourceRead;
11 import org.simantics.db.exception.DatabaseException;
12 import org.simantics.event.ontology.EventResource;
15 * Request for getting all event logs from a model.
17 * @author Tuukka Lehtonen
19 public class AllEventLogs extends ResourceRead<Collection<Resource>> {
21 public AllEventLogs(Resource model) {
26 public Collection<Resource> perform(ReadGraph graph) throws DatabaseException {
27 EventResource EVENT = EventResource.getInstance(graph);
28 List<Resource> result = new ArrayList<Resource>();
29 for (Resource eventLog : graph.syncRequest(new ObjectsWithType(resource, EVENT.HasEventLog, EVENT.EventLog))) {