Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/jmx/snmp/InetAddressAcl.java
38924 views
/*1* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.jmx.snmp;2627// java import28//29import java.net.InetAddress;30import java.util.Enumeration;3132/**33* Defines the IP address based ACL used by the SNMP protocol adaptor.34* <p>35* <p><b>This API is a Sun Microsystems internal API and is subject36* to change without notice.</b></p>37* @since 1.538*/3940public interface InetAddressAcl {4142/**43* Returns the name of the ACL.44*45* @return The name of the ACL.46*/47public String getName();4849/**50* Checks whether or not the specified host has <CODE>READ</CODE> access.51*52* @param address The host address to check.53*54* @return <CODE>true</CODE> if the host has read permission, <CODE>false</CODE> otherwise.55*/56public boolean checkReadPermission(InetAddress address);5758/**59* Checks whether or not the specified host and community have <CODE>READ</CODE> access.60*61* @param address The host address to check.62* @param community The community associated with the host.63*64* @return <CODE>true</CODE> if the pair (host, community) has read permission, <CODE>false</CODE> otherwise.65*/66public boolean checkReadPermission(InetAddress address, String community);6768/**69* Checks whether or not a community string is defined.70*71* @param community The community to check.72*73* @return <CODE>true</CODE> if the community is known, <CODE>false</CODE> otherwise.74*/75public boolean checkCommunity(String community);7677/**78* Checks whether or not the specified host has <CODE>WRITE</CODE> access.79*80* @param address The host address to check.81*82* @return <CODE>true</CODE> if the host has write permission, <CODE>false</CODE> otherwise.83*/84public boolean checkWritePermission(InetAddress address);8586/**87* Checks whether or not the specified host and community have <CODE>WRITE</CODE> access.88*89* @param address The host address to check.90* @param community The community associated with the host.91*92* @return <CODE>true</CODE> if the pair (host, community) has write permission, <CODE>false</CODE> otherwise.93*/94public boolean checkWritePermission(InetAddress address, String community);9596/**97* Returns an enumeration of trap destinations.98*99* @return An enumeration of the trap destinations (enumeration of <CODE>InetAddress</CODE>).100*/101public Enumeration<InetAddress> getTrapDestinations();102103/**104* Returns an enumeration of trap communities for a given host.105*106* @param address The address of the host.107*108* @return An enumeration of trap communities for a given host (enumeration of <CODE>String</CODE>).109*/110public Enumeration<String> getTrapCommunities(InetAddress address);111112/**113* Returns an enumeration of inform destinations.114*115* @return An enumeration of the inform destinations (enumeration of <CODE>InetAddress</CODE>).116*/117public Enumeration<InetAddress> getInformDestinations();118119/**120* Returns an enumeration of inform communities for a given host.121*122* @param address The address of the host.123*124* @return An enumeration of inform communities for a given host (enumeration of <CODE>String</CODE>).125*/126public Enumeration<String> getInformCommunities(InetAddress address);127}128129130