/** * Validate group */ public static void checkGroup(String group) throws MQClientException { if (UtilAll.isBlank(group)) { throw new MQClientException("the specified group is blank", null); } if (!regularExpressionMatcher(group, PATTERN)) { throw new MQClientException(String.format( "the specified group[%s] contains illegal characters, allowing only %s", group, VALID_PATTERN_STR), null); } if (group.length() > CHARACTER_MAX_LENGTH) { throw new MQClientException("the specified group is longer than group max length 255.", null); } }
/** * Validate topic */ public static void checkTopic(String topic) throws MQClientException { if (UtilAll.isBlank(topic)) { throw new MQClientException("The specified topic is blank", null); } if (!regularExpressionMatcher(topic, PATTERN)) { throw new MQClientException(String.format( "The specified topic[%s] contains illegal characters, allowing only %s", topic, VALID_PATTERN_STR), null); } if (topic.length() > CHARACTER_MAX_LENGTH) { throw new MQClientException("The specified topic is longer than topic max length 255.", null); } //whether the same with system reserved keyword if (topic.equals(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC)) { throw new MQClientException( String.format("The topic[%s] is conflict with AUTO_CREATE_TOPIC_KEY_TOPIC.", topic), null); } } }
/** * Validate group */ public static void checkGroup(String group) throws MQClientException { if (UtilAll.isBlank(group)) { throw new MQClientException("the specified group is blank", null); } if (!regularExpressionMatcher(group, PATTERN)) { throw new MQClientException(String.format( "the specified group[%s] contains illegal characters, allowing only %s", group, VALID_PATTERN_STR), null); } if (group.length() > CHARACTER_MAX_LENGTH) { throw new MQClientException("the specified group is longer than group max length 255.", null); } }
/** * Validate topic */ public static void checkTopic(String topic) throws MQClientException { if (UtilAll.isBlank(topic)) { throw new MQClientException("The specified topic is blank", null); } if (!regularExpressionMatcher(topic, PATTERN)) { throw new MQClientException(String.format( "The specified topic[%s] contains illegal characters, allowing only %s", topic, VALID_PATTERN_STR), null); } if (topic.length() > CHARACTER_MAX_LENGTH) { throw new MQClientException("The specified topic is longer than topic max length 255.", null); } //whether the same with system reserved keyword if (topic.equals(MixAll.DEFAULT_TOPIC)) { throw new MQClientException( String.format("The topic[%s] is conflict with default topic.", topic), null); } } }
/** * Validate group */ public static void checkGroup(String group) throws MQClientException { if (UtilAll.isBlank(group)) { throw new MQClientException("the specified group is blank", null); } if (!regularExpressionMatcher(group, PATTERN)) { throw new MQClientException(String.format( "the specified group[%s] contains illegal characters, allowing only %s", group, VALID_PATTERN_STR), null); } if (group.length() > CHARACTER_MAX_LENGTH) { throw new MQClientException("the specified group is longer than group max length 255.", null); } }
/** * Validate topic */ public static void checkTopic(String topic) throws MQClientException { if (UtilAll.isBlank(topic)) { throw new MQClientException("The specified topic is blank", null); } if (!regularExpressionMatcher(topic, PATTERN)) { throw new MQClientException(String.format( "The specified topic[%s] contains illegal characters, allowing only %s", topic, VALID_PATTERN_STR), null); } if (topic.length() > CHARACTER_MAX_LENGTH) { throw new MQClientException("The specified topic is longer than topic max length 255.", null); } //whether the same with system reserved keyword if (topic.equals(MixAll.AUTO_CREATE_TOPIC_KEY_TOPIC)) { throw new MQClientException( String.format("The topic[%s] is conflict with AUTO_CREATE_TOPIC_KEY_TOPIC.", topic), null); } } }