Checks to make sure that the assigned writer for the topic is valid.

@param topic The topic to check the assigned writer for.
@return True if the assigned writer exists in the database and is under the Assigned Writer category otherwise
false.
327309
private boolean preValidateAssignedWriter(final ITopicNode topic) {
        if (topic.getAssignedWriter(true) == null) {
            log.error(String.format(ProcessorConstants.ERROR_NO_WRITER_MSG, topic.getLineNumber(), topic.getText()));
            return false;
        }

        return true;
    }
1341900
public void addTopic(String topic)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "addTopic", topic);

    SelectionCriteria criteria = _messageProcessor.
                                   getSelectionCriteriaFactory().
                                   createSelectionCriteria(topic,
                                                           null,
                                                           SelectorDomain.SIMESSAGE);

    if (_subscriptionState == null)
    {
       _subscriptionState =
        new ConsumerDispatcherState(_destinationHandler.getUuid(), criteria, _destName, _busName);
    }
    else
      _subscriptionState.addSelectionCriteria(criteria);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addTopic");
  }
395722
private void checkTopicSubscribePermission(String topic) {
        SecurityManager sm = System.getSecurityManager();
        if (sm == null)
            return;

        sm.checkPermission(new TopicPermission(topic, SUBSCRIBE));
    }
745475
public boolean isEnabled(String topicName) {
        if (topicName == null || topicName.length() == 0) {
            throw new JavametricsException("Topic names must not be null or 0 length");
        }
        return getTopic(topicName).isEnabled();
    }
376660
public boolean isDuplicate(HelpTopic topic) {
        return ObjectUtils.equals(url, topic.url) && compareTo(topic) == 0;
    }
