Method removeConsumerListForExpression

Removes the row from the appropriate table after the last consumer for
the topic expression has been removed.

@param topicExpression
@param selector
@param isWildcarded
961125
public void removeConsumerListForExpression(
    String topicExpression,
    boolean selector,
    boolean isWildcarded)
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "removeConsumerListForExpression", 
                  new Object[]{topicExpression, 
                               new Boolean(selector),
                               new Boolean(isWildcarded)});

    if(selector)
    {
      if(isWildcarded)
      {
        // Selector and wildcarded
        ArrayList consumerList = (ArrayList)_wildcardSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
          
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:265:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:272:1.5",
                topicExpression },
              null));                       
        }                          
        // Test whether table is now empty
        if(_wildcardSelectorSubs.isEmpty())
          _areWildcardSelectorSubs = false;
      }
      else
      {
        // Selector but not wildcarded
        ArrayList consumerList = (ArrayList)_exactSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
        
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:296:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:303:1.5",
                topicExpression },
              null));                       
        }                  
        // Test whether table is now empty
        if(_exactSelectorSubs.isEmpty())
          _areExactSelectorSubs = false;
      }
    }
    else
    {
      // No Selector expression
      if(isWildcarded)
      {
        // No selector and wildcarded
        ArrayList consumerList = (ArrayList)_wildcardNonSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
        
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:331:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:338:1.5",
                topicExpression },
              null));                       
        }                       
        // Test whether table is now empty
        if(_wildcardNonSelectorSubs.isEmpty())
          _areWildcardNonSelectorSubs = false;        
      }
      else
      {
        // No selector and not wildcarded
        ArrayList consumerList = (ArrayList)_exactNonSelectorSubs.remove(topicExpression);
        if(consumerList == null)
        {
          // Couldn't find the consumerlist. This means we have an internal 
          // inconsistency in our tables, so throw an SIErrorException
        
          // Build the message for the Exception
          if (tc.isEntryEnabled()) 
            SibTr.exit(tc, "removeConsumerListForExpression", topicExpression);
      
          SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
            new Object[] {
              "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
              "1:362:1.5",
              topicExpression });  
          throw new SIErrorException(
            nls.getFormattedMessage(
              "INTERNAL_MESSAGING_ERROR_CWSIP0005",
              new Object[] {
                "com.ibm.ws.sib.processor.matching.SubscriptionRegistrar",
                "1:369:1.5",
                topicExpression },
              null));                       
        }                            
        // Test whether table is now empty
        if(_exactNonSelectorSubs.isEmpty())
          _areExactNonSelectorSubs = false;        
      }      
    }           
    if (tc.isEntryEnabled()) SibTr.exit(tc, "removeConsumerListForExpression");
  }
255666
@Override
	public void removeByCommerceRegionId(long commerceRegionId) {
		for (CommerceAddress commerceAddress : findByCommerceRegionId(
				commerceRegionId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceAddress);
		}
	}
576978
@Override
	public void unregisterConsumer(LocalMessageConsumer consumer)
    {
        super.unregisterConsumer(consumer);
        if (!consumer.isDurable())
        {
            log.debug("Removing non-durable subscription "+consumer.getSubscriberId());
            subscriptionsLock.writeLock().lock();
            try
    		{
            	LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId());
            	if (subscription != null)
            		removeSubscription(subscription);
    		}
            finally
            {
            	subscriptionsLock.writeLock().unlock();
            }
        }
    }
568134
public void addNewConsumerForExpression(
    String topicExpression,
    MonitoredConsumer mc,
    boolean selector,
    boolean isWildcarded)
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "addNewConsumerForExpression", 
                  new Object[]{topicExpression, 
                               mc,
                               new Boolean(selector),
                               new Boolean(isWildcarded)});

    ArrayList consumerList = new ArrayList(1);
      
    // Add new consumer into list      
    consumerList.add(mc);
        
    if(selector)
    {
      if(isWildcarded)
      {
        // Selector and wildcarded
        _wildcardSelectorSubs.put(topicExpression,consumerList);
        _areWildcardSelectorSubs = true;
      }
      else
      {
        // Selector but not wildcarded
        _exactSelectorSubs.put(topicExpression,consumerList);
        _areExactSelectorSubs = true;
      }
    }
    else
    {
      // No Selector expression
      if(isWildcarded)
      {
        // No selector and wildcarded
        _wildcardNonSelectorSubs.put(topicExpression,consumerList);
        _areWildcardNonSelectorSubs = true;        
      }
      else
      {
        // No selector and not wildcarded
        _exactNonSelectorSubs.put(topicExpression,consumerList);
        _areExactNonSelectorSubs = true;        
      }      
    }           
    if (tc.isEntryEnabled()) SibTr.exit(tc, "addNewConsumerForExpression");
  }
191990
protected void deactivateConsumers(List<ConsumerHolder> consumerHolders) {
        synchronized (activationMonitor) {
            for (ConsumerHolder consumerHolder : consumerHolders) {
                consumerHolder.deactivate();
            }
        }
    }
935428
void removeConsumerSession(ConsumerSessionImpl consumer)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "removeConsumerSession", consumer);

        synchronized (_consumers)
        {
            _consumers.remove(consumer);
        }

        _messageProcessor.removeConsumer(consumer);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "removeConsumerSession");
    }
416029
def _purge_consumer_by_tag(self, consumer_tag):
        '''
        '''
        try:
            del self._consumer_cb[consumer_tag]
        except KeyError:
            self.logger.warning(
                'no callback registered for consumer tag " %s "', consumer_tag)
        else:
            self.logger.info('purged consumer with tag " %s "', consumer_tag)
1344526
@Override
    public void removeFilteredPolicy(String sec, String ptype, int fieldIndex, String... fieldValues) {
        throw new Error("not implemented");
    }
1285495
public boolean removeSelectionCriteria(SelectionCriteria selCriteria)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeSelectionCriteria", selCriteria);

        SelectionCriteria[] tmp = selectionCriteriaList;

        boolean removedCriteria = false;

        // Loop through the selectionCriteriaList
        for (int i = 0; i < selectionCriteriaList.length; ++i)
        {
            if (selectionCriteriaList[i].equals(selCriteria))
            {
                // 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();
                    }
                }

                removedCriteria = true;

                break;
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeSelectionCriteria", Boolean.valueOf(removedCriteria));
        return removedCriteria;
    }
36274
@Override
	public void removeByCommerceUserSegmentEntryId(
		long commerceUserSegmentEntryId) {
		for (CommerceDiscountUserSegmentRel commerceDiscountUserSegmentRel : findByCommerceUserSegmentEntryId(
				commerceUserSegmentEntryId, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(commerceDiscountUserSegmentRel);
		}
	}
826079
public final void removeConsumerKey(String selector, JSRemoteConsumerPoint aock)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "removeConsumerKey", new Object[] { selector, aock });

    synchronized (this)
    {
      JSRemoteConsumerPoint aock2 = (JSRemoteConsumerPoint) consumerKeyTable.get(selector);
      if (aock2 == aock)
      { // the object is still in the table
        consumerKeyTable.remove(selector);
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "removeConsumerKey");
  }
195155
@Override
    public java.util.concurrent.Future<RemovePermissionResult> removePermissionAsync(String topicArn, String label,
            com.amazonaws.handlers.AsyncHandler<RemovePermissionRequest, RemovePermissionResult> asyncHandler) {

        return removePermissionAsync(new RemovePermissionRequest().withTopicArn(topicArn).withLabel(label), asyncHandler);
    }
1066474
@Override
	public void removeByC_S(long commerceOrderId, boolean subscription) {
		for (CommerceOrderItem commerceOrderItem : findByC_S(commerceOrderId,
				subscription, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceOrderItem);
		}
	}
709376
@Override
    public java.util.concurrent.Future<RemoveTagsFromResourceResult> removeTagsFromResourceAsync(
            com.amazonaws.handlers.AsyncHandler<RemoveTagsFromResourceRequest, RemoveTagsFromResourceResult> asyncHandler) {

        return removeTagsFromResourceAsync(new RemoveTagsFromResourceRequest(), asyncHandler);
    }
447137
public void addCallbackToConnectionIndex(
    ConnectionImpl connection,
    String topicExpression,
    boolean isWildcarded,
    ConsumerSetChangeCallback callback)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(
          tc,
          "addCallbackToConnectionIndex",
          new Object[] {connection, topicExpression, new Boolean(isWildcarded), callback });

    // Map of callbacks-to-expressions for a connection
    Map connMap = null;
    if(_callbackIndex.containsKey(connection))
    {
      // Already have registered callbacks for this connection
      connMap = (HashMap)_callbackIndex.get(connection);
    }
    else
    {
      // No registered callbacks for this connection
      connMap = new HashMap();
      _callbackIndex.put(connection,connMap);
    }

    // Add the new callback to the index, so we can find it when we deregister
    TopicRecord tRecord = new TopicRecord(topicExpression, isWildcarded);
    connMap.put(callback, tRecord);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "addCallbackToConnectionIndex");

  }
876517
@Override
	public void removeByC_SC(long CPDefinitionId, boolean skuContributor) {
		for (CPDefinitionOptionRel cpDefinitionOptionRel : findByC_SC(
				CPDefinitionId, skuContributor, QueryUtil.ALL_POS,
				QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionOptionRel);
		}
	}
356846
@Override
    public void removeReadyConsumer(JSConsumerKey consumerKey, boolean bSelector)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "removeReadyConsumer",
                        new Object[] { consumerKey, Boolean.valueOf(bSelector) });

        if (consumerKey == null)
        {
            SIErrorException e =
                            new SIErrorException(
                                            nls.getFormattedMessage(
                                                                    "INTERNAL_MESSAGING_ERROR_CWSIP0001",
                                                                    new Object[] {
                                                                                  "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                                                                  "1:1684:1.280.5.25" },
                                                                    null));

            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.removeReadyConsumer",
                                        "1:1690:1.280.5.25",
                                        this);

            SibTr.exception(tc, e);

            SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
                        new Object[] {
                                      "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                      "1:1698:1.280.5.25" });

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "removeReadyConsumer", e);

            throw e;
        }

        if (consumerKey.getForwardScanning())
        {
            //remove the consumer point from the FS ready list
            ((SimpleEntry) consumerKey).remove();
        }
        else
        {
            if (bSelector)
            {
                //decrement the specific ready consumer counter
                specificReadyConsumerCount--;

                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    SibTr.debug(tc, "sepcificReadyConsumerCount:" + specificReadyConsumerCount);
            }
            else
            {
                //remove the consumer point from the ready list
                ((SimpleEntry) consumerKey).remove();
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "removeReadyConsumer");
    }