com.adventnet.snmp.snmp2.vacm
Class VacmAccessEntry

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.vacm.VacmAccessEntry
All Implemented Interfaces:
java.io.Serializable

public class VacmAccessEntry
extends java.lang.Object
implements java.io.Serializable

This class represents the VacmAccessEntry. It represents the vacmAccessEntry OBJECT-TYPE (OID - .1.3.6.1.6.3.16.1.4.1) from the ViewBasedAccessControl. This class has the attributes like the contextPrefix, securityModel, securityLevel, contextMatch and the read, write, notify view names. These attributes represent the access rights, authorizing access to an SNMP context. The VacmGroupAccessEntry maintains a list of VacmAccessEntries for each groupName. It is to be noted that modifying any of attributes in this entry will not update the entries in other tables. For example while processing the isAccessAllowed the viewName from this entry is used to consult the VacmViewTreeTable and VacmFamilyEntry to select one entry that is included or excluded. If any of the view names are modified in this entry, then they are not correspondingly updated in the VacmFamilyEntry.

See Also:
VacmGroupAccessEntry, Serialized Form

Field Summary
static int EXACT_MATCH
          Constant values for VamcContextMatch = exact
static int PREFIX_MATCH
          Constant values for VacmContextMatch = prefix
 
Constructor Summary
VacmAccessEntry(int model, byte[] prefix, byte secLevel)
          Create a VacmAccessEntry using the specified securityModel, contextPrefix and securityLevel.
 
Method Summary
 boolean equals(VacmAccessEntry entry)
          Compares two VacmAccessEntry Objects for equality.
 int getContextMatch()
          Get the VacmAccessContextMatch value.
 byte[] getContextPrefix()
          Get the contextPrefix value.
 byte[] getNotifyView()
          Get the VacmAccessNotifyViewName.
 byte[] getReadView()
          Get the VacmAccessReadViewName.
 byte getSecurityLevel()
          Get the securityLevel.
 int getSecurityModel()
          Get the securityModel value.
 int getStorageType()
          Get the VACM Access StorageType associated with this VacmAccessEntry
 int getVacmAccessStatus()
          Get the vacmAccessStatus associated with this VacmAccessEntry
 byte[] getWriteView()
          Get the VacmAccessWriteViewName.
 void setContextMatch(int match)
          Set the VacmAccessContextMatch value.
 void setNotifyView(byte[] notifyViewName)
          Set the VacmAccessNotifyViewName.
 void setReadView(byte[] readViewName)
          Set the VacmAccessReadViewName.
 void setStorageType(int storageType)
          Set the VACM Access StorageType associated with this VacmAccessEntry
 void setVacmAccessStatus(int userStatus)
          Set the vacmAccessStatus associated with this VacmAccessEntry.
 void setWriteView(byte[] writeViewName)
          Set the VacmAccessWriteViewName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXACT_MATCH

public static final int EXACT_MATCH
Constant values for VamcContextMatch = exact

PREFIX_MATCH

public static final int PREFIX_MATCH
Constant values for VacmContextMatch = prefix
Constructor Detail

VacmAccessEntry

public VacmAccessEntry(int model,
                       byte[] prefix,
                       byte secLevel)
Create a VacmAccessEntry using the specified securityModel, contextPrefix and securityLevel.
Parameters:
model - The VacmAccessSecurityModel for this object.
prefix - The VacmAccessContextPrefix for this object.
secLevel - The VacmAccessSecurityLeve for this object.
Method Detail

getContextPrefix

public byte[] getContextPrefix()
Get the contextPrefix value. In order to gain the access rights allowed by this object, a contextName must match exactly (if the value of vacmAccessContextMatch is 'exact') or partially (if the value of vacmAccessContextMatch is 'prefix') to the value of the instance of this object.
Returns:
The VacmAccessContextPrefix value associated with this object.

getSecurityModel

public int getSecurityModel()
Get the securityModel value. In order to gain the access rights allowed by this object, this securityModel must be in use.
Returns:
The VacmAccessSecurityModel associated with this object.

getSecurityLevel

public byte getSecurityLevel()
Get the securityLevel. The securityLevel is the minimum level of security required in order to gain the access rights allowed by this object.
Returns:
The VacmAccessSecurityLevel associated with this object.

getContextMatch

public int getContextMatch()
Get the VacmAccessContextMatch value. This is the ContextMatch to match the ContextName with ContextPrefix. The possible values for the VacmAccessContextMatch are EXACT_MATCH with value 1 and PREFIX_MATCH with value 2. These EXACT and PREFIX constants are defined in this class. If the value of this object is EXACT_MATCH, then all rows where the contextName exactly matches vacmAccessContextPrefix are selected. If the value of this object is PREFIX_MATCH, then all rows where the contextName whose starting octets exactly match vacmAccessContextPrefix are selected. The default value for the context match is EXACT_MATCH.
Returns:
The VacmAccessContextMatch value if set, otherwise returns the default value EXACT_MATCH.

setContextMatch

public void setContextMatch(int match)
Set the VacmAccessContextMatch value. This is the ContextMatch to match the ContextName with ContextPrefix. The possible values for the VacmAccessContextMatch are EXACT_MATCH with value 1 and PREFIX_MATCH with value 2. These EXACT and PREFIX constants are defined in this class. If the value of this object is EXACT_MATCH, then all rows where the contextName exactly matches vacmAccessContextPrefix are selected. If the value of this object is PREFIX_MATCH, then all rows where the contextName whose starting octets exactly match vacmAccessContextPrefix are selected. If the parameter to set is not a valid one, then the value is assumed to be EXACT_MATCH.
Parameters:
match - The VacmAccessContextMatch value.

getReadView

public byte[] getReadView()
Get the VacmAccessReadViewName. The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes read access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; 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.
Returns:
The VacmAccessReadViewName associated with this object.

setReadView

public void setReadView(byte[] readViewName)
Set the VacmAccessReadViewName. The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes read access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; 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.
Parameters:
readViewName - The VacmAccessReadViewName to be set for this object.

getWriteView

public byte[] getWriteView()
Get the VacmAccessWriteViewName. The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes write access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; 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.
Returns:
The VacmAccessReadViewName associated with this object.

setWriteView

public void setWriteView(byte[] writeViewName)
Set the VacmAccessWriteViewName. The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes write access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; 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.
Parameters:
writeViewName - The VacmAccessWriteViewName to be set for this object.

getNotifyView

public byte[] getNotifyView()
Get the VacmAccessNotifyViewName. The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes access for notification. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; 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.
Returns:
The VacmAccessNotifyViewName associated with this object.

setNotifyView

public void setNotifyView(byte[] notifyViewName)
Set the VacmAccessNotifyViewName. The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes access for notification. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; 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.
Parameters:
notifyViewName - The VacmAccessNotifyViewName to be set for this object.

getStorageType

public int getStorageType()
Get the VACM Access StorageType associated with this VacmAccessEntry

setStorageType

public void setStorageType(int storageType)
Set the VACM Access StorageType associated with this VacmAccessEntry

getVacmAccessStatus

public int getVacmAccessStatus()
Get the vacmAccessStatus associated with this VacmAccessEntry

setVacmAccessStatus

public void setVacmAccessStatus(int userStatus)
Set the vacmAccessStatus associated with this VacmAccessEntry. This is used in case of an agent side mplementation.
Parameters:
userStatus - The row status value to be set on this entry.

equals

public boolean equals(VacmAccessEntry entry)
Compares two VacmAccessEntry Objects for equality. It returns true if the object to be compared is the same as this object. The contextPrefix, securityModel, securityLevel, contextMatch, readView, writeView, and notifyView are compared with this VacmAccessEntry object.
Parameters:
enrty - The object to compare this VacmAccessEntry against.
Returns:
True if this object is the same as the VacmAccessEntry argument, false otherwise. It returns false if the VacmAccessEntry is null.


Copyright (c)AdventNet Inc., 1996-2004