org.mobicents.slee.services.sip.balancer.mbean
Class BalancerNodeMonitorMBeanImpl

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.mobicents.slee.services.sip.balancer.mbean.BalancerNodeMonitorMBeanImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, BalancerNodeMonitorMBeanImplMBean

public class BalancerNodeMonitorMBeanImpl
extends org.jboss.system.ServiceMBeanSupport
implements BalancerNodeMonitorMBeanImplMBean


Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
BalancerNodeMonitorMBeanImpl()
           
 
Method Summary
 boolean addBalancerAddress(byte[] addr)
           
 boolean addBalancerAddress(java.lang.String hostName, int index)
          Adds balancer address to distribution list.
 boolean addRAMBeanRegex(java.lang.String regex)
          Adds MBean regex - this regex must follow ObjectName convention - "slee:management=*"
 java.util.List<java.lang.String> getBalancers()
           
 long getHeartBeatInterval()
           
 java.util.List<java.lang.String> getRABeansRegex()
           
 boolean removeBalancerAddress(byte[] addr)
          Tries to remove balancer with name: addr[0].addr[1].addr[2].addr[3]
 void removeBalancerAddress(int index)
           
 boolean removeBalancerAddress(java.lang.String hostName, int index)
           
 void removeRAMBeanRegex(int index)
          Removes mbean regex
 boolean removeRAMBeanRegex(java.lang.String regex)
          Removes mbean regex
 void setHeartBeatInterval(long heartBeatInterval)
           
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

BalancerNodeMonitorMBeanImpl

public BalancerNodeMonitorMBeanImpl()
Method Detail

getHeartBeatInterval

public long getHeartBeatInterval()
Specified by:
getHeartBeatInterval in interface BalancerNodeMonitorMBeanImplMBean

setHeartBeatInterval

public void setHeartBeatInterval(long heartBeatInterval)
Specified by:
setHeartBeatInterval in interface BalancerNodeMonitorMBeanImplMBean

addRAMBeanRegex

public boolean addRAMBeanRegex(java.lang.String regex)
                        throws java.lang.IllegalArgumentException,
                               java.lang.NullPointerException
Description copied from interface: BalancerNodeMonitorMBeanImplMBean
Adds MBean regex - this regex must follow ObjectName convention - "slee:management=*"

Specified by:
addRAMBeanRegex in interface BalancerNodeMonitorMBeanImplMBean
Returns:
  • true - there wasnt regex that mathces this one and operation was success
  • false - otherwise
Throws:
java.lang.IllegalArgumentException - - does not follow ObjectName convention
java.lang.NullPointerException - - arg is null

getBalancers

public java.util.List<java.lang.String> getBalancers()
Specified by:
getBalancers in interface BalancerNodeMonitorMBeanImplMBean
Returns:
- list of String objects representing balancer addresses. Example content:
  • 192.168.1.100
  • ala.ma.kota.pl

getRABeansRegex

public java.util.List<java.lang.String> getRABeansRegex()
Specified by:
getRABeansRegex in interface BalancerNodeMonitorMBeanImplMBean
Returns:
List of pseduo regular expresion - one that can be used to lokup group of mbeans like, "slee:management=*". List that is stored here is used to lookup SIPRA confiruration mbeans ant fetch data from it. After that this data is shiped to balancers

removeBalancerAddress

public void removeBalancerAddress(int index)
                           throws java.lang.IllegalArgumentException
Specified by:
removeBalancerAddress in interface BalancerNodeMonitorMBeanImplMBean
Throws:
java.lang.IllegalArgumentException

removeRAMBeanRegex

public boolean removeRAMBeanRegex(java.lang.String regex)
                           throws java.lang.NullPointerException
Description copied from interface: BalancerNodeMonitorMBeanImplMBean
Removes mbean regex

Specified by:
removeRAMBeanRegex in interface BalancerNodeMonitorMBeanImplMBean
Returns:
  • true - there was regex that mathces this one and operation was success
  • false - otherwise
Throws:
java.lang.NullPointerException

removeRAMBeanRegex

public void removeRAMBeanRegex(int index)
                        throws java.lang.IllegalArgumentException
Description copied from interface: BalancerNodeMonitorMBeanImplMBean
Removes mbean regex

Specified by:
removeRAMBeanRegex in interface BalancerNodeMonitorMBeanImplMBean
Throws:
java.lang.IllegalArgumentException - - wrong index

startService

protected void startService()
                     throws java.lang.Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

addBalancerAddress

public boolean addBalancerAddress(byte[] addr)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.NullPointerException,
                                  java.io.IOException
Specified by:
addBalancerAddress in interface BalancerNodeMonitorMBeanImplMBean
Throws:
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException

addBalancerAddress

public boolean addBalancerAddress(java.lang.String hostName,
                                  int index)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.NullPointerException,
                                  java.io.IOException
Description copied from interface: BalancerNodeMonitorMBeanImplMBean
Adds balancer address to distribution list. Tries to connect to it.

Specified by:
addBalancerAddress in interface BalancerNodeMonitorMBeanImplMBean
Parameters:
hostName - - name of the host to be looked up in DNS
index - - possible index of IP address when host has more than one address - like InetAddress.getAllByName(..);
Returns:
  • true - if address didnt exist and it has been injected into list
  • false - otherwise
Throws:
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.io.IOException

removeBalancerAddress

public boolean removeBalancerAddress(byte[] addr)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.NullPointerException
Description copied from interface: BalancerNodeMonitorMBeanImplMBean
Tries to remove balancer with name: addr[0].addr[1].addr[2].addr[3]

Specified by:
removeBalancerAddress in interface BalancerNodeMonitorMBeanImplMBean
Parameters:
addr - - The argument is address representation in network byte order: the highest order byte of the address is in [0].
Returns:
  • true - if name exists and was removed
  • false - otherwise
Throws:
java.lang.IllegalArgumentException - - if there is no balancer with that name on the list.
java.lang.NullPointerException - - if addr==null

removeBalancerAddress

public boolean removeBalancerAddress(java.lang.String hostName,
                                     int index)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.NullPointerException
Specified by:
removeBalancerAddress in interface BalancerNodeMonitorMBeanImplMBean
Throws:
java.lang.IllegalArgumentException
java.lang.NullPointerException


Copyright © 2008. All Rights Reserved.