@Override
 public MessageFilterBase setSubscriptionPreferences(
     ByteString topic, ByteString subscriberId, SubscriptionPreferences preferences) {
   Map<String, ByteString> userOptions = SubscriptionStateUtils.buildUserOptions(preferences);
   ByteString modValue = userOptions.get(OPT_MOD);
   if (null == modValue) {
     mod = 0;
   } else {
     mod = Integer.valueOf(modValue.toStringUtf8());
   }
   return this;
 }
示例#2
0
 private void printTopicSubscriptions(Map<ByteString, SubscriptionData> states) {
   System.out.println(">>> Subscription Info <<<");
   if (0 == states.size()) {
     System.out.println("No subscriber.");
     return;
   }
   for (Map.Entry<ByteString, SubscriptionData> entry : states.entrySet()) {
     System.out.println(
         "Subscriber "
             + entry.getKey().toStringUtf8()
             + " : "
             + SubscriptionStateUtils.toString(entry.getValue()));
   }
   System.out.println();
 }