- java.lang.Object
-
- org.snmp4j.agent.security.BasicVacmConfigurator
-
- All Implemented Interfaces:
VacmConfigurator
public class BasicVacmConfigurator extends java.lang.Object implements VacmConfigurator
TheBasicVacmConfigurator
implements theVacmConfigurator
that uses three unrestricted views for all access types to support two rolesadmin
andmonitor
. Theadmin
role has unrestricted access to the agent, whereasmonitor
has 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 class
BasicVacmConfigurator.Roles
-
Nested classes/interfaces inherited from interface org.snmp4j.agent.security.VacmConfigurator
VacmConfigurator.VacmConfigResult
-
-
Field Summary
Fields Modifier and Type Field Description protected int
contextMatch
protected org.snmp4j.smi.OctetString
contextPrefix
protected org.snmp4j.smi.OID
rootOID
protected org.snmp4j.smi.OctetString
rootViewName
protected org.snmp4j.security.SecurityLevel
securityLevel
protected org.snmp4j.security.SecurityModel
securityModel
-
Constructor Summary
Constructors Constructor Description BasicVacmConfigurator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VacmConfigurator.VacmConfigResult
addUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, java.lang.String role)
Add a new user to a group.java.lang.String[]
getSupportedRoles()
Returns the list of roles supported by this configurator.protected boolean
isRoleSupported(java.lang.String role)
VacmConfigurator.VacmConfigResult
removeRole(MutableVACM vacm, java.lang.String role)
Remover all users from the specified security group and then remove the group itself.VacmConfigurator.VacmConfigResult
removeUser(MutableVACM vacm, org.snmp4j.smi.OctetString securityName, java.lang.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, java.lang.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, java.lang.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
public VacmConfigurator.VacmConfigResult removeRole(MutableVACM vacm, java.lang.String role)
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
public java.lang.String[] 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
protected boolean isRoleSupported(java.lang.String role)
-
-