1 <?xml version='1.0' encoding='UTF-8'?>
   2 <!--   
   3    Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
   4    
   5    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   6    
   7    The contents of this file are subject to the terms of either the Universal Permissive License 
   8    v 1.0 as shown at http://oss.oracle.com/licenses/upl
   9    
  10    or the following license:
  11    
  12    Redistribution and use in source and binary forms, with or without modification, are permitted
  13    provided that the following conditions are met:
  14    
  15    1. Redistributions of source code must retain the above copyright notice, this list of conditions
  16    and the following disclaimer.
  17    
  18    2. Redistributions in binary form must reproduce the above copyright notice, this list of
  19    conditions and the following disclaimer in the documentation and/or other materials provided with
  20    the distribution.
  21    
  22    3. Neither the name of the copyright holder nor the names of its contributors may be used to
  23    endorse or promote products derived from this software without specific prior written permission.
  24    
  25    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  26    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  27    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  28    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  30    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  31    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
  32    WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33 -->
  34 <schema targetNamespace="org.openjdk.jmc.rjmx" xmlns="http://www.w3.org/2001/XMLSchema">
  35 <annotation>
  36       <appinfo>
  37          <meta.schema plugin="org.openjdk.jmc.rjmx" id="triggerConstraints" name="Trigger Constraints"/>
  38       </appinfo>
  39       <documentation>
  40          This extension point is used to add new trigger constraints to the JMX Console.
  41       </documentation>
  42    </annotation>
  43 
  44    <element name="extension">
  45       <annotation>
  46          <appinfo>
  47             <meta.element />
  48          </appinfo>
  49          <documentation>
  50             A trigger constraint must have an id, name, description and a class that extends &lt;code&gt;org.openjdk.jmc.rjmx.triggers.TriggerConstraint&lt;/code&gt;. 
  51 
  52 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.
  53          </documentation>
  54       </annotation>
  55       <complexType>
  56          <sequence>
  57             <element ref="triggerConstraint" minOccurs="1" maxOccurs="unbounded"/>
  58          </sequence>
  59          <attribute name="point" type="string" use="required">
  60             <annotation>
  61                <documentation>
  62                   
  63                </documentation>
  64             </annotation>
  65          </attribute>
  66          <attribute name="id" type="string">
  67             <annotation>
  68                <documentation>
  69                   
  70                </documentation>
  71             </annotation>
  72          </attribute>
  73          <attribute name="name" type="string">
  74             <annotation>
  75                <documentation>
  76                   
  77                </documentation>
  78                <appinfo>
  79                   <meta.attribute translatable="true"/>
  80                </appinfo>
  81             </annotation>
  82          </attribute>
  83       </complexType>
  84    </element>
  85 
  86    <element name="triggerConstraint">
  87       <annotation>
  88          <appinfo>
  89             <meta.element labelAttribute="name" icon="icon"/>
  90          </appinfo>
  91       </annotation>
  92       <complexType>
  93          <sequence>
  94             <element ref="string" minOccurs="0" maxOccurs="unbounded"/>
  95             <element ref="file" minOccurs="0" maxOccurs="unbounded"/>
  96             <element ref="boolean" minOccurs="0" maxOccurs="unbounded"/>
  97             <element ref="integer" minOccurs="0" maxOccurs="unbounded"/>
  98             <element ref="date" minOccurs="0" maxOccurs="unbounded"/>
  99             <element ref="time" minOccurs="0" maxOccurs="unbounded"/>
 100             <element ref="float" minOccurs="0" maxOccurs="unbounded"/>
 101          </sequence>
 102          <attribute name="id" type="string" use="required">
 103             <annotation>
 104                <documentation>
 105                   the identifier for the constraint
 106                </documentation>
 107             </annotation>
 108          </attribute>
 109          <attribute name="name" type="string" use="required">
 110             <annotation>
 111                <documentation>
 112                   the name for the constraint
 113                </documentation>
 114                <appinfo>
 115                   <meta.attribute translatable="true"/>
 116                </appinfo>
 117             </annotation>
 118          </attribute>
 119          <attribute name="icon" type="string">
 120             <annotation>
 121                <documentation>
 122                   the icon for the constraint
 123                </documentation>
 124                <appinfo>
 125                   <meta.attribute kind="resource"/>
 126                </appinfo>
 127             </annotation>
 128          </attribute>
 129          <attribute name="description" type="string" use="required">
 130             <annotation>
 131                <documentation>
 132                   the description for the constraint
 133                </documentation>
 134                <appinfo>
 135                   <meta.attribute translatable="true"/>
 136                </appinfo>
 137             </annotation>
 138          </attribute>
 139          <attribute name="class" type="string" use="required">
 140             <annotation>
 141                <documentation>
 142                   class that extends &lt;code&gt;org.openjdk.jmc.rjmx.triggers.TriggerConstraint&lt;/code&gt; and that implements the method &lt;code&gt;validate(NotificationEvent e)&lt;/code&gt; which accepts or rejects a notification event.
 143                </documentation>
 144                <appinfo>
 145                   <meta.attribute kind="java" basedOn="org.openjdk.jmc.rjmx.triggers.TriggerConstraint"/>
 146                </appinfo>
 147             </annotation>
 148          </attribute>
 149       </complexType>
 150    </element>
 151 
 152    <element name="date">
 153       <annotation>
 154          <documentation>
 155             Date setting for a trigger constraint.
 156          </documentation>
 157       </annotation>
 158       <complexType>
 159          <attribute name="id" type="string" use="required">
 160             <annotation>
 161                <documentation>
 162                   the identifier for the setting
 163                </documentation>
 164             </annotation>
 165          </attribute>
 166          <attribute name="name" type="string" use="required">
 167             <annotation>
 168                <documentation>
 169                   the name of the setting
 170                </documentation>
 171                <appinfo>
 172                   <meta.attribute translatable="true"/>
 173                </appinfo>
 174             </annotation>
 175          </attribute>
 176          <attribute name="description" type="string">
 177             <annotation>
 178                <documentation>
 179                   the description of the setting
 180                </documentation>
 181                <appinfo>
 182                   <meta.attribute translatable="true"/>
 183                </appinfo>
 184             </annotation>
 185          </attribute>
 186          <attribute name="value" type="string">
 187             <annotation>
 188                <documentation>
 189                   the default value
 190                </documentation>
 191             </annotation>
 192          </attribute>
 193          <attribute name="preference" type="boolean">
 194             <annotation>
 195                <documentation>
 196                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 197                </documentation>
 198             </annotation>
 199          </attribute>
 200       </complexType>
 201    </element>
 202 
 203    <element name="time">
 204       <annotation>
 205          <documentation>
 206             Time setting for a trigger action.
 207          </documentation>
 208       </annotation>
 209       <complexType>
 210          <attribute name="id" type="string" use="required">
 211             <annotation>
 212                <documentation>
 213                   a unique identifier for this setting
 214                </documentation>
 215             </annotation>
 216          </attribute>
 217          <attribute name="name" type="string" use="required">
 218             <annotation>
 219                <documentation>
 220                   the name of the setting
 221                </documentation>
 222                <appinfo>
 223                   <meta.attribute translatable="true"/>
 224                </appinfo>
 225             </annotation>
 226          </attribute>
 227          <attribute name="description" type="string">
 228             <annotation>
 229                <documentation>
 230                   the description of the setting
 231                </documentation>
 232                <appinfo>
 233                   <meta.attribute translatable="true"/>
 234                </appinfo>
 235             </annotation>
 236          </attribute>
 237          <attribute name="value" type="string">
 238             <annotation>
 239                <documentation>
 240                   the default value
 241                </documentation>
 242             </annotation>
 243          </attribute>
 244          <attribute name="preference" type="boolean">
 245             <annotation>
 246                <documentation>
 247                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 248                </documentation>
 249             </annotation>
 250          </attribute>
 251       </complexType>
 252    </element>
 253 
 254    <element name="string">
 255       <annotation>
 256          <documentation>
 257             String setting for a trigger constraint.
 258          </documentation>
 259       </annotation>
 260       <complexType>
 261          <attribute name="id" type="string" use="required">
 262             <annotation>
 263                <documentation>
 264                   a unique identifier for this setting
 265                </documentation>
 266             </annotation>
 267          </attribute>
 268          <attribute name="name" type="string" use="required">
 269             <annotation>
 270                <documentation>
 271                   the name of the setting
 272                </documentation>
 273                <appinfo>
 274                   <meta.attribute translatable="true"/>
 275                </appinfo>
 276             </annotation>
 277          </attribute>
 278          <attribute name="description" type="string">
 279             <annotation>
 280                <documentation>
 281                   the description of the setting
 282                </documentation>
 283                <appinfo>
 284                   <meta.attribute translatable="true"/>
 285                </appinfo>
 286             </annotation>
 287          </attribute>
 288          <attribute name="value" type="string">
 289             <annotation>
 290                <documentation>
 291                   the default value
 292                </documentation>
 293             </annotation>
 294          </attribute>
 295          <attribute name="preference" type="boolean">
 296             <annotation>
 297                <documentation>
 298                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 299                </documentation>
 300             </annotation>
 301          </attribute>
 302       </complexType>
 303    </element>
 304 
 305    <element name="file">
 306       <annotation>
 307          <documentation>
 308             File setting for a trigger constraint.
 309          </documentation>
 310       </annotation>
 311       <complexType>
 312          <attribute name="id" type="string" use="required">
 313             <annotation>
 314                <documentation>
 315                   a unique identifier for this setting
 316                </documentation>
 317             </annotation>
 318          </attribute>
 319          <attribute name="name" type="string" use="required">
 320             <annotation>
 321                <documentation>
 322                   the name of the setting
 323                </documentation>
 324                <appinfo>
 325                   <meta.attribute translatable="true"/>
 326                </appinfo>
 327             </annotation>
 328          </attribute>
 329          <attribute name="description" type="string">
 330             <annotation>
 331                <documentation>
 332                   the description of the setting
 333                </documentation>
 334                <appinfo>
 335                   <meta.attribute translatable="true"/>
 336                </appinfo>
 337             </annotation>
 338          </attribute>
 339          <attribute name="value" type="string">
 340             <annotation>
 341                <documentation>
 342                   the default value
 343                </documentation>
 344             </annotation>
 345          </attribute>
 346          <attribute name="preference" type="boolean">
 347             <annotation>
 348                <documentation>
 349                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 350                </documentation>
 351             </annotation>
 352          </attribute>
 353       </complexType>
 354    </element>
 355 
 356    <element name="boolean">
 357       <annotation>
 358          <documentation>
 359             Boolean setting for a trigger constraint.
 360          </documentation>
 361       </annotation>
 362       <complexType>
 363          <attribute name="id" type="string" use="required">
 364             <annotation>
 365                <documentation>
 366                   a unique identifier for this setting
 367                </documentation>
 368             </annotation>
 369          </attribute>
 370          <attribute name="name" type="string" use="required">
 371             <annotation>
 372                <documentation>
 373                   the name of the setting
 374                </documentation>
 375                <appinfo>
 376                   <meta.attribute translatable="true"/>
 377                </appinfo>
 378             </annotation>
 379          </attribute>
 380          <attribute name="description" type="string">
 381             <annotation>
 382                <documentation>
 383                   the description of the setting
 384                </documentation>
 385                <appinfo>
 386                   <meta.attribute translatable="true"/>
 387                </appinfo>
 388             </annotation>
 389          </attribute>
 390          <attribute name="value" type="boolean">
 391             <annotation>
 392                <documentation>
 393                   the default value
 394                </documentation>
 395             </annotation>
 396          </attribute>
 397          <attribute name="preference" type="boolean">
 398             <annotation>
 399                <documentation>
 400                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 401                </documentation>
 402             </annotation>
 403          </attribute>
 404       </complexType>
 405    </element>
 406 
 407    <element name="integer">
 408       <annotation>
 409          <documentation>
 410             Integer setting for a trigger constraint.
 411          </documentation>
 412       </annotation>
 413       <complexType>
 414          <attribute name="id" type="string" use="required">
 415             <annotation>
 416                <documentation>
 417                   a unique identifier for this setting
 418                </documentation>
 419             </annotation>
 420          </attribute>
 421          <attribute name="name" type="string" use="required">
 422             <annotation>
 423                <documentation>
 424                   the name of the setting
 425                </documentation>
 426                <appinfo>
 427                   <meta.attribute translatable="true"/>
 428                </appinfo>
 429             </annotation>
 430          </attribute>
 431          <attribute name="description" type="string">
 432             <annotation>
 433                <documentation>
 434                   the description of the setting
 435                </documentation>
 436                <appinfo>
 437                   <meta.attribute translatable="true"/>
 438                </appinfo>
 439             </annotation>
 440          </attribute>
 441          <attribute name="value" type="string">
 442             <annotation>
 443                <documentation>
 444                   the default value
 445                </documentation>
 446             </annotation>
 447          </attribute>
 448          <attribute name="preference" type="boolean">
 449             <annotation>
 450                <documentation>
 451                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 452                </documentation>
 453             </annotation>
 454          </attribute>
 455          <attribute name="min" type="string">
 456             <annotation>
 457                <documentation>
 458                   the minimum allowed integer value for this setting
 459                </documentation>
 460             </annotation>
 461          </attribute>
 462          <attribute name="max" type="string">
 463             <annotation>
 464                <documentation>
 465                   the maximum allowed integer value for this setting
 466                </documentation>
 467             </annotation>
 468          </attribute>
 469       </complexType>
 470    </element>
 471 
 472    <element name="float">
 473       <annotation>
 474          <documentation>
 475             Float setting for a trigger action.
 476          </documentation>
 477       </annotation>
 478       <complexType>
 479          <attribute name="id" type="string" use="required">
 480             <annotation>
 481                <documentation>
 482                   a unique identifier for this setting
 483                </documentation>
 484             </annotation>
 485          </attribute>
 486          <attribute name="name" type="string" use="required">
 487             <annotation>
 488                <documentation>
 489                   the name of the setting
 490                </documentation>
 491                <appinfo>
 492                   <meta.attribute translatable="true"/>
 493                </appinfo>
 494             </annotation>
 495          </attribute>
 496          <attribute name="description" type="string">
 497             <annotation>
 498                <documentation>
 499                   the description of the setting
 500                </documentation>
 501                <appinfo>
 502                   <meta.attribute translatable="true"/>
 503                </appinfo>
 504             </annotation>
 505          </attribute>
 506          <attribute name="value" type="string">
 507             <annotation>
 508                <documentation>
 509                   the default value
 510                </documentation>
 511             </annotation>
 512          </attribute>
 513          <attribute name="preference" type="boolean">
 514             <annotation>
 515                <documentation>
 516                   set to true if the default value should be fetched from the preference store for the RJMXPlugin using the id as a key.
 517                </documentation>
 518             </annotation>
 519          </attribute>
 520          <attribute name="min" type="string">
 521             <annotation>
 522                <documentation>
 523                   the minimum allowed float value for this setting
 524                </documentation>
 525             </annotation>
 526          </attribute>
 527          <attribute name="max" type="string">
 528             <annotation>
 529                <documentation>
 530                   the maximum allowed float value for this setting
 531                </documentation>
 532             </annotation>
 533          </attribute>
 534       </complexType>
 535    </element>
 536 
 537    <annotation>
 538       <appinfo>
 539          <meta.section type="since"/>
 540       </appinfo>
 541       <documentation>
 542          5.0.0
 543       </documentation>
 544    </annotation>
 545 
 546    <annotation>
 547       <appinfo>
 548          <meta.section type="examples"/>
 549       </appinfo>
 550       <documentation>
 551          &lt;pre&gt;
 552 &lt;extension point=&quot;org.openjdk.jmc.rjmx.triggerConstraints&quot;&gt;
 553       &lt;triggerConstraint
 554             class=&quot;com.example.triggers.constraints.DisablingConstraint&quot;
 555             description=&quot;This constraint will disable the rule, if the &apos;Disable rule&apos; value is true. The event data of a particular event will not matter.&quot;
 556             icon=&quot;icons/disablingconstraint.gif&quot;
 557             id=&quot;com.example.triggers.HelloWorld&quot;
 558             name=&quot;Disabling constraint&quot;&gt;
 559             &lt;boolean
 560                   id=&quot;com.example.triggers.constraint.disable.rule&quot;
 561                   name=&quot;Disable rule&quot;&gt;
 562             &lt;/boolean&gt;     
 563      &lt;/triggerConstraint&gt;
 564 &lt;/extension&gt;
 565 &lt;/pre&gt;
 566 
 567 &lt;pre&gt;
 568 package com.example.triggers.constraints;
 569 
 570 import org.openjdk.jmc.rjmx.triggers.TriggerConstraint;
 571 import org.openjdk.jmc.rjmx.triggers.internal.NotificationEvent;
 572 
 573 public class DisablingConstraint extends TriggerConstraint {
 574  public boolean isValid(NotificationEvent e) {
 575   return !getSetting(&quot;com.example.triggers.constraint.disable.rule&quot;).getBoolean();
 576  }
 577 }
 578 &lt;/pre&gt;
 579       </documentation>
 580    </annotation>
 581 
 582 
 583 
 584    <annotation>
 585       <appinfo>
 586          <meta.section type="copyright"/>
 587       </appinfo>
 588       <documentation>
 589          Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
 590       </documentation>
 591    </annotation>
 592 
 593 </schema>