javax.management.remote

Class NotificationResult

public class NotificationResult extends Object implements Serializable

Wraps the result of a query for buffered notifications. In a remote scenario, it may be more practical for the server to buffer individual notifications from its beans and then return them in bulk on request. This class contains the notifications returned by such a request.

It consists of a series of Notification and identifier pairs, wrapped in a TargetedNotification object. The identifiers serve to pair up the notification with the listener that requested it. Two positive numbers are also included: the first sequence number used by the returned notifications, and the sequence number of the notification which will be returned by the next query. The first sequence number may be greater than the next sequence number if some notifications have been lost.

Since: 1.5

Constructor Summary
NotificationResult(long startSeqNumber, long nextSeqNumber, TargetedNotification[] notifications)
Constructs a new NotificationResult using the specified sequence numbers and the supplied array of notification pairs.
Method Summary
longgetEarliestSequenceNumber()
Returns the sequence number of the earliest notification in the buffer.
longgetNextSequenceNumber()
Returns the sequence number of the next notification to be returned by a future query.
TargetedNotification[]getTargetedNotifications()
Returns the notification and identifier pairs returned by the query.
StringtoString()
Returns a textual representation of the object.

Constructor Detail

NotificationResult

public NotificationResult(long startSeqNumber, long nextSeqNumber, TargetedNotification[] notifications)
Constructs a new NotificationResult using the specified sequence numbers and the supplied array of notification pairs.

Parameters: startSeqNumber the sequence number of the first notification being returned. nextSeqNumber the sequence numbr of the next notification that will be returned from a future query. notifications the notification and identifier pairs. This may be empty.

Throws: IllegalArgumentException if a sequence number is negative or notifications is null.

Method Detail

getEarliestSequenceNumber

public long getEarliestSequenceNumber()
Returns the sequence number of the earliest notification in the buffer.

Returns: the sequence number of the earliest notification.

getNextSequenceNumber

public long getNextSequenceNumber()
Returns the sequence number of the next notification to be returned by a future query.

Returns: the sequence number of the next notification.

getTargetedNotifications

public TargetedNotification[] getTargetedNotifications()
Returns the notification and identifier pairs returned by the query.

Returns: the notification and identifier pairs.

toString

public String toString()
Returns a textual representation of the object.

Returns: a textual representation.