- All Superinterfaces:
VACM
- All Known Implementing Classes:
VacmMIB
The
MutableVACM interface extends the basic VACM
by providing methods to change the configuration of the view-based access
model.- Version:
- 3.0
- Author:
- Frank Fock
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields inherited from interface org.snmp4j.agent.security.VACM
VACM_NO_ACCESS_ENTRY, VACM_NO_GROUP_NAME, VACM_NO_SUCH_CONTEXT, VACM_NO_SUCH_VIEW, VACM_NOT_IN_VIEW, VACM_OK, VACM_OTHER_ERROR, VIEW_NOTIFY, VIEW_READ, VIEW_WRITE -
Method Summary
Modifier and TypeMethodDescriptionintaccessEntryCount(org.snmp4j.smi.OctetString groupName) Counts the number of access entries for the provided group name.voidaddAccess(org.snmp4j.smi.OctetString groupName, org.snmp4j.smi.OctetString prefix, int securityModel, int securityLevel, int match, org.snmp4j.smi.OctetString readView, org.snmp4j.smi.OctetString writeView, org.snmp4j.smi.OctetString notifyView, int storageType) Adds an access entry for the specified group name.voidaddGroup(int securityModel, org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString groupName, int storageType) Adds a security name to group mapping to the VACM.voidaddViewTreeFamily(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID subtree, org.snmp4j.smi.OctetString mask, int type, int storageType) Adds a view tree family to an VACM view.booleanhasSecurityToGroupMapping(int securityModel, org.snmp4j.smi.OctetString securityName) Check if there is a security mapping for the specified security model and security name.booleanremoveAccess(org.snmp4j.smi.OctetString groupName, org.snmp4j.smi.OctetString prefix, int securityModel, int securityLevel) Removes an access entry from the VACM.booleanremoveGroup(int securityModel, org.snmp4j.smi.OctetString securityName) Removes a security name to group mapping from the VACM.booleanremoveViewTreeFamily(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID subtree) Removes a view tree family from a VACM view.intviewTreeFamilyEntryCount(org.snmp4j.smi.OctetString viewName) Counts the number of view name to tree family mapping entries in this VACM.Methods inherited from interface org.snmp4j.agent.security.VACM
getViewName, isAccessAllowed, isAccessAllowed
-
Field Details
-
VACM_MATCH_EXACT
static final int VACM_MATCH_EXACT- See Also:
-
VACM_MATCH_PREFIX
static final int VACM_MATCH_PREFIX- See Also:
-
VACM_VIEW_INCLUDED
static final int VACM_VIEW_INCLUDED- See Also:
-
VACM_VIEW_EXCLUDED
static final int VACM_VIEW_EXCLUDED- See Also:
-
-
Method Details
-
addGroup
void addGroup(int securityModel, org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString groupName, int storageType) Adds a security name to group mapping to the VACM.- Parameters:
securityModel- the security model the mapping is based on, seeSecurityModelfor possible values.securityName- the security name to map to a group.groupName- the name of the group.storageType- the storage type to use for the entry. Possible values are defined byStorageType.
-
removeGroup
boolean removeGroup(int securityModel, org.snmp4j.smi.OctetString securityName) Removes a security name to group mapping from the VACM.- Parameters:
securityModel- the security model the mapping is based on, seeSecurityModelfor possible values.securityName- the mapped security name.- Returns:
trueif the entry has been removed,falseotherwise (i.e. if such an entry does not exists).
-
hasSecurityToGroupMapping
boolean hasSecurityToGroupMapping(int securityModel, org.snmp4j.smi.OctetString securityName) Check if there is a security mapping for the specified security model and security name.- Parameters:
securityModel- the security model the mapping is based on, seeSecurityModelfor possible values.securityName- a security name.- Returns:
trueif there is a mapping andfalseotherwise.
-
addAccess
void addAccess(org.snmp4j.smi.OctetString groupName, org.snmp4j.smi.OctetString prefix, int securityModel, int securityLevel, int match, org.snmp4j.smi.OctetString readView, org.snmp4j.smi.OctetString writeView, org.snmp4j.smi.OctetString notifyView, int storageType) Adds an access entry for the specified group name.- Parameters:
groupName- the group name for which to create an access entry.prefix- ifmatchisVACM_MATCH_PREFIXthe context name checked by the VACM must exatcly match this value, otherwise a prefix match is sufficient.securityModel- the security model that must be used to gain access on behalf of this entry, seeSecurityModelfor possible values.securityLevel- the minimum security level that must be used to gain access on behalf of this entry, seeSecurityLevelfor possible values.match- specifies the type of context match used by this entry. Possible values areVACM_MATCH_EXACTandVACM_MATCH_PREFIX.readView- the MIB view of the SNMP context to which this conceptual row authorizes read access. If the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted.writeView- the MIB view of the SNMP context to which this conceptual row authorizes write access. If the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted.notifyView- the MIB view of the SNMP context to which this conceptual row authorizes access for notifications. If the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted.storageType- the storage type to use for the entry. Possible values are defined byStorageType.
-
removeAccess
boolean removeAccess(org.snmp4j.smi.OctetString groupName, org.snmp4j.smi.OctetString prefix, int securityModel, int securityLevel) Removes an access entry from the VACM.- Parameters:
groupName- the group name for which to remove an access entry.prefix- the context name or prefix of the access entry.securityModel- the security model that must be used to gain access on behalf of this entry, seeSecurityModelfor possible values.securityLevel- the minimum security level that must be used to gain access on behalf of this entry, seeSecurityLevelfor possible values.- Returns:
trueif the entry has been removed,falseotherwise (i.e. if such an entry does not exists).
-
accessEntryCount
int accessEntryCount(org.snmp4j.smi.OctetString groupName) Counts the number of access entries for the provided group name.- Parameters:
groupName- the group name for which access entries should be counted.- Returns:
- the number of group to view(s) access entries.
- Since:
- 3.0
-
addViewTreeFamily
void addViewTreeFamily(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID subtree, org.snmp4j.smi.OctetString mask, int type, int storageType) Adds a view tree family to an VACM view.- Parameters:
viewName- the view name to which a tree family is to be added.subtree- the MIB subtree which when combined with the corresponding instance ofmask(vacmViewTreeFamilyMask) defines a family of view subtrees.mask- The bit mask which, in combination with the corresponding instance ofsubtree(vacmViewTreeFamilySubtree), defines a family of view subtrees. See RFC 3415 vacmViewTreeFamilySubtree definition for more details on the bit mask.type- specifies whether the subtree is includedVACM_VIEW_INCLUDEDor excludedVACM_VIEW_EXCLUDEDfrom the view.storageType- the storage type to use for the entry. Possible values are defined byStorageType.
-
removeViewTreeFamily
boolean removeViewTreeFamily(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID subtree) Removes a view tree family from a VACM view.- Parameters:
viewName- the view name from which a subtree family is to be removed.subtree- the MIB subtree associated with this entry.- Returns:
trueif the entry has been removed,falseotherwise (i.e. if such an entry does not exists).
-
viewTreeFamilyEntryCount
int viewTreeFamilyEntryCount(org.snmp4j.smi.OctetString viewName) Counts the number of view name to tree family mapping entries in this VACM.- Parameters:
viewName- a VACM view name.- Returns:
- the number of view tree family entries for this view name.
- Since:
- 3.0
-