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 classes/interfaces inherited from interface org.snmp4j.agent.security.VacmConfigurator
VacmConfigurator.VacmConfigResult
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected org.snmp4j.smi.OctetString
protected org.snmp4j.smi.OID
protected org.snmp4j.smi.OctetString
protected org.snmp4j.security.SecurityLevel
protected org.snmp4j.security.SecurityModel
-
Constructor Summary
-
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 boolean
isRoleSupported
(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:VacmConfigurator
Add 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:
addUser
in interfaceVacmConfigurator
- Parameters:
vacm
- theMutableVACM
to 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:VacmConfigurator
Remove a new user from the specified group. If the referenced group does not exist, nothing will be changed andVacmConfigurator.VacmConfigResult.userRemovedFromRole
will be returned. If the role identified by the group is not supported by this configurator, an error is returned.- Specified by:
removeUser
in interfaceVacmConfigurator
- Parameters:
vacm
- theMutableVACM
to 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:VacmConfigurator
Remover all users from the specified security group and then remove the group itself. This operation will only affect theVACM
provided, but not theUSM
.- Specified by:
removeRole
in interfaceVacmConfigurator
- Parameters:
vacm
- theMutableVACM
to modifyrole
- the group (VACM)/role to be removed from the abovevacm
.- Returns:
- the operation result.
-
getSupportedRoles
Description copied from interface:VacmConfigurator
Returns the list of roles supported by this configurator.- Specified by:
getSupportedRoles
in interfaceVacmConfigurator
- Returns:
- a non-empty array of roles/groups supported by this configurator.
-
isRoleSupported
-