001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at 010 * http://www.opensource.org/licenses/cddl1.php. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file. If applicable, add the following below this CDDL HEADER, 016 * with the fields enclosed by brackets "[]" replaced with your own 017 * identifying information: 018 * Portions Copyright [yyyy] [name of copyright owner] 019 * 020 * CDDL HEADER END 021 * 022 * 023 * Portions Copyright 2008-2019 Ping Identity Corporation 024 * Portions Copyright 2008 Sun Microsystems, Inc. 025 */ 026package com.unboundid.directory.sdk.ds.types; 027 028 029 030import com.unboundid.util.StaticUtils; 031import com.unboundid.util.ThreadSafety; 032import com.unboundid.util.ThreadSafetyLevel; 033 034 035 036/** 037 * This class implements an enumeration that holds the possible set of 038 * additional properties that can be included in an account status notification. 039 */ 040@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 041public enum AccountStatusNotificationProperty 042{ 043 /** 044 * The property whose value will be the name of the account status 045 * notification type. This will be available for all notification types. 046 */ 047 NOTIFICATION_TYPE("notification-type"), 048 049 050 051 /** 052 * The property whose value will be the string representation of the DN of the 053 * password policy for the target user. This will be available for all 054 * notification types. 055 */ 056 PASSWORD_POLICY_DN("password-policy-dn"), 057 058 059 060 /** 061 * The property whose value will be a generalized time representation of the 062 * time that the account status notification was generated. This will be 063 * available for all notification types. 064 */ 065 NOTIFICATION_TIME("notification-time"), 066 067 068 069 /** 070 * The property whose value will the DN of the account with which the 071 * notification is associated. This will be available for all notification 072 * types. 073 */ 074 ACCOUNT_DN("account-dn"), 075 076 077 078 /** 079 * The property whose value will be a generalized time representation of the 080 * time that the account's password was last changed. This will be available 081 * for all notification types. 082 */ 083 PASSWORD_CHANGED_TIME("password-changed-time"), 084 085 086 087 /** 088 * The property whose value will be the number of seconds since the account's 089 * password was last changed. This will be available for all notification 090 * types. 091 */ 092 SECONDS_SINCE_PASSWORD_CHANGE("seconds-since-password-change"), 093 094 095 096 /** 097 * The property whose value will be a localized, human-readable representation 098 * of the time since the account's password was last changed. This will be 099 * available for all notification types. 100 */ 101 TIME_SINCE_PASSWORD_CHANGE("time-since-password-change"), 102 103 104 105 /** 106 * The property whose value will be "true" if the associated account is in a 107 * state that will allow it to authenticate when provided with appropriate 108 * credentials, or "false" if the account is not usable for some reason. This 109 * will be available for all notification types. 110 */ 111 ACCOUNT_IS_USABLE("account-is-usable"), 112 113 114 115 /** 116 * The property whose values will be human-readable messages about error 117 * conditions affecting an account's usability. This will be available for 118 * all notification types. 119 */ 120 ACCOUNT_USABILITY_ERRORS("account-usability-errors"), 121 122 123 124 /** 125 * The property whose values will be human-readable messages about warning 126 * conditions that may affect an account's usability in the near future. This 127 * will be available for all notification types. 128 */ 129 ACCOUNT_USABILITY_WARNINGS("account-usability-warnings"), 130 131 132 133 /** 134 * The property whose values will be human-readable messages about noteworthy 135 * conditions regarding an account that do not necessarily represent a current 136 * or imminent problem with the account. This will be available for all 137 * notification types. 138 */ 139 ACCOUNT_USABILITY_NOTICES("account-usability-notices"), 140 141 142 143 /** 144 * The property whose value will be "true" if the associated account is 145 * administratively disabled, or "false" if the account is enabled. This will 146 * be available for all notification types. 147 */ 148 ACCOUNT_IS_DISABLED("account-is-disabled"), 149 150 151 152 /** 153 * The property whose value will be "true" if the associated account is 154 * not yet active, or "false" if the account either does not have an 155 * activation time or that time is in the past. This will be available for 156 * all notification types. 157 */ 158 ACCOUNT_IS_NOT_YET_ACTIVE("account-is-not-yet-active"), 159 160 161 162 /** 163 * The property whose value will be a generalized time representation of the 164 * activation time for the associated account, if available. This will be 165 * available for all notification types, if the account has an activation 166 * time. 167 */ 168 ACCOUNT_ACTIVATION_TIME("account-activation-time"), 169 170 171 172 /** 173 * The property whose value will be the number of seconds until the associated 174 * account becomes active. This will be available for all notification types, 175 * if the account has an activation time in the future. 176 */ 177 SECONDS_UNTIL_ACCOUNT_ACTIVATION("seconds-until-account-activation"), 178 179 180 181 /** 182 * The property whose value will be a localized, human-readable length of 183 * time until the associated account becomes active. This will be available 184 * for all notification types, if the account has an activation time in the 185 * future. 186 */ 187 TIME_UNTIL_ACCOUNT_ACTIVATION("time-until-account-activation"), 188 189 190 191 /** 192 * The property whose value will be the number of seconds since the associated 193 * account became active. This will be available for all notification types, 194 * if the account has an activation time in the past. 195 */ 196 SECONDS_SINCE_ACCOUNT_ACTIVATION("seconds-since-account-activation"), 197 198 199 200 /** 201 * The property whose value will be a localized, human-readable length of 202 * time since the associated account became active. This will be available 203 * for all notification types, if the account has an activation time in the 204 * past. 205 */ 206 TIME_SINCE_ACCOUNT_ACTIVATION("time-since-account-activation"), 207 208 209 210 /** 211 * The property whose value will be "true" if the associated account is 212 * expired, or "false" if the account either does not have an expiration time 213 * or that time is in the future. This will be available for all notification 214 * types. 215 */ 216 ACCOUNT_IS_EXPIRED("account-is-expired"), 217 218 219 220 /** 221 * The property whose value will be a generalized time representation of the 222 * expiration time for the associated account, if available. This will be 223 * available for all notification types, if the account has an expiration 224 * time. 225 */ 226 ACCOUNT_EXPIRATION_TIME("account-expiration-time"), 227 228 229 230 /** 231 * The property whose value will be the number of seconds until the associated 232 * account expires. This will be available for all notification types, if the 233 * account has an expiration time in the future. 234 */ 235 SECONDS_UNTIL_ACCOUNT_EXPIRATION("seconds-until-account-expiration"), 236 237 238 239 /** 240 * The property whose value will be a localized, human-readable length of 241 * time until the associated account expires. This will be available for all 242 * notification types, if the account has an expiration time in the future. 243 */ 244 TIME_UNTIL_ACCOUNT_EXPIRATION("time-until-account-expiration"), 245 246 247 248 /** 249 * The property whose value will be the number of seconds since the associated 250 * account expired. This will be available for all notification types, if the 251 * account has an expiration time in the past. 252 */ 253 SECONDS_SINCE_ACCOUNT_EXPIRATION("seconds-since-account-expiration"), 254 255 256 257 /** 258 * The property whose value will be a localized, human-readable length of 259 * time since the associated account expired. This will be available for all 260 * notification types, if the account has an expiration time in the past. 261 */ 262 TIME_SINCE_ACCOUNT_EXPIRATION("time-since-account-expiration"), 263 264 265 266 /** 267 * The property whose value will be "true" if the associated account has been 268 * temporarily or permanently locked as a result of too many authentication 269 * failures, or "false" if the account is not failure-locked. This will be 270 * available for all notification types. 271 */ 272 ACCOUNT_IS_FAILURE_LOCKED("account-is-failure-locked"), 273 274 275 276 /** 277 * The property whose value will be a generalized time representation of the 278 * time that the account was locked as a result of too many authentication 279 * failures. This will be available for all notification types, if the 280 * account is failure-locked. 281 */ 282 FAILURE_LOCKED_TIME("failure-locked-time"), 283 284 285 286 /** 287 * The property whose value will be a generalized time representation of the 288 * time at which the user's account will be unlocked. This will be available 289 * for all notification types, if an account is temporarily failure-locked. 290 */ 291 ACCOUNT_UNLOCK_TIME("account-unlock-time"), 292 293 294 295 /** 296 * The property whose value will be the number of seconds until the user's 297 * account is unlocked. This will be available for all notification types, if 298 * an account is temporarily failure-locked. 299 */ 300 SECONDS_UNTIL_UNLOCK("seconds-until-unlock"), 301 302 303 304 /** 305 * The property whose value will be a localized, human-readable representation 306 * of the length of time until the user's account is unlocked. This will be 307 * available for all notification types, if an account is temporarily 308 * failure-locked. 309 */ 310 TIME_UNTIL_UNLOCK("time-until-unlock"), 311 312 313 314 /** 315 * The property whose value will be the number of failed authentication 316 * attempts required to lock an account. This will be available for all 317 * notification types, if failure lockout is enabled. 318 */ 319 FAILURE_LOCKOUT_COUNT("failure-lockout-count"), 320 321 322 323 /** 324 * The property whose value will be the number of seconds that an account will 325 * remain locked as a result of too many authentication failures. This will 326 * be available for all notification types, if failure lockout is enabled with 327 * a lockout duration. 328 */ 329 FAILURE_LOCKOUT_DURATION_SECONDS("failure-lockout-duration-seconds"), 330 331 332 333 /** 334 * The property whose value will be a localized, human-readable representation 335 * of the length of time that an account will remain locked as a result of too 336 * many authentication failures. This will be available for all notification 337 * types, if failure lockout is enabled with a lockout duration. 338 */ 339 FAILURE_LOCKOUT_DURATION("failure-lockout-duration"), 340 341 342 343 /** 344 * The property whose value will be "true" if the associated account has been 345 * locked because it has been too long since the last successful 346 * authentication, or "false" if the account is not idle-locked. This will be 347 * available for all notification types. 348 */ 349 ACCOUNT_IS_IDLE_LOCKED("account-is-idle-locked"), 350 351 352 353 /** 354 * The property whose value will be the maximum number of seconds that may 355 * pass between the last successful authentication on an account and that 356 * account becoming locked for lack of use. This will be available for all 357 * notification types, if idle lockout is enabled. 358 */ 359 IDLE_LOCKOUT_INTERVAL_SECONDS("idle-lockout-interval-seconds"), 360 361 362 363 /** 364 * The property whose value will be a localized, human-readable representation 365 * of the maximum length of time that may pass between the last successful 366 * authentication for an account and that account becoming locked for lack of 367 * use. This will be available for all notification types, if idle lockout 368 * is enabled. 369 */ 370 IDLE_LOCKOUT_INTERVAL("idle-lockout-interval"), 371 372 373 374 /** 375 * The property whose value will be a generalized time representation of the 376 * time that the user last successfully authenticated, if available. This 377 * will be available for all notification types, if a last login time is 378 * available for the user. 379 */ 380 LAST_LOGIN_TIME("last-login-time"), 381 382 383 384 /** 385 * The property whose value will be the number of seconds since the user last 386 * successfully authenticated, if available. This will be available for all 387 * notification types, if a last login time is available for the user. 388 */ 389 SECONDS_SINCE_LAST_LOGIN("seconds-since-last-login"), 390 391 392 393 /** 394 * The property whose value will be a localized, human-readable representation 395 * of the length of time since the user last successfully authenticated, if 396 * available. This will be available for all notification types, if a last 397 * login time is available for the user. 398 */ 399 TIME_SINCE_LAST_LOGIN("time-since-last-login"), 400 401 402 403 /** 404 * The property whose value will be the IP address of the client from which 405 * the user last successfully authenticated, if available. This will be 406 * available for all notification types. 407 */ 408 LAST_LOGIN_IP_ADDRESS("last-login-ip-address"), 409 410 411 412 /** 413 * The property whose value will be "true" if the associated account has been 414 * locked because the user failed to choose a new password in a timely manner 415 * after it was administratively reset, or "false" if the account is not 416 * reset-locked. This will be available for all notification types. 417 */ 418 ACCOUNT_IS_RESET_LOCKED("account-is-reset-locked"), 419 420 421 422 /** 423 * The property whose value will be the maximum number of seconds that a user 424 * has to change their password after an administrative reset before their 425 * account will become locked. This will be available for all notification 426 * types, if reset lockout is enabled. 427 */ 428 MAXIMUM_PASSWORD_RESET_AGE_SECONDS("maximum-password-reset-age-seconds"), 429 430 431 432 /** 433 * The property whose value will be a localized, human-readable representation 434 * of the maximum length of time that a user has to change their password 435 * after an administrative reset before their account will become locked. 436 * This will be available for all notification types, if reset lockout is 437 * enabled. 438 */ 439 MAXIMUM_PASSWORD_RESET_AGE("maximum-password-reset-age"), 440 441 442 443 /** 444 * The property whose value will be "true" if the associated user must choose 445 * a new password before they will be permitted to request any other 446 * operations, or "false" if the user will not be required to change their 447 * password. 448 */ 449 MUST_CHANGE_PASSWORD("must-change-password"), 450 451 452 453 /** 454 * The property whose value will be "true" if the associated account was 455 * unlocked by the associated operation, or "false" if it was not unlocked. 456 * This will be available for the 457 * {@link AccountStatusNotificationType#PASSWORD_RESET} and 458 * {@link AccountStatusNotificationType#PASSWORD_CHANGED} notification types. 459 */ 460 ACCOUNT_WAS_UNLOCKED("account-was-unlocked"), 461 462 463 464 /** 465 * The property whose value will be "true" if the associated account has an 466 * expired password, or "false" if the password is not expired. This will be 467 * available for all notification types. 468 */ 469 PASSWORD_IS_EXPIRED("password-is-expired"), 470 471 472 473 /** 474 * The property whose value will be "true" if the associated account has a 475 * password that is about to expire, or "false" if the account does not have 476 * a password that is about to expire. This will be available for all 477 * notification types. 478 */ 479 PASSWORD_IS_EXPIRING("password-is-expiring"), 480 481 482 483 /** 484 * The property whose value will be the maximum length of time in seconds that 485 * an account will be permitted to continue using the same password before it 486 * will expire. This will be available for all notification types, if 487 * password expiration is enabled. 488 */ 489 MAXIMUM_PASSWORD_AGE_SECONDS("maximum-password-age-seconds"), 490 491 492 493 /** 494 * The property whose value will be a localized, human-readable representation 495 * of the maximum length of time that an account will be permitted to continue 496 * using the same password before it will expire. This will be available for 497 * all notification types, if password expiration is enabled. 498 */ 499 MAXIMUM_PASSWORD_AGE("maximum-password-age"), 500 501 502 503 /** 504 * The property whose value will be the generalized time representation of the 505 * time that the user's password will expire (if it is in the future) or that 506 * it did expire (if it was in the past). This will be available for all 507 * notification types, if password expiration is enabled. 508 */ 509 PASSWORD_EXPIRATION_TIME("password-expiration-time"), 510 511 512 513 /** 514 * The property whose value will be the number of seconds until the user's 515 * password expires (if it is in the future). This will be available for all 516 * notification types, if there is an upcoming password expiration. 517 */ 518 SECONDS_UNTIL_PASSWORD_EXPIRATION("seconds-until-password-expiration"), 519 520 521 522 /** 523 * The property whose value will be the number of seconds until the user's 524 * password expires (if it is in the future). This will be available for all 525 * notification types, if there is an upcoming password expiration. 526 * 527 * @deprecated Use {@link #SECONDS_UNTIL_PASSWORD_EXPIRATION} instead. 528 */ 529 @Deprecated() 530 SECONDS_UNTIL_EXPIRATION("seconds-until-expiration"), 531 532 533 534 /** 535 * The property whose value will be a localized, human-readable representation 536 * of the length of time until the user's password expires (if it is in the 537 * future). This will be available for all notification types, if there is an 538 * upcoming password expiration. 539 */ 540 TIME_UNTIL_PASSWORD_EXPIRATION("time-until-password-expiration"), 541 542 543 544 /** 545 * The property whose value will be a localized, human-readable representation 546 * of the length of time until the user's password expires (if it is in the 547 * future). This will be available for all notification types, if there is an 548 * upcoming password expiration. 549 * 550 * @deprecated Use {@link #TIME_UNTIL_PASSWORD_EXPIRATION} instead. 551 */ 552 @Deprecated() 553 TIME_UNTIL_EXPIRATION("time-until-expiration"), 554 555 556 557 /** 558 * The property whose value will be the number of seconds since the user's 559 * password expired (if it is in the past). This will be available for all 560 * notification types, if there is an expired password. 561 */ 562 SECONDS_SINCE_PASSWORD_EXPIRATION("seconds-since-password-expiration"), 563 564 565 566 /** 567 * The property whose value will be a localized, human-readable representation 568 * of the length of time since the user's password expired (if it is in the 569 * past). This will be available for all notification types, if there is an 570 * expired password. 571 */ 572 TIME_SINCE_PASSWORD_EXPIRATION("time-since-password-expiration"), 573 574 575 576 /** 577 * The property whose value will be a clear-text representation of the user's 578 * old password. This may be (but is not guaranteed to be) available for the 579 * {@link AccountStatusNotificationType#PASSWORD_RESET} and 580 * {@link AccountStatusNotificationType#PASSWORD_CHANGED} notification types. 581 */ 582 OLD_PASSWORD("old-password"), 583 584 585 586 /** 587 * The property whose value will be a clear-text representation of the user's 588 * new password. This may be (but is not guaranteed to be) available for the 589 * {@link AccountStatusNotificationType#PASSWORD_RESET} and 590 * {@link AccountStatusNotificationType#PASSWORD_CHANGED} notification types. 591 */ 592 NEW_PASSWORD("new-password"), 593 594 595 596 /** 597 * The property whose value will be a clear-text representation of the user's 598 * new password, but only if the new password was generated by the server 599 * rather than provided by the client. This may be (but is not guaranteed to 600 * be) available for the 601 * {@link AccountStatusNotificationType#PASSWORD_RESET} and 602 * {@link AccountStatusNotificationType#PASSWORD_CHANGED} notification types. 603 */ 604 NEW_GENERATED_PASSWORD("new-generated-password"), 605 606 607 608 /** 609 * The property whose value will be the IP address of the client that 610 * requested the associated operation. This will be available for all 611 * notification types, if the request was initiated by an external client. 612 */ 613 REQUESTER_IP_ADDRESS("requester-ip-address"), 614 615 616 617 /** 618 * The property whose value will be the DN of the authorization identity for 619 * the associated operation. This will be available for all notification 620 * types. 621 */ 622 REQUESTER_DN("requester-dn"), 623 624 625 626 /** 627 * The property whose value will be name of the operation type for the 628 * associated operation. This will be available for all notification types. 629 */ 630 OPERATION_TYPE("operation-type"), 631 632 633 634 /** 635 * The property whose value will be the operation ID for the associated 636 * operation. This will be available for all notification types. 637 */ 638 OPERATION_ID("operation-id"), 639 640 641 642 /** 643 * The property whose value will be the connection ID for the associated 644 * operation. This will be available for all notification types. 645 */ 646 CONNECTION_ID("connection-id"), 647 648 649 650 /** 651 * The property whose value will be the server UUID value for the server in 652 * which the notification was generated. This will be available for all 653 * notification types. 654 */ 655 SERVER_UUID("server-uuid"), 656 657 658 659 /** 660 * The property whose value will be the server instance name for the server in 661 * which the notification was generated. This will be available for all 662 * notification types. 663 */ 664 INSTANCE_NAME("instance-name"); 665 666 667 668 // The notification type name. 669 private final String name; 670 671 672 673 /** 674 * Creates a new account status notification property with the provided name. 675 * 676 * @param name The name for this account status notification property. 677 */ 678 AccountStatusNotificationProperty(final String name) 679 { 680 this.name = name; 681 } 682 683 684 685 /** 686 * Retrieves the account status notification type with the specified name. 687 * 688 * @param name The name for the account status notification type to 689 * retrieve. 690 * 691 * @return The requested account status notification type, or {@code null} 692 * if there is no type with the given name. 693 */ 694 public static AccountStatusNotificationProperty forName(final String name) 695 { 696 final String lowerNameWithDashesInsteadOfUnderscores = 697 StaticUtils.toLowerCase(name).replace('_', '-'); 698 for (final AccountStatusNotificationProperty p : values()) 699 { 700 if (p.getName().equals(lowerNameWithDashesInsteadOfUnderscores)) 701 { 702 return p; 703 } 704 } 705 706 return null; 707 } 708 709 710 711 /** 712 * Retrieves the name for this account status notification property. 713 * 714 * @return The name for this account status notification property. 715 */ 716 public String getName() 717 { 718 return name; 719 } 720 721 722 723 /** 724 * Retrieves a string representation of this account status 725 * notification property. 726 * 727 * @return A string representation of this account status 728 * notification property. 729 */ 730 @Override() 731 public String toString() 732 { 733 return name; 734 } 735} 736