1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.server.xdbm.search.impl;
21  
22  
23  import org.apache.directory.shared.ldap.schema.AttributeType;
24  import org.apache.directory.shared.ldap.schema.UsageEnum;
25  import org.apache.directory.shared.ldap.schema.Syntax;
26  import org.apache.directory.shared.ldap.schema.MatchingRule;
27  import org.apache.directory.shared.ldap.constants.SchemaConstants;
28  
29  import javax.naming.NamingException;
30  
31  
32  /**
33   * An attributeType used for testing situations when there is no matchingRule
34   * for one.
35   *
36   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
37   * @version $$Rev$$
38   */
39  public class NoMatchingRuleAttributeType implements AttributeType
40  {
41      private static final long serialVersionUID = 1L;
42  
43  
44      public boolean isSingleValue()
45      {
46          return false;
47      }
48  
49  
50      public boolean isCanUserModify()
51      {
52          return false;
53      }
54  
55  
56      public boolean isCollective()
57      {
58          return false;
59      }
60  
61  
62      public UsageEnum getUsage()
63      {
64          return null;
65      }
66  
67  
68      public AttributeType getSuperior() throws NamingException
69      {
70          return null;
71      }
72  
73  
74      public Syntax getSyntax() throws NamingException
75      {
76          return new BogusSyntax();
77      }
78  
79  
80      public int getLength()
81      {
82          return 0;
83      }
84  
85  
86      public MatchingRule getEquality() throws NamingException
87      {
88          return null;
89      }
90  
91  
92      public MatchingRule getOrdering() throws NamingException
93      {
94          return null;
95      }
96  
97  
98      public MatchingRule getSubstr() throws NamingException
99      {
100         return null;
101     }
102 
103 
104     public boolean isAncestorOf( AttributeType descendant ) throws NamingException
105     {
106         return false;
107     }
108 
109 
110     public boolean isDescentantOf( AttributeType ancestor ) throws NamingException
111     {
112         return false;
113     }
114 
115 
116     public boolean isObsolete()
117     {
118         return false;
119     }
120 
121 
122     public String getOid()
123     {
124         return SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000";
125     }
126 
127 
128     public String[] getNames()
129     {
130         return new String[] { "bogus" };
131     }
132 
133 
134     public String getName()
135     {
136         return "bogus";
137     }
138 
139 
140     public String getDescription()
141     {
142         return "";
143     }
144 
145 
146     public String getSchema()
147     {
148         return "other";
149     }
150 
151 
152     public void setSchema( String schemaName )
153     {
154     }
155 
156 
157     public String[] getNamesRef()
158     {
159         return new String[] { "bogus" };
160     }
161 }