- java.lang.Object
-
- org.snmp4j.agent.security.BasicVacmConfigurator
-
- All Implemented Interfaces:
VacmConfigurator
public class BasicVacmConfigurator extends Object implements VacmConfigurator
TheBasicVacmConfiguratorimplements theVacmConfiguratorthat uses three unrestricted views for all access types to support two rolesadminandmonitor. Theadminrole has unrestricted access to the agent, whereasmonitorhas no write access, but unrestricted read and notification access.- Since:
- 3.0
- Author:
- Frank Fock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBasicVacmConfigurator.Roles-
Nested classes/interfaces inherited from interface org.snmp4j.agent.security.VacmConfigurator
VacmConfigurator.VacmConfigResult
-
-
Field Summary
Fields Modifier and Type Field Description protected intcontextMatchprotected org.snmp4j.smi.OctetStringcontextPrefixprotected org.snmp4j.smi.OIDrootOIDprotected org.snmp4j.smi.OctetStringrootViewNameprotected org.snmp4j.security.SecurityLevelsecurityLevelprotected org.snmp4j.security.SecurityModelsecurityModel
-
Constructor Summary
Constructors Constructor Description BasicVacmConfigurator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VacmConfigurator.VacmConfigResultaddUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, String role)Add a new user to a group.String[]getSupportedRoles()Returns the list of roles supported by this configurator.protected booleanisRoleSupported(String role)VacmConfigurator.VacmConfigResultremoveRole(MutableVACM vacm, String role)Remover all users from the specified security group and then remove the group itself.VacmConfigurator.VacmConfigResultremoveUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, String role)Remove a new user from the specified group.
-
-
-
Field Detail
-
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
-
-
Method Detail
-
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
public VacmConfigurator.VacmConfigResult removeRole(MutableVACM vacm, String role)
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
public String[] 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
protected boolean isRoleSupported(String role)
-
-