FileDocCategorySizeDatePackage
NotificationResult.javaAPI DocJava SE 5 API4288Fri Aug 26 14:57:38 BST 2005javax.management.remote

NotificationResult

public class NotificationResult extends Object implements Serializable

Result of a query for buffered notifications. Notifications in a notification buffer have positive, monotonically increasing sequence numbers. The result of a notification query contains the following elements:

  • The sequence number of the earliest notification still in the buffer.
  • The sequence number of the next notification available for querying. This will be the starting sequence number for the next notification query.
  • An array of (Notification,listenerID) pairs corresponding to the returned notifications and the listeners they correspond to.

It is possible for the nextSequenceNumber to be less than the earliestSequenceNumber. This signifies that notifications between the two might have been lost.

since
1.5
since.unbundled
1.0

Fields Summary
private static final long
serialVersionUID
private final long
earliestSequenceNumber
private final long
nextSequenceNumber
private final TargetedNotification[]
targetedNotifications
Constructors Summary
public NotificationResult(long earliestSequenceNumber, long nextSequenceNumber, TargetedNotification[] targetedNotifications)

Constructs a notification query result.

param
earliestSequenceNumber the sequence number of the earliest notification still in the buffer.
param
nextSequenceNumber the sequence number of the next notification available for querying.
param
targetedNotifications the notifications resulting from the query, and the listeners they correspond to. This array can be empty.
exception
IllegalArgumentException if targetedNotifications is null or if earliestSequenceNumber or nextSequenceNumber is negative.


                                                                        
      
			       
			        
	if (targetedNotifications == null) {
	    final String msg = "Notifications null";
	    throw new IllegalArgumentException(msg);
	}

	if (earliestSequenceNumber < 0 || nextSequenceNumber < 0)
	    throw new IllegalArgumentException("Bad sequence numbers");
	/* We used to check nextSequenceNumber >= earliestSequenceNumber
	   here.  But in fact the opposite can legitimately be true if
	   notifications have been lost.  */

	this.earliestSequenceNumber = earliestSequenceNumber;
	this.nextSequenceNumber = nextSequenceNumber;
	this.targetedNotifications = targetedNotifications;
    
Methods Summary
public longgetEarliestSequenceNumber()
Returns the sequence number of the earliest notification still in the buffer.

return
the sequence number of the earliest notification still in the buffer.

	return earliestSequenceNumber;
    
public longgetNextSequenceNumber()
Returns the sequence number of the next notification available for querying.

return
the sequence number of the next notification available for querying.

	return nextSequenceNumber;
    
public javax.management.remote.TargetedNotification[]getTargetedNotifications()
Returns the notifications resulting from the query, and the listeners they correspond to.

return
the notifications resulting from the query, and the listeners they correspond to. This array can be empty.

	return targetedNotifications;
    
public java.lang.StringtoString()
Returns a string representation of the object. The result should be a concise but informative representation that is easy for a person to read.

return
a string representation of the object.

	return "NotificationResult: earliest=" + getEarliestSequenceNumber() +
	    "; next=" + getNextSequenceNumber() + "; nnotifs=" +
	    getTargetedNotifications().length;