001    /*
002     * Copyright 2012-2015 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2015 UnboundID Corp.
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     */
021    package com.unboundid.ldap.sdk.unboundidds.controls;
022    
023    
024    
025    import com.unboundid.util.ThreadSafety;
026    import com.unboundid.util.ThreadSafetyLevel;
027    
028    
029    
030    /**
031     * <BLOCKQUOTE>
032     *   <B>NOTE:</B>  This class is part of the Commercial Edition of the UnboundID
033     *   LDAP SDK for Java.  It is not available for use in applications that
034     *   include only the Standard Edition of the LDAP SDK, and is not supported for
035     *   use in conjunction with non-UnboundID products.
036     * </BLOCKQUOTE>
037     * This enum defines the set of operational update types that may be suppressed
038     * by the suppress operational attribute update request control.
039     */
040    @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
041    public enum SuppressType
042    {
043      /**
044       * The value that indicates that last access time updates should be
045       * suppressed.
046       */
047      LAST_ACCESS_TIME(0),
048    
049    
050    
051      /**
052       * The value that indicates that last login time updates should be suppressed.
053       */
054      LAST_LOGIN_TIME(1),
055    
056    
057    
058      /**
059       * The value that indicates that last login IP address updates should be
060       * suppressed.
061       */
062      LAST_LOGIN_IP(2),
063    
064    
065    
066      /**
067       * The value that indicates that lastmod updates (creatorsName,
068       * createTimestamp, modifiersName, modifyTimestamp) should be suppressed.
069       */
070      LASTMOD(3);
071    
072    
073    
074      // The integer value for this suppress type enum value.
075      private final int intValue;
076    
077    
078    
079      /**
080       * Creates a new suppress type enum value with the provided information.
081       *
082       * @param  intValue  The integer value for this value, as will be used to
083       *                   indicate it in the request control.
084       */
085      SuppressType(final int intValue)
086      {
087        this.intValue = intValue;
088      }
089    
090    
091    
092      /**
093       * Retrieves the integer value for this suppress type value.
094       *
095       * @return  The integer value for this suppress type value.
096       */
097      public int intValue()
098      {
099        return intValue;
100      }
101    
102    
103    
104      /**
105       * Retrieves the suppress type value for the provided integer value.
106       *
107       * @param  intValue  The integer value for the suppress type value to
108                           retrieve.
109       *
110       * @return  The suppress type value that corresponds to the provided integer
111       *          value, or {@code null} if there is no corresponding suppress type
112       *          value.
113       */
114      public static SuppressType valueOf(final int intValue)
115      {
116        for (final SuppressType t : values())
117        {
118          if (t.intValue == intValue)
119          {
120            return t;
121          }
122        }
123    
124        return null;
125      }
126    }