Tabnine Logo
Hostname.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
com.ning.billing.Hostname

Best Java code snippets using com.ning.billing.Hostname.get (Showing top 15 results out of 315)

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

@Override
public void recordFutureNotification(final DateTime futureNotificationTime, final NotificationEvent event, final UUID userToken, final Long searchKey1, final Long searchKey2) throws IOException {
  final String eventJson = objectMapper.writeValueAsString(event);
  final UUID futureUserToken = UUID.randomUUID();
  final Long searchKey2WithNull =  Objects.firstNonNull(searchKey2, new Long(0));
  final NotificationEventModelDao notification = new NotificationEventModelDao(Hostname.get(), clock.getUTCNow(), event.getClass().getName(), eventJson, userToken, searchKey1, searchKey2WithNull, futureUserToken, futureNotificationTime, getFullQName());
  dao.insertEntry(notification);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public void recordFutureNotificationFromTransaction(final Transmogrifier transmogrifier, final DateTime futureNotificationTime, final NotificationEvent event,
                          final UUID userToken, final Long searchKey1, final Long searchKey2) throws IOException {
  final NotificationSqlDao transactionalNotificationDao = transmogrifier.become(NotificationSqlDao.class);
  final String eventJson = objectMapper.writeValueAsString(event);
  final UUID futureUserToken = UUID.randomUUID();
  final Long searchKey2WithNull =  Objects.firstNonNull(searchKey2, new Long(0));
  final NotificationEventModelDao notification = new NotificationEventModelDao(Hostname.get(), clock.getUTCNow(), event.getClass().getName(), eventJson, userToken, searchKey1, searchKey2WithNull, futureUserToken, futureNotificationTime, getFullQName());
  dao.insertEntryFromTransaction(transactionalNotificationDao, notification);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private List<T> fetchReadyEntries(int size) {
  final Date now = clock.getUTCNow().toDate();
  final List<T> entries = sqlDao.getReadyEntries(now, Hostname.get(), size, config.getTableName());
  return entries;
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public void post(final BusEvent event) throws EventBusException {
  try {
    if (isStarted.get()) {
      final String json = objectMapper.writeValueAsString(event);
      final BusEventModelDao entry = new BusEventModelDao(Hostname.get(), clock.getUTCNow(), event.getClass().getName(), json,
          event.getUserToken(), event.getSearchKey1(), event.getSearchKey2());
      dao.insertEntry(entry);
    } else {
      log.warn("Attempting to post event " + event + " in a non initialized bus");
    }
  } catch (Exception e) {
    log.error("Failed to post BusEvent " + event, e);
  }
}
origin: com.ning.billing.commons/killbill-queue

public MockNotificationQueue(final Clock clock, final String svcName, final String queueName, final NotificationQueueHandler handler, final MockNotificationQueueService mockNotificationQueueService) {
  this.svcName = svcName;
  this.queueName = queueName;
  this.handler = handler;
  this.clock = clock;
  this.hostname = Hostname.get();
  this.queueService = mockNotificationQueueService;
  this.recordIds = new AtomicLong();
  notifications = new TreeSet<NotificationEventModelDao>(new Comparator<NotificationEventModelDao>() {
    @Override
    public int compare(final NotificationEventModelDao o1, final NotificationEventModelDao o2) {
      if (o1.getEffectiveDate().equals(o2.getEffectiveDate())) {
        return o1.getRecordId().compareTo(o2.getRecordId());
      } else {
        return o1.getEffectiveDate().compareTo(o2.getEffectiveDate());
      }
    }
  });
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private boolean claimEntry(T entry) {
  final Date nextAvailable = clock.getUTCNow().plus(config.getClaimedTime().getMillis()).toDate();
  final boolean claimed = (sqlDao.claimEntry(entry.getRecordId(), clock.getUTCNow().toDate(), Hostname.get(), nextAvailable, config.getTableName()) == 1);
  if (claimed && log.isDebugEnabled()) {
    log.debug(DB_QUEUE_LOG_ID + "Claiming entry " + entry.getRecordId());
  }
  return claimed;
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private void clearFailedNotification(final NotificationEventModelDao cleared) {
  NotificationEventModelDao processedEntry = new NotificationEventModelDao(cleared, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.FAILED);
  dao.moveEntryToHistory(processedEntry);
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

  @Override
  public void postFromTransaction(final BusEvent event, final Transmogrifier transmogrifier)
      throws EventBusException {
    try {
      final PersistentBusSqlDao transactional = transmogrifier.become(PersistentBusSqlDao.class);
      if (isStarted.get()) {
        final String json = objectMapper.writeValueAsString(event);
        final BusEventModelDao entry = new BusEventModelDao(Hostname.get(), clock.getUTCNow(), event.getClass().getName(), json,
            event.getUserToken(), event.getSearchKey1(), event.getSearchKey2());
        dao.insertEntryFromTransaction(transactional, entry);
      } else {
        log.warn("Attempting to post event " + event + " in a non initialized bus");
      }
    } catch (Exception e) {
      log.error("Failed to post BusEvent " + event, e);
    }
  }
}
origin: com.ning.billing/killbill-osgi-bundles-analytics

private void clearNotification(final NotificationEventModelDao cleared) {
  NotificationEventModelDao processedEntry = new NotificationEventModelDao(cleared, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.PROCESSED);
  dao.moveEntryToHistory(processedEntry);
}
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

} finally {
  if (lastException == null) {
    BusEventModelDao processedEntry = new BusEventModelDao(cur, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.PROCESSED);
    dao.moveEntryToHistory(processedEntry);
  } else if (errorCount <= config.getMaxFailureRetries()) {
    log.info("Bus dispatch error, will attempt a retry ", lastException);
    BusEventModelDao retriedEntry = new BusEventModelDao(cur, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.AVAILABLE, errorCount);
    dao.updateOnError(retriedEntry);
  } else {
    log.error("Fatal Bus dispatch error, data corruption...", lastException);
    BusEventModelDao processedEntry = new BusEventModelDao(cur, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.FAILED);
    dao.moveEntryToHistory(processedEntry);
origin: com.ning.billing/killbill-osgi-bundles-analytics

} 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);
  dao.updateOnError(failedNotification);
} else {
origin: com.ning.billing.commons/killbill-queue

final DateTime effDt = new DateTime();
final NotificationEventModelDao notif = new NotificationEventModelDao(Hostname.get(), clock.getUTCNow(), eventJson.getClass().getName(),
                                eventJson, UUID.randomUUID(), searchKey1, SEARCH_KEY_2,
                                UUID.randomUUID(), effDt, "testBasic");
NotificationEventModelDao notificationHistory = new NotificationEventModelDao(notification, Hostname.get(), processedTime, PersistentQueueEntryLifecycleState.PROCESSED);
dao.insertEntry(notificationHistory, notificationQueueConfig.getHistoryTableName());
assertEquals(notificationHistory.getEventJson(), eventJson);
validateDate(notificationHistory.getEffectiveDate(), effDt);
assertEquals(notificationHistory.getProcessingOwner(), Hostname.get());
assertEquals(notificationHistory.getProcessingState(), PersistentQueueEntryLifecycleState.PROCESSED);
validateDate(notificationHistory.getNextAvailableDate(), processedTime);
origin: com.ning.billing.commons/killbill-queue

private int doProcessEventsForQueue(final MockNotificationQueue queue) {
  int result = 0;
  final List<NotificationEventModelDao> processedNotifications = new ArrayList<NotificationEventModelDao>();
  final List<NotificationEventModelDao> oldNotifications = new ArrayList<NotificationEventModelDao>();
  List<NotificationEventModelDao> readyNotifications = queue.getReadyNotifications();
  for (final NotificationEventModelDao cur : readyNotifications) {
    final NotificationEvent key = deserializeEvent(cur.getClassName(), objectMapper, cur.getEventJson());
    queue.getHandler().handleReadyNotification(key, cur.getEffectiveDate(), cur.getFutureUserToken(), cur.getSearchKey1(), cur.getSearchKey2());
    final NotificationEventModelDao processedNotification = new NotificationEventModelDao(cur.getRecordId(), Hostname.get(), Hostname.get(), clock.getUTCNow(),
                                               getClock().getUTCNow().plus(CLAIM_TIME_MS),
                                               PersistentQueueEntryLifecycleState.PROCESSED, cur.getClassName(),
                                               cur.getEventJson(), 0L, cur.getUserToken(), cur.getSearchKey1(), cur.getSearchKey2(),
                                               cur.getFutureUserToken(), cur.getEffectiveDate(), "MockQueue");
    oldNotifications.add(cur);
    processedNotifications.add(processedNotification);
    result++;
  }
  queue.markProcessedNotifications(oldNotifications, processedNotifications);
  return result;
}
com.ning.billingHostnameget

Popular methods of Hostname

    Popular in Java

    • Creating JSON documents from java classes using gson
    • setContentView (Activity)
    • getSupportFragmentManager (FragmentActivity)
    • scheduleAtFixedRate (ScheduledExecutorService)
    • Kernel (java.awt.image)
    • PrintStream (java.io)
      Fake signature of an existing Java class.
    • GregorianCalendar (java.util)
      GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
    • Handler (java.util.logging)
      A Handler object accepts a logging request and exports the desired messages to a target, for example
    • SSLHandshakeException (javax.net.ssl)
      The exception that is thrown when a handshake could not be completed successfully.
    • JTextField (javax.swing)
    • Top 12 Jupyter Notebook extensions
    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