/* * Copyright 2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package $package; import java.util.ArrayList; import javax.naming.NamingException; import org.apache.ldap.common.schema.*; #if ( $package != "org.apache.ldap.server.schema.bootstrap" ) import org.apache.ldap.server.schema.bootstrap.*; #end /** * A producer of schema attributeType definations for the $schema schema. This * code has been automatically generated using schema files in the OpenLDAP * format along with the directory plugin for maven. This has been done * to facilitate Eve<->OpenLDAP schema interoperability. * * @author Apache Directory Project * @version $Rev$ */ public class $classname extends AbstractBootstrapProducer { public $classname() { super( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER ); } // ------------------------------------------------------------------------ // BootstrapProducer Methods // ------------------------------------------------------------------------ /** * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback) */ public void produce( BootstrapRegistries registries, ProducerCallback cb ) throws NamingException { ArrayList names = new ArrayList(); BootstrapAttributeType attributeType; #foreach ( $attrType in $attrTypes ) // -------------------------------------------------------------------- // AttributeType $attrType.getOid() $!attrType.getName() // -------------------------------------------------------------------- attributeType = newAttributeType( "$attrType.getOid()", registries ); #if ( $attrType.getDescription() ) attributeType.setDescription( "$attrType.getDescription()" ); #end attributeType.setCanUserModify( ! $attrType.isNoUserModification() ); attributeType.setSingleValue( $attrType.isSingleValue() ); attributeType.setCollective( $attrType.isCollective() ); attributeType.setObsolete( $attrType.isObsolete() ); attributeType.setLength( $attrType.getLength() ); attributeType.setUsage( UsageEnum.getUsage( "$attrType.getUsage().getName()" ) ); #if ( $attrType.getSuperior() ) attributeType.setSuperiorId( "$attrType.getSuperior()" ); #end #if ( $attrType.getEquality() ) attributeType.setEqualityId( "$attrType.getEquality()" ); #end #if ( $attrType.getSubstr() ) attributeType.setSubstrId( "$attrType.getSubstr()" );#end #if ( $attrType.getOrdering() ) attributeType.setOrderingId( "$attrType.getOrdering()" );#end #if ( $attrType.getSyntax() ) attributeType.setSyntaxId( "$attrType.getSyntax()" );#end #if ( $attrType.getNames() ) names.clear(); #foreach ( $name in $attrType.getNames() ) names.add( "$name" ); #end attributeType.setNames( ( String[] ) names.toArray( EMPTY ) ); #else attributeType.setNames( EMPTY ); #end cb.schemaObjectProduced( this, "$attrType.getOid()", attributeType ); #end } }