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.shared.ldap.model.entry; 021 022import java.io.Externalizable; 023 024import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException; 025import org.apache.directory.shared.ldap.model.schema.AttributeType; 026 027/** 028 * An internal interface for a ModificationItem. The name has been 029 * chosen so that it does not conflict with @see ModificationItem 030 * 031 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 032 */ 033public interface Modification extends Cloneable, Externalizable 034{ 035 /** 036 * @return the operation 037 */ 038 ModificationOperation getOperation(); 039 040 041 /** 042 * Store the modification operation 043 * 044 * @param operation The DirContext value to assign 045 */ 046 void setOperation( int operation ); 047 048 049 /** 050 * Store the modification operation 051 * 052 * @param operation The ModificationOperation value to assign 053 */ 054 void setOperation( ModificationOperation operation ); 055 056 057 /** 058 * @return the attribute containing the modifications 059 */ 060 Attribute getAttribute(); 061 062 063 /** 064 * Set the attribute's modification 065 * 066 * @param attribute The modified attribute 067 */ 068 void setAttribute( Attribute attribute ); 069 070 071 /** 072 * The clone operation 073 * 074 * @return a clone of the current modification 075 */ 076 Modification clone(); 077 078 079 /** 080 * Apply the AttributeType to the Modification 081 * 082 * @param AttributeType the injected AttributeType 083 */ 084 void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException; 085}