001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *  
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *  
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License. 
018 *  
019 */
020package org.apache.directory.api.ldap.aci;
021
022
023/**
024 * An enumeration that represents all micro-operations that makes up LDAP
025 * operations.
026 * 
027 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
028 */
029public enum MicroOperation
030{
031    // Permissions that may be used in conjunction with any component of <tt>ProtectedItem</tt>s.
032    /** The Add permission, may be used in conjunction with any component of {@link ProtectedItem}s. */
033    ADD("Add"),
034
035    /** The DiscloseOnError permission, may be used in conjunction with any component of {@link ProtectedItem}s. */
036    DISCLOSE_ON_ERROR("DiscloseOnError"),
037
038    /** The Read permission, may be used in conjunction with any component of {@link ProtectedItem}s. */
039    READ("Read"),
040
041    /** The Remove permission, may be used in conjunction with any component of {@link ProtectedItem}s. */
042    REMOVE("Remove"),
043
044    // Permissions that may be used only in conjunction with the entry component.
045    /** The Browse permission, may be used only in conjunction with the entry component. */
046    BROWSE("Browse"),
047
048    /** The Export permission, may be used only in conjunction with the entry component. */
049    EXPORT("Export"),
050
051    /** The Import permission, may be used only in conjunction with the entry component. */
052    IMPORT("Import"),
053
054    /** The Modify permission, may be used only in conjunction with the entry component. */
055    MODIFY("Modify"),
056
057    /** The Rename permission, may be used only in conjunction with the entry component. */
058    RENAME("Rename"),
059
060    /** The ReturnDN permission, may be used only in conjunction with the entry component. */
061    RETURN_DN("ReturnDN"),
062
063    // Permissions that may be used in conjunction with any component, except entry, of <tt>ProtectedItem</tt>s.
064    /** The Compare permission, may be used in conjunction with any component, except entry. */
065    COMPARE("Compare"),
066
067    /** The FilterMatch permission, may be used in conjunction with any component, except entry. */
068    FILTER_MATCH("FilterMatch"),
069
070    /** The Invoke permission, may be used in conjunction with any component, except entry. */
071    INVOKE("Invoke");
072
073    /** The name. */
074    private final String name;
075
076
077    MicroOperation( String name )
078    {
079        this.name = name;
080    }
081
082
083    /**
084     * Gets the name of this micro-operation.
085     *
086     * @return the name
087     */
088    public String getName()
089    {
090        return name;
091    }
092
093
094    /**
095     * {@inheritDoc}
096     */
097    @Override
098    public String toString()
099    {
100        return name;
101    }
102}