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