001/*
002 * Copyright 2012-2017 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2017 Ping Identity Corporation
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk.unboundidds.controls;
022
023
024
025import com.unboundid.util.ThreadSafety;
026import com.unboundid.util.ThreadSafetyLevel;
027
028
029
030/**
031 * This enum defines the set of operational update types that may be suppressed
032 * by the suppress operational attribute update request control.
033 * <BR>
034 * <BLOCKQUOTE>
035 *   <B>NOTE:</B>  This class, and other classes within the
036 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
037 *   supported for use against Ping Identity, UnboundID, and Alcatel-Lucent 8661
038 *   server products.  These classes provide support for proprietary
039 *   functionality or for external specifications that are not considered stable
040 *   or mature enough to be guaranteed to work in an interoperable way with
041 *   other types of LDAP servers.
042 * </BLOCKQUOTE>
043 */
044@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
045public enum SuppressType
046{
047  /**
048   * The value that indicates that last access time updates should be
049   * suppressed.
050   */
051  LAST_ACCESS_TIME(0),
052
053
054
055  /**
056   * The value that indicates that last login time updates should be suppressed.
057   */
058  LAST_LOGIN_TIME(1),
059
060
061
062  /**
063   * The value that indicates that last login IP address updates should be
064   * suppressed.
065   */
066  LAST_LOGIN_IP(2),
067
068
069
070  /**
071   * The value that indicates that lastmod updates (creatorsName,
072   * createTimestamp, modifiersName, modifyTimestamp) should be suppressed.
073   */
074  LASTMOD(3);
075
076
077
078  // The integer value for this suppress type enum value.
079  private final int intValue;
080
081
082
083  /**
084   * Creates a new suppress type enum value with the provided information.
085   *
086   * @param  intValue  The integer value for this value, as will be used to
087   *                   indicate it in the request control.
088   */
089  SuppressType(final int intValue)
090  {
091    this.intValue = intValue;
092  }
093
094
095
096  /**
097   * Retrieves the integer value for this suppress type value.
098   *
099   * @return  The integer value for this suppress type value.
100   */
101  public int intValue()
102  {
103    return intValue;
104  }
105
106
107
108  /**
109   * Retrieves the suppress type value for the provided integer value.
110   *
111   * @param  intValue  The integer value for the suppress type value to
112                       retrieve.
113   *
114   * @return  The suppress type value that corresponds to the provided integer
115   *          value, or {@code null} if there is no corresponding suppress type
116   *          value.
117   */
118  public static SuppressType valueOf(final int intValue)
119  {
120    for (final SuppressType t : values())
121    {
122      if (t.intValue == intValue)
123      {
124        return t;
125      }
126    }
127
128    return null;
129  }
130}