1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.ldap.server.authz.support;
20
21 import java.util.ArrayList;
22 import java.util.Iterator;
23 import java.util.List;
24
25 import javax.naming.NamingException;
26
27 import org.apache.ldap.server.schema.OidRegistry;
28
29 /***
30 * A mock {@link OidRegistry} to test {@link ACITupleFilter} implementations.
31 *
32 * @author The Apache Directory Project
33 * @version $Rev: 292666 $, $Date: 2005-09-30 03:54:28 -0400 (Fri, 30 Sep 2005) $
34 *
35 */
36 class DummyOidRegistry implements OidRegistry
37 {
38 public String getOid( String name ) throws NamingException
39 {
40 return String.valueOf( name.hashCode() );
41 }
42
43 public boolean hasOid( String id )
44 {
45 return true;
46 }
47
48 public String getPrimaryName( String oid ) throws NamingException
49 {
50 return oid;
51 }
52
53 public List getNameSet( String oid ) throws NamingException
54 {
55 List list = new ArrayList();
56 list.add( oid );
57 return list;
58 }
59
60 public Iterator list()
61 {
62
63 return new ArrayList().iterator();
64 }
65
66 public void register( String name, String oid )
67 {
68
69 }
70
71 }