Tabnine Logo
NotificationQueueConfig
Code IndexAdd Tabnine to your IDE (free)

How to use
NotificationQueueConfig
in
com.ning.billing.notificationq.api

Best Java code snippets using com.ning.billing.notificationq.api.NotificationQueueConfig (Showing top 9 results out of 315)

origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public int getReadyNotificationEntriesForSearchKey1(Long searchKey1) {
  return ((NotificationSqlDao) dao.getSqlDao()).getCountReadyEntries(searchKey1, clock.getUTCNow().toDate(), config.getTableName(), "search_key1");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

    return th;
}), config.getNbThreads(), config);
this.nbProcessedEvents = new AtomicLong();
final NotificationSqlDao sqlDao = (dbi != null) ? dbi.onDemand(NotificationSqlDao.class) : null;
this.dao = new DBBackedQueue<NotificationEventModelDao>(clock, sqlDao, config, "notif-" + config.getTableName(), metricRegistry);
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public void stopQueue() {
  if (config.isProcessingOff() || !isStarted()) {
    return;
  }
  // If there are no active queues left, stop the processing for the queues
  // (This is not intended to be robust against a system that would stop and start queues at the same time,
  // for a a normal shutdown sequence)
  //
  int nbQueueStarted = 0;
  synchronized (queues) {
    for (final NotificationQueue cur : queues.values()) {
      if (cur.isStarted()) {
        nbQueueStarted++;
      }
    }
  }
  if (nbQueueStarted == 0) {
    super.stopQueue();
  }
}
origin: com.ning.billing.commons/killbill-queue

                                UUID.randomUUID(), effDt, "testBasic");
dao.insertEntry(notif, notificationQueueConfig.getTableName());
final List<NotificationEventModelDao> notifications = dao.getReadyEntries(now.toDate(), hostname, 3, notificationQueueConfig.getTableName());
assertNotNull(notifications);
assertEquals(notifications.size(), 1);
final int res = dao.claimEntry(notification.getRecordId(), now.toDate(), ownerId, nextAvailable.toDate(),  notificationQueueConfig.getTableName());
assertEquals(res, 1);
dao.claimEntry(notification.getRecordId(), now.toDate(),  ownerId, nextAvailable.toDate(), notificationQueueConfig.getTableName());
notification = dao.getByRecordId(notification.getRecordId(), notificationQueueConfig.getTableName());
assertEquals(notification.getEventJson(), eventJson);
validateDate(notification.getEffectiveDate(), effDt);
dao.insertEntry(notificationHistory, notificationQueueConfig.getHistoryTableName());
notificationHistory = dao.getByRecordId(notification.getRecordId(), notificationQueueConfig.getHistoryTableName());
assertEquals(notificationHistory.getEventJson(), eventJson);
validateDate(notificationHistory.getEffectiveDate(), effDt);
validateDate(notificationHistory.getNextAvailableDate(), processedTime);
dao.removeEntry(notification.getRecordId(), notificationQueueConfig.getTableName());
notification = dao.getByRecordId(notification.getRecordId(), notificationQueueConfig.getTableName());
assertNull(notification);
origin: com.ning.billing/killbill-osgi-bundles-analytics

  clearNotification(cur);
  logDebug("done handling notification %s, key = %s for time %s", cur.getRecordId(), cur.getEventJson(), cur.getEffectiveDate());
} else if (errorCount <= config.getMaxFailureRetries()) {
  log.info("NotificationQ dispatch error, will attempt a retry ", lastException);
  NotificationEventModelDao failedNotification = new NotificationEventModelDao(cur, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.AVAILABLE, errorCount);
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public int getReadyNotificationEntriesForSearchKey2(Long searchKey2) {
  return ((NotificationSqlDao) dao.getSqlDao()).getCountReadyEntries(searchKey2, clock.getUTCNow().toDate(), config.getTableName(), "search_key2");
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public void removeNotificationFromTransaction(final Transmogrifier transmogrifier, final Long recordId) {
  final NotificationSqlDao transactional = transmogrifier.become(NotificationSqlDao.class);
  final NotificationEventModelDao existing = transactional.getByRecordId(recordId, config.getTableName());
  final NotificationEventModelDao removedEntry = new NotificationEventModelDao(existing, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.REMOVED);
  dao.moveEntryToHistoryFromTransaction(transactional, removedEntry);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public void removeNotification(final Long recordId) {
  final NotificationEventModelDao existing = dao.getSqlDao().getByRecordId(recordId, config.getTableName());
  final NotificationEventModelDao removedEntry = new NotificationEventModelDao(existing, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.REMOVED);
  dao.moveEntryToHistory(removedEntry);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private <T extends NotificationEvent> List<NotificationEventWithMetadata<T>> getFutureNotificationsInternal(final Class<T> typeX, final NotificationSqlDao transactionalDao, final String searchKey, final Long searchKeyValue) {
  final List<NotificationEventWithMetadata<T>> result = new LinkedList<NotificationEventWithMetadata<T>>();
  final List<NotificationEventModelDao> entries = transactionalDao.getReadyQueueEntriesForSearchKey(getFullQName(), searchKeyValue, config.getTableName(), searchKey);
  for (NotificationEventModelDao cur : entries) {
    final T event = (T) DefaultQueueLifecycle.deserializeEvent(cur.getClassName(), objectMapper, cur.getEventJson());
    final NotificationEventWithMetadata<T> foo = new NotificationEventWithMetadata<T>(cur.getRecordId(), cur.getUserToken(), cur.getCreatedDate(), cur.getSearchKey1(), cur.getSearchKey2(), event,
                                             cur.getFutureUserToken(), cur.getEffectiveDate(), cur.getQueueName());
    result.add(foo);
  }
  return result;
}
com.ning.billing.notificationq.apiNotificationQueueConfig

Most used methods

  • getTableName
  • getHistoryTableName
  • getMaxFailureRetries
  • getNbThreads
  • isProcessingOff

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Notification (javax.management)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now