@Test public void testIsTopicPattern() { Assert.assertTrue(Subscription.isTopicPattern("#")); Assert.assertTrue(Subscription.isTopicPattern("/#")); Assert.assertTrue(Subscription.isTopicPattern("#/")); Assert.assertTrue(Subscription.isTopicPattern("+")); Assert.assertTrue(Subscription.isTopicPattern("/+")); Assert.assertTrue(Subscription.isTopicPattern("+/")); Assert.assertTrue(Subscription.isTopicPattern("com/#")); Assert.assertTrue(Subscription.isTopicPattern("com/+")); Assert.assertTrue(Subscription.isTopicPattern("com/+/test")); Assert.assertFalse(Subscription.isTopicPattern("com/")); Assert.assertFalse(Subscription.isTopicPattern("")); }
public static boolean isTopicPattern(String pattern) { if (StringUtils.isBlank(pattern)) { return false; } return pattern.contains(WeEvent.WILD_CARD_ALL_LAYER) || pattern.contains(WeEvent.WILD_CARD_ONE_LAYER); }
Subscription { public static boolean isTopicPattern(String pattern) { if (StringUtils.isBlank(pattern)) { return false; } return pattern.contains(WeEvent.WILD_CARD_ALL_LAYER) || pattern.contains(WeEvent.WILD_CARD_ONE_LAYER); } }
Subscription { public static boolean isTopicPattern(String pattern) { if (StringUtils.isBlank(pattern)) { return false; } return pattern.contains(WeEvent.WILD_CARD_ALL_LAYER) || pattern.contains(WeEvent.WILD_CARD_ONE_LAYER); } Subscription(IBlockChain blockChain, String uuid, String[] topics, String groupId, String offset, String tag, IConsumer.ConsumerListener listener); }
Subscription { public static boolean isTopicPattern(String pattern) { if (StringUtils.isBlank(pattern)) { return false; } return pattern.contains(WeEvent.WILD_CARD_ALL_LAYER) || pattern.contains(WeEvent.WILD_CARD_ONE_LAYER); } Subscription(IBlockChain blockChain, String uuid, String[] topics, String groupId, String offset, String tag, IConsumer.ConsumerListener listener); Long getNotifyingEventCount(); Long getNotifiedEventCount(); Date getNotifyTimeStamp(); void dispatch(List<WeEvent> events, boolean mainLoop, Long blockHeight); synchronized void doStart(Executor executor); synchronized void doStop(); synchronized void stopHistory(); synchronized boolean tryStopHistory(Long mainLastBlock); static List<WeEvent> filter(List<WeEvent> from, String[] topics, String tag); static boolean isTopicPattern(String pattern); static void validateTopicPattern(String pattern); static boolean patternMatch(String topic, String pattern); }
Subscription { public static boolean isTopicPattern(String pattern) { if (StringUtils.isBlank(pattern)) { return false; } return pattern.contains(WeEvent.WILD_CARD_ALL_LAYER) || pattern.contains(WeEvent.WILD_CARD_ONE_LAYER); } Subscription(IBlockChain blockChain, String uuid, String[] topics, String groupId, String offset, String tag, IConsumer.ConsumerListener listener); Long getNotifyingEventCount(); Long getNotifiedEventCount(); Date getNotifyTimeStamp(); void dispatch(List<WeEvent> events, boolean mainLoop, Long blockHeight); synchronized void doStart(Executor executor); synchronized void doStop(); synchronized void stopHistory(); synchronized boolean tryStopHistory(Long mainLastBlock); static List<WeEvent> filter(List<WeEvent> from, String[] topics, String tag); static boolean isTopicPattern(String pattern); static void validateTopicPattern(String pattern); static boolean patternMatch(String topic, String pattern);  }