agave-notifications/notifications-core/src/main/java/org/iplantc/service/notification/dao/FailedNotificationAttemptQueue.java
/**
	 * Returns the next entry on the queue. This will be the oldest item,
	 * or the "top" of the queue.
	 * 
	 * @param notificationId notification uuid
	 * @return the {@link NotificationAttempt} at the top of the queue or null if the queue is empty.
	 * @throws NotificationException if unable to fetch attempt
	 */
Returns the next entry on the queue. This will be the oldest item,
or the "top" of the queue.

@param notificationId notification uuid
@return the  NotificationAttempt at the top of the queue or null if the queue is empty.
@throws NotificationException if unable to fetch attempt
Returns the next entry on the queue . This will be the oldest item or the " top " of the queue . @param notificationId notification uuid @return the NotificationAttempt at the top of the queue or null if the queue is empty . @throws NotificationException if unable to fetch attempt
public NotificationAttempt next(String notificationId) 
	throws NotificationException
	{
		NotificationAttempt attempt = null;
		try {
			MongoCollection<NotificationAttempt> cappedCollection = getOrCreateCappedCollection(notificationId);
			attempt = cappedCollection.find().first();
		}
		catch (MongoException e) {
			log.error("Failed to fetch last failed notification attempt for " + notificationId, e);
		}
		catch (Exception e) {
			log.error("Unexpected server error while fetching last failed notification attempt for " + 
					notificationId, e);
		}
		return attempt;
	}
public NotificationAttempt next ( String notificationId ) throws NotificationException { NotificationAttempt attempt = null ; try { MongoCollection < NotificationAttempt > cappedCollection = getOrCreateCappedCollection ( notificationId ) ; attempt = cappedCollection . find ( ) . first ( ) ; } catch ( MongoException e ) { log . error ( "Failed to fetch last failed notification attempt for " + notificationId , e ) ; } catch ( Exception e ) { log . error ( "Unexpected server error while fetching last failed notification attempt for " + notificationId , e ) ; } return attempt ; }
Returns the next entry on the queue.
Returns the next entry on the queue .
// capped collections guarantee results return in the insertion order