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