public class VacmMIB extends Object implements MOGroup, MutableVACM
MutableVACM
) or via SNMP but an initial configuration must be
created programatically in order to allow any access to the agent via SNMP.Modifier and Type | Class and Description |
---|---|
static class |
VacmMIB.VacmContextIterator |
VACM_MATCH_EXACT, VACM_MATCH_PREFIX, VACM_VIEW_EXCLUDED, VACM_VIEW_INCLUDED
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
Modifier and Type | Method and Description |
---|---|
void |
addAccess(org.snmp4j.smi.OctetString groupName,
org.snmp4j.smi.OctetString contextPrefix,
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 to this VACM and thus adds access rights for a group.
|
void |
addGroup(int securityModel,
org.snmp4j.smi.OctetString securityName,
org.snmp4j.smi.OctetString groupName,
int storageType)
Adds a security model and name to group name mapping to this VACM.
|
void |
addViewTreeFamily(org.snmp4j.smi.OctetString viewName,
org.snmp4j.smi.OID subtree,
org.snmp4j.smi.OctetString mask,
int type,
int storageType)
Adds a new view to this VACM.
|
MOTable |
getVacmSecurityToGroupTable() |
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.
|
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.
|
void |
registerMOs(MOServer server,
org.snmp4j.smi.OctetString context)
Registers the managed objects of this group with the server for the
supplied context.
|
boolean |
removeAccess(org.snmp4j.smi.OctetString groupName,
org.snmp4j.smi.OctetString contextPrefix,
int securityModel,
int securityLevel)
Removes an access entry from this VACM.
|
boolean |
removeGroup(int securityModel,
org.snmp4j.smi.OctetString securityName)
Removes a security model and name to group name mapping from this VACM.
|
boolean |
removeViewTreeFamily(org.snmp4j.smi.OctetString viewName,
org.snmp4j.smi.OID subtree)
Removes a view tree family from this VACM.
|
void |
unregisterMOs(MOServer server,
org.snmp4j.smi.OctetString context)
Unregisters the managed objects of this group from the supplied server and
from the supplied context.
|
public static final org.snmp4j.smi.OID vacmContextEntryOID
public static final int colVacmGroupName
public static final int colVacmSecurityToGroupStorageType
public static final int colVacmSecurityToGroupRowStatus
public static final int idxVacmGroupName
public static final int idxVacmSecurityToGroupStorageType
public static final int idxVacmSecurityToGroupRowStatus
public static final org.snmp4j.smi.OID vacmSecurityToGroupEntryOID
public static final int colVacmAccessContextMatch
public static final int colVacmAccessReadViewName
public static final int colVacmAccessWriteViewName
public static final int colVacmAccessNotifyViewName
public static final int colVacmAccessStorageType
public static final int colVacmAccessRowStatus
public static final int idxVacmAccessContextPrefix
public static final int idxVacmAccessSecurityModel
public static final int idxVacmAccessSecurityLevel
public static final int idxVacmAccessContextMatch
public static final int idxVacmAccessReadViewName
public static final int idxVacmAccessWriteViewName
public static final int idxVacmAccessNotifyViewName
public static final int idxVacmAccessStorageType
public static final int idxVacmAccessRowStatus
public static final org.snmp4j.smi.OID vacmAccessEntryOID
public static final int vacmExactMatch
public static final int vacmPrefixMatch
public static final org.snmp4j.smi.OID vacmViewSpinLockOID
public static final int colVacmViewTreeFamilyMask
public static final int colVacmViewTreeFamilyType
public static final int colVacmViewTreeFamilyStorageType
public static final int colVacmViewTreeFamilyRowStatus
public static final int idxVacmViewTreeSubtree
public static final int idxVacmViewTreeFamilyMask
public static final int idxVacmViewTreeFamilyType
public static final int idxVacmViewTreeFamilyStorageType
public static final int idxVacmViewTreeFamilyRowStatus
public static final org.snmp4j.smi.OID vacmViewTreeFamilyEntryOID
public static final int vacmViewIncluded
public static final int vacmViewExcluded
public VacmMIB(MOServer[] server)
public void registerMOs(MOServer server, org.snmp4j.smi.OctetString context) throws DuplicateRegistrationException
MOGroup
registerMOs
in interface MOGroup
server
- the MOServer
where to register the managed objects.context
- the context to use (may be null
if no specific context
is selected).DuplicateRegistrationException
- if a managed object's scope (i.e. lower bound) is already registered
at the server.public void unregisterMOs(MOServer server, org.snmp4j.smi.OctetString context)
MOGroup
unregisterMOs
in interface MOGroup
server
- the MOServer
where to unregister the managed objects.context
- the context to use (may be null
if no specific context
is selected).public int isAccessAllowed(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OctetString securityName, int securityModel, int securityLevel, int viewType, org.snmp4j.smi.OID oid)
VACM
isAccessAllowed
in interface VACM
context
- the context for which access is requested.securityName
- the security name.securityModel
- the security model, see SecurityModel
for possible values.securityLevel
- the security level, see SecurityLevel
for possible values.viewType
- the requested view type, possible values are VACM.VIEW_NOTIFY
,
VACM.VIEW_READ
, and VACM.VIEW_WRITE
.oid
- the OID of the object instance for which access is requested.VACM.VACM_OK
if access is granted or one of the VACM errors defined
by this interface if access is rejected.public org.snmp4j.smi.OctetString getViewName(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OctetString securityName, int securityModel, int securityLevel, int viewType)
VACM
getViewName
in interface VACM
context
- the context for which access is requested.securityName
- the security name.securityModel
- the security model, see SecurityModel
for possible values.securityLevel
- the security level, see SecurityLevel
for possible values.viewType
- the requested view type, possible values are VACM.VIEW_NOTIFY
,
VACM.VIEW_READ
, and VACM.VIEW_WRITE
.null
is returned.public int isAccessAllowed(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID oid)
VACM
isAccessAllowed
in interface VACM
viewName
- the name of an existing view, i.e. that has bee retrieved by
VACM.getViewName(org.snmp4j.smi.OctetString, org.snmp4j.smi.OctetString, int, int, int)
before.oid
- the OID of the object instance for which access is requested.VACM.VACM_OK
if access is granted or one of the VACM errors defined
by this interface if access is rejected.public void addGroup(int securityModel, org.snmp4j.smi.OctetString securityName, org.snmp4j.smi.OctetString groupName, int storageType)
addGroup
in interface MutableVACM
securityModel
- the security model.securityName
- the security name.groupName
- the group name.storageType
- the storage type for the new entry.public boolean removeGroup(int securityModel, org.snmp4j.smi.OctetString securityName)
removeGroup
in interface MutableVACM
securityModel
- the security model.securityName
- the security name.true
when the entry has been removed or false
if such a mapping could not be found.public void addAccess(org.snmp4j.smi.OctetString groupName, org.snmp4j.smi.OctetString contextPrefix, int securityModel, int securityLevel, int match, org.snmp4j.smi.OctetString readView, org.snmp4j.smi.OctetString writeView, org.snmp4j.smi.OctetString notifyView, int storageType)
addAccess
in interface MutableVACM
groupName
- the group for which access rights are to be added.contextPrefix
- the context or context prefix.securityModel
- the security modelsecurityLevel
- the security levelmatch
- indicates whether exact context match (vacmExactMatch
)
or prefix context match (vacmPrefixMatch
) should
be used by the new entry.readView
- the view name for read access (use a zero length OctetString to disable
access).writeView
- the view name for write access (use a zero length OctetString to disable
access).notifyView
- the view name for notify access (use a zero length OctetString to
disable access).storageType
- the StorageType
for this access entry.public boolean removeAccess(org.snmp4j.smi.OctetString groupName, org.snmp4j.smi.OctetString contextPrefix, int securityModel, int securityLevel)
removeAccess
in interface MutableVACM
groupName
- the group for which access rights are to be added.contextPrefix
- the context or context prefix.securityModel
- the security modelsecurityLevel
- the security leveltrue
when the entry has been removed or false
if no such entry could be found.public void addViewTreeFamily(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID subtree, org.snmp4j.smi.OctetString mask, int type, int storageType)
addViewTreeFamily
in interface MutableVACM
viewName
- the view name.subtree
- the subtree OID.mask
- the bit mask which, in combination with subtree
,
defines a family of view subtrees.type
- indicates whether the view defined by subtree
and
mask
is included (vacmViewIncluded
) or excluded
(@link #vacmViewExcluded}) from the MIB view.storageType
- the StorageType
for this access entry.public boolean removeViewTreeFamily(org.snmp4j.smi.OctetString viewName, org.snmp4j.smi.OID subtree)
removeViewTreeFamily
in interface MutableVACM
viewName
- the view name.subtree
- the subtree OID.true
when the entry has been removed or false
if no such entry could be found.public MOTable getVacmSecurityToGroupTable()
Copyright © 2016 SNMP4J.org. All rights reserved.