|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.IPAcl.JdmkAcl
public class JdmkAcl
Defines an implementation of the InetAddressAcl
interface.
In this implementation the ACL information is stored on a flat file and its default location is specified in the following order:
jdmk.acl.file
property.
getEtcDir("conf" + File.separator + "jdmk.acl")
in class DefaultPaths
.
Constructor Summary | |
---|---|
JdmkAcl(String name)
Constructs the Java Dynamic Management(TM) Access Control List based on IP addresses. |
|
JdmkAcl(String name,
String fileName)
Constructs the Java Dynamic Management(TM) Access Control List based on IP addresses. |
Method Summary | |
---|---|
boolean |
checkCommunity(String community)
Checks whether or not a community string is defined. |
boolean |
checkReadPermission(InetAddress address)
Checks whether or not the specified host has READ access. |
boolean |
checkReadPermission(InetAddress address,
String community)
Checks whether or not the specified host and community have READ access. |
boolean |
checkWritePermission(InetAddress address)
Checks whether or not the specified host has WRITE access. |
boolean |
checkWritePermission(InetAddress address,
String community)
Checks whether or not the specified host and community have WRITE access. |
Enumeration |
communities()
Returns an 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. |
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 com.sun.management.snmp.IPAcl.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 com.sun.management.snmp.IPAcl.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdmkAcl(String name, String fileName) throws UnknownHostException, IllegalArgumentException
name
- The name of the ACL.fileName
- The name of the ACL file.
UnknownHostException
- If the local host is unknown.
IllegalArgumentException
- If the ACL file doesn't exist.public JdmkAcl(String name) throws UnknownHostException, IllegalArgumentException
name
- The name of the ACL.
UnknownHostException
- If the local host is unknown.
Thrown only if this class is instantiated internally by
SnmpAdaptorServer
or SnmpV3AdaptorServer
.
IllegalArgumentException
- If the ACL file doesn't exist.Method Detail |
---|
public Enumeration entries()
java.security.acl.AclEntry
.
public Enumeration communities()
public String getName()
getName
in interface InetAddressAcl
public static com.sun.management.snmp.IPAcl.PermissionImpl getREAD()
public static com.sun.management.snmp.IPAcl.PermissionImpl getWRITE()
public void setAuthorizedListFile(String filename) throws IllegalArgumentException, NotOwnerException, UnknownHostException
IllegalArgumentException
is thrown, the previous existing ACL configuration is not cleared.
filename
- The full path of the file containing the ACL information.
IllegalArgumentException
- If the passed ACL file is null or doesn't exist.
NotOwnerException
- This exception is never thrown.
UnknownHostException
- If IP addresses for hosts contained in the ACL file couldn't be found.public void rereadTheFile() throws NotOwnerException, UnknownHostException
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 String getAuthorizedListFile()
public boolean checkReadPermission(InetAddress address)
READ
access.
checkReadPermission
in interface InetAddressAcl
address
- The host address to check.
true
if the host has read permission, false
otherwise.public boolean checkReadPermission(InetAddress address, String community)
READ
access.
checkReadPermission
in interface InetAddressAcl
address
- The host address to check.community
- The community associated with the host.
true
if the pair (host, community) has read permission, false
otherwise.public boolean checkCommunity(String community)
checkCommunity
in interface InetAddressAcl
community
- The community to check.
true
if the community is known, false
otherwise.public boolean checkWritePermission(InetAddress address)
WRITE
access.
checkWritePermission
in interface InetAddressAcl
address
- The host address to check.
true
if the host has write permission, false
otherwise.public boolean checkWritePermission(InetAddress address, String community)
WRITE
access.
checkWritePermission
in interface InetAddressAcl
address
- The host address to check.community
- The community associated with the host.
true
if the pair (host, community) has write permission, false
otherwise.public Enumeration getTrapDestinations()
getTrapDestinations
in interface InetAddressAcl
InetAddress).
public Enumeration getTrapCommunities(InetAddress i)
getTrapCommunities
in interface InetAddressAcl
i
- The address of the host.
String).
public Enumeration getInformDestinations()
getInformDestinations
in interface InetAddressAcl
InetAddress).
public Enumeration getInformCommunities(InetAddress i)
getInformCommunities
in interface InetAddressAcl
i
- The address of the host.
String).
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |