@Test public void testIsSystemTopic() { boolean res; for (String topic : TopicValidator.getSystemTopicSet()) { res = TopicValidator.isSystemTopic(topic); assertThat(res).isTrue(); } String topic = TopicValidator.SYSTEM_TOPIC_PREFIX + "_test"; res = TopicValidator.isSystemTopic(topic); assertThat(res).isTrue(); topic = "test_not_system_topic"; res = TopicValidator.isSystemTopic(topic); assertThat(res).isFalse(); }
public static boolean isSystemTopic(String topic, RemotingCommand response) { if (isSystemTopic(topic)) { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark("The topic[" + topic + "] is conflict with system topic."); return true; } return false; }
TopicValidator { public static boolean isSystemTopic(String topic, RemotingCommand response) { if (isSystemTopic(topic)) { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark("The topic[" + topic + "] is conflict with system topic."); return true; } return false; } }
TopicValidator { public static boolean isSystemTopic(String topic, RemotingCommand response) { if (isSystemTopic(topic)) { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark("The topic[" + topic + "] is conflict with system topic."); return true; } return false; }  }
TopicValidator { public static boolean isSystemTopic(String topic, RemotingCommand response) { if (isSystemTopic(topic)) { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark("The topic[" + topic + "] is conflict with system topic."); return true; } return false; }  static boolean validateTopic(String topic, RemotingCommand response); static boolean isSystemTopic(String topic, RemotingCommand response); static boolean isSystemTopic(String topic); static boolean isNotAllowedSendTopic(String topic); static boolean isNotAllowedSendTopic(String topic, RemotingCommand response); static void addSystemTopic(String systemTopic); static Set<String> getSystemTopicSet(); static Set<String> getNotAllowedSendTopicSet(); }
TopicValidator { public static boolean isSystemTopic(String topic, RemotingCommand response) { if (isSystemTopic(topic)) { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark("The topic[" + topic + "] is conflict with system topic."); return true; } return false; }  static boolean validateTopic(String topic, RemotingCommand response); static boolean isSystemTopic(String topic, RemotingCommand response); static boolean isSystemTopic(String topic); static boolean isNotAllowedSendTopic(String topic); static boolean isNotAllowedSendTopic(String topic, RemotingCommand response); static void addSystemTopic(String systemTopic); static Set<String> getSystemTopicSet(); static Set<String> getNotAllowedSendTopicSet(); static final String AUTO_CREATE_TOPIC_KEY_TOPIC; static final String RMQ_SYS_SCHEDULE_TOPIC; static final String RMQ_SYS_BENCHMARK_TOPIC; static final String RMQ_SYS_TRANS_HALF_TOPIC; static final String RMQ_SYS_TRACE_TOPIC; static final String RMQ_SYS_TRANS_OP_HALF_TOPIC; static final String RMQ_SYS_TRANS_CHECK_MAX_TIME_TOPIC; static final String RMQ_SYS_SELF_TEST_TOPIC; static final String RMQ_SYS_OFFSET_MOVED_EVENT; static final String SYSTEM_TOPIC_PREFIX; }