public class

SnmpAcl

extends Object
implements InetAddressAcl Serializable
java.lang.Object
   ↳ com.sun.jmx.snmp.IPAcl.SnmpAcl

Class Overview

Defines an implementation of the InetAddressAcl interface.

In this implementation the ACL information is stored on a flat file and its default location is "$JRE/lib/snmp.acl" - See getDefaultAclFileName()

    This API is a Sun Microsystems internal API and is subject to change without notice.

Summary

Public Constructors
SnmpAcl(String Owner)
Constructs the Java Dynamic Management(TM) Access Control List based on IP addresses.
SnmpAcl(String Owner, String aclFileName)
Constructs the Java Dynamic Management(TM) Access Control List based on IP addresses.
Public Methods
boolean checkCommunity(String community)
Checks whether or not a community string is defined.
boolean checkReadPermission(InetAddress address, String community)
Checks whether or not the specified host and community have READ access.
boolean checkReadPermission(InetAddress address)
Checks whether or not the specified host has READ access.
boolean checkWritePermission(InetAddress address, String community)
Checks whether or not the specified host and community have WRITE access.
boolean checkWritePermission(InetAddress address)
Checks whether or not the specified host has WRITE access.
Enumeration<String> communities()
Returns ann enumeration of community strings.
Enumeration entries()
Returns an enumeration of the entries in this ACL.
String getAuthorizedListFile()
Returns the full path of the file used to get ACL information.
static String getDefaultAclFileName()
Get the default name for the ACL file.
Enumeration getInformCommunities(InetAddress i)
Returns an enumeration of inform communities for a given host.
Enumeration getInformDestinations()
Returns an enumeration of inform destinations.
String getName()
Returns the name of the ACL.
static PermissionImpl getREAD()
Returns the read permission instance used.
Enumeration getTrapCommunities(InetAddress i)
Returns an enumeration of trap communities for a given host.
Enumeration getTrapDestinations()
Returns an enumeration of trap destinations.
static PermissionImpl getWRITE()
Returns the write permission instance used.
void rereadTheFile()
Resets this ACL to the values contained in the configuration file.
void setAuthorizedListFile(String filename)
Sets the full path of the file containing the ACL information.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.sun.jmx.snmp.InetAddressAcl

Public Constructors

public SnmpAcl (String Owner)

Constructs the Java Dynamic Management(TM) Access Control List based on IP addresses. The ACL will take the given owner name. The current IP address will be the owner of the ACL.

Parameters
Owner The name of the ACL Owner.
Throws
UnknownHostException If the local host is unknown.
IllegalArgumentException If the ACL file doesn't exist.

public SnmpAcl (String Owner, String aclFileName)

Constructs the Java Dynamic Management(TM) Access Control List based on IP addresses. The ACL will take the given owner name. The current IP address will be the owner of the ACL.

Parameters
Owner The name of the ACL Owner.
aclFileName The name of the ACL File.
Throws
UnknownHostException If the local host is unknown.
IllegalArgumentException If the ACL file doesn't exist.

Public Methods

public boolean checkCommunity (String community)

Checks whether or not a community string is defined.

Parameters
community The community to check.
Returns
  • true if the community is known, false otherwise.

public boolean checkReadPermission (InetAddress address, String community)

Checks whether or not the specified host and community have READ access.

Parameters
address The host address to check.
community The community associated with the host.
Returns
  • true if the pair (host, community) has read permission, false otherwise.

public boolean checkReadPermission (InetAddress address)

Checks whether or not the specified host has READ access.

Parameters
address The host address to check.
Returns
  • true if the host has read permission, false otherwise.

public boolean checkWritePermission (InetAddress address, String community)

Checks whether or not the specified host and community have WRITE access.

Parameters
address The host address to check.
community The community associated with the host.
Returns
  • true if the pair (host, community) has write permission, false otherwise.

public boolean checkWritePermission (InetAddress address)

Checks whether or not the specified host has WRITE access.

Parameters
address The host address to check.
Returns
  • true if the host has write permission, false otherwise.

public Enumeration<String> communities ()

Returns ann enumeration of community strings. Community strings are returned as String.

Returns
  • The enumeration of community strings.

public Enumeration entries ()

Returns an enumeration of the entries in this ACL. Each element in the enumeration is of type java.security.acl.AclEntry.

Returns
  • An enumeration of the entries in this ACL.

public String getAuthorizedListFile ()

Returns the full path of the file used to get ACL information.

Returns
  • The full path of the file used to get ACL information.

public static String getDefaultAclFileName ()

Get the default name for the ACL file. In this implementation this is "$JRE/lib/snmp.acl"

Returns
  • The default name for the ACL file.

public Enumeration getInformCommunities (InetAddress i)

Returns an enumeration of inform communities for a given host.

Parameters
i The address of the host.
Returns
  • An enumeration of inform communities for a given host (enumeration of String).

public Enumeration getInformDestinations ()

Returns an enumeration of inform destinations.

Returns
  • An enumeration of the inform destinations (enumeration of InetAddress).

public String getName ()

Returns the name of the ACL.

Returns
  • The name of the ACL.

public static PermissionImpl getREAD ()

Returns the read permission instance used.

Returns
  • The read permission instance.

public Enumeration getTrapCommunities (InetAddress i)

Returns an enumeration of trap communities for a given host.

Parameters
i The address of the host.
Returns
  • An enumeration of trap communities for a given host (enumeration of String).

public Enumeration getTrapDestinations ()

Returns an enumeration of trap destinations.

Returns
  • An enumeration of the trap destinations (enumeration of InetAddress).

public static PermissionImpl getWRITE ()

Returns the write permission instance used.

Returns
  • The write permission instance.

public void rereadTheFile ()

Resets this ACL to the values contained in the configuration file.

Throws
NotOwnerException If the principal attempting the reset is not an owner of this ACL.
UnknownHostException If IP addresses for hosts contained in the ACL file couldn't be found.

public void setAuthorizedListFile (String filename)

Sets the full path of the file containing the ACL information.

Parameters
filename The full path of the file containing the ACL information.
Throws
IllegalArgumentException If the passed ACL file doesn't exist.