From 1117025e404e76adb6ec973b3b3f9276f77b9c5c Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Thu, 16 Feb 2012 02:19:04 +0000 Subject: [PATCH] - Added a method to retireve only running nodes from a specific region git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6788 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/peer/server/persist/NodeRepository.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java b/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java index b24b6e4fa..7ee55bfbd 100644 --- a/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java +++ b/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java @@ -90,6 +90,18 @@ public class NodeRepository extends DepotRepository return (conditions.isEmpty() ? query : query.where(conditions)).select(); } + /** + * Returns a list of nodes registered in the repository with the specified region that are not + * explicitly shut down. + */ + public List loadNodesFromRegion (String region) + { + return from(NodeRecord.class) + .noCache() + .where(NodeRecord.REGION.eq(region), Ops.not(NodeRecord.SHUTDOWN)) + .select(); + } + /** * Updates the supplied node record, inserting it into the database if necessary. */