java.lang.Object
org.snmp4j.agent.security.BasicVacmConfigurator
- All Implemented Interfaces:
VacmConfigurator
The
BasicVacmConfigurator implements the VacmConfigurator that uses three unrestricted views
for all access types to support two roles admin and monitor. The admin role has unrestricted
access to the agent, whereas monitor has no write access, but unrestricted read and notification access.- Since:
- 3.0
- Author:
- Frank Fock
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.snmp4j.agent.security.VacmConfigurator
VacmConfigurator.VacmConfigResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected org.snmp4j.smi.OctetStringprotected org.snmp4j.smi.OIDprotected org.snmp4j.smi.OctetStringprotected org.snmp4j.security.SecurityLevelprotected org.snmp4j.security.SecurityModel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, String role) Add a new user to a group.String[]Returns the list of roles supported by this configurator.protected booleanisRoleSupported(String role) removeRole(MutableVACM vacm, String role) Remover all users from the specified security group and then remove the group itself.removeUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, String role) Remove a new user from the specified group.
-
Field Details
-
rootViewName
protected org.snmp4j.smi.OctetString rootViewName -
rootOID
protected org.snmp4j.smi.OID rootOID -
securityModel
protected org.snmp4j.security.SecurityModel securityModel -
securityLevel
protected org.snmp4j.security.SecurityLevel securityLevel -
contextPrefix
protected org.snmp4j.smi.OctetString contextPrefix -
contextMatch
protected int contextMatch
-
-
Constructor Details
-
BasicVacmConfigurator
public BasicVacmConfigurator()
-
-
Method Details
-
addUser
public VacmConfigurator.VacmConfigResult addUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, String role) Description copied from interface:VacmConfiguratorAdd a new user to a group. If the referenced group does not exist, it will be created. If the role identified by the group is not supported by this configurator, an error is returned.- Specified by:
addUserin interfaceVacmConfigurator- Parameters:
vacm- theMutableVACMto modifysecurityName- the user name of the new user.role- the group (VACM)/role name associated with the user. Only supported groups must ber provided. SeeVacmConfigurator.getSupportedRoles().- Returns:
- the operation result.
-
removeUser
public VacmConfigurator.VacmConfigResult removeUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, String role) Description copied from interface:VacmConfiguratorRemove a new user from the specified group. If the referenced group does not exist, nothing will be changed andVacmConfigurator.VacmConfigResult.userRemovedFromRolewill be returned. If the role identified by the group is not supported by this configurator, an error is returned.- Specified by:
removeUserin interfaceVacmConfigurator- Parameters:
vacm- theMutableVACMto modifysecurityName- the user name of the new user.role- the group (VACM)/role name associated with the user. Only supported groups must be provided. SeeVacmConfigurator.getSupportedRoles().- Returns:
- the operation result.
-
removeRole
Description copied from interface:VacmConfiguratorRemover all users from the specified security group and then remove the group itself. This operation will only affect theVACMprovided, but not theUSM.- Specified by:
removeRolein interfaceVacmConfigurator- Parameters:
vacm- theMutableVACMto modifyrole- the group (VACM)/role to be removed from the abovevacm.- Returns:
- the operation result.
-
getSupportedRoles
Description copied from interface:VacmConfiguratorReturns the list of roles supported by this configurator.- Specified by:
getSupportedRolesin interfaceVacmConfigurator- Returns:
- a non-empty array of roles/groups supported by this configurator.
-
isRoleSupported
-