/** All replies. */
private final Set<Reply> replies = new HashSet<Reply>();
+ /** The IDs of all blocked Sones. */
+ private final Set<String> blockedSoneIds = new HashSet<String>();
+
/** Modification count. */
private volatile long modificationCounter = 0;
}
/**
+ * Returns the IDs of all blocked Sones. These Sones will not propagated
+ * using the “known Sones” mechanism.
+ *
+ * @return The IDs of all blocked Sones
+ */
+ public Set<String> getBlockedSoneIds() {
+ return Collections.unmodifiableSet(blockedSoneIds);
+ }
+
+ /**
+ * Returns whether the given Sone ID is blocked.
+ *
+ * @param soneId
+ * The Sone ID to check
+ * @return {@code true} if the given Sone ID is blocked, {@code false}
+ * otherwise
+ */
+ public boolean isSoneBlocked(String soneId) {
+ return blockedSoneIds.contains(soneId);
+ }
+
+ /**
+ * Adds the given ID to the list of blocked IDs.
+ *
+ * @param soneId
+ * The Sone ID to block
+ */
+ public void addBlockedSoneId(String soneId) {
+ blockedSoneIds.add(soneId);
+ }
+
+ /**
+ * Removes the given ID from the list of blocked IDs.
+ *
+ * @param soneId
+ * The Sone ID to unblock
+ */
+ public void removeBlockedSoneIds(String soneId) {
+ blockedSoneIds.remove(soneId);
+ }
+
+ /**
* Returns the modification counter.
*
* @return The modification counter