Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/sun/management/DiagnosticCommandInfo.java
38827 views
/*1* Copyright (c) 2013, 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 sun.management;2627import java.util.List;2829/**30* Diagnostic command information. It contains the description of a31* diagnostic command.32*33* @since 834*/3536class DiagnosticCommandInfo {37private final String name;38private final String description;39private final String impact;40private final String permissionClass;41private final String permissionName;42private final String permissionAction;43private final boolean enabled;44private final List<DiagnosticCommandArgumentInfo> arguments;4546/**47* Returns the diagnostic command name.48*49* @return the diagnostic command name50*/51String getName() {52return name;53}5455/**56* Returns the diagnostic command description.57*58* @return the diagnostic command description59*/60String getDescription() {61return description;62}6364/**65* Returns the potential impact of the diagnostic command execution66* on the Java virtual machine behavior.67*68* @return the potential impact of the diagnostic command execution69* on the Java virtual machine behavior70*/71String getImpact() {72return impact;73}7475/**76* Returns the name of the permission class required to be allowed77* to invoke the diagnostic command, or null if no permission78* is required.79*80* @return the name of the permission class name required to be allowed81* to invoke the diagnostic command, or null if no permission82* is required83*/84String getPermissionClass() {85return permissionClass;86}8788/**89* Returns the permission name required to be allowed to invoke the90* diagnostic command, or null if no permission is required.91*92* @return the permission name required to be allowed to invoke the93* diagnostic command, or null if no permission is required94*/95String getPermissionName() {96return permissionName;97}9899/**100* Returns the permission action required to be allowed to invoke the101* diagnostic command, or null if no permission is required or102* if the permission has no action specified.103*104* @return the permission action required to be allowed to invoke the105* diagnostic command, or null if no permission is required or106* if the permission has no action specified107*/108String getPermissionAction() {109return permissionAction;110}111112/**113* Returns {@code true} if the diagnostic command is enabled,114* {@code false} otherwise. The enabled/disabled115* status of a diagnostic command can evolve during116* the lifetime of the Java virtual machine.117*118* @return {@code true} if the diagnostic command is enabled,119* {@code false} otherwise120*/121boolean isEnabled() {122return enabled;123}124125/**126* Returns the list of the diagnostic command arguments description.127* If the diagnostic command has no arguments, it returns an empty list.128*129* @return a list of the diagnostic command arguments description130*/131List<DiagnosticCommandArgumentInfo> getArgumentsInfo() {132return arguments;133}134135DiagnosticCommandInfo(String name, String description,136String impact, String permissionClass,137String permissionName, String permissionAction,138boolean enabled,139List<DiagnosticCommandArgumentInfo> arguments)140{141this.name = name;142this.description = description;143this.impact = impact;144this.permissionClass = permissionClass;145this.permissionName = permissionName;146this.permissionAction = permissionAction;147this.enabled = enabled;148this.arguments = arguments;149}150}151152153