001/* 002 * Copyright 2020-2026 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright 2020-2026 Ping Identity Corporation 007 * 008 * Licensed under the Apache License, Version 2.0 (the "License"); 009 * you may not use this file except in compliance with the License. 010 * You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, software 015 * distributed under the License is distributed on an "AS IS" BASIS, 016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 * See the License for the specific language governing permissions and 018 * limitations under the License. 019 */ 020/* 021 * Copyright (C) 2020-2026 Ping Identity Corporation 022 * 023 * This program is free software; you can redistribute it and/or modify 024 * it under the terms of the GNU General Public License (GPLv2 only) 025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 026 * as published by the Free Software Foundation. 027 * 028 * This program is distributed in the hope that it will be useful, 029 * but WITHOUT ANY WARRANTY; without even the implied warranty of 030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 031 * GNU General Public License for more details. 032 * 033 * You should have received a copy of the GNU General Public License 034 * along with this program; if not, see <http://www.gnu.org/licenses>. 035 */ 036package com.unboundid.ldap.sdk.unboundidds.tasks; 037 038 039 040import java.io.Serializable; 041import java.util.ArrayList; 042import java.util.Date; 043import java.util.Iterator; 044import java.util.List; 045import java.util.concurrent.TimeUnit; 046 047import com.unboundid.util.Debug; 048import com.unboundid.util.Mutable; 049import com.unboundid.util.NotNull; 050import com.unboundid.util.Nullable; 051import com.unboundid.util.ThreadSafety; 052import com.unboundid.util.ThreadSafetyLevel; 053import com.unboundid.util.args.ArgumentException; 054import com.unboundid.util.args.DurationArgument; 055 056 057 058/** 059 * This class defines a set of properties that may be used when creating a 060 * {@link CollectSupportDataTask}. 061 * <BR> 062 * <BLOCKQUOTE> 063 * <B>NOTE:</B> This class, and other classes within the 064 * {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only 065 * supported for use against Ping Identity, UnboundID, and 066 * Nokia/Alcatel-Lucent 8661 server products. These classes provide support 067 * for proprietary functionality or for external specifications that are not 068 * considered stable or mature enough to be guaranteed to work in an 069 * interoperable way with other types of LDAP servers. 070 * </BLOCKQUOTE> 071 */ 072@Mutable() 073@ThreadSafety(level=ThreadSafetyLevel.NOT_THREADSAFE) 074public final class CollectSupportDataTaskProperties 075 implements Serializable 076{ 077 /** 078 * The serial version UID for this serializable class. 079 */ 080 private static final long serialVersionUID = 1424492798476859173L; 081 082 083 084 // Indicates whether to generate an administrative alert if the task completes 085 // with an error. 086 @Nullable private Boolean alertOnError; 087 088 // Indicates whether to generate an administrative alert when the task starts 089 // running. 090 @Nullable private Boolean alertOnStart; 091 092 // Indicates whether to generate an administrative alert if the task completes 093 // successfully. 094 @Nullable private Boolean alertOnSuccess; 095 096 // Indicates whether to include binary files in the support data archive. 097 @Nullable private Boolean includeBinaryFiles; 098 099 // Indicates whether to include expensive data in the support data archive. 100 @Nullable private Boolean includeExpensiveData; 101 102 // Indicates whether to include third-party extension source code in the 103 // support data archive. 104 @Nullable private Boolean includeExtensionSource; 105 106 // Indicates whether to include a replication state dump in the support data 107 // archive. 108 @Nullable private Boolean includeReplicationStateDump; 109 110 // Indicates whether to skip the collection of Java Flight Recorder data. 111 @Nullable private Boolean noJFR; 112 113 // Indicates whether to capture information sequentially rather than in 114 // parallel. 115 @Nullable private Boolean useSequentialMode; 116 117 // The security level to use for data included in the support data archive. 118 @Nullable private CollectSupportDataSecurityLevel securityLevel; 119 120 // The time at which to end collecting log data. 121 @Nullable private Date logEndTime; 122 123 // The time at which to start collecting log data. 124 @Nullable private Date logStartTime; 125 126 // The time at which the task should start running. 127 @Nullable private Date scheduledStartTime; 128 129 // The action to take if any of the dependencies for this task complete 130 // unsuccessfully. 131 @Nullable private FailedDependencyAction failedDependencyAction; 132 133 // The number of jstacks to include in the support data archive. 134 @Nullable private Integer jstackCount; 135 136 // The amount of data in kilobytes to capture from the beginning of each log 137 // file. 138 @Nullable private Integer logFileHeadCollectionSizeKB; 139 140 // The amount of data in kilobytes to capture from the end of each log file. 141 @Nullable private Integer logFileTailCollectionSizeKB; 142 143 // The report count to use for sampled metrics. 144 @Nullable private Integer reportCount; 145 146 // The report interval in seconds to use for sampled metrics. 147 @Nullable private Integer reportIntervalSeconds; 148 149 // The minimum number of existing support data archives that should be 150 // retained. 151 @Nullable private Integer retainPreviousSupportDataArchiveCount; 152 153 // The dependency IDs of any tasks on which the collect support data task 154 // should depend. 155 @NotNull private final List<String> dependencyIDs; 156 157 // The addresses to email whenever the task completes, regardless of success 158 // or failure. 159 @NotNull private final List<String> notifyOnCompletion; 160 161 // The addresses to email if the task completes with an error. 162 @NotNull private final List<String> notifyOnError; 163 164 // The addresses to email when the task starts. 165 @NotNull private final List<String> notifyOnStart; 166 167 // The addresses to email if the task completes successfully. 168 @NotNull private final List<String> notifyOnSuccess; 169 170 // A comment to include in the support data archive. 171 @Nullable private String comment; 172 173 // The path to the encryption passphrase file. 174 @Nullable private String encryptionPassphraseFile; 175 176 // A string representation of the log duration to capture. 177 @Nullable private String logDuration; 178 179 // The path to which the support data archive should be written. 180 @Nullable private String outputPath; 181 182 // The minimum age for existing support data archives that should be retained. 183 @Nullable private String retainPreviousSupportDataArchiveAge; 184 185 // The task ID to use for the collect support data task. 186 @Nullable private String taskID; 187 188 189 190 /** 191 * Creates a new set of collect support data task properties without any of 192 * the properties set (so that the server will use default values for all of 193 * them). 194 */ 195 public CollectSupportDataTaskProperties() 196 { 197 alertOnError = null; 198 alertOnStart = null; 199 alertOnSuccess = null; 200 includeBinaryFiles = null; 201 includeExpensiveData = null; 202 includeExtensionSource = null; 203 includeReplicationStateDump = null; 204 noJFR = null; 205 useSequentialMode = null; 206 securityLevel = null; 207 logEndTime = null; 208 logStartTime = null; 209 scheduledStartTime = null; 210 failedDependencyAction = null; 211 jstackCount = null; 212 logFileHeadCollectionSizeKB = null; 213 logFileTailCollectionSizeKB = null; 214 reportCount = null; 215 reportIntervalSeconds = null; 216 retainPreviousSupportDataArchiveCount = null; 217 dependencyIDs = new ArrayList<>(5); 218 notifyOnCompletion = new ArrayList<>(5); 219 notifyOnError = new ArrayList<>(5); 220 notifyOnStart = new ArrayList<>(5); 221 notifyOnSuccess = new ArrayList<>(5); 222 comment = null; 223 encryptionPassphraseFile = null; 224 logDuration = null; 225 outputPath = null; 226 retainPreviousSupportDataArchiveAge = null; 227 taskID = null; 228 } 229 230 231 232 /** 233 * Creates a new set of collect support data task properties as a copy of the 234 * provided properties. 235 * 236 * @param properties The collect support data task properties to duplicate. 237 */ 238 public CollectSupportDataTaskProperties( 239 @NotNull final CollectSupportDataTaskProperties properties) 240 { 241 alertOnError = properties.getAlertOnError(); 242 alertOnStart = properties.getAlertOnStart(); 243 alertOnSuccess = properties.getAlertOnSuccess(); 244 includeBinaryFiles = properties.getIncludeBinaryFiles(); 245 includeExpensiveData = properties.getIncludeExpensiveData(); 246 includeExtensionSource = properties.getIncludeExtensionSource(); 247 includeReplicationStateDump = properties.getIncludeReplicationStateDump(); 248 noJFR = properties.getNoJFR(); 249 useSequentialMode = properties.getUseSequentialMode(); 250 securityLevel = properties.getSecurityLevel(); 251 logEndTime = properties.getLogEndTime(); 252 logStartTime = properties.getLogStartTime(); 253 scheduledStartTime = properties.getScheduledStartTime(); 254 failedDependencyAction = properties.getFailedDependencyAction(); 255 jstackCount = properties.getJStackCount(); 256 logFileHeadCollectionSizeKB = properties.getLogFileHeadCollectionSizeKB(); 257 logFileTailCollectionSizeKB = properties.getLogFileTailCollectionSizeKB(); 258 reportCount = properties.getReportCount(); 259 reportIntervalSeconds = properties.getReportIntervalSeconds(); 260 retainPreviousSupportDataArchiveCount = 261 properties.getRetainPreviousSupportDataArchiveCount(); 262 dependencyIDs = new ArrayList<>(properties.getDependencyIDs()); 263 notifyOnCompletion = new ArrayList<>(properties.getNotifyOnCompletion()); 264 notifyOnError = new ArrayList<>(properties.getNotifyOnError()); 265 notifyOnStart = new ArrayList<>(properties.getNotifyOnStart()); 266 notifyOnSuccess = new ArrayList<>(properties.getNotifyOnSuccess()); 267 comment = properties.getComment(); 268 encryptionPassphraseFile = properties.getEncryptionPassphraseFile(); 269 logDuration = properties.getLogDuration(); 270 outputPath = properties.getOutputPath(); 271 retainPreviousSupportDataArchiveAge = 272 properties.getRetainPreviousSupportDataArchiveAge(); 273 taskID = properties.getTaskID(); 274 } 275 276 277 278 /** 279 * Creates a new set of collect support data task properties set from the 280 * provided task instance. 281 * 282 * @param task The collect support data task instance from which the 283 * properties should be set. 284 */ 285 public CollectSupportDataTaskProperties( 286 @NotNull final CollectSupportDataTask task) 287 { 288 alertOnError = task.getAlertOnError(); 289 alertOnStart = task.getAlertOnStart(); 290 alertOnSuccess = task.getAlertOnSuccess(); 291 includeBinaryFiles = task.getIncludeBinaryFiles(); 292 includeExpensiveData = task.getIncludeExpensiveData(); 293 includeExtensionSource = task.getIncludeExtensionSource(); 294 includeReplicationStateDump = task.getIncludeReplicationStateDump(); 295 noJFR = task.getNoJFR(); 296 useSequentialMode = task.getUseSequentialMode(); 297 securityLevel = task.getSecurityLevel(); 298 logEndTime = task.getLogEndTime(); 299 logStartTime = task.getLogStartTime(); 300 scheduledStartTime = task.getScheduledStartTime(); 301 failedDependencyAction = task.getFailedDependencyAction(); 302 jstackCount = task.getJStackCount(); 303 logFileHeadCollectionSizeKB = task.getLogFileHeadCollectionSizeKB(); 304 logFileTailCollectionSizeKB = task.getLogFileTailCollectionSizeKB(); 305 reportCount = task.getReportCount(); 306 reportIntervalSeconds = task.getReportIntervalSeconds(); 307 retainPreviousSupportDataArchiveCount = 308 task.getRetainPreviousSupportDataArchiveCount(); 309 dependencyIDs = new ArrayList<>(task.getDependencyIDs()); 310 notifyOnCompletion = new ArrayList<>(task.getNotifyOnCompletionAddresses()); 311 notifyOnError = new ArrayList<>(task.getNotifyOnErrorAddresses()); 312 notifyOnStart = new ArrayList<>(task.getNotifyOnStartAddresses()); 313 notifyOnSuccess = new ArrayList<>(task.getNotifyOnSuccessAddresses()); 314 comment = task.getComment(); 315 encryptionPassphraseFile = task.getEncryptionPassphraseFile(); 316 logDuration = task.getLogDuration(); 317 outputPath = task.getOutputPath(); 318 retainPreviousSupportDataArchiveAge = 319 task.getRetainPreviousSupportDataArchiveAge(); 320 taskID = task.getTaskID(); 321 } 322 323 324 325 /** 326 * Retrieves the path on the server filesystem to which the support data 327 * archive should be written. 328 * 329 * @return The path on the server filesystem to which the support data 330 * archive should be written, or {@code null} if no value has been 331 * specified for the property. 332 */ 333 @Nullable() 334 public String getOutputPath() 335 { 336 return outputPath; 337 } 338 339 340 341 /** 342 * Specifies the path on the server filesystem to which the support data ' 343 * archive should be written. If this is provided, then the value may be 344 * one of the following: 345 * <UL> 346 * <LI>If the path refers to a file that exists, then the file will be 347 * overwritten with the new support data archive.</LI> 348 * <LI>If the path refers to a directory that exists, then the support data 349 * archive will be written into that directory with a name generated 350 * by the server.</LI> 351 * <LI>If the path refers to a file that does not exist, then its parent 352 * directory must exist, and the support data archive will be written 353 * with the specified path and name.</LI> 354 * </UL> 355 * 356 * @param outputPath The path on the server filesystem to which the support 357 * data archive should be written. It may be {@code null} 358 * if the server should choose the path and name for the 359 * output file. 360 */ 361 public void setOutputPath(@Nullable final String outputPath) 362 { 363 this.outputPath = outputPath; 364 } 365 366 367 368 /** 369 * Retrieves the path on the server filesystem to a file that contains the 370 * passphrase to use to encrypt the support data archive. 371 * 372 * @return The path on the server filesystem to a file that contains the 373 * passphrase to use to encrypt the support data archive, or 374 * {@code null} if no value has been specified for the property, and 375 * the support data archive should not be encrypted. 376 */ 377 @Nullable() 378 public String getEncryptionPassphraseFile() 379 { 380 return encryptionPassphraseFile; 381 } 382 383 384 385 /** 386 * Specifies the path on the server filesystem to a file that contains the 387 * passphrase to use to encrypt the support data archive. If this is 388 * provided, then this must refer to a file that exists and that contains 389 * exactly one line whose entire content is the desired encryption passphrase. 390 * 391 * @param encryptionPassphraseFile The path on the server filesystem to a 392 * file that contains the passphrase to use 393 * to encrypt the support data archive. It 394 * may be {@code null} if the support data 395 * archive should not be encrypted. 396 */ 397 public void setEncryptionPassphraseFile( 398 @Nullable final String encryptionPassphraseFile) 399 { 400 this.encryptionPassphraseFile = encryptionPassphraseFile; 401 } 402 403 404 405 /** 406 * Retrieves the value of a flag that indicates whether the support data 407 * archive may include data that is potentially expensive to collect and 408 * could affect the performance or responsiveness of the server. 409 * 410 * @return The value of a flag that indicates whether the support data 411 * archive may include data that is potentially expensive to collect, 412 * or {@code null} if the property should not be specified when the 413 * task is created (in which case the server will use a default 414 * behavior of excluding expensive data). 415 */ 416 @Nullable() 417 public Boolean getIncludeExpensiveData() 418 { 419 return includeExpensiveData; 420 } 421 422 423 424 /** 425 * Specifies the value of a flag that indicates whether the support data 426 * archive may include data that is potentially expensive to collect and could 427 * affect the performance or responsiveness of the server. 428 * 429 * @param includeExpensiveData The value of a flag that indicates whether 430 * the support data archive may include data 431 * that is potentially expensive to collect. It 432 * may be {@code null} if the flag should not be 433 * specified when the task is created (in which 434 * case the server will use a default behavior 435 * of excluding expensive data). 436 */ 437 public void setIncludeExpensiveData( 438 @Nullable final Boolean includeExpensiveData) 439 { 440 this.includeExpensiveData = includeExpensiveData; 441 } 442 443 444 445 /** 446 * Retrieves the value of a flag that indicates whether the support data 447 * archive may include a replication state dump, which may be several 448 * megabytes in size. 449 * 450 * @return The value of a flag that indicates whether the support data 451 * archive may include a replication state dump, or {@code null} if 452 * the property should not be specified when the task is created (in 453 * which case the server will use a default behavior of excluding the 454 * state dump). 455 */ 456 @Nullable() 457 public Boolean getIncludeReplicationStateDump() 458 { 459 return includeReplicationStateDump; 460 } 461 462 463 464 /** 465 * Specifies the value of a flag that indicates whether the support data 466 * archive may include a replication state dump, which may be several 467 * megabytes in size. 468 * 469 * @param includeReplicationStateDump The value of a flag that indicates 470 * whether the support data archive may 471 * include a replication state dump. It 472 * may be {@code null} if the flag should 473 * not be specified when the task is 474 * created (in which case the server will 475 * use a default behavior of excluding 476 * the state dump). 477 */ 478 public void setIncludeReplicationStateDump( 479 @Nullable final Boolean includeReplicationStateDump) 480 { 481 this.includeReplicationStateDump = includeReplicationStateDump; 482 } 483 484 485 486 /** 487 * Retrieves the value of a flag that indicates whether the support data 488 * archive may include binary files. 489 * 490 * @return The value of a flag that indicates whether the support data 491 * archive may include binary files, or {@code null} if the property 492 * should not be specified when the task is created (in which case 493 * the server will use a default behavior of excluding binary files). 494 */ 495 @Nullable() 496 public Boolean getIncludeBinaryFiles() 497 { 498 return includeBinaryFiles; 499 } 500 501 502 503 /** 504 * Specifies the value of a flag that that indicates whether the support data 505 * archive may include binary files. 506 * 507 * @param includeBinaryFiles The value of a flag that indicates whether the 508 * support data archive may include binary files. 509 * It may be {@code null} if the property should 510 * not be specified when the task is created (in 511 * which case the server will use a default 512 * behavior of excluding binary files). 513 */ 514 public void setIncludeBinaryFiles(@Nullable final Boolean includeBinaryFiles) 515 { 516 this.includeBinaryFiles = includeBinaryFiles; 517 } 518 519 520 521 /** 522 * Retrieves the value of a flag that indicates whether the support data 523 * archive should include source code (if available) for any third-party 524 * extensions installed in the server. 525 * 526 * @return The value of a flag that indicates whether the support data 527 * archive should include source code (if available) for any 528 * third-party extensions installed in the server, or {@code null} if 529 * the property should not be specified when the task is created (in 530 * which case the server will use a default behavior of excluding 531 * extension source code). 532 */ 533 @Nullable() 534 public Boolean getIncludeExtensionSource() 535 { 536 return includeExtensionSource; 537 } 538 539 540 541 /** 542 * Specifies the value of a flag that indicates whether the support data 543 * archive should include source code (if available) for any third-party 544 * extensions installed in the server. 545 * 546 * @param includeExtensionSource The value of a flag that indicates whether 547 * the support data archive should include 548 * source code (if available) for any 549 * third-party extensions in the server. It 550 * may be {@code null} if the property should 551 * not be specified when the task is 552 * created (in which case the server will use 553 * a default behavior of excluding extension 554 * source code). 555 */ 556 public void setIncludeExtensionSource( 557 @Nullable final Boolean includeExtensionSource) 558 { 559 this.includeExtensionSource = includeExtensionSource; 560 } 561 562 563 564 /** 565 * Retrieves the value of a flag that indicates whether the server should 566 * collect items for the support data archive in sequential mode rather than 567 * in parallel. Collecting data in sequential mode may reduce the amount of 568 * memory consumed during the collection process, but it will take longer to 569 * complete. 570 * 571 * @return The value of a flag that indicates whether the server should 572 * collect items for the support data archive in sequential mode 573 * rather than in parallel, or {@code null} if the property should 574 * not be specified when the task is created (in which case the 575 * server will default to capturing data in parallel). 576 */ 577 @Nullable() 578 public Boolean getUseSequentialMode() 579 { 580 return useSequentialMode; 581 } 582 583 584 585 /** 586 * Specifies the value of a flag that indicates whether the server should 587 * collect items for the support data archive in sequential mode rather than 588 * in parallel. Collecting data in sequential mode may reduce the amount of 589 * memory consumed during the collection process, but it will take longer to 590 * complete. 591 * 592 * @param useSequentialMode The value of a flag that indicates whether the 593 * server should collect items for the support data 594 * archive in sequential mode rather than in 595 * parallel. It may be {@code null} if the 596 * property should not be specified when the task 597 * is created (in which case the server will 598 * default to capturing data in parallel). 599 */ 600 public void setUseSequentialMode(@Nullable final Boolean useSequentialMode) 601 { 602 this.useSequentialMode = useSequentialMode; 603 } 604 605 606 607 /** 608 * Retrieves the value of a flag that indicates whether the server should skip 609 * the collection of Java Flight Recorder (JFR) data. 610 * 611 * @return The value of a flag that indicates whether the server should skip 612 * the collection of Java Flight Recorder data, or {@code null} if 613 * the property should not be specified when the task is created (in 614 * which case the server will use a default behavior of collecting 615 * JFR data if a recording is available). 616 */ 617 @Nullable() 618 public Boolean getNoJFR() 619 { 620 return noJFR; 621 } 622 623 624 625 /** 626 * Specifies the value of a flag that indicates whether the server should skip 627 * the collection of Java Flight Recorder (JFR) data. This may be useful to 628 * avoid the additional time and space needed to include a JFR recording 629 * sample in the support data archive. 630 * 631 * @param noJFR The value of a flag that indicates whether the server should 632 * skip the collection of Java Flight Recorder data. It may be 633 * {@code null} if the property should not be specified when 634 * the task is created (in which case the server will use a 635 * default behavior of collecting JFR data if a recording is 636 * available). 637 */ 638 public void setNoJFR(@Nullable final Boolean noJFR) 639 { 640 this.noJFR = noJFR; 641 } 642 643 644 645 /** 646 * Retrieves the security level that should be used to indicate which data 647 * should be obscured, redacted, or omitted from the support data archive. 648 * 649 * @return The security level that should be used when creating the support 650 * data archive, or {@code null} if the property should not be 651 * specified when the task is created (in which case the server will 652 * use a default security level). 653 */ 654 @Nullable() 655 public CollectSupportDataSecurityLevel getSecurityLevel() 656 { 657 return securityLevel; 658 } 659 660 661 662 /** 663 * Specifies the security level that should be used to indicate which data 664 * should be obscured, redacted, or omitted from the support data archive. 665 * 666 * @param securityLevel The security level that should be used when creating 667 * the support data archive. It may be {@code null} if 668 * the property should not be specified when the task 669 * is created (in which case the server will use a 670 * default security level). 671 */ 672 public void setSecurityLevel( 673 @Nullable final CollectSupportDataSecurityLevel securityLevel) 674 675 { 676 this.securityLevel = securityLevel; 677 } 678 679 680 681 /** 682 * Retrieves the number of intervals that should be captured from tools that 683 * use interval-based sampling (e.g., vmstat, iostat, mpstat, etc.). 684 * 685 * @return The number of intervals that should be captured from tools that 686 * use interval-based sampling, or {@code null} if the property 687 * should not be specified when the task is created (in which case 688 * the server will use a default report count). 689 */ 690 @Nullable() 691 public Integer getReportCount() 692 { 693 return reportCount; 694 } 695 696 697 698 /** 699 * Specifies the number of intervals that should be captured form tools that 700 * use interval-based sampling (e.g., vmstat, iostat, mpstat, etc.). 701 * 702 * @param reportCount The number of intervals that should be captured from 703 * tools that use interval-based sampling. The value 704 * must not be negative, but it may be zero to indicate 705 * that no intervals should be captured. It may be 706 * {@code null} if the property should not be specified 707 * when the task is created (in which case the server 708 * will use a default report count). 709 */ 710 public void setReportCount(@Nullable final Integer reportCount) 711 { 712 this.reportCount = reportCount; 713 } 714 715 716 717 /** 718 * Retrieves the interval duration in seconds that should be used for tools 719 * that use interval-based sampling (e.g., vmstat, iostat, mpstat, etc.). 720 * 721 * @return The interval duration in seconds that should be used for tools 722 * that use interval-based sampling, or {@code null} if the property 723 * should not be specified when the task is created (in which case 724 * the server will use a default report interval). 725 */ 726 @Nullable() 727 public Integer getReportIntervalSeconds() 728 { 729 return reportIntervalSeconds; 730 } 731 732 733 734 /** 735 * Specifies the interval duration in seconds that should be used for tools 736 * that use interval-based sampling (e.g., vmstat, iostat, mpstat, etc.). 737 * 738 * @param reportIntervalSeconds The interval duration in seconds that should 739 * be used for tools that use interval-based 740 * sampling. The value must be greater than or 741 * equal to one. It may be {@code null} if the 742 * property should not be specified when the 743 * task is created (in which case the server 744 * will use a default report count). 745 */ 746 public void setReportIntervalSeconds( 747 @Nullable final Integer reportIntervalSeconds) 748 { 749 this.reportIntervalSeconds = reportIntervalSeconds; 750 } 751 752 753 754 /** 755 * Retrieves the number of times that the jstack utility should be invoked to 756 * obtain stack traces from all threads in the server. 757 * 758 * @return The number of times that the jstack utility should be invoked to 759 * obtain stack traces from all threads in the server, or 760 * {@code null} if the property should not be specified when the task 761 * is created (in which case the server will use a default count). 762 */ 763 @Nullable() 764 public Integer getJStackCount() 765 { 766 return jstackCount; 767 } 768 769 770 771 /** 772 * Specifies the number of times that the jstack utility should be invoked to 773 * obtain stack traces from all threads in the server. 774 * 775 * @param jstackCount The number of times that the jstack utility should be 776 * invoked to obtain stack traces from all threads in the 777 * server. The value must not be negative, but it may be 778 * zero to indicate that the jstack utility should not be 779 * invoked. It may be {@code null} if the property 780 * should not be specified when the task is created (in 781 * which case the server will use a default count). 782 */ 783 public void setJStackCount(@Nullable final Integer jstackCount) 784 { 785 this.jstackCount = jstackCount; 786 } 787 788 789 790 /** 791 * Retrieves the start time for the range of log messages to include in the 792 * support data archive. 793 * 794 * @return The start time for the range of log messages to include in the 795 * support data archive, or {@code null} if no log start time has 796 * been specified. 797 */ 798 @Nullable() 799 public Date getLogStartTime() 800 { 801 return logStartTime; 802 } 803 804 805 806 /** 807 * Retrieves the end time for the range of log messages to include in the 808 * support data archive. 809 * 810 * @return The end time for the range of log messages to include in the 811 * support data archive, or {@code null} if no log end time has 812 * been specified. 813 */ 814 @Nullable() 815 public Date getLogEndTime() 816 { 817 return logEndTime; 818 } 819 820 821 822 /** 823 * Specifies the time range for log messages to include in the support data 824 * archive. If a log time range is to be used, then the start time must be 825 * specified, and the end time may optionally be specified. A log time range 826 * should not be used in conjunction with a log duration or with a log head 827 * or tail size. 828 * 829 * @param logStartTime The start time for the range of log messages to 830 * include in the support data archive. It may be 831 * {@code null} if no log time range should be used. 832 * @param logEndTime The end time for the range of log messages to include 833 * in the support data archive. It may be {@code null} 834 * if no log time range should be used, or if the time 835 * range should only be specified using a start time 836 * without an end time. 837 */ 838 public void setLogTimeRange(@Nullable final Date logStartTime, 839 @Nullable final Date logEndTime) 840 { 841 this.logStartTime = logStartTime; 842 this.logEndTime = logEndTime; 843 } 844 845 846 847 /** 848 * Retrieves a string representation of the duration (up until the time that 849 * the collect support data task is invoked) of log content that should be 850 * included in the support data archive. 851 * 852 * @return A string representation of the duration of log content that should 853 * be included in the support data archive, or {@code null} if the 854 * property should not be specified when the task is created (in 855 * which case the server will use a default behavior for selecting 856 * the amount of log content to include). 857 */ 858 @Nullable() 859 public String getLogDuration() 860 { 861 return logDuration; 862 } 863 864 865 866 /** 867 * Retrieves a parsed value of the log duration in milliseconds. 868 * 869 * @return A parsed value of the log duration in milliseconds or {@code null} 870 * if no log duration is set. 871 * 872 * @throws TaskException If the log duration value cannot be parsed as a 873 * valid duration. 874 */ 875 @Nullable() 876 public Long getLogDurationMillis() 877 throws TaskException 878 { 879 if (logDuration == null) 880 { 881 return null; 882 } 883 884 try 885 { 886 return DurationArgument.parseDuration(logDuration, TimeUnit.MILLISECONDS); 887 } 888 catch (final ArgumentException e) 889 { 890 Debug.debugException(e); 891 throw new TaskException(e.getMessage(), e); 892 } 893 } 894 895 896 897 /** 898 * Specifies the string representation of the duration (up until the time that 899 * the collect support data task is invoked) of log content that should be 900 * included in the support data archive. 901 * <BR><BR> 902 * The string representation of the duration should be specified as 903 * an integer followed by a time unit, where the unit may be one of 904 * millisecond, second, minute, hour, day, or week (or one of their plurals). 905 * For example, "5 minutes" or "1 hour". 906 * 907 * @param logDuration The string representation of the duration of log 908 * content that should be included in the support data 909 * archive. It may be {@code null} if the property 910 * should not be specified when the task is created (in 911 * which case the server will determine an appropriate 912 * amount of log content to include). 913 * 914 * @throws TaskException If the provided string representation cannot be 915 * parsed as a valid duration. 916 */ 917 public void setLogDuration(@Nullable final String logDuration) 918 throws TaskException 919 { 920 if (logDuration == null) 921 { 922 this.logDuration = null; 923 } 924 else 925 { 926 try 927 { 928 DurationArgument.parseDuration(logDuration, TimeUnit.MILLISECONDS); 929 this.logDuration = logDuration; 930 } 931 catch (final ArgumentException e) 932 { 933 Debug.debugException(e); 934 throw new TaskException(e.getMessage(), e); 935 } 936 } 937 } 938 939 940 941 /** 942 * Specifies the duration in milliseconds (up until the time that the collect 943 * support data task is invoked) of log content that should be included in the 944 * support data archive. 945 * 946 * @param logDurationMillis The duration in milliseconds of log content that 947 * should be included in the support data archive. 948 * The value must be greater than zero. It may be 949 * {@code null} if the property should not be 950 * specified when the task is created (in which 951 * case the server will determine an appropriate 952 * amount of log content to include). 953 */ 954 public void setLogDurationMillis(@Nullable final Long logDurationMillis) 955 { 956 if (logDurationMillis == null) 957 { 958 logDuration = null; 959 } 960 else 961 { 962 logDuration = DurationArgument.nanosToDuration( 963 TimeUnit.MILLISECONDS.toNanos(logDurationMillis)); 964 } 965 } 966 967 968 969 /** 970 * Retrieves the amount of data in kilobytes to capture from the beginning of 971 * each log file that should be included in the support data archive. 972 * 973 * @return The amount of data in kilobytes to capture from the beginning of 974 * each log file that should be included in the support data archive, 975 * or {@code null} if the property should not be specified when the 976 * task is created (in which case the server will determine an 977 * appropriate amount of log content to include). 978 */ 979 @Nullable() 980 public Integer getLogFileHeadCollectionSizeKB() 981 { 982 return logFileHeadCollectionSizeKB; 983 } 984 985 986 987 /** 988 * Specifies the amount of data in kilobytes to capture from the beginning of 989 * each log file that should be included in the support data archive. 990 * 991 * @param logFileHeadCollectionSizeKB The amount of data in kilobytes to 992 * capture from the beginning of each log 993 * file that should be included in the 994 * support data archive. This may be 995 * {@code null} if the property should 996 * not be specified when the task is 997 * created (in which case the server will 998 * determine an appropriate amount of log 999 * content to include). 1000 */ 1001 public void setLogFileHeadCollectionSizeKB( 1002 @Nullable final Integer logFileHeadCollectionSizeKB) 1003 { 1004 this.logFileHeadCollectionSizeKB = logFileHeadCollectionSizeKB; 1005 } 1006 1007 1008 1009 /** 1010 * Retrieves the amount of data in kilobytes to capture from the end of each 1011 * log file that should be included in the support data archive. 1012 * 1013 * @return The amount of data in kilobytes to capture from the end of each 1014 * log file that should be included in the support data archive, or 1015 * {@code null} if the property should not be specified when the task 1016 * is created (in which case the server will determine an 1017 * appropriate amount of log content to include). 1018 */ 1019 @Nullable() 1020 public Integer getLogFileTailCollectionSizeKB() 1021 { 1022 return logFileTailCollectionSizeKB; 1023 } 1024 1025 1026 1027 /** 1028 * Specifies the amount of data in kilobytes to capture from the end of each 1029 * log file that should be included in the support data archive. 1030 * 1031 * @param logFileTailCollectionSizeKB The amount of data in kilobytes to 1032 * capture from the end of each log file 1033 * that should be included in the 1034 * support data archive. This may be 1035 * {@code null} if the property should 1036 * not be specified when the task is 1037 * created (in which case the server will 1038 * determine an appropriate amount of log 1039 * content to include). 1040 */ 1041 public void setLogFileTailCollectionSizeKB( 1042 @Nullable final Integer logFileTailCollectionSizeKB) 1043 { 1044 this.logFileTailCollectionSizeKB = logFileTailCollectionSizeKB; 1045 } 1046 1047 1048 1049 /** 1050 * Retrieves an additional comment that should be included in the support data 1051 * archive. 1052 * 1053 * @return An additional comment that should be included in the support data 1054 * archive, or {@code null} if no comment should be included. 1055 */ 1056 @Nullable() 1057 public String getComment() 1058 { 1059 return comment; 1060 } 1061 1062 1063 1064 /** 1065 * Specifies an additional comment that should be included in the support data 1066 * archive. 1067 * 1068 * @param comment An additional comment that should be included in the 1069 * support data archive. It may be {@code null} if no 1070 * additional comment should be included. 1071 */ 1072 public void setComment(@Nullable final String comment) 1073 { 1074 this.comment = comment; 1075 } 1076 1077 1078 1079 /** 1080 * Retrieves the minimum number of existing support data archives that should 1081 * be retained. 1082 * 1083 * @return The minimum number of existing support data archives that should 1084 * be retained, or {@code null} if there is no minimum retain count. 1085 */ 1086 @Nullable() 1087 public Integer getRetainPreviousSupportDataArchiveCount() 1088 { 1089 return retainPreviousSupportDataArchiveCount; 1090 } 1091 1092 1093 1094 /** 1095 * Specifies the minimum number of existing support data archives that should 1096 * be retained. 1097 * <BR><BR> 1098 * Note that if an output path is specified, then a retain count or retain age 1099 * may only be used if that output path specifies a directory rather than a 1100 * file, so that the file name will be generated by the server, and only 1101 * archive files in that directory with names that conform to the 1102 * server-generated pattern may be removed. 1103 * <BR><BR> 1104 * If neither a retain count nor a retain age is specified, then no existing 1105 * support data archives will be removed. If both are specified, then any 1106 * existing archive that is outside the criteria for either will be removed. 1107 * 1108 * @param retainPreviousSupportDataArchiveCount 1109 * The minimum number of existing support data archives that 1110 * should be retained. A value of zero indicates that only the 1111 * new support data archive should be retained, and any other 1112 * preexisting archives may be removed. It may be {@code null} 1113 * if only the age of existing archives should be considered (if 1114 * a retain age is specified), or if no existing support data 1115 * archives should be removed (if no retain age is specified). 1116 */ 1117 public void setRetainPreviousSupportDataArchiveCount( 1118 @Nullable final Integer retainPreviousSupportDataArchiveCount) 1119 { 1120 this.retainPreviousSupportDataArchiveCount = 1121 retainPreviousSupportDataArchiveCount; 1122 } 1123 1124 1125 1126 /** 1127 * Retrieves the minimum age of existing support data archives that should be 1128 * retained. 1129 * 1130 * @return The minimum age of existing support data archives that should 1131 * be retained, or {@code null} if there is no minimum retain age. 1132 */ 1133 @Nullable() 1134 public String getRetainPreviousSupportDataArchiveAge() 1135 { 1136 return retainPreviousSupportDataArchiveAge; 1137 } 1138 1139 1140 1141 /** 1142 * Retrieves a parsed value of the retain previous support data archive age in 1143 * milliseconds. 1144 * 1145 * @return A parsed value of the retain previous support data archive age in 1146 * milliseconds or {@code null} if no retain age is set. 1147 * 1148 * @throws TaskException If the retain age value cannot be parsed as a valid 1149 * duration. 1150 */ 1151 @Nullable() 1152 public Long getRetainPreviousSupportDataArchiveAgeMillis() 1153 throws TaskException 1154 { 1155 if (retainPreviousSupportDataArchiveAge == null) 1156 { 1157 return null; 1158 } 1159 1160 try 1161 { 1162 return DurationArgument.parseDuration( 1163 retainPreviousSupportDataArchiveAge, TimeUnit.MILLISECONDS); 1164 } 1165 catch (final ArgumentException e) 1166 { 1167 Debug.debugException(e); 1168 throw new TaskException(e.getMessage(), e); 1169 } 1170 } 1171 1172 1173 1174 /** 1175 * Specifies the minimum age of existing support data archives that should be 1176 * retained. 1177 * <BR><BR> 1178 * The string representation of the duration should be specified as an integer 1179 * followed by a time unit, where the unit may be one of millisecond, second, 1180 * minute, hour, day, or week (or one of their plurals). For example, "5 1181 * minutes" or "1 hour". 1182 * <BR><BR> 1183 * Note that if an output path is specified, then a retain count or retain age 1184 * may only be used if that output path specifies a directory rather than a 1185 * file, so that the file name will be generated by the server, and only 1186 * archive files in that directory with names that conform to the 1187 * server-generated pattern may be removed. 1188 * <BR><BR> 1189 * If neither a retain count nor a retain age is specified, then no existing 1190 * support data archives will be removed. If both are specified, then any 1191 * existing archive that is outside the criteria for either will be removed. 1192 * 1193 * @param retainPreviousSupportDataArchiveAge 1194 * The minimum age of existing support data archives that 1195 * should be retained. Any existing support data archives that 1196 * are older than this may be removed. It may be {@code null} 1197 * if only the number of existing archives should be considered 1198 * (if a retain count is specified), or if no existing support 1199 * data archives should be removed (if no retain count is 1200 * specified). 1201 * 1202 * @throws TaskException If the provided string representation cannot be 1203 * parsed as a valid duration. 1204 */ 1205 public void setRetainPreviousSupportDataArchiveAge( 1206 @Nullable final String retainPreviousSupportDataArchiveAge) 1207 throws TaskException 1208 { 1209 if (retainPreviousSupportDataArchiveAge == null) 1210 { 1211 this.retainPreviousSupportDataArchiveAge = null; 1212 } 1213 else 1214 { 1215 try 1216 { 1217 DurationArgument.parseDuration(retainPreviousSupportDataArchiveAge, 1218 TimeUnit.MILLISECONDS); 1219 this.retainPreviousSupportDataArchiveAge = 1220 retainPreviousSupportDataArchiveAge; 1221 } 1222 catch (final ArgumentException e) 1223 { 1224 Debug.debugException(e); 1225 throw new TaskException(e.getMessage(), e); 1226 } 1227 } 1228 } 1229 1230 1231 1232 /** 1233 * Specifies the minimum age in milliseconds of existing support data 1234 * archives that should be retained. 1235 * <BR><BR> 1236 * Note that if an output path is specified, then a retain count or retain age 1237 * may only be used if that output path specifies a directory rather than a 1238 * file, so that the file name will be generated by the server, and only 1239 * archive files in that directory with names that conform to the 1240 * server-generated pattern may be removed. 1241 * <BR><BR> 1242 * If neither a retain count nor a retain age is specified, then no existing 1243 * support data archives will be removed. If both are specified, then any 1244 * existing archive that is outside the criteria for either will be removed. 1245 * 1246 * @param retainPreviousSupportDataArchiveAgeMillis 1247 * The minimum age in milliseconds of existing support data 1248 * archives that should be retained. Any existing support data 1249 * archives that are older than this may be removed. It may be 1250 * {@code null} if only the number of existing archives should be 1251 * considered (if a retain count is specified), or if no existing 1252 * support data archives should be removed (if no retain count is 1253 * specified). 1254 */ 1255 public void setRetainPreviousSupportDataArchiveAgeMillis( 1256 @Nullable final Long retainPreviousSupportDataArchiveAgeMillis) 1257 { 1258 if (retainPreviousSupportDataArchiveAgeMillis == null) 1259 { 1260 retainPreviousSupportDataArchiveAge = null; 1261 } 1262 else 1263 { 1264 retainPreviousSupportDataArchiveAge = DurationArgument.nanosToDuration( 1265 TimeUnit.MILLISECONDS.toNanos( 1266 retainPreviousSupportDataArchiveAgeMillis)); 1267 } 1268 } 1269 1270 1271 1272 /** 1273 * Retrieves the task ID that should be used for the task. 1274 * 1275 * @return The task ID that should be used for the task, or {@code null} if a 1276 * random UUID should be generated for use as the task ID. 1277 */ 1278 @Nullable() 1279 public String getTaskID() 1280 { 1281 return taskID; 1282 } 1283 1284 1285 1286 /** 1287 *Specifies the task ID that should be used for the task. 1288 * 1289 * @param taskID The task ID that should be used for the task. It may be 1290 * {@code null} if a random UUID should be generated for use 1291 * as the task ID. 1292 */ 1293 public void setTaskID(@Nullable final String taskID) 1294 { 1295 this.taskID = taskID; 1296 } 1297 1298 1299 1300 /** 1301 * Retrieves the earliest time that the task should be eligible to start 1302 * running. 1303 * 1304 * @return The earliest time that the task should be eligible to start 1305 * running, or {@code null} if the task should be eligible to start 1306 * immediately (or as soon as all of its dependencies have been 1307 * satisfied). 1308 */ 1309 @Nullable() 1310 public Date getScheduledStartTime() 1311 { 1312 return scheduledStartTime; 1313 } 1314 1315 1316 1317 /** 1318 * Specifies the earliest time that the task should be eligible to start 1319 * running. 1320 * 1321 * @param scheduledStartTime The earliest time that the task should be 1322 * eligible to start running. It may be 1323 * {@code null} if the task should be eligible to 1324 * start immediately (or as soon as all of its 1325 * dependencies have been satisfied). 1326 */ 1327 public void setScheduledStartTime(@Nullable final Date scheduledStartTime) 1328 { 1329 this.scheduledStartTime = scheduledStartTime; 1330 } 1331 1332 1333 1334 /** 1335 * Retrieves the task IDs for any tasks that must complete before the new 1336 * collect support data task will be eligible to start running. 1337 * 1338 * @return The task IDs for any tasks that must complete before the new 1339 * collect support data task will be eligible to start running, or 1340 * an empty list if the new task should not depend on any other 1341 * tasks. 1342 */ 1343 @NotNull() 1344 public List<String> getDependencyIDs() 1345 { 1346 return new ArrayList<>(dependencyIDs); 1347 } 1348 1349 1350 1351 /** 1352 * Specifies the task IDs for any tasks that must complete before the new 1353 * collect support data task will be eligible to start running. 1354 * 1355 * @param dependencyIDs The task IDs for any tasks that must complete before 1356 * the new collect support data task will be eligible 1357 * to start running. It may be {@code null} or empty 1358 * if the new task should not depend on any other 1359 * tasks. 1360 */ 1361 public void setDependencyIDs(@Nullable final List<String> dependencyIDs) 1362 { 1363 this.dependencyIDs.clear(); 1364 if (dependencyIDs != null) 1365 { 1366 this.dependencyIDs.addAll(dependencyIDs); 1367 } 1368 } 1369 1370 1371 1372 /** 1373 * Retrieves the action that the server should take if any of the tasks on 1374 * which the new task depends did not complete successfully. 1375 * 1376 * @return The action that the server should take if any of the tasks on 1377 * which the new task depends did not complete successfully, or 1378 * {@code null} if the property should not be specified when creating 1379 * the task (and the server should choose an appropriate failed 1380 * dependency action). 1381 */ 1382 @Nullable() 1383 public FailedDependencyAction getFailedDependencyAction() 1384 { 1385 return failedDependencyAction; 1386 } 1387 1388 1389 1390 /** 1391 * Specifies the action that the server should take if any of the tasks on 1392 * which the new task depends did not complete successfully. 1393 * 1394 * @param failedDependencyAction The action that the server should take if 1395 * any of the tasks on which the new task 1396 * depends did not complete successfully. It 1397 * may be {@code null} if the property should 1398 * not be specified when creating the task 1399 * (and the server should choose an 1400 * appropriate failed dependency action). 1401 */ 1402 public void setFailedDependencyAction( 1403 @Nullable final FailedDependencyAction failedDependencyAction) 1404 { 1405 this.failedDependencyAction = failedDependencyAction; 1406 } 1407 1408 1409 1410 /** 1411 * Retrieves the addresses to email whenever the task starts running. 1412 * 1413 * @return The addresses to email whenever the task starts running, or an 1414 * empty list if no email notification should be sent when starting 1415 * the task. 1416 */ 1417 @NotNull() 1418 public List<String> getNotifyOnStart() 1419 { 1420 return new ArrayList<>(notifyOnStart); 1421 } 1422 1423 1424 1425 /** 1426 * Specifies the addresses to email whenever the task starts running. 1427 * 1428 * @param notifyOnStart The addresses to email whenever the task starts 1429 * running. It amy be {@code null} or empty if no 1430 * email notification should be sent when starting the 1431 * task. 1432 */ 1433 public void setNotifyOnStart(@Nullable final List<String> notifyOnStart) 1434 { 1435 this.notifyOnStart.clear(); 1436 if (notifyOnStart != null) 1437 { 1438 this.notifyOnStart.addAll(notifyOnStart); 1439 } 1440 } 1441 1442 1443 1444 /** 1445 * Retrieves the addresses to email whenever the task completes, regardless of 1446 * its success or failure. 1447 * 1448 * @return The addresses to email whenever the task completes, or an 1449 * empty list if no email notification should be sent when the task 1450 * completes. 1451 */ 1452 @NotNull() 1453 public List<String> getNotifyOnCompletion() 1454 { 1455 return new ArrayList<>(notifyOnCompletion); 1456 } 1457 1458 1459 1460 /** 1461 * Specifies the addresses to email whenever the task completes, regardless of 1462 * its success or failure. 1463 * 1464 * @param notifyOnCompletion The addresses to email whenever the task 1465 * completes. It amy be {@code null} or empty if 1466 * no email notification should be sent when the 1467 * task completes. 1468 */ 1469 public void setNotifyOnCompletion( 1470 @Nullable final List<String> notifyOnCompletion) 1471 { 1472 this.notifyOnCompletion.clear(); 1473 if (notifyOnCompletion != null) 1474 { 1475 this.notifyOnCompletion.addAll(notifyOnCompletion); 1476 } 1477 } 1478 1479 1480 1481 /** 1482 * Retrieves the addresses to email if the task completes successfully. 1483 * 1484 * @return The addresses to email if the task completes successfully, or an 1485 * empty list if no email notification should be sent on successful 1486 * completion. 1487 */ 1488 @NotNull() 1489 public List<String> getNotifyOnSuccess() 1490 { 1491 return new ArrayList<>(notifyOnSuccess); 1492 } 1493 1494 1495 1496 /** 1497 * Specifies the addresses to email if the task completes successfully. 1498 * 1499 * @param notifyOnSuccess The addresses to email if the task completes 1500 * successfully. It amy be {@code null} or empty if 1501 * no email notification should be sent on 1502 * successful completion. 1503 */ 1504 public void setNotifyOnSuccess(@Nullable final List<String> notifyOnSuccess) 1505 { 1506 this.notifyOnSuccess.clear(); 1507 if (notifyOnSuccess != null) 1508 { 1509 this.notifyOnSuccess.addAll(notifyOnSuccess); 1510 } 1511 } 1512 1513 1514 1515 /** 1516 * Retrieves the addresses to email if the task does not complete 1517 * successfully. 1518 * 1519 * @return The addresses to email if the task does not complete successfully, 1520 * or an empty list if no email notification should be sent on an 1521 * unsuccessful completion. 1522 */ 1523 @NotNull() 1524 public List<String> getNotifyOnError() 1525 { 1526 return new ArrayList<>(notifyOnError); 1527 } 1528 1529 1530 1531 /** 1532 * Specifies the addresses to email if the task does not complete 1533 * successfully. 1534 * 1535 * @param notifyOnError The addresses to email if the task does not complete 1536 * successfully. It amy be {@code null} or empty if 1537 * no email notification should be sent on an 1538 * unsuccessful completion. 1539 */ 1540 public void setNotifyOnError(@Nullable final List<String> notifyOnError) 1541 { 1542 this.notifyOnError.clear(); 1543 if (notifyOnError != null) 1544 { 1545 this.notifyOnError.addAll(notifyOnError); 1546 } 1547 } 1548 1549 1550 1551 /** 1552 * Retrieves the flag that indicates whether the server should send an 1553 * administrative alert notification when the task starts running. 1554 * 1555 * @return The flag that indicates whether the server should send an 1556 * administrative alert notification when the task starts running, 1557 * or {@code null} if the property should not be specified when the 1558 * task is created (and the server will default to not sending any 1559 * alert). 1560 */ 1561 @Nullable() 1562 public Boolean getAlertOnStart() 1563 { 1564 return alertOnStart; 1565 } 1566 1567 1568 1569 /** 1570 * Specifies the flag that indicates whether the server should send an 1571 * administrative alert notification when the task starts running. 1572 * 1573 * @param alertOnStart The flag that indicates whether the server should 1574 * send an administrative alert notification when the 1575 * task starts running, It may be {@code null} if the 1576 * property should not be specified when the task is 1577 * created (and the server will default to not sending 1578 * any alert). 1579 */ 1580 public void setAlertOnStart(@Nullable final Boolean alertOnStart) 1581 { 1582 this.alertOnStart = alertOnStart; 1583 } 1584 1585 1586 1587 /** 1588 * Retrieves the flag that indicates whether the server should send an 1589 * administrative alert notification if the task completes successfully. 1590 * 1591 * @return The flag that indicates whether the server should send an 1592 * administrative alert notification if the task completes 1593 * successfully, or {@code null} if the property should not be 1594 * specified when the task is created (and the server will default to 1595 * not sending any alert). 1596 */ 1597 @Nullable() 1598 public Boolean getAlertOnSuccess() 1599 { 1600 return alertOnSuccess; 1601 } 1602 1603 1604 1605 /** 1606 * Specifies the flag that indicates whether the server should send an 1607 * administrative alert notification if the task completes successfully. 1608 * 1609 * @param alertOnSuccess The flag that indicates whether the server should 1610 * send an administrative alert notification if the 1611 * task completes successfully, It may be 1612 * {@code null} if the property should not be 1613 * specified when the task is created (and the server 1614 * will default to not sending any alert). 1615 */ 1616 public void setAlertOnSuccess(@Nullable final Boolean alertOnSuccess) 1617 { 1618 this.alertOnSuccess = alertOnSuccess; 1619 } 1620 1621 1622 1623 /** 1624 * Retrieves the flag that indicates whether the server should send an 1625 * administrative alert notification if the task does not complete 1626 * successfully. 1627 * 1628 * @return The flag that indicates whether the server should send an 1629 * administrative alert notification if the task does not complete 1630 * successfully, or {@code null} if the property should not be 1631 * specified when the task is created (and the server will default to 1632 * not sending any alert). 1633 */ 1634 @Nullable() 1635 public Boolean getAlertOnError() 1636 { 1637 return alertOnError; 1638 } 1639 1640 1641 1642 /** 1643 * Specifies the flag that indicates whether the server should send an 1644 * administrative alert notification if the task does not complete 1645 * successfully. 1646 * 1647 * @param alertOnError The flag that indicates whether the server should 1648 * send an administrative alert notification if the task 1649 * does not complete successfully, It may be 1650 * {@code null} if the property should not be specified 1651 * when the task is created (and the server will default 1652 * to not sending any alert). 1653 */ 1654 public void setAlertOnError(@Nullable final Boolean alertOnError) 1655 { 1656 this.alertOnError = alertOnError; 1657 } 1658 1659 1660 1661 /** 1662 * Retrieves a string representation of this collect support data task 1663 * properties object. 1664 * 1665 * @return A string representation of this collect support data task 1666 * properties object. 1667 */ 1668 @Override() 1669 @NotNull() 1670 public String toString() 1671 { 1672 final StringBuilder buffer = new StringBuilder(); 1673 toString(buffer); 1674 return buffer.toString(); 1675 } 1676 1677 1678 1679 /** 1680 * Appends a string representation of this collect support data task 1681 * properties object to the provided buffer. 1682 * 1683 * @param buffer The buffer to which the string representation will be 1684 * appended. It must not be {@code null}. 1685 */ 1686 public void toString(@NotNull final StringBuilder buffer) 1687 { 1688 buffer.append("CollectSupportDataArchiveProperties("); 1689 1690 appendNameValuePair(buffer, "taskID", taskID); 1691 appendNameValuePair(buffer, "outputPath", outputPath); 1692 appendNameValuePair(buffer, "encryptionPassphraseFile", 1693 encryptionPassphraseFile); 1694 appendNameValuePair(buffer, "includeExpensiveData", includeExpensiveData); 1695 appendNameValuePair(buffer, "includeReplicationStateDump", 1696 includeReplicationStateDump); 1697 appendNameValuePair(buffer, "includeBinaryFiles", includeBinaryFiles); 1698 appendNameValuePair(buffer, "includeExtensionSource", 1699 includeExtensionSource); 1700 appendNameValuePair(buffer, "securityLevel", securityLevel); 1701 appendNameValuePair(buffer, "useSequentialMode", useSequentialMode); 1702 appendNameValuePair(buffer, "noJFR", noJFR); 1703 appendNameValuePair(buffer, "reportCount", reportCount); 1704 appendNameValuePair(buffer, "reportIntervalSeconds", reportIntervalSeconds); 1705 appendNameValuePair(buffer, "jstackCount", jstackCount); 1706 appendNameValuePair(buffer, "logStartTime", logStartTime); 1707 appendNameValuePair(buffer, "logEndTime", logEndTime); 1708 appendNameValuePair(buffer, "logDuration", logDuration); 1709 appendNameValuePair(buffer, "logFileHeadCollectionSizeKB", 1710 logFileHeadCollectionSizeKB); 1711 appendNameValuePair(buffer, "logFileTailCollectionSizeKB", 1712 logFileTailCollectionSizeKB); 1713 appendNameValuePair(buffer, "comment", comment); 1714 appendNameValuePair(buffer, "retainPreviousSupportDataArchiveCount", 1715 retainPreviousSupportDataArchiveCount); 1716 appendNameValuePair(buffer, "retainPreviousSupportDataArchiveAge", 1717 retainPreviousSupportDataArchiveAge); 1718 appendNameValuePair(buffer, "scheduledStartTime", scheduledStartTime); 1719 appendNameValuePair(buffer, "dependencyIDs", dependencyIDs); 1720 appendNameValuePair(buffer, "failedDependencyAction", 1721 failedDependencyAction); 1722 appendNameValuePair(buffer, "notifyOnStart", notifyOnStart); 1723 appendNameValuePair(buffer, "notifyOnCompletion", notifyOnCompletion); 1724 appendNameValuePair(buffer, "notifyOnSuccess", notifyOnSuccess); 1725 appendNameValuePair(buffer, "notifyOnError", notifyOnError); 1726 appendNameValuePair(buffer, "alertOnStart", alertOnStart); 1727 appendNameValuePair(buffer, "alertOnSuccess", alertOnSuccess); 1728 appendNameValuePair(buffer, "alertOnError", alertOnError); 1729 1730 buffer.append(')'); 1731 } 1732 1733 1734 1735 /** 1736 * Appends a name-value pair to the provided buffer, if the value is 1737 * non-{@code null}. 1738 * 1739 * @param buffer The buffer to which the name-value pair should be appended. 1740 * @param name The name to be used. It must not be {@code null}. 1741 * @param value The value to be used. It may be {@code null} if there is 1742 * no value for the property. 1743 */ 1744 private static void appendNameValuePair(@NotNull final StringBuilder buffer, 1745 @NotNull final String name, 1746 @Nullable final Object value) 1747 { 1748 if (value == null) 1749 { 1750 return; 1751 } 1752 1753 if ((buffer.length() > 0) && 1754 (buffer.charAt(buffer.length() - 1) != '(')) 1755 { 1756 buffer.append(", "); 1757 } 1758 1759 buffer.append(name); 1760 buffer.append("='"); 1761 buffer.append(value); 1762 buffer.append('\''); 1763 } 1764 1765 1766 1767 /** 1768 * Appends a name-value pair to the provided buffer, if the value is 1769 * non-{@code null}. 1770 * 1771 * @param buffer The buffer to which the name-value pair should be 1772 * appended. 1773 * @param name The name to be used. It must not be {@code null}. 1774 * @param values The list of values to be used. It may be {@code null} or 1775 * empty if there are no values for the property. 1776 */ 1777 private static void appendNameValuePair(@NotNull final StringBuilder buffer, 1778 @NotNull final String name, 1779 @Nullable final List<String> values) 1780 { 1781 if ((values == null) || values.isEmpty()) 1782 { 1783 return; 1784 } 1785 1786 if ((buffer.length() > 0) && 1787 (buffer.charAt(buffer.length() - 1) != '(')) 1788 { 1789 buffer.append(", "); 1790 } 1791 1792 buffer.append(name); 1793 buffer.append("={ "); 1794 1795 final Iterator<String> iterator = values.iterator(); 1796 while (iterator.hasNext()) 1797 { 1798 buffer.append('\''); 1799 buffer.append(iterator.next()); 1800 buffer.append('\''); 1801 1802 if (iterator.hasNext()) 1803 { 1804 buffer.append(", "); 1805 } 1806 } 1807 1808 buffer.append('}'); 1809 } 1810}