blob: 0209c68014a3c3df0a372d0710602bcb36400088 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26package com.sun.jmx.snmp;
27
28// java import
29//
30import java.net.InetAddress;
31import java.util.Enumeration;
32
33/**
34 * Defines the IP address based ACL used by the SNMP protocol adaptor.
35 * <p>
36 * <p><b>This API is a Sun Microsystems internal API and is subject
37 * to change without notice.</b></p>
38 * @since 1.5
39 */
40
41public interface InetAddressAcl {
42
43 /**
44 * Returns the name of the ACL.
45 *
46 * @return The name of the ACL.
47 */
48 public String getName();
49
50 /**
51 * Checks whether or not the specified host has <CODE>READ</CODE> access.
52 *
53 * @param address The host address to check.
54 *
55 * @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.
56 */
57 public boolean checkReadPermission(InetAddress address);
58
59 /**
60 * Checks whether or not the specified host and community have <CODE>READ</CODE> access.
61 *
62 * @param address The host address to check.
63 * @param community The community associated with the host.
64 *
65 * @return <CODE>true</CODE> if the pair (host, community) has read permission, <CODE>false</CODE> otherwise.
66 */
67 public boolean checkReadPermission(InetAddress address, String community);
68
69 /**
70 * Checks whether or not a community string is defined.
71 *
72 * @param community The community to check.
73 *
74 * @return <CODE>true</CODE> if the community is known, <CODE>false</CODE> otherwise.
75 */
76 public boolean checkCommunity(String community);
77
78 /**
79 * Checks whether or not the specified host has <CODE>WRITE</CODE> access.
80 *
81 * @param address The host address to check.
82 *
83 * @return <CODE>true</CODE> if the host has write permission, <CODE>false</CODE> otherwise.
84 */
85 public boolean checkWritePermission(InetAddress address);
86
87 /**
88 * Checks whether or not the specified host and community have <CODE>WRITE</CODE> access.
89 *
90 * @param address The host address to check.
91 * @param community The community associated with the host.
92 *
93 * @return <CODE>true</CODE> if the pair (host, community) has write permission, <CODE>false</CODE> otherwise.
94 */
95 public boolean checkWritePermission(InetAddress address, String community);
96
97 /**
98 * Returns an enumeration of trap destinations.
99 *
100 * @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress</CODE>).
101 */
102 public Enumeration getTrapDestinations();
103
104 /**
105 * Returns an enumeration of trap communities for a given host.
106 *
107 * @param address The address of the host.
108 *
109 * @return An enumeration of trap communities for a given host (enumeration of <CODE>String</CODE>).
110 */
111 public Enumeration getTrapCommunities(InetAddress address);
112
113 /**
114 * Returns an enumeration of inform destinations.
115 *
116 * @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress</CODE>).
117 */
118 public Enumeration getInformDestinations();
119
120 /**
121 * Returns an enumeration of inform communities for a given host.
122 *
123 * @param address The address of the host.
124 *
125 * @return An enumeration of inform communities for a given host (enumeration of <CODE>String</CODE>).
126 */
127 public Enumeration getInformCommunities(InetAddress address);
128}