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