<?xml version='1.0' encoding='UTF-8'?>
<!--   
   Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
   
   DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   
   The contents of this file are subject to the terms of either the Universal Permissive License 
   v 1.0 as shown at http://oss.oracle.com/licenses/upl
   
   or the following license:
   
   Redistribution and use in source and binary forms, with or without modification, are permitted
   provided that the following conditions are met:
   
   1. Redistributions of source code must retain the above copyright notice, this list of conditions
   and the following disclaimer.
   
   2. Redistributions in binary form must reproduce the above copyright notice, this list of
   conditions and the following disclaimer in the documentation and/or other materials provided with
   the distribution.
   
   3. Neither the name of the copyright holder nor the names of its contributors may be used to
   endorse or promote products derived from this software without specific prior written permission.
   
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
   WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<schema targetNamespace="org.openjdk.jmc.rjmx" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
      <appinfo>
         <meta.schema plugin="org.openjdk.jmc.rjmx" id="triggerActions" name="Trigger Actions"/>
      </appinfo>
      <documentation>
         This extension point is used to add new trigger actions to the JMX Console.
      </documentation>
   </annotation>

   <element name="extension">
      <annotation>
         <appinfo>
            <meta.element />
         </appinfo>
         <documentation>
            A trigger action must have an id, name, description and a class that extends &lt;code&gt;org.openjdk.jmc.rjmx.triggers.TriggerAction &lt;/code&gt;. 

It may also define settings of various types(string, file, boolean, integer, date or time) that can be configured in the JMX Console user interface.
         </documentation>
      </annotation>
      <complexType>
         <sequence>
            <element ref="triggerAction" minOccurs="1" maxOccurs="unbounded"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="triggerAction">
      <annotation>
         <appinfo>
            <meta.element labelAttribute="name" icon="icon"/>
         </appinfo>
      </annotation>
      <complexType>
         <sequence>
            <element ref="string" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="file" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="boolean" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="integer" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="date" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="time" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="float" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="timerange" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="password" minOccurs="0" maxOccurs="unbounded"/>
         </sequence>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this action.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the action
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string" use="required">
            <annotation>
               <documentation>
                  the description of the action
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="icon" type="string">
            <annotation>
               <documentation>
                  the icon for the action
               </documentation>
               <appinfo>
                  <meta.attribute kind="resource"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="class" type="string" use="required">
            <annotation>
               <documentation>
                  class that extends &lt;code&gt;org.openjdk.jmc.rjmx.triggers.TriggerAction&lt;/code&gt; and that implements the method &lt;code&gt;handleNotificationEvent(NotificationEvent e)&lt;/code&gt; that will execute when a trigger is triggered.
               </documentation>
               <appinfo>
                  <meta.attribute kind="java" basedOn="org.openjdk.jmc.rjmx.triggers.TriggerAction"/>
               </appinfo>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="date">
      <annotation>
         <documentation>
            Date setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="time">
      <annotation>
         <documentation>
            Time setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="timerange">
      <annotation>
         <documentation>
            Time range setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value for this time range. If no unit is set, seconds will be assumed.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="string">
      <annotation>
         <documentation>
            String setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="file">
      <annotation>
         <documentation>
            File setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="boolean">
      <annotation>
         <documentation>
            Boolean setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="boolean">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="integer">
      <annotation>
         <documentation>
            Integer setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="min" type="string">
            <annotation>
               <documentation>
                  the minimum allowed integer value for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="max" type="string">
            <annotation>
               <documentation>
                  the maximum allowed integer value for this setting
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="float">
      <annotation>
         <documentation>
            Float setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="min" type="string">
            <annotation>
               <documentation>
                  the minimum allowed float value for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="max" type="string">
            <annotation>
               <documentation>
                  the maximum allowed float value for this setting
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="password">
      <annotation>
         <documentation>
            Password setting for a trigger action.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="id" type="string" use="required">
            <annotation>
               <documentation>
                  a unique identifier for this setting
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string" use="required">
            <annotation>
               <documentation>
                  the name of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="description" type="string">
            <annotation>
               <documentation>
                  the description of the setting
               </documentation>
               <appinfo>
                  <meta.attribute translatable="true"/>
               </appinfo>
            </annotation>
         </attribute>
         <attribute name="value" type="string">
            <annotation>
               <documentation>
                  the default value
               </documentation>
            </annotation>
         </attribute>
         <attribute name="preference" type="boolean">
            <annotation>
               <documentation>
                  set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <annotation>
      <appinfo>
         <meta.section type="since"/>
      </appinfo>
      <documentation>
         5.2.0
      </documentation>
   </annotation>

   <annotation>
      <appinfo>
         <meta.section type="examples"/>
      </appinfo>
      <documentation>
         &lt;extension point=&quot;org.openjdk.jmc.rjmx.triggerActions&quot;&gt;
      &lt;triggerAction
            class=&quot;com.example.triggers.actions.HelloAction&quot;
            description=&quot;Hello World Action&quot;
            icon=&quot;icons/console_view.png&quot;
            id=&quot;com.example.triggers.HelloWorld&quot;
            name=&quot;Hello World&quot;&gt;
            &lt;string
                  id=&quot;com.example.triggers.actions.username&quot;
                  name=&quot;Your Name&quot;
                  value=&quot;Mr X&quot;&gt;
            &lt;/string&gt;         
     &lt;/triggerAction&gt;
&lt;/extension&gt;


package com.example.triggers.actions;

import org.openjdk.jmc.rjmx.triggers.TriggerAction;
import org.openjdk.jmc.rjmx.triggers.TriggerEvent;

public class HelloAction extends TriggerAction 
{
 public void handleNotificationEvent(TriggerEvent e) 
 {
  System.out.println(&quot;Hello &quot; + getSetting(&quot;com.example.triggers.actions.username&quot;).getString() +&quot;! Trigger value is &quot; + e.getTriggerValue());
 }
}
      </documentation>
   </annotation>



   <annotation>
      <appinfo>
         <meta.section type="copyright"/>
      </appinfo>
      <documentation>
         Copyright (c) 2018, 2020, Oracle and/or its affiliates.
      </documentation>
   </annotation>

</schema>