- All Known Subinterfaces:
MutableVACM
- All Known Implementing Classes:
VacmMIB
public interface VACM
The View-based Access Control Model interface defines methods and constants
that a contrete implementation of such a model has to implement.
An example of such a concrete implementation is defined by RFC 3415 and
implemented by the VacmMIB class.
- Version:
- 3.7.0
- Author:
- Frank Fock
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionorg.snmp4j.smi.OctetString
getViewName
(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OctetString securityName, int securityModel, int securityLevel, int viewType) Gets the view name of the view defined by the supplied credentials.default boolean
hasContext
(org.snmp4j.smi.OctetString contextName) Test if the provided context is known by this VACM or not.int
isAccessAllowed
(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OctetString securityName, int securityModel, int securityLevel, int viewType, org.snmp4j.smi.OID oid) Checks whether access is allowed in the specified context for the security name, model, level, and view type for the supplied OID.int
isAccessAllowed
(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID oid) Checks if access is allowed for the given OID within the specified view.
-
Field Details
-
VIEW_NOTIFY
static final int VIEW_NOTIFY- See Also:
-
VIEW_READ
static final int VIEW_READ- See Also:
-
VIEW_WRITE
static final int VIEW_WRITE- See Also:
-
VACM_OK
static final int VACM_OK- See Also:
-
VACM_NOT_IN_VIEW
static final int VACM_NOT_IN_VIEW- See Also:
-
VACM_NO_SUCH_VIEW
static final int VACM_NO_SUCH_VIEW- See Also:
-
VACM_NO_SUCH_CONTEXT
static final int VACM_NO_SUCH_CONTEXT- See Also:
-
VACM_NO_GROUP_NAME
static final int VACM_NO_GROUP_NAME- See Also:
-
VACM_NO_ACCESS_ENTRY
static final int VACM_NO_ACCESS_ENTRY- See Also:
-
VACM_OTHER_ERROR
static final int VACM_OTHER_ERROR- See Also:
-
-
Method Details
-
isAccessAllowed
int isAccessAllowed(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OctetString securityName, int securityModel, int securityLevel, int viewType, org.snmp4j.smi.OID oid) Checks whether access is allowed in the specified context for the security name, model, level, and view type for the supplied OID.- Parameters:
context
- the context for which access is requested.securityName
- the security name.securityModel
- the security model, seeSecurityModel
for possible values.securityLevel
- the security level, seeSecurityLevel
for possible values.viewType
- the requested view type, possible values areVIEW_NOTIFY
,VIEW_READ
, andVIEW_WRITE
.oid
- the OID of the object instance for which access is requested.- Returns:
VACM_OK
if access is granted or one of the VACM errors defined by this interface if access is rejected.
-
isAccessAllowed
int isAccessAllowed(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID oid) Checks if access is allowed for the given OID within the specified view.- Parameters:
viewName
- the name of an existing view, i.e. that has bee retrieved bygetViewName(org.snmp4j.smi.OctetString, org.snmp4j.smi.OctetString, int, int, int)
before.oid
- the OID of the object instance for which access is requested.- Returns:
VACM_OK
if access is granted or one of the VACM errors defined by this interface if access is rejected.
-
getViewName
org.snmp4j.smi.OctetString getViewName(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OctetString securityName, int securityModel, int securityLevel, int viewType) Gets the view name of the view defined by the supplied credentials.- Parameters:
context
- the context for which access is requested.securityName
- the security name.securityModel
- the security model, seeSecurityModel
for possible values.securityLevel
- the security level, seeSecurityLevel
for possible values.viewType
- the requested view type, possible values areVIEW_NOTIFY
,VIEW_READ
, andVIEW_WRITE
.- Returns:
- the view name if the credentials can be mapped to an existing view.
Otherwise, if no such view exists then
null
is returned.
-
hasContext
default boolean hasContext(org.snmp4j.smi.OctetString contextName) Test if the provided context is known by this VACM or not. This method can be used to early check if a context is in general supported or not, i.e., to increaseSnmpTargetMIB.snmpUnknownContexts
.- Parameters:
contextName
- a SNMPv3 context name.- Returns:
true
if the vacmContextTable contains an entry for this context name,false
otherwise. By defaulttrue
is returned, if this method is not implemented yet to useVacmMIB
to check the provided context.- Since:
- 3.7.0
-