001    /*
002     * Copyright 2007-2016 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2008-2016 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.schema;
022    
023    
024    
025    
026    
027    
028    /**
029     * This enum defines the set of attribute type usages that are defined in the
030     * LDAP protocol.
031     */
032    public enum AttributeUsage
033    {
034      /**
035       * The "userApplications" attribute usage.
036       */
037      USER_APPLICATIONS("userApplications", false),
038    
039    
040    
041      /**
042       * The "directoryOperation" attribute usage.
043       */
044      DIRECTORY_OPERATION("directoryOperation", true),
045    
046    
047    
048      /**
049       * The "distributedOperation" attribute usage.
050       */
051      DISTRIBUTED_OPERATION("distributedOperation", true),
052    
053    
054    
055      /**
056       * The "dSAOperation" attribute usage.
057       */
058      DSA_OPERATION("dSAOperation", true);
059    
060    
061    
062      // Indicates whether this is an operational attribute usage.
063      private final boolean isOperational;
064    
065      // The name for this object class type.
066      private final String name;
067    
068    
069    
070      /**
071       * Creates a new attribute usage with the specified name.
072       *
073       * @param  name           The name for this attribute usage.
074       * @param  isOperational  Indicates whether this is an operational attribute
075       *                        usage.
076       */
077      private AttributeUsage(final String name, final boolean isOperational)
078      {
079        this.name          = name;
080        this.isOperational = isOperational;
081      }
082    
083    
084    
085      /**
086       * Retrieves the name of this attribute usage.
087       *
088       * @return  The name of this attribute usage.
089       */
090      public String getName()
091      {
092        return name;
093      }
094    
095    
096    
097      /**
098       * Indicates whether this is an operational attribute usage.
099       *
100       * @return  {@code true} if this is an operational attribute usage.
101       */
102      public boolean isOperational()
103      {
104        return isOperational;
105      }
106    
107    
108    
109      /**
110       * Retrieves a string representation of this attribute usage.
111       *
112       * @return  A string representation of this attribute usage.
113       */
114      @Override()
115      public String toString()
116      {
117        return name;
118      }
119    }