Compute full topicname from jsTopicName.prefix, topic and jsTopicName.postfix
@param jsTopicName
@param topic
@return
487532
String computeTopic(JsTopicName jsTopicName, String topic) {
		StringBuilder result = new StringBuilder();
		if (!jsTopicName.prefix().isEmpty()) {
			result.append(jsTopicName.prefix()).append(Constants.Topic.COLON);
		}
		result.append(topic);
		if (!jsTopicName.postfix().isEmpty()) {
			result.append(Constants.Topic.COLON).append(jsTopicName.postfix());
		}
		return result.toString();
	}
342213
public int getNumPartitions(String topicName) {
        Map<String, List<PartitionInfo>> topicInfo = getTopicInfo();
        List<PartitionInfo> partitionInfo = topicInfo != null ? topicInfo.get(topicName) : null;
        return partitionInfo != null ? partitionInfo.size() : 0;
    }
206738
public Topic getTopic(String topicName) throws ServiceLocatorException {
    Topic topic = null;
    try {
      if (cache.containsKey(topicName)) {
        topic = (Topic) cache.get(topicName);
      } else {
        topic = (Topic) ic.lookup(topicName);
        cache.put(topicName, topic);
      }
    } catch (NamingException ne) {
      throw new ServiceLocatorException(ne);
    } catch (Exception e) {
      throw new ServiceLocatorException(e);
    }
    return topic;
  }
274870
@Override
	public TopicConnection createTopicConnection() throws JMSException
    {
    	String username = getStringProperty(Context.SECURITY_PRINCIPAL,null); 
    	String password = getStringProperty(Context.SECURITY_CREDENTIALS,null);
    	
        return createTopicConnection(username,password);
    }
369922
public JsTopicMessageController getJsTopicMessageController(String topic) {
		logger.debug("Looking for messageController for topic '{}'", topic);
		JsTopicMessageController messageController = messageControllerCache.loadFromCache(topic);
		if(null == messageController) { // not in cache
			messageController = getJsTopicMessageControllerFromJsTopicControl(topic); // get from JsTopicControl
			if(null == messageController) {
				messageController = getJsTopicMessageControllerFromJsTopicControls(topic); // get from JsTopicControls
				if(null == messageController) {
					messageController = new DefaultJsTopicMessageController();
				}
			}
			messageControllerCache.saveToCache(topic, messageController.getClass()); // save in cache
		}
		return messageController;
	}
649317
@Override
	public TopicPublisher createPublisher(Topic topic) throws JMSException
    {
    	externalAccessLock.readLock().lock();
    	try
		{
	        checkNotClosed();
	        LocalTopicPublisher publisher = new LocalTopicPublisher(this,topic,idProvider.createID());
	        registerProducer(publisher);
	        return publisher;
		}
    	finally
    	{
    		externalAccessLock.readLock().unlock();
    	}
    }
549354
@JsTopic
	@WsDataService
	public Integer unsubscribe(@JsTopicName(prefix = Constants.Topic.SUBSCRIBERS) String topic, Session session) {
		return topicManager.unregisterTopicSession(topic, session);
	}
1130485
public JsTopicMessageController loadFromCache(String topic) {
		if(null == topic) {
			return null;
		}
		if(messageControllers.containsKey(topic)) {
			Instance<? extends JsTopicMessageController> instances = getInstances(messageControllers.get(topic));
			if(!instances.isUnsatisfied()) {
				return instances.get();
			}
		}
		return null;
	}
972769
public <T> TopicProducer<T> createTopicProducer(final String topic, final ProducerCallback<T> messageCallback)
    {
        Preconditions.checkState(connectionFactory != null, "connection factory was never injected!");
        return new TopicProducer<T>(connectionFactory, jmsConfig, topic, messageCallback);
    }
365531
public PubsubFuture<Topic> createTopic(final String project,
                                         final String topic) {
    return createTopic(canonicalTopic(project, topic));
  }
72426
@Override
    public TopicConnectionFactory createTopicConnectionFactory(JmsJcaConnectionFactory jcaConnectionFactory) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createTopicConnectionFactory", jcaConnectionFactory);
        TopicConnectionFactory tcf = new JmsManagedTopicConnectionFactoryImpl(jcaConnectionFactory);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "createTopicConnectionFactory", tcf);
        return tcf;
    }
825955
public Observable<TopicTypeInfoInner> getAsync(String topicTypeName) {
        return getWithServiceResponseAsync(topicTypeName).map(new Func1<ServiceResponse<TopicTypeInfoInner>, TopicTypeInfoInner>() {
            @Override
            public TopicTypeInfoInner call(ServiceResponse<TopicTypeInfoInner> response) {
                return response.body();
            }
        });
    }
1199229
public boolean isMatchingTopic(String topic) {
		if (isFixedTopics()) {
			return getFixedTopics().contains(topic);
		} else {
			return topicPattern.matcher(topic).matches();
		}
	}
1061136
@Override
    public Topic createTopic(String topicName) throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createTopic", new Object[] { topicName });

        Topic topic = null;

        try {
            topic = jmsSession.createTopic(topicName);
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createTopic", new Object[] { topic });
        }

        return topic;
    }
1203234
public synchronized Set<String> regexInTopic(final String topic, final String payload) {
    final Set<String> res = new HashSet<>();
    final Map<String, List<KafkaDependencyInstanceContext>> eventMap = this.topicEventMap.get(topic);
    if (eventMap == null) {
      return Collections.emptySet();
    }

    for (final Map.Entry<String, List<KafkaDependencyInstanceContext>> entry : eventMap.entrySet()) {
      final RegexKafkaDependencyMatcher matcher = new RegexKafkaDependencyMatcher(Pattern.compile(entry.getKey()));
      if (matcher.isMatch(payload)) {
        res.add(entry.getKey());
      }
    }
    return res;
  }
1081393
@Override
    public SpecTopic getClosestTopic(final SpecTopic topic, final SpecNode callerNode, final boolean checkParentNode) {
        final SpecTopic retValue = super.getClosestTopic(topic, callerNode, checkParentNode);
        if (retValue != null) {
            return retValue;
        } else {
            // Look up the metadata topics
            final ContentSpec contentSpec = getContentSpec();
            for (final Node contentSpecNode : contentSpec.getNodes()) {
                if (contentSpecNode instanceof KeyValueNode && ((KeyValueNode) contentSpecNode).getValue() instanceof SpecTopic) {
                    final SpecTopic childTopic = (SpecTopic) ((KeyValueNode) contentSpecNode).getValue();
                    if (childTopic == topic || childTopic.getId().equals(topic.getId())) {
                        return childTopic;
                    }
                }
            }

            return null;
        }
    }
30902
public SpecTopic getClosestTopic(final SpecTopic topic, final SpecNode callerNode, final boolean checkParentNode) {
        /*
         * Check this level to see if the topic exists
         */
        final List<SpecTopic> topics = getSpecTopics();
        for (final SpecTopic childTopic : topics) {
            if (childTopic == topic || childTopic.getId().equals(topic.getId())) {
                return childTopic;
            }
        }

        /*
         * If we get to this stage, then the topic wasn't directly at this level. So we should try this levels, child levels
         * first.
         */
        final List<Level> childLevels = getChildLevels();
        for (final Level childLevel : childLevels) {
            if (callerNode == childLevel) {
                continue;
            } else {
                final SpecTopic childLevelTopic = childLevel.getClosestTopic(topic, callerNode, false);
                if (childLevelTopic != null) {
                    return childLevelTopic;
                }
            }
        }

        /*
         * If we still haven't found the closest node then check this nodes parents.
         */
        if (getParent() != null && checkParentNode) {
            return getParent().getClosestTopic(topic, this, checkParentNode);
        }

        return null;
    }