javax.slee.usage
Class UsageNotification

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--javax.management.Notification
              |
              +--javax.slee.usage.UsageNotification
All Implemented Interfaces:
java.io.Serializable

public class UsageNotification
extends javax.management.Notification

This notification is emitted by an SbbUsageMBean object to indicate a counter-type usage parameter has been updated or a sample-type usage parameter has accumulated a new sample.

The notification type of all usage notifications is specified by the SbbUsageMBean.USAGE_NOTIFICATION_TYPE attribute.

See Also:
Serialized Form

Fields inherited from class javax.management.Notification
source
 
Constructor Summary
UsageNotification(SbbUsageMBean notificationSource, ServiceID serviceID, SbbID sbbID, java.lang.String paramSet, java.lang.String paramName, boolean counter, long value, long sequenceNumber, long timeStamp)
          Create a UsageNotification containing the updated value of an SBB's usage parameter.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this notification for equality with another object.
 SbbID getSbb()
          Get the component identifier of the SBB whose usage parameter was updated.
 ServiceID getService()
          Get the component identifier of the Service whose SBB's usage parameter was updated.
 java.lang.String getUsageParameterName()
          Get the name of the usage parameter that was updated.
 java.lang.String getUsageParameterSetName()
          Get the name of the usage parameter set containing the usage parameter thas was updated.
 long getValue()
          Get the updated value or emitted sample of the usage parameter.
 int hashCode()
          Get a hash code value for this notification.
 boolean isCounter()
          Determine if the usage parameter updated is counter-type or sample-type.
 java.lang.String toString()
          Get a string representation for this notification.
 
Methods inherited from class javax.management.Notification
getMessage, getSequenceNumber, getSource, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UsageNotification

public UsageNotification(SbbUsageMBean notificationSource,
                         ServiceID serviceID,
                         SbbID sbbID,
                         java.lang.String paramSet,
                         java.lang.String paramName,
                         boolean counter,
                         long value,
                         long sequenceNumber,
                         long timeStamp)
                  throws java.lang.NullPointerException
Create a UsageNotification containing the updated value of an SBB's usage parameter.
Parameters:
notificationSource - the SbbUsageMBean object that is emitting this notification.
serviceID - the component identifier of the Service whose SBB's usage parameter was updated.
sbbID - the component identifier of the SBB whose usage parameter was updated.
paramSet - the name of the SBB usage parameter set containing the usage parameter that was updated. If the unamed usage parameter set was updated, this value is null.
paramName - the name of the usage parameter that was updated.
value - this is either the new value of the usage parameter (for counter-type usage parameters), or a sample value (for sample-type usage parameters).
sequenceNumber - the notification sequence number within the source SbbUsageMBean.
timeStamp - the time (in ms since January 1, 1970 UTC) that the notification was generated.
Throws:
java.lang.NullPointerException - if notificationSource, serviceID, sbbID or paramName is null.
Method Detail

getService

public final ServiceID getService()
Get the component identifier of the Service whose SBB's usage parameter was updated.
Returns:
the component identifier of the Service whose SBB's usage parameter was updated.

getSbb

public final SbbID getSbb()
Get the component identifier of the SBB whose usage parameter was updated.
Returns:
the component identifier of the SBB whose usage parameter was updated.

getUsageParameterSetName

public final java.lang.String getUsageParameterSetName()
Get the name of the usage parameter set containing the usage parameter thas was updated.
Returns:
the name of the usage parameter set, or null if the usage parameter was a member of the unnamed usage parameter set for the SBB.

getUsageParameterName

public final java.lang.String getUsageParameterName()
Get the name of the usage parameter that was updated.
Returns:
the name of the usage parameter that was updated.

isCounter

public final boolean isCounter()
Determine if the usage parameter updated is counter-type or sample-type.
Returns:
true if the usage parameter updated is counter-type, false if the usage parameter updated is sample-type.

getValue

public final long getValue()
Get the updated value or emitted sample of the usage parameter. If isCounter() returns true this value is the updated value of the counter-type usage parameter. If isCounter() returns false this value is a sample value for the usage parameter.
Returns:
the updated value or emitted sample of the usage parameter.

equals

public boolean equals(java.lang.Object obj)
Compare this notification for equality with another object.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an instance of this class and the Service identifier, SBB identifier, usage parameter set name, and usage parameter name attributes of obj are the same as the corresponding attributes of this.

hashCode

public int hashCode()
Get a hash code value for this notification. The hash code is the logical XOR of the hash codes of the Service identifier, the SBB identifier, and the usage parameter name.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this notification.

toString

public java.lang.String toString()
Get a string representation for this notification.
Overrides:
toString in class java.util.EventObject
Returns:
a string representation for this notification.