1 /* 2 * Copyright 2004 The Apache Software Foundation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 package org.apache.ldap.server.schema.bootstrap; 18 19 20 import javax.naming.NamingException; 21 22 23 /** 24 * A schema object producer which uses a callback to announce object creation 25 * rather than completely returning objects in bulk. This way registries can 26 * be populated while the producer is doing is creating schema objects. 27 * 28 * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a> 29 * @version $Rev: 169198 $ 30 */ 31 public interface BootstrapProducer 32 { 33 /** 34 * Gets the type of producer this is. 35 * 36 * @return the type of the BootstrapProducer as a enum 37 */ 38 ProducerTypeEnum getType(); 39 40 /** 41 * Produces schema objects announcing each one after creation via the 42 * callback before continuing on to create more objects. 43 * 44 * @param registries the registry set used by this producer 45 * @param cb the producer's callback 46 * @throws NamingException callbacks often operate upon registries and can 47 * throw these exceptions so we must throw this as well since 48 * implementations will have to call the callback methods 49 */ 50 void produce( BootstrapRegistries registries, ProducerCallback cb ) 51 throws NamingException; 52 } 53