867864
public void removeTopic(String topic)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeTopic", topic);

        SelectionCriteria[] tmp = selectionCriteriaList;

        // Loop through the selectionCriteriaList
        for (int i = 0; i < selectionCriteriaList.length; ++i)
        {
            if ((selectionCriteriaList[i].getDiscriminator() == null && topic == null) ||
                (topic != null && selectionCriteriaList[i].getDiscriminator().equals(topic)))
            {
                // If there was only one criteria and we have removed it then
                // nullify lists
                if (selectionCriteriaList.length == 1)
                {
                    selectionCriteriaList = null;
                    topics = null;
                }
                else
                {
                    // The criteria match, so resize the array without this
                    // criteria in it.
                    tmp = new SelectionCriteria[selectionCriteriaList.length - 1];
                    System.arraycopy(selectionCriteriaList, 0, tmp, 0, i);
                    System.arraycopy(selectionCriteriaList, i + 1, tmp, i, selectionCriteriaList.length - i - 1);

                    selectionCriteriaList = tmp;

                    // And copy into the topics array so that they always match
                    this.topics = new String[selectionCriteriaList.length];
                    for (int t = 0; t < selectionCriteriaList.length; t++)
                    {
                        topics[t] = (selectionCriteriaList[t] == null) ? null : selectionCriteriaList[t].getDiscriminator();
                    }
                }

                break;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeTopic");
    }
499210
public void checkEventTopicSyntax(String topic)
    throws InvalidTopicSyntaxException
  {
    checkTopicNotNull(topic);
		    
    if (topic.indexOf(MatchSpace.SUBTOPIC_MQSI_MATCHONE_CHAR) > -1 || 
      topic.indexOf(MatchSpace.SUBTOPIC_MQSI_MATCHMANY_CHAR) > -1)
      throw new InvalidTopicSyntaxException(
         NLS.format(
           "INVALID_TOPIC_ERROR_CWSIH0006",
           new Object[] { topic }));
  }
769668
public TopicProducer<String> createTopicTextMessageProducer(final String topic)
    {
        Preconditions.checkState(connectionFactory != null, "connection factory was never injected!");
        return new TopicProducer<String>(connectionFactory, jmsConfig, topic, new TextMessageProducerCallback());
    }
334779
@Then("^A kafka topic named '(.+?)' exists")
    public void kafkaTopicExist(String topic_name) throws KeeperException, InterruptedException {
        assert commonspec.getKafkaUtils().getZkUtils().pathExists("/" + topic_name) : "There is no topic with that name";
    }
150578
boolean isInconsistenceContext(String topic, Session session) {
		return null == topic || null == session || topic.isEmpty();
	}
9183
private void _checkAndSubscribe(KafkaConsumer<?, ?> consumer, String topic) {
        synchronized (consumer) {
            Set<String> subscription = consumer.subscription();
            if (subscription == null || !subscription.contains(topic)) {
                consumer.subscribe(Arrays.asList(topic));
            }
        }
    }
921113
private boolean isRequiredToUploadAtTime(TopicPartition topicPartition) throws Exception{
        final String topic = topicPartition.getTopic();
        if (mTopicFilter == null || mTopicFilter.isEmpty()){
            return false;
        }
        if (topic.matches(mTopicFilter)){
            if (DateTime.now().minuteOfHour().get() == mConfig.getUploadMinuteMark()){
               return true;
            }
        }
        return false;
    }
1084389
@SuppressWarnings("unchecked")
    public boolean postValidateInfoTopic(final InfoTopic infoTopic, final ContentSpec contentSpec) {
        // Check if the app should be shutdown
        if (isShuttingDown.get()) {
            shutdown.set(true);
            return false;
        }

        boolean valid = true;

        // New Topics
        if (infoTopic.isTopicANewTopic()) {
            // Validate the tags
            if (!validateTopicTags(infoTopic, infoTopic.getTags(false))) {
                valid = false;
            }

            // Check Assigned Writer exists
            if (!postValidateAssignedWriter(infoTopic)) {
                valid = false;
            }
        }
        // Existing Topics
        else if (infoTopic.isTopicAnExistingTopic()) {
            // Calculate the revision for the topic
            final Integer revision;
            if (infoTopic.getRevision() == null && processingOptions.getMaxRevision() != null) {
                revision = processingOptions.getMaxRevision();
            } else {
                revision = infoTopic.getRevision();
            }

            // Check that the id actually exists
            BaseTopicWrapper<?> topic = null;
            try {
                if (processingOptions.isTranslation()) {
                    topic = EntityUtilities.getTranslatedTopicByTopicId(factory, Integer.parseInt(infoTopic.getId()), revision,
                            processingOptions.getTranslationLocale() == null ? defaultLocale : processingOptions.getTranslationLocale());
                } else {
                    topic = topicProvider.getTopic(Integer.parseInt(infoTopic.getId()), revision);
                }
            } catch (NotFoundException e) {
                log.debug("Could not find topic for id " + infoTopic.getDBId());
            }

            // Check that the topic actually exists
            if (topic == null) {
                log.error(String.format(ProcessorConstants.ERROR_TOPIC_NONEXIST_MSG, infoTopic.getLineNumber(), infoTopic.getText()));
                valid = false;
            } else {
                infoTopic.setTopic(topic);

                // Check to see if the topic contains the "Internal-Only" tag
                if (serverEntities.getInternalOnlyTagId() != null && topic.hasTag(serverEntities.getInternalOnlyTagId())) {
                    log.warn(String.format(ProcessorConstants.WARN_INTERNAL_TOPIC_MSG, infoTopic.getLineNumber(), infoTopic.getText()));
                }

                if (!postValidateExistingTopic(infoTopic, topic, contentSpec)) {
                    valid = false;
                }
            }
            // Cloned Topics
        } else if (infoTopic.isTopicAClonedTopic()) {
            // Get the original topic from the database
            int topicId = Integer.parseInt(infoTopic.getId().substring(1));
            TopicWrapper topic = null;
            try {
                topic = topicProvider.getTopic(topicId, infoTopic.getRevision());
            } catch (NotFoundException e) {
                log.debug("Could not find topic for id " + topicId);
            }

            // Check that the original topic was found
            if (topic == null) {
                log.error(String.format(ProcessorConstants.ERROR_TOPIC_NONEXIST_MSG, infoTopic.getLineNumber(), infoTopic.getText()));
                valid = false;
            } else {
                if (!postValidateExistingTopic(infoTopic, topic, contentSpec)) {
                    valid = false;
                }

                // Check Assigned Writer exists
                if (!postValidateAssignedWriter(infoTopic)) {
                    valid = false;
                }
            }
        }

        return valid;
    }
754349
public int topicQueueSize(final String topic) {
    final TopicQueue topicQueue = this.topics.get(topic);
    return topicQueue == null ? 0 : topicQueue.queue.size();
  }
1313333
public static boolean isKeySchemaValid(Schema keySchema, Schema topicSchema) {
    return SchemaCompatibility.checkReaderWriterCompatibility(keySchema, topicSchema).getType()
        .equals(SchemaCompatibilityType.COMPATIBLE);
  }
451706
public boolean seekToEnd(String topic) {
        KafkaConsumer<?, ?> consumer = _getConsumer(topic);
        return KafkaHelper.seekToEnd(consumer, topic);
    }
1129390
public boolean topicExists(String topicName) {
        Map<String, List<PartitionInfo>> topicInfo = getTopicInfo();
        return topicInfo != null && topicInfo.containsKey(topicName);
    }