001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2008-2009 Sun Microsystems, Inc.
015 * Portions Copyright 2011 ForgeRock AS.
016 */
017package org.opends.server.authorization.dseecompat;
018
019import org.opends.server.core.*;
020import org.opends.server.types.*;
021import org.opends.server.workflowelement.localbackend.*;
022
023/**
024 * The AciLDAPOperationContainer is an AciContainer
025 * extended class that wraps each LDAP operation being
026 * evaluated or tested for target matched of an ACI.
027 */
028public class AciLDAPOperationContainer extends AciContainer  {
029
030    /**
031     * Constructor interface for all currently supported LDAP operations.
032     * @param operation The compare operation to evaluate.
033     * @param rights The rights of a compare operation.
034     * @param entry The entry for evaluation.
035     */
036    public AciLDAPOperationContainer(Operation operation,
037      int rights, Entry entry)
038    {
039      super(operation, rights, entry);
040    }
041
042
043    /**
044     * Constructor interface for the compare operation.
045     * @param operation The compare operation to evaluate.
046     * @param rights  The rights of a compare operation.
047     */
048    public AciLDAPOperationContainer(LocalBackendCompareOperation operation,
049        int rights)
050    {
051      super(operation, rights, operation.getEntryToCompare());
052    }
053
054
055    /**
056     * Constructor interface for evaluation general purpose Operation, entry and
057     * rights..
058     *
059     * @param operation The operation to use in the evaluation.
060     * @param e The entry for evaluation.
061     * @param authInfo The authentication information to use in the evaluation.
062     * @param rights The rights of the operation.
063     */
064    public AciLDAPOperationContainer(Operation operation, Entry e,
065                                     AuthenticationInfo authInfo,
066                                     int rights) {
067      super(operation, e, authInfo, rights);
068    }
069
070
071    /**
072     * Constructor interface for evaluation of a control.
073     *
074     * @param operation The operation to use in the evaluation.
075     * @param e An entry built especially for evaluation.
076     * @param c The control to evaluate.
077     * @param rights The rights of a control.
078     */
079    public AciLDAPOperationContainer(Operation operation, Entry e, Control c,
080                                     int rights) {
081      super(operation, rights, e );
082      setControlOID(c.getOID());
083    }
084
085    /**
086     * Constructor interface for evaluation of the extended operation.
087     *
088     * @param operation  The extended operation to evaluate.
089     * @param e  An entry built especially for evaluation.
090     * @param rights The rights of a extended operation.
091     */
092    public AciLDAPOperationContainer(ExtendedOperation operation, Entry e,
093                                     int rights) {
094      super(operation, rights, e );
095      setExtOpOID(operation.getRequestOID());
096    }
097
098    /**
099     * Constructor interface for the add operation.
100     * @param operation The add operation to evaluate.
101     * @param rights  The rights of an add operation.
102     */
103    public AciLDAPOperationContainer(LocalBackendAddOperation operation,
104        int rights)
105    {
106        super(operation, rights, operation.getEntryToAdd());
107    }
108
109    /**
110     * Constructor interface for the delete operation.
111     * @param operation The add operation to evaluate.
112     * @param rights  The rights of a delete operation.
113     */
114    public AciLDAPOperationContainer(LocalBackendDeleteOperation operation,
115                                     int rights) {
116        super(operation, rights, operation.getEntryToDelete());
117    }
118
119    /**
120     * Constructor interface for the modify operation.
121     * @param rights The rights of modify operation.
122     * @param operation The add operation to evaluate.
123     */
124    public AciLDAPOperationContainer(LocalBackendModifyOperation operation,
125        int rights)
126    {
127        super(operation, rights, operation.getCurrentEntry());
128    }
129
130    /**
131     * Constructor interface for the modify DN operation.
132     * @param operation  The modify DN operation.
133     * @param rights  The rights of the modify DN operation.
134     * @param entry  The entry to evaluated for this modify DN.
135     */
136    public AciLDAPOperationContainer(ModifyDNOperation operation,
137                                     int rights,
138                                     Entry entry) {
139        super(operation, rights,  entry);
140    }
141}