Returns the number of commerce notification attachments where commerceNotificationQueueEntryId = &#63;.

@param commerceNotificationQueueEntryId the commerce notification queue entry ID
@return the number of matching commerce notification attachments
347950
@Override
	public int countByCommerceNotificationQueueEntryId(
		long commerceNotificationQueueEntryId) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_COMMERCENOTIFICATIONQUEUEENTRYID;

		Object[] finderArgs = new Object[] { commerceNotificationQueueEntryId };

		Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(2);

			query.append(_SQL_COUNT_COMMERCENOTIFICATIONATTACHMENT_WHERE);

			query.append(_FINDER_COLUMN_COMMERCENOTIFICATIONQUEUEENTRYID_COMMERCENOTIFICATIONQUEUEENTRYID_2);

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(commerceNotificationQueueEntryId);

				count = (Long)q.uniqueResult();

				finderCache.putResult(finderPath, finderArgs, count);
			}
			catch (Exception e) {
				finderCache.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
1116836
public Notification getNotification() {
    try {
      Notification notif = notifications.take();
      log.debug("Dequeued notification {}", notif);
      return notif;
    } catch (InterruptedException e) {
      log.info("Interrupted while polling notifications' queue");
      return null;
    }
  }
640540
private synchronized int getNewClientID() {
        if ((clientIDGenerator + 1) >= Integer.MAX_VALUE) {
            //if we can't find a reusable ID within the first 100 slots, then fail.
            //Revisit: I don't want to loop through all 2+ billion entries to find that they are all taken, as this
            //could be seem as a DoS, but maybe some better heuristics for finding an empty ID? not sure if we will ever be
            //in this situation...
            final int limit = Integer.MIN_VALUE + 100;
            for (int i = Integer.MIN_VALUE; i < limit; i++) {
                if (inboxes.get(i) == null) {
                    return i;
                }
            }

            //Emit the warning
            Tr.warning(tc, "jmx.connector.server.rest.notification.limit.warning");

            throw ErrorHelper.createRESTHandlerJsonException(new RuntimeException("The server has reached its limit of new client notifications."),
                                                             JSONConverter.getConverter(),
                                                             APIConstants.STATUS_SERVICE_UNAVAILABLE);
        }

        return clientIDGenerator++;
    }
768673
protected int getNumberOfLockedMessages()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getNumberOfLockedMessages");

    int count = 0;

    synchronized(this)
    {
      LMEMessage message;

      message = firstMsg;
      while(message != null)
      {
        count++;
        message = message.next;
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getNumberOfLockedMessages", new Integer(count));
    return count;
  }
366050
@Override
	public List<CommerceNotificationTemplateUserSegmentRel> findByCommerceUserSegmentEntryId(
		long commerceUserSegmentEntryId) {
		return findByCommerceUserSegmentEntryId(commerceUserSegmentEntryId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
745936
@Override
	public void clearCache() {
		entityCache.clearCache(CommerceNotificationQueueEntryImpl.class);

		finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
		finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
	}
1138203
@Override
	public int countByCommerceShippingMethodId(long commerceShippingMethodId) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_COMMERCESHIPPINGMETHODID;

		Object[] finderArgs = new Object[] { commerceShippingMethodId };

		Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(2);

			query.append(_SQL_COUNT_COMMERCESHIPPINGFIXEDOPTION_WHERE);

			query.append(_FINDER_COLUMN_COMMERCESHIPPINGMETHODID_COMMERCESHIPPINGMETHODID_2);

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(commerceShippingMethodId);

				count = (Long)q.uniqueResult();

				finderCache.putResult(finderPath, finderArgs, count);
			}
			catch (Exception e) {
				finderCache.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
70801
public static com.liferay.commerce.model.CommerceShipment createCommerceShipment(
		long commerceShipmentId) {
		return getService().createCommerceShipment(commerceShipmentId);
	}
89199
@Override
	@Transactional(enabled = false)
	public CommerceDiscount createCommerceDiscount(long commerceDiscountId) {
		return commerceDiscountPersistence.create(commerceDiscountId);
	}
1052763
@Override
	public List<CommerceShipmentItem> findByCommerceShipment(
		long commerceShipmentId) {
		return findByCommerceShipment(commerceShipmentId, QueryUtil.ALL_POS,
			QueryUtil.ALL_POS, null);
	}
285785
@Override
	public void cacheResult(
		List<CommerceNotificationQueueEntry> commerceNotificationQueueEntries) {
		for (CommerceNotificationQueueEntry commerceNotificationQueueEntry : commerceNotificationQueueEntries) {
			if (entityCache.getResult(
						CommerceNotificationQueueEntryModelImpl.ENTITY_CACHE_ENABLED,
						CommerceNotificationQueueEntryImpl.class,
						commerceNotificationQueueEntry.getPrimaryKey()) == null) {
				cacheResult(commerceNotificationQueueEntry);
			}
			else {
				commerceNotificationQueueEntry.resetOriginalValues();
			}
		}
	}
139232
public <T extends Notification> T getFromQueue() {
    int batchSize = 1;
    List<NotificationQueueDto> notificationDtos = dbClient.notificationQueueDao().selectOldest(batchSize);
    if (notificationDtos.isEmpty()) {
      return null;
    }
    dbClient.notificationQueueDao().delete(notificationDtos);

    return convertToNotification(notificationDtos);
  }
125211
@SuppressWarnings({"unused", "WeakerAccess"})
    public int getInboxMessageUnreadCount(){
        synchronized (inboxControllerLock) {
            if (this.ctInboxController != null) {
                return ctInboxController.unreadCount();
            } else {
                getConfigLogger().debug(getAccountId(), "Notification Inbox not initialized");
                return -1;
            }
        }
    }
398801
@Override
	public List<CommerceNotificationTemplate> findByGroupId(long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
741288
@Override
	public int countByCommerceAccountUserId(long commerceAccountUserId) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_COMMERCEACCOUNTUSERID;

		Object[] finderArgs = new Object[] { commerceAccountUserId };

		Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(2);

			query.append(_SQL_COUNT_COMMERCEACCOUNTUSERREL_WHERE);

			query.append(_FINDER_COLUMN_COMMERCEACCOUNTUSERID_COMMERCEACCOUNTUSERID_2);

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(commerceAccountUserId);

				count = (Long)q.uniqueResult();

				finderCache.putResult(finderPath, finderArgs, count);
			}
			catch (Exception e) {
				finderCache.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
1337020
public long getNumberOfQueuedMessages()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getNumberOfQueuedMessages");

    long total = 0;
    try
    {
      total = referenceItemStream.getStatistics().getTotalItemCount();
    }
    catch (MessageStoreException e)
    {
      FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.runtime.LocalSubscriptionControl.getNumberOfQueuedMessages",
          "1:422:1.36", 
          this);
      
      SibTr.exception(tc, e);
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())             
      SibTr.exit(tc, "getNumberOfQueuedMessages", new Long(total));
    return total;
  }
1312989
public CmsCategoryTreeEntry getEntryById(CmsUUID id) {

        for (CmsCategoryTreeEntry entry : getFlatList()) {
            if (id.equals(entry.getId())) {
                return entry;
            }
        }
        return null;
    }