com.bea.netuix.application.notifications.enumerators
Class CollectionNotificationUserEnumerator

java.lang.Object
  extended by com.bea.netuix.application.notifications.enumerators.CollectionNotificationUserEnumerator
All Implemented Interfaces
INotificationUserEnumerator, Serializable

public class CollectionNotificationUserEnumerator
extends Object
implements INotificationUserEnumerator

Used to enumerate a list of usernames to the NotificationManager when sending notifications to a reasonably-sized (not too large to fit in memory) set of users.

See Also
Serialized Form

Constructor Summary
CollectionNotificationUserEnumerator(Collection<String> usernames)
          Constructor where the collection of usernames to enumerate is specified.
 
Method Summary
 void close()
          Releases any resources used by this enumeration.
 String getNext()
          Returns the next username in the enumeration.
 boolean hasNext()
          Used to determine if more usernames are available from this enumeration.
 void open()
          Serves to initialize the enumeration.
 void reset()
          Used to reset the enumeration to the beginning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionNotificationUserEnumerator

public CollectionNotificationUserEnumerator(Collection<String> usernames)
Constructor where the collection of usernames to enumerate is specified.

Parameters
usernames - the collection of usernames to enumerate.
Method Detail

open

public void open()
          throws NotificationUserEnumerationException
Serves to initialize the enumeration. Any resources the enumeration needs may be obtained in this initialization method. This method is called before any calls to the reset, hasNext or getNext methods are made.

Specified by:
open in interface INotificationUserEnumerator
Throws
NotificationUserEnumerationException - if any problems were encountered.

reset

public void reset()
           throws NotificationUserEnumerationException
Used to reset the enumeration to the beginning. This may be necessary if a transaction got rolled back and the NotificationManager is attempting to send the notification again.

It is not necessary that the enumeration proceed in the same order as it did previously, nor that the enumeration results in the same total return set-- in other words, the enumeration can be based entirely on dynamic criteria or data which may change over time. The only requirement is that an enumeration must not return the same username twice unless a call to reset() has been made.

Specified by:
reset in interface INotificationUserEnumerator
Throws
NotificationUserEnumerationException - if any problems were encountered.

hasNext

public boolean hasNext()
                throws NotificationUserEnumerationException
Used to determine if more usernames are available from this enumeration.

Specified by:
hasNext in interface INotificationUserEnumerator
Returns
true as long as more usernames are available from the enumeration.
Throws
NotificationUserEnumerationException - if any problems were encountered.

getNext

public String getNext()
               throws NotificationUserEnumerationException
Returns the next username in the enumeration.

Specified by:
getNext in interface INotificationUserEnumerator
Returns
the next username in the enumeration.
Throws
NotificationUserEnumerationException - if any problems were encountered.

close

public void close()
           throws NotificationUserEnumerationException
Releases any resources used by this enumeration.

Specified by:
close in interface INotificationUserEnumerator
Throws
NotificationUserEnumerationException - if any problems were encountered.


Copyright © 2011, Oracle. All rights reserved.