AciLDAPOperationContainer.java revision 31ef6298b4179ddca52d4b1d0aad873af9d17155
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/*
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * CDDL HEADER START
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The contents of this file are subject to the terms of the
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Common Development and Distribution License, Version 1.0 only
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * (the "License"). You may not use this file except in compliance
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * with the License.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * You can obtain a copy of the license at
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * trunk/opends/resource/legal-notices/OpenDS.LICENSE
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * See the License for the specific language governing permissions
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * and limitations under the License.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * When distributing Covered Code, include this CDDL HEADER in each
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * file and include the License file at
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * add the following below this CDDL HEADER, with the fields enclosed
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * by brackets "[]" replaced with your own identifying information:
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Portions Copyright [yyyy] [name of copyright owner]
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * CDDL HEADER END
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk *
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * Portions Copyright 2007 Sun Microsystems, Inc.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkpackage org.opends.server.authorization.dseecompat;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport java.util.List;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.core.AddOperation;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.core.CompareOperation;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.core.DeleteOperation;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.core.ModifyOperation;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.core.SearchOperation;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.types.Modification;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkimport org.opends.server.types.SearchResultEntry;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk/**
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The AciLDAPOperationContainer is an AciContainer
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * extended class that wraps each LDAP operation being
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * evaluated or tested for target matched of an ACI.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkpublic class AciLDAPOperationContainer extends AciContainer {
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /*
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The entry to be returned if this is a LDAP search.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private SearchResultEntry searchEntry;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk /*
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * The list of modifications if this operation is a LDAP
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk * modify.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk */
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk private List<Modification> modifications;
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk
/**
* Constructor interface for the compare operation.
* @param operation The compare operation to evaluate.
* @param rights The rights of a compare operation.
*/
public AciLDAPOperationContainer(CompareOperation operation, int rights) {
super(operation, rights, operation.getEntryToCompare());
}
/**
* Constructor interface for the add operation.
* @param operation The add operation to evaluate.
* @param rights The rights of an add operation.
*/
public AciLDAPOperationContainer(AddOperation operation, int rights) {
super(operation, rights, operation.getEntryToAdd());
}
/**
* Constructor interface for the delete operation.
* @param operation The add operation to evaluate.
* @param rights The rights of a delete operation.
*/
public AciLDAPOperationContainer(DeleteOperation operation, int rights) {
super(operation, rights, operation.getEntryToDelete());
}
/**
* Constructor interface for the modify operation.
* @param rights The rights of modify operation.
* @param operation The add operation to evaluate.
*/
public AciLDAPOperationContainer(ModifyOperation operation, int rights) {
super(operation, rights, operation.getCurrentEntry());
this.modifications=operation.getModifications();
}
/**
* Constructor interface for the LDAP search operation.
* @param operation The search operation.
* @param rights The rights of a search operation.
* @param entry The entry to be evaluated for this search.
*/
public AciLDAPOperationContainer(SearchOperation operation, int rights,
SearchResultEntry entry) {
super(operation, rights, entry);
this.searchEntry = entry;
}
/**
* Retrieve the search result entry of the search operation.
* @return The search result entry.
*/
public SearchResultEntry getSearchResultEntry() {
return this.searchEntry;
}
/** Retrieve the list of modifications if this is a LDAP modify.
* @return The list of LDAP modifications to made on the resource entry.
*/
public List<Modification> getModifications() {
return modifications;
}
}