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.model.message; 021 022 023import org.apache.directory.api.ldap.model.entry.Value; 024import org.apache.directory.api.ldap.model.name.Dn; 025 026 027/** 028 * Compare request protocol message that tests an entry to see if it abides by 029 * an attribute value assertion. 030 * 031 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 032 */ 033public interface CompareRequest extends SingleReplyRequest, AbandonableRequest 034{ 035 /** 036 * Gets the distinguished name of the entry to be compared using the 037 * attribute value assertion. 038 * 039 * @return the Dn of the compared entry. 040 */ 041 Dn getName(); 042 043 044 /** 045 * Sets the distinguished name of the entry to be compared using the 046 * attribute value assertion. 047 * 048 * @param name the Dn of the compared entry. 049 * @return The CompareRequest instance 050 */ 051 CompareRequest setName( Dn name ); 052 053 054 /** 055 * Gets the attribute value to use in making the comparison. 056 * 057 * @return the attribute value to used in comparison. 058 */ 059 Value<?> getAssertionValue(); 060 061 062 /** 063 * Sets the attribute value to use in the comparison. 064 * 065 * @param value the attribute value used in comparison. 066 * @return The CompareRequest instance 067 */ 068 CompareRequest setAssertionValue( String value ); 069 070 071 /** 072 * Sets the attribute value to use in the comparison. 073 * 074 * @param value the attribute value used in comparison. 075 * @return The CompareRequest instance 076 */ 077 CompareRequest setAssertionValue( byte[] value ); 078 079 080 /** 081 * Gets the attribute id use in making the comparison. 082 * 083 * @return the attribute id used in comparison. 084 */ 085 String getAttributeId(); 086 087 088 /** 089 * Sets the attribute id used in the comparison. 090 * 091 * @param attrId the attribute id used in comparison. 092 * @return The CompareRequest instance 093 */ 094 CompareRequest setAttributeId( String attrId ); 095 096 097 /** 098 * {@inheritDoc} 099 */ 100 @Override 101 CompareRequest setMessageId( int messageId ); 102 103 104 /** 105 * {@inheritDoc} 106 */ 107 @Override 108 CompareRequest addControl( Control control ); 109 110 111 /** 112 * {@inheritDoc} 113 */ 114 @Override 115 CompareRequest addAllControls( Control[] controls ); 116 117 118 /** 119 * {@inheritDoc} 120 */ 121 @Override 122 CompareRequest removeControl( Control control ); 123}