1 7 8 package javax.management.remote; 9 10 import java.io.Serializable ; 11 12 import javax.management.Notification ; 13 import javax.management.ObjectName ; 14 15 42 public class NotificationResult implements Serializable { 43 44 private static final long serialVersionUID = 1191800228721395279L; 45 46 62 public NotificationResult(long earliestSequenceNumber, 63 long nextSequenceNumber, 64 TargetedNotification [] targetedNotifications) { 65 if (targetedNotifications == null) { 66 final String msg = "Notifications null"; 67 throw new IllegalArgumentException (msg); 68 } 69 70 if (earliestSequenceNumber < 0 || nextSequenceNumber < 0) 71 throw new IllegalArgumentException ("Bad sequence numbers"); 72 75 76 this.earliestSequenceNumber = earliestSequenceNumber; 77 this.nextSequenceNumber = nextSequenceNumber; 78 this.targetedNotifications = targetedNotifications; 79 } 80 81 88 public long getEarliestSequenceNumber() { 89 return earliestSequenceNumber; 90 } 91 92 99 public long getNextSequenceNumber() { 100 return nextSequenceNumber; 101 } 102 103 110 public TargetedNotification [] getTargetedNotifications() { 111 return targetedNotifications; 112 } 113 114 121 public String toString() { 122 return "NotificationResult: earliest=" + getEarliestSequenceNumber() + 123 "; next=" + getNextSequenceNumber() + "; nnotifs=" + 124 getTargetedNotifications().length; 125 } 126 127 private final long earliestSequenceNumber; 128 private final long nextSequenceNumber; 129 private final TargetedNotification [] targetedNotifications; 130 } 131 | Popular Tags |