|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ireasoning.protocol.snmp.DefaultAgentConfig
This class represents agent's configuration settings.
Constructor Summary | |
DefaultAgentConfig()
Constructs a SnmpAgentConfig object |
Method Summary | |
boolean |
addGroup(Map attrs)
Adds a group, views associated with this group should already exist. |
void |
addPropertyChangeListener(com.ireasoning.protocol.snmp.PropertyChangeListener listener)
Adds PropertyChangeListener listener. |
boolean |
addProxy(ProxyEntry proxy,
boolean isPersistent)
Adds a new proxy |
void |
addReadCommunity(String community)
Adds a new read community string |
void |
addTrapSink(Map attributes)
Adds a trapSink or snmpV3TrapSink element |
void |
addTrapSink(TrapSink trapsink)
Adds a trapSink or snmpV3TrapSink element |
boolean |
addUser(Map attrs)
Adds a user. |
boolean |
addView(Map attrs)
Adds a view |
void |
addWriteCommunity(String community)
Adds a new write community string |
protected abstract boolean |
doAddGroup(Map attrs)
Adds a group, views associated with this group should already exist. |
protected abstract boolean |
doAddProxy(ProxyEntry entry)
Adds a new proxy to the config settings |
protected abstract boolean |
doAddTrapSink(Map attributes)
Adds a trapSink or snmpV3TrapSink element |
protected abstract boolean |
doAddUser(Map attrs)
Adds a user. |
protected abstract boolean |
doAddView(Map attrs)
Adds a view |
protected abstract Map |
doGetPropertiesProps()
Returns a Map object which stores the attributes of properties node |
protected abstract Map[] |
doGetProxyProps()
Return proxies' properties |
protected abstract Map[] |
doGetSnmpV3TrapSinkProps()
Returns SNMPv3 trapsinks' properties |
protected abstract Map |
doGetTrapProxyProps()
Returns trap proxy's properties |
protected abstract Map[] |
doGetTrapSinkProps()
Returns non-SNMPv3 trapsinks' properties |
protected abstract void |
doReloadConfig()
Reloads config settings |
protected abstract boolean |
doRemoveGroup(String groupName)
Removes a group. |
protected abstract boolean |
doRemoveProxy(ProxyEntry entry)
Adds a new proxy to the config settings |
protected abstract boolean |
doRemoveTrapSink(String trapSinkHostName,
int trapSinkPort,
int trapSinkVersion)
Removes a trapSink or snmpV3TrapSink element |
protected abstract boolean |
doRemoveUser(String userName)
Removes a user |
protected abstract boolean |
doRemoveView(String viewName)
Removes a view. |
protected abstract void |
doSave()
Saves config settings. |
Map[] |
getCommunityViews()
Returns communityView's properties |
int |
getEngineBoots()
Returns the engineBoots value |
byte[] |
getEngineID()
Returns the engineID of this agent |
abstract Map[] |
getGroups()
Returns groups' properties |
int |
getInformRetries()
Returns the number of retries for inform requests |
int |
getInformTimeout()
Returns the timeout value for inform requests, in seconds |
String |
getIpAddress()
Returns the IP address of this agent. |
String[] |
getManagerIpAddresses()
Returns the authorized manager's IP address |
int |
getMasterAgentPort()
Returns the SNMP master agent's listening port |
int |
getMaxPacketSize()
Returns the max packet size value, in bytes |
int |
getMaxThreadCount()
Returns the max number of threads in thread pool |
int |
getPort()
Returns the SNMP agent's listening port |
Vector |
getProxies()
Returns a vector whose elements are objects of ProxyEntry |
String[] |
getReadCommunities()
Returns the community strings for READ operation |
SnmpOID |
getReloadConfigOID()
Returns the reload config OID |
String |
getRemoteMasterAgentIpAddress()
Returns the remote SNMP master agent's ip address or host name |
int |
getRemoteMasterAgentPort()
Returns the remote SNMP master agent's listening port |
String[] |
getSubagentIpAddresses()
Returns the authorized subagent's IP address |
SnmpOID |
getSysObjectID()
Returns the sysObjectID |
TrapSink[] |
getTrapSinks()
Returns the trap sink objects (including TrapSink and SnmpV3TrapSink). |
long |
getUnderCreationTimeWindow()
Returns the time window allowed in the underCreation state, in milliseconds. |
abstract Map[] |
getUsers()
Returns users' properties |
int |
getVersion()
Returns the SNMP version |
abstract Map[] |
getViews()
Returns views' properties |
String[] |
getWriteCommunities()
Returns the community strings for WRITE operation |
boolean |
isAuthTrapEnabled()
|
boolean |
isUseThreadPool()
Whether to use thread pool to handle requests and send traps. |
static void |
main(String[] args)
|
protected void |
postReloadConfig()
It's invoked after reloadConfig() method is called |
void |
reloadConfig()
Reloads config. |
boolean |
removeGroup(String groupName)
Removes a group. |
boolean |
removePropertyChangeListener(com.ireasoning.protocol.snmp.PropertyChangeListener listener)
Removes PropertyChangeListener object |
boolean |
removeProxy(ProxyEntry proxy,
boolean isPersistent)
Removes a proxy |
boolean |
removeTrapSink(String trapSinkHostName,
int trapSinkPort,
int trapSinkVersion)
Removes a trapSink or snmpV3TrapSink element |
boolean |
removeTrapSink(TrapSink trapsink)
Removes a trapSink or snmpV3TrapSink element |
boolean |
removeUser(String userName)
Removes a user |
boolean |
removeView(String viewName)
Removes a view. |
void |
save()
|
protected abstract boolean |
setAttributeValue(String elementName,
Map keyvals,
String attributeName,
String attributeValue)
Sets attribute's value. |
void |
setEngineBoots(int boots)
Sets the engineBoots value |
void |
setEngineID(String engineID)
Sets a new engineID |
boolean |
setGroupAttributeValue(String groupName,
String attrName,
String attrValue)
Changes group's attribute's value |
void |
setInformRetries(int retries)
Sets the number of retries for inform requests |
void |
setInformTimeout(int timeout)
Sets the timeout value for inform requests, in seconds |
void |
setIpAddress(String ip)
Sets the local ip address |
void |
setManagerIpAddresses(String ipaddresses)
Sets the authorized manager's IP address |
void |
setManagerIpAddresses(String[] ipaddresses)
Sets the authorized manager's IP address |
void |
setMasterAgentPort(int port)
Sets SNMP master agent's listening port |
void |
setMaxPacketSize(int size)
Sets the max packet size value, in bytes |
void |
setPort(int port)
Sets SNMP agent's listening port |
void |
setProperty(String name,
String value)
Sets "properties" element node 's attributes value |
protected void |
setPropertyValue(String name,
String value)
|
void |
setReadCommunities(String communities)
Sets the community string for READ operation |
void |
setReloadConfigOID(SnmpOID reloadConfigOID)
Sets the reload config oid |
void |
setRemoteMasterAgentIpAddress(String ipAddr)
Sets the remote SNMP master agent's ip address or host name |
void |
setRemoteMasterAgentPort(int port)
Sets remote SNMP master agent's port |
void |
setSubagentIpAddresses(String ipaddresses)
Sets the authorized subagent's IP address |
void |
setSubagentIpAddresses(String[] ipaddresses)
Sets the authorized subagent's IP address |
void |
setSysObjectID(SnmpOID sysObjectID)
Sets the sysObjectID |
void |
setUnderCreationTimeWindow(long time)
Returns the time window allowed in the underCreation state, in milliseconds. |
boolean |
setUserAttributeValue(String userName,
String attrName,
String attrValue)
Changes user's attribute's value |
void |
setUseThreadPool(boolean b)
To set whether agent is to use thread pool or not |
void |
setVersion(int version)
Sets SNMP version |
void |
setWriteCommunities(String communities)
Sets the community strings for WRITE operation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultAgentConfig()
SnmpAgentConfig
object
Method Detail |
protected abstract boolean setAttributeValue(String elementName, Map keyvals, String attributeName, String attributeValue)
keyvals
- key/value pairs used to distinguish nodes with identical node nameselementName
- element name if config is a XML file. Or table name if config settings are stored in database.attributeName
- attribute's nameattributeValue
- attribute's valueprotected abstract Map doGetPropertiesProps()
protected abstract boolean doAddTrapSink(Map attributes)
attributes
- a Map object containing the name/value of attributes, such as "verion" -- "2"protected abstract boolean doRemoveTrapSink(String trapSinkHostName, int trapSinkPort, int trapSinkVersion)
trapSinkHostName
- host name or ip address of trap receivertrapSinkPort
- port number of trap receivertrapSinkVersion
- version of trapSink. 1: SNMPv1, 2: SNMPv2c, 3: SNMPv3
public abstract Map[] getViews()
protected abstract boolean doAddView(Map attrs)
attrs
- a map containing view's attributes
protected abstract boolean doRemoveView(String viewName)
public abstract Map[] getGroups()
protected abstract boolean doAddGroup(Map attrs)
protected abstract boolean doRemoveGroup(String groupName)
public abstract Map[] getUsers()
public Map[] getCommunityViews()
protected abstract Map[] doGetTrapSinkProps()
protected abstract Map[] doGetSnmpV3TrapSinkProps()
protected abstract Map[] doGetProxyProps()
protected abstract Map doGetTrapProxyProps()
protected abstract boolean doAddUser(Map attrs)
attrs
- user's attributes, such as "name", "authPassword", "privPassword", etc
protected abstract boolean doRemoveUser(String userName)
protected abstract void doSave() throws IOException
IOException
protected abstract void doReloadConfig() throws IOException
IOException
protected abstract boolean doAddProxy(ProxyEntry entry)
protected abstract boolean doRemoveProxy(ProxyEntry entry)
public void addPropertyChangeListener(com.ireasoning.protocol.snmp.PropertyChangeListener listener)
public boolean removePropertyChangeListener(com.ireasoning.protocol.snmp.PropertyChangeListener listener)
public boolean addGroup(Map attrs)
public boolean removeGroup(String groupName)
public boolean setGroupAttributeValue(String groupName, String attrName, String attrValue)
groupName
- group's nameattrName
- group's attribute's nameattrValue
- group's attribute's new valuepublic boolean addUser(Map attrs)
attrs
- user's attributes, such as "name", "authPassword", "privPassword", etc
public boolean removeUser(String userName)
public boolean setUserAttributeValue(String userName, String attrName, String attrValue)
userName
- user nameattrName
- user's attribute's nameattrValue
- user's attribute's new valuepublic boolean addView(Map attrs)
attrs
- a map containing the name/value pairs of view's attributes
public boolean removeView(String viewName)
public TrapSink[] getTrapSinks()
public void addTrapSink(TrapSink trapsink)
trapsink
- a TrapSink or SnmpV3TrapSink objectpublic void addTrapSink(Map attributes)
attributes
- a Map object containing the name/value of attributes, such as "verion" -- "2"public boolean removeTrapSink(TrapSink trapsink)
trapsink
- a TrapSink or SnmpV3TrapSink objectpublic boolean removeTrapSink(String trapSinkHostName, int trapSinkPort, int trapSinkVersion)
trapSinkHostName
- host name or ip address of trap receivertrapSinkPort
- port number of trap receivertrapSinkVersion
- version of trapSink. 1: SNMPv1, 2: SNMPv2c, 3: SNMPv3
public void save() throws IOException
IOException
public void setProperty(String name, String value)
name
- attribute's namevalue
- attribute's valuepublic void reloadConfig() throws IOException
If config was loaded from an InputStream object, then reloadConfig(InputStream istream) method should be used instead.
IOException
protected void postReloadConfig()
public int getVersion()
public void setVersion(int version)
public int getPort()
public void setPort(int port)
public int getRemoteMasterAgentPort()
public void setRemoteMasterAgentPort(int port)
public String getRemoteMasterAgentIpAddress()
public void setRemoteMasterAgentIpAddress(String ipAddr)
public int getMasterAgentPort()
public void setMasterAgentPort(int port)
public String[] getReadCommunities()
public void setReadCommunities(String communities)
public void addReadCommunity(String community)
public String[] getWriteCommunities()
public void setWriteCommunities(String communities)
public void addWriteCommunity(String community)
public int getInformRetries()
public void setInformRetries(int retries)
public int getInformTimeout()
public void setInformTimeout(int timeout)
public boolean isUseThreadPool()
public int getMaxThreadCount()
public boolean isAuthTrapEnabled()
public int getEngineBoots()
public void setEngineBoots(int boots)
public int getMaxPacketSize()
public void setMaxPacketSize(int size)
public long getUnderCreationTimeWindow()
public void setUnderCreationTimeWindow(long time)
public void setUseThreadPool(boolean b)
public SnmpOID getReloadConfigOID()
public void setReloadConfigOID(SnmpOID reloadConfigOID)
public SnmpOID getSysObjectID()
public void setSysObjectID(SnmpOID sysObjectID)
public String[] getSubagentIpAddresses()
public void setSubagentIpAddresses(String ipaddresses)
public void setSubagentIpAddresses(String[] ipaddresses)
public String[] getManagerIpAddresses()
public void setManagerIpAddresses(String ipaddresses)
ipaddresses
- IP address separated by commapublic void setManagerIpAddresses(String[] ipaddresses)
public byte[] getEngineID()
public void setEngineID(String engineID)
public String getIpAddress()
public void setIpAddress(String ip)
protected void setPropertyValue(String name, String value)
public Vector getProxies()
ProxyEntry
public boolean addProxy(ProxyEntry proxy, boolean isPersistent)
proxy
- new proxy instanceisPersistent
- if true, config settings will be updated
public boolean removeProxy(ProxyEntry proxy, boolean isPersistent)
proxy
- new proxy instanceisPersistent
- if true, config settings will be updated
public static void main(String[] args)
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |