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 */
020 package org.apache.directory.shared.ldap.message.internal;
021
022 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
023 import org.apache.directory.shared.ldap.entry.Value;
024 import org.apache.directory.shared.ldap.message.SingleReplyRequest;
025 import org.apache.directory.shared.ldap.name.DN;
026
027
028 /**
029 * Compare request protocol message that tests an entry to see if it abides by
030 * an attribute value assertion.
031 *
032 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
033 * @version $Revision: 918756 $
034 */
035 public interface InternalCompareRequest extends SingleReplyRequest, InternalAbandonableRequest
036 {
037 /** Compare request message type enum code */
038 MessageTypeEnum TYPE = MessageTypeEnum.COMPARE_REQUEST;
039
040 /** Compare response message type enum code */
041 MessageTypeEnum RESP_TYPE = InternalCompareResponse.TYPE;
042
043
044 /**
045 * Gets the distinguished name of the entry to be compared using the
046 * attribute value assertion.
047 *
048 * @return the DN of the compared entry.
049 */
050 DN getName();
051
052
053 /**
054 * Sets the distinguished name of the entry to be compared using the
055 * attribute value assertion.
056 *
057 * @param name the DN of the compared entry.
058 */
059 void setName( DN name );
060
061
062 /**
063 * Gets the attribute value to use in making the comparison.
064 *
065 * @return the attribute value to used in comparison.
066 */
067 Value<?> getAssertionValue();
068
069
070 /**
071 * Sets the attribute value to use in the comparison.
072 *
073 * @param value the attribute value used in comparison.
074 */
075 void setAssertionValue( String value );
076
077
078 /**
079 * Sets the attribute value to use in the comparison.
080 *
081 * @param value the attribute value used in comparison.
082 */
083 void setAssertionValue( byte[] value );
084
085
086 /**
087 * Gets the attribute id use in making the comparison.
088 *
089 * @return the attribute id used in comparison.
090 */
091 String getAttributeId();
092
093
094 /**
095 * Sets the attribute id used in the comparison.
096 *
097 * @param attrId the attribute id used in comparison.
098 */
099 void setAttributeId( String attrId );
100 }