javax.management.remote
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.
Constructor and Description |
---|
NotificationResult(long startSeqNumber,
long nextSeqNumber,
TargetedNotification[] notifications)
Constructs a new
NotificationResult using the specified
sequence numbers and the supplied array of notification pairs. |
Modifier and Type | Method and Description |
---|---|
long |
getEarliestSequenceNumber()
Returns the sequence number of the earliest notification
in the buffer.
|
long |
getNextSequenceNumber()
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.
|
String |
toString()
Returns a textual representation of the object.
|
public NotificationResult(long startSeqNumber, long nextSeqNumber, TargetedNotification[] notifications)
NotificationResult
using the specified
sequence numbers and the supplied array of notification pairs.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.IllegalArgumentException
- if a sequence number is negative
or notifications
is
null
.public long getEarliestSequenceNumber()
public long getNextSequenceNumber()
public TargetedNotification[] getTargetedNotifications()
public String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)