1 package at.ac.tuwien.sbc.valesriegler.xvsm.spacehelpers;
3 import org.mozartspaces.capi3.FifoCoordinator;
4 import org.mozartspaces.core.Capi;
5 import org.mozartspaces.core.ContainerReference;
6 import org.mozartspaces.core.MzsConstants;
7 import org.mozartspaces.core.MzsConstants.RequestTimeout;
8 import org.mozartspaces.notifications.NotificationManager;
10 import java.io.Serializable;
11 import java.util.List;
15 * @author Gregor Riegler <gregor DOT riegler AT gmail DOT com>
19 public class SpaceListenerImpl extends SpaceListener {
21 public final NotificationManager notificationManager;
23 private ContainerReference cref;
24 private final boolean countAll;
27 public SpaceListenerImpl(Capi capi, ContainerReference cref, int timeout, SpaceAction spaceAction, NotificationManager notificationManager, boolean lookaround, boolean countAll) {
30 this.timeout = timeout;
31 this.spaceAction = spaceAction;
32 this.notificationManager = notificationManager;
33 this.lookAround = lookaround;
34 this.countAll = countAll;
38 List<? extends Serializable> getEntries() throws Exception {
39 final int count = countAll ? MzsConstants.Selecting.COUNT_ALL : MzsConstants.Selecting.COUNT_MAX;
40 return capi.read(cref, FifoCoordinator
42 RequestTimeout.DEFAULT, null);