|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.system.ListenerServiceMBeanSupport
org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService
public class SnmpAgentService
SnmpAgentService is an MBean class implementing an SNMP agent. It allows to send V1 or V2 traps to one or more SNMP managers defined by their IP address, listening port number and expected SNMP version. It support mapping SNMP get/set requests JMX mbean attribute get/sets.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jboss.system.ListenerServiceMBeanSupport |
|---|
org.jboss.system.ListenerServiceMBeanSupport.SubscriptionInfo |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_READ_COMMUNITY
Default communities |
static java.lang.String |
DEFAULT_WRITE_COMMUNITY
|
static int |
SNMPV1
Supported versions |
static int |
SNMPV2
|
static int |
SNMPV3
|
| Fields inherited from class org.jboss.system.ServiceMBeanSupport |
|---|
log, server, SERVICE_CONTROLLER_SIG, serviceName |
| Fields inherited from interface org.jboss.jmx.adaptor.snmp.agent.SnmpAgentServiceMBean |
|---|
OBJECT_NAME |
| Fields inherited from interface org.jboss.system.ListenerServiceMBean |
|---|
SL_FILTER_ELEMENT, SL_FILTER_FACTORY_ATTRIBUTE, SL_MBEAN_ELEMENT, SL_MBEAN_HANDBACK_ATTRIBUTE, SL_MBEAN_NAME_ATTRIBUTE, SL_NOTIFICATION_ELEMENT, SL_NOTIFICATION_TYPE_ATTRIBUTE, SL_ROOT_ELEMENT |
| 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 | |
|---|---|
SnmpAgentService()
Default CTOR |
|
| Method Summary | |
|---|---|
void |
addAttributeMappings(java.util.List<ManagedBean> mappings)
|
void |
addNotifications(java.util.List<Mapping> notifications)
|
java.lang.String |
getBindAddress()
Gets the agent bind address |
Clock |
getClock()
|
boolean |
getDynamicSubscriptions()
Gets the dynamic subscriptions status |
int |
getHeartBeatPeriod()
Gets the heartbeat switch |
long |
getInstantiationTime()
Returns the difference, measured in milliseconds, between the instantiation time and midnight, January 1, 1970 UTC. |
java.lang.String |
getManagersResName()
Gets the name of the file containing SNMP manager specifications |
long |
getNextJMXNotificationSequenceNumber()
|
java.lang.String |
getNotificationMapResName()
Gets the name of the file containing the notification/trap mappings |
int |
getNumberOfThreads()
Gets the number of threads in the agent requests processing thread pool |
int |
getPort()
Gets the agent listening port number |
RequestHandler |
getRequestHandler()
|
java.lang.String |
getRequestHandlerClassName()
Gets the RequestHandler implementation class |
java.lang.String |
getRequestHandlerResName()
Gets the resource file name containing get/set mappings |
SnmpRequest |
getResponder()
|
org.snmp4j.Snmp |
getSession()
|
int |
getSnmpVersion()
Gets the snmp protocol version |
javax.management.ObjectName |
getTimerName()
Gets the utilised timer MBean name |
org.snmp4j.TransportMapping[] |
getTransportMappings()
|
long |
getTrapCount()
Returns the current trap counter reading |
Counter |
getTrapCounter()
|
java.lang.String |
getTrapFactoryClassName()
Gets the utilised trap factory name |
long |
getUptime()
Returns the up-time |
java.util.Map<java.lang.String,User> |
getUserMap()
|
java.lang.String |
getUsersResName()
|
void |
handleNotification2(javax.management.Notification n,
java.lang.Object handback)
All notifications are intercepted here and are routed for emission. |
void |
reconfigureRequestHandler()
Reconfigures the RequestHandler, reponsible for handling get requests etc. |
void |
removeAttributeMappings(java.util.List<ManagedBean> mappings)
|
void |
removeNotifications(java.util.List<Mapping> notifications)
|
void |
sendJMXNotification(javax.management.Notification notification)
|
void |
setBindAddress(java.lang.String bindAddress)
Sets the agent bind address |
void |
setDynamicSubscriptions(boolean dynamicSubscriptions)
Enables/disables dynamic subscriptions |
void |
setHeartBeatPeriod(int heartBeatPeriod)
Sets the heartbeat period (in seconds) switch |
void |
setManagersResName(java.lang.String managersResName)
Sets the name of the file containing SNMP manager specifications |
void |
setNotificationMapResName(java.lang.String notificationMapResName)
Sets the name of the file containing the notification/trap mappings |
void |
setNumberOfThreads(int numberOfThreads)
Sets the number of threads in the agent request processing thread pool |
void |
setPort(int port)
Sets the agent listening port number |
void |
setReadCommunity(java.lang.String readCommunity)
Sets the read community (no getter) |
void |
setRequestHandlerClassName(java.lang.String requestHandlerClassName)
Sets the RequestHandler implementation class |
void |
setRequestHandlerResName(java.lang.String requestHandlerResName)
Sets the resource file name containing get/set mappings |
void |
setSnmpVersion(int snmpVersion)
Sets the snmp protocol version |
void |
setTimerName(javax.management.ObjectName timerName)
Sets the utilised timer MBean name |
void |
setTrapFactoryClassName(java.lang.String name)
Sets the utilised trap factory name |
void |
setUsersResName(java.lang.String usersResName)
The name of the file containing SNMPv3 users |
void |
setWriteCommunity(java.lang.String writeCommunity)
Sets the write community (no getter) |
protected void |
startService()
Perform service start-up |
protected void |
stopService()
Perform service shutdown |
| Methods inherited from class org.jboss.system.ListenerServiceMBeanSupport |
|---|
getSubscriptions, handleNotification, setSubscriptionList, setSubscriptions, subscribe, subscribe, subscribe, unsubscribe |
| 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, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext |
| 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.ListenerServiceMBean |
|---|
setSubscriptionList |
| Methods inherited from interface org.jboss.system.ServiceMBean |
|---|
getName, getState, getStateString, jbossInternalLifecycle |
| Methods inherited from interface org.jboss.system.Service |
|---|
create, destroy, start, stop |
| Field Detail |
|---|
public static final int SNMPV1
public static final int SNMPV2
public static final int SNMPV3
public static final java.lang.String DEFAULT_READ_COMMUNITY
public static final java.lang.String DEFAULT_WRITE_COMMUNITY
| Constructor Detail |
|---|
public SnmpAgentService()
| Method Detail |
|---|
public int getHeartBeatPeriod()
getHeartBeatPeriod in interface SnmpAgentServiceMBeanpublic void setHeartBeatPeriod(int heartBeatPeriod)
setHeartBeatPeriod in interface SnmpAgentServiceMBeanpublic long getInstantiationTime()
getInstantiationTime in interface SnmpAgentServiceMBeanpublic long getUptime()
getUptime in interface SnmpAgentServiceMBeanpublic long getTrapCount()
getTrapCount in interface SnmpAgentServiceMBeanpublic void setManagersResName(java.lang.String managersResName)
setManagersResName in interface SnmpAgentServiceMBeanpublic java.lang.String getManagersResName()
getManagersResName in interface SnmpAgentServiceMBeanpublic void setNotificationMapResName(java.lang.String notificationMapResName)
setNotificationMapResName in interface SnmpAgentServiceMBeanpublic java.lang.String getNotificationMapResName()
getNotificationMapResName in interface SnmpAgentServiceMBeanpublic void setTrapFactoryClassName(java.lang.String name)
setTrapFactoryClassName in interface SnmpAgentServiceMBeanpublic java.lang.String getTrapFactoryClassName()
getTrapFactoryClassName in interface SnmpAgentServiceMBeanpublic void setTimerName(javax.management.ObjectName timerName)
setTimerName in interface SnmpAgentServiceMBeanpublic javax.management.ObjectName getTimerName()
getTimerName in interface SnmpAgentServiceMBean
public void setBindAddress(java.lang.String bindAddress)
throws java.net.UnknownHostException
setBindAddress in interface SnmpAgentServiceMBeanjava.net.UnknownHostExceptionpublic java.lang.String getBindAddress()
getBindAddress in interface SnmpAgentServiceMBeanpublic void setNumberOfThreads(int numberOfThreads)
setNumberOfThreads in interface SnmpAgentServiceMBeanpublic int getNumberOfThreads()
getNumberOfThreads in interface SnmpAgentServiceMBeanpublic void setPort(int port)
setPort in interface SnmpAgentServiceMBeanpublic int getPort()
getPort in interface SnmpAgentServiceMBeanpublic void setSnmpVersion(int snmpVersion)
setSnmpVersion in interface SnmpAgentServiceMBeanpublic int getSnmpVersion()
getSnmpVersion in interface SnmpAgentServiceMBeanpublic void setReadCommunity(java.lang.String readCommunity)
setReadCommunity in interface SnmpAgentServiceMBeanpublic void setWriteCommunity(java.lang.String writeCommunity)
setWriteCommunity in interface SnmpAgentServiceMBeanpublic void setRequestHandlerClassName(java.lang.String requestHandlerClassName)
setRequestHandlerClassName in interface SnmpAgentServiceMBeanpublic java.lang.String getRequestHandlerClassName()
getRequestHandlerClassName in interface SnmpAgentServiceMBeanpublic void setRequestHandlerResName(java.lang.String requestHandlerResName)
setRequestHandlerResName in interface SnmpAgentServiceMBeanpublic java.lang.String getRequestHandlerResName()
getRequestHandlerResName in interface SnmpAgentServiceMBeanpublic void setDynamicSubscriptions(boolean dynamicSubscriptions)
setDynamicSubscriptions in interface SnmpAgentServiceMBeanpublic boolean getDynamicSubscriptions()
getDynamicSubscriptions in interface SnmpAgentServiceMBean
public void reconfigureRequestHandler()
throws java.lang.Exception
reconfigureRequestHandler in interface SnmpAgentServiceMBeanjava.lang.Exception
protected void startService()
throws java.lang.Exception
startService in class org.jboss.system.ServiceMBeanSupportjava.lang.Exception
protected void stopService()
throws java.lang.Exception
stopService in class org.jboss.system.ServiceMBeanSupportjava.lang.Exception
public void handleNotification2(javax.management.Notification n,
java.lang.Object handback)
handleNotification2 in class org.jboss.system.ListenerServiceMBeanSupportpublic void setUsersResName(java.lang.String usersResName)
SnmpAgentServiceMBean
setUsersResName in interface SnmpAgentServiceMBeanusersResName - the usersResName to setpublic java.lang.String getUsersResName()
getUsersResName in interface SnmpAgentServiceMBeanpublic Clock getClock()
public Counter getTrapCounter()
public java.util.Map<java.lang.String,User> getUserMap()
public org.snmp4j.Snmp getSession()
public SnmpRequest getResponder()
public RequestHandler getRequestHandler()
public org.snmp4j.TransportMapping[] getTransportMappings()
public void sendJMXNotification(javax.management.Notification notification)
sendJMXNotification in interface SnmpAgentServiceMBeanpublic long getNextJMXNotificationSequenceNumber()
getNextJMXNotificationSequenceNumber in interface SnmpAgentServiceMBeanpublic void addAttributeMappings(java.util.List<ManagedBean> mappings)
addAttributeMappings in interface SnmpAgentServiceMBeanpublic void removeAttributeMappings(java.util.List<ManagedBean> mappings)
removeAttributeMappings in interface SnmpAgentServiceMBeanpublic void addNotifications(java.util.List<Mapping> notifications)
addNotifications in interface SnmpAgentServiceMBeanpublic void removeNotifications(java.util.List<Mapping> notifications)
removeNotifications in interface SnmpAgentServiceMBean
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||