View Javadoc

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.schema.bootstrap;
21  
22  
23  import javax.naming.NamingException;
24  
25  import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer;
26  import org.apache.directory.server.schema.bootstrap.ProducerCallback;
27  import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
28  import org.apache.directory.server.schema.registries.Registries;
29  import org.apache.directory.shared.ldap.schema.syntax.AcceptAllSyntaxChecker;
30  import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
31  
32  
33  /**
34   * A producer of SyntaxChecker objects for the nis schema.
35   * Modified by hand from generated code
36   *
37   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
38   * @version $Rev: 498728 $
39   */
40  public class NisSyntaxCheckerProducer extends AbstractBootstrapProducer
41  {
42      public NisSyntaxCheckerProducer()
43      {
44          super( ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER );
45      }
46  
47  
48      // ------------------------------------------------------------------------
49      // BootstrapProducer Methods
50      // ------------------------------------------------------------------------
51  
52      /**
53       * @see org.apache.directory.server.schema.bootstrap.BootstrapProducer#produce(Registries, org.apache.directory.server.schema.bootstrap.ProducerCallback)
54       */
55      public void produce( Registries registries, ProducerCallback cb ) throws NamingException
56      {
57          SyntaxChecker syntaxChecker;
58  
59          /*
60           * We are going to need a syntax checker for each and every one of
61           * these syntaxes.  However right now we're probably not going to be
62           * turning on syntax checking or are not as interested in it.  So we
63           * can put in place simple do nothing syntax checkers - which is really
64           * the binary syntax checker.
65           */
66  
67          // 1.3.6.1.1.1.0.0 - RFC2307 NIS Netgroup Triple
68          syntaxChecker = new AcceptAllSyntaxChecker( "1.3.6.1.1.1.0.0" );
69          cb.schemaObjectProduced( this, syntaxChecker.getSyntaxOid(), syntaxChecker );
70  
71          // 1.3.6.1.1.1.0.1 - RFC2307 Boot Parameter Syntax
72          syntaxChecker = new AcceptAllSyntaxChecker( "1.3.6.1.1.1.0.1" );
73          cb.schemaObjectProduced( this, syntaxChecker.getSyntaxOid(), syntaxChecker );
74      }
75  }