@Test public void testExchangeAndTempRoutingKeyLabel() { Operation op = createOperation(); KeyValPair<String, String> props = addOperationProps(op, true, true, Boolean.TRUE); assertEquals("Mismatched label", "e-" + AbstractRabbitMQResourceAnalyzer.UNNAMED_TEMP_QUEUE_LABEL, AbstractRabbitMQResourceAnalyzer.buildLabel(props.getKey(), props.getValue())); }
public static String buildLabel(String finalExchange, String finalRoutingKey) { StringBuilder sb = new StringBuilder(StringUtil.getSafeLength(finalExchange) + StringUtil.getSafeLength(finalRoutingKey) + 2); boolean hasExchange = !isTrimEmpty(finalExchange); if (hasExchange) { sb.append(finalExchange); } boolean hasRoutingKey = !isTrimEmpty(finalRoutingKey); if (hasRoutingKey) { if (hasExchange) { sb.append('-'); } sb.append(finalRoutingKey); } return sb.toString(); }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public static String buildLabel(String finalExchange, String finalRoutingKey) { StringBuilder sb = new StringBuilder(StringUtil.getSafeLength(finalExchange) + StringUtil.getSafeLength(finalRoutingKey) + 2); boolean hasExchange = !isTrimEmpty(finalExchange); if (hasExchange) { sb.append(finalExchange); } boolean hasRoutingKey = !isTrimEmpty(finalRoutingKey); if (hasRoutingKey) { if (hasExchange) { sb.append('-'); } sb.append(finalRoutingKey); } return sb.toString(); } }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public static String buildLabel(String finalExchange, String finalRoutingKey) { StringBuilder sb = new StringBuilder(StringUtil.getSafeLength(finalExchange) + StringUtil.getSafeLength(finalRoutingKey) + 2); boolean hasExchange = !isTrimEmpty(finalExchange); if (hasExchange) { sb.append(finalExchange); } boolean hasRoutingKey = !isTrimEmpty(finalRoutingKey); if (hasRoutingKey) { if (hasExchange) { sb.append('-'); } sb.append(finalRoutingKey); } return sb.toString(); } protected  AbstractRabbitMQResourceAnalyzer(RabbitPluginOperationType type, boolean incoming); }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public static String buildLabel(String finalExchange, String finalRoutingKey) { StringBuilder sb = new StringBuilder(StringUtil.getSafeLength(finalExchange) + StringUtil.getSafeLength(finalRoutingKey) + 2); boolean hasExchange = !isTrimEmpty(finalExchange); if (hasExchange) { sb.append(finalExchange); } boolean hasRoutingKey = !isTrimEmpty(finalRoutingKey); if (hasRoutingKey) { if (hasExchange) { sb.append('-'); } sb.append(finalRoutingKey); } return sb.toString(); } protected  AbstractRabbitMQResourceAnalyzer(RabbitPluginOperationType type, boolean incoming); final boolean isIncomingResource(); final RabbitPluginOperationType getRabbitPluginOperationType(); OperationType getOperationType(); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace); Collection<Frame> locateFrames(Trace trace); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> queueFrames); static String getFinalExchangeName(String exchange); static String getFinalRoutingKey(String routingKey); static String buildExternalResourceName(String finalExchange, String finalRoutingKey, String vhost); static String buildExternalResourceLabel(String label); static String buildLabel(String finalExchange, String finalRoutingKey); @Override String toString(); }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public static String buildLabel(String finalExchange, String finalRoutingKey) { StringBuilder sb = new StringBuilder(StringUtil.getSafeLength(finalExchange) + StringUtil.getSafeLength(finalRoutingKey) + 2); boolean hasExchange = !isTrimEmpty(finalExchange); if (hasExchange) { sb.append(finalExchange); } boolean hasRoutingKey = !isTrimEmpty(finalRoutingKey); if (hasRoutingKey) { if (hasExchange) { sb.append('-'); } sb.append(finalRoutingKey); } return sb.toString(); } protected  AbstractRabbitMQResourceAnalyzer(RabbitPluginOperationType type, boolean incoming); final boolean isIncomingResource(); final RabbitPluginOperationType getRabbitPluginOperationType(); OperationType getOperationType(); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace); Collection<Frame> locateFrames(Trace trace); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> queueFrames); static String getFinalExchangeName(String exchange); static String getFinalRoutingKey(String routingKey); static String buildExternalResourceName(String finalExchange, String finalRoutingKey, String vhost); static String buildExternalResourceLabel(String label); static String buildLabel(String finalExchange, String finalRoutingKey); @Override String toString(); static final String RABBIT; static final String NO_EXCHANGE; static final String NO_ROUTING_KEY; static final int DEFAULT_SCORE; static final String UNNAMED_TEMP_QUEUE_KEY_PREFIX; static final String UNNAMED_TEMP_QUEUE_LABEL; static final String UNNAMED_RPC_QUEUE_KEY_PREFIX; static final String UNNAMED_RPC_QUEUE_LABEL; }