com.adventnet.snmp.snmp2.vacm
Class VacmAccessEntry

java.lang.Object
  extended by 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
(package private)  int contextMatch
          The ContextMatch to match the ContextName with ContextPrefix
(package private)  byte[] contextPrefix
          The ContextPrefix for the particular group,security model and level
static int EXACT_MATCH
          Constant values for VamcContextMatch = exact
(package private) static int NONVOLATILE
           
(package private)  byte[] notifyView
          The NotifyViewName for the particular Context
(package private) static int OTHER
          The below are the various StorageType constants
(package private) static int PERMANENT
           
static int PREFIX_MATCH
          Constant values for VacmContextMatch = prefix
(package private) static int READONLY
           
(package private)  byte[] readView
          The ReadViewName for the particular Context
(package private)  byte securityLevel
          Security level for which access is required
(package private)  int securityModel
          Security model for which access is required
(package private)  int storageType
          The StorageType variable
(package private)  int userStatus
          The userStatus variable
(package private) static int VOLATILE
           
(package private)  byte[] writeView
          The WriteViewName for the particular Context
 
Constructor Summary
VacmAccessEntry(int model, byte[] prefix, byte secLevel)
          Create a VacmAccessEntry using the specified securityModel, contextPrefix and securityLevel.
 
Method Summary
(package private)  boolean checkNull(byte[] thisValue, byte[] value)
           
(package private)  int compareTo(VacmAccessEntry accessEntry)
          Compares two access entry objects.
 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

See Also:
Constant Field Values

PREFIX_MATCH

public static final int PREFIX_MATCH
Constant values for VacmContextMatch = prefix

See Also:
Constant Field Values

contextPrefix

byte[] contextPrefix
The ContextPrefix for the particular group,security model and level


securityModel

int securityModel
Security model for which access is required


securityLevel

byte securityLevel
Security level for which access is required


contextMatch

int contextMatch
The ContextMatch to match the ContextName with ContextPrefix


readView

byte[] readView
The ReadViewName for the particular Context


writeView

byte[] writeView
The WriteViewName for the particular Context


notifyView

byte[] notifyView
The NotifyViewName for the particular Context


OTHER

static final int OTHER
The below are the various StorageType constants

See Also:
Constant Field Values

VOLATILE

static final int VOLATILE
See Also:
Constant Field Values

NONVOLATILE

static final int NONVOLATILE
See Also:
Constant Field Values

PERMANENT

static final int PERMANENT
See Also:
Constant Field Values

READONLY

static final int READONLY
See Also:
Constant Field Values

storageType

int storageType
The StorageType variable


userStatus

int userStatus
The userStatus variable

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.

compareTo

int compareTo(VacmAccessEntry accessEntry)
Compares two access entry objects. This method is used to compare the the context match, context prefix and security level of access entry objects and determine the position to add the entry in the vector. The API user need not use this method

Parameters:
accessEntry - The VacmAccessEntry
Returns:
0 if the position to add the entry is determined, othwrwise returns -1.

checkNull

boolean checkNull(byte[] thisValue,
                  byte[] value)