Package com.opencloud.slee.remote
Class RemoteUsage.UsageNotificationManager
- java.lang.Object
-
- com.opencloud.slee.remote.RemoteUsage.UsageNotificationManager
-
- Enclosing class:
- RemoteUsage
public static class RemoteUsage.UsageNotificationManager extends Object
Helps enabling/disabling notifications for usage parameters. This class can be instantiated directly by a client if an ObjectName reference has already been obtained, but is normally created and returned by calling on of the following methods: *RemoteUsage.Subsystems.getUsageNotificationManager(javax.management.MBeanServerConnection, String)
*RemoteUsage.Sbbs.getUsageNotificationManager(javax.management.MBeanServerConnection, javax.slee.ServiceID, javax.slee.SbbID)
*RemoteUsage.Profiles.getUsageNotificationManager(javax.management.MBeanServerConnection, String)
*RemoteUsage.Resources.getUsageNotificationManager(javax.management.MBeanServerConnection, String)
-
-
Constructor Summary
Constructors Constructor Description UsageNotificationManager(MBeanServerConnection server, ObjectName objectName)
Create a usage notification manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the Usage Notification Manager MBean.boolean
getNotificationsEnabled(String name)
Determine whether notifications are enabled for a usage parameter.int
getParameterCount()
Get the number of usage parameter names available to have notifications enabled.String
getUsageParametersInterfaceType()
Get the usage parameters interface type.Iterator
nameIterator()
Get an iterator of the usage parameter names available to have notifications enabled.void
setNotificationsEnabled(String name, boolean enabled)
Enable notifications for a usage parameter.
-
-
-
Constructor Detail
-
UsageNotificationManager
public UsageNotificationManager(MBeanServerConnection server, ObjectName objectName) throws ManagementException
Create a usage notification manager.- Parameters:
server
- a server connectionobjectName
- the objectName of the Usage Notification MBean- Throws:
ManagementException
-
-
Method Detail
-
getUsageParametersInterfaceType
public String getUsageParametersInterfaceType()
Get the usage parameters interface type. This method only returns a non-null value if the usage parameters interface was declared using the Rhino extension mechanism.- Returns:
- the usage parameters interface type name, or
null
if the usage parameters interface was declared using the standard SLEE mechanism.
-
getParameterCount
public int getParameterCount() throws ManagementException
Get the number of usage parameter names available to have notifications enabled.- Returns:
- number of usage parameters
- Throws:
ManagementException
-
nameIterator
public Iterator nameIterator() throws ManagementException
Get an iterator of the usage parameter names available to have notifications enabled.- Returns:
- usage parameter names
- Throws:
ManagementException
-
getNotificationsEnabled
public boolean getNotificationsEnabled(String name) throws ManagementException
Determine whether notifications are enabled for a usage parameter. After checking the the usage parameter name is valid, this method invokes getAttribute using the MBean server and object name stored in this instance of `UsageNotificationManager`: [source,java] ---- server.getAttribute(objectName, name + "NotificationsEnabled"); ----- Parameters:
name
- the name of the usage parameter to test- Returns:
- true - enabled, false - disabled
- Throws:
ManagementException
- if any problem occurs invoking getAttribute on the MBean server
-
setNotificationsEnabled
public void setNotificationsEnabled(String name, boolean enabled) throws ManagementException
Enable notifications for a usage parameter. This method simply invokes setAttribute using the MBean server and object name stored in this instance of `UsageNotificationManager`: [source,java] ---- server.setAttribute(objectName, new Attribute(name + "NotificationsEnabled", enabled)); ----- Parameters:
name
- the name of the usage parameter to enable/disable notifications forenabled
- true - enabled, false - disabled- Throws:
ManagementException
- if any problem occurs invoking setAttribute on the MBean server
-
close
public void close() throws ManagementException
Close the Usage Notification Manager MBean.- Throws:
ManagementException
- if any problem occurs closing the MBean
-
-