Package org.apache.directory.server.schema.registries

Examples of org.apache.directory.server.schema.registries.AttributeTypeRegistry


        getLog().info( "------------------------------------------------------------------------" );
        getLog().info( " Adding attributeTypes:" );
        getLog().info( "------------------------------------------------------------------------" );
        getLog().info( "" );

        AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();

        for ( AttributeType attributeType:attributeTypeRegistry )
        {
            String schemaName = attributeTypeRegistry.getSchemaName( attributeType.getOid() );
            Schema schema = registries.getLoadedSchemas().get( schemaName );
            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( attributeType ) );
            LdapDN dn = checkCreateSchema( schemaName );
            dn.add( SchemaConstants.OU_AT + "=attributeTypes" );
            dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
View Full Code Here


     * @throws NamingException with problems initializing cache
     */
    public TriggerSpecCache( DirectoryService directoryService ) throws Exception
    {
        this.nexus = directoryService.getPartitionNexus();
        final AttributeTypeRegistry registry = directoryService.getRegistries().getAttributeTypeRegistry();
        triggerSpecParser = new TriggerSpecificationParser( new NormalizerMappingResolver()
            {
                public Map<String, OidNormalizer> getNormalizerMapping() throws Exception
                {
                    return registry.getNormalizerMapping();
                }
            });
        initialize( directoryService );
    }
View Full Code Here

    }

   
    private void initHandlerMaps() throws NamingException
    {
        AttributeTypeRegistry atReg = registries.getAttributeTypeRegistry();
        for ( int ii = 0; ii < OP_ATTRS.length; ii++ )
        {
            AttributeType at = atReg.lookup( OP_ATTRS[ii] );
            opAttr2handlerMap.put( at.getOid(), schemaObjectHandlers[ii] );
        }

        ObjectClassRegistry ocReg = registries.getObjectClassRegistry();
        for ( int ii = 0; ii < META_OBJECT_CLASSES.length; ii++ )
View Full Code Here

    public void init( DirectoryService directoryService ) throws Exception
    {
        super.init( directoryService );
       
        triggerSpecCache = new TriggerSpecCache( directoryService );
        final AttributeTypeRegistry attrRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
        triggerParser = new TriggerSpecificationParser
            ( new NormalizerMappingResolver()
                {
                    public Map<String, OidNormalizer> getNormalizerMapping() throws Exception
                    {
                        return attrRegistry.getNormalizerMapping();
                    }
                }
            );
        chain = directoryService.getInterceptorChain();
       
View Full Code Here

        for ( Modification mod:mods )
        {
            newModsList.add( mod );
        }
       
        AttributeTypeRegistry atRegistry = modContext.getSession()
            .getDirectoryService().getRegistries().getAttributeTypeRegistry();

        // Add our modification items.
        newModsList.add(
            new ServerModification(
                ModificationOperation.REPLACE_ATTRIBUTE,
                new DefaultServerAttribute(
                    KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
                    atRegistry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT ),
                    principalName ) ) );
        newModsList.add(
            new ServerModification(
                ModificationOperation.REPLACE_ATTRIBUTE,
                new DefaultServerAttribute(
                    KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT,
                    atRegistry.lookup( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT ),
                    Integer.toString( kvno ) ) ) );
       
        ServerAttribute attribute = getKeyAttribute( modContext.getSession()
            .getDirectoryService().getRegistries(), keys );
        newModsList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute ) );
View Full Code Here

        LOG.info( "Initializing ..." );
        super.init( ds );
       
        this.ds = ds;
        OidRegistry oidRegistry = ds.getRegistries().getOidRegistry();
        AttributeTypeRegistry attributeRegistry = ds.getRegistries().getAttributeTypeRegistry();
        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry, oidRegistry );
        filterNormalizer = new FilterNormalizingVisitor( ncn, ds.getRegistries() );
        evaluator = new ExpressionEvaluator( oidRegistry, attributeRegistry );
        executor = new ThreadPoolExecutor( 1, 10, 1000, TimeUnit.MILLISECONDS,
            new ArrayBlockingQueue<Runnable>( 100 ) );
View Full Code Here

    public TupleCache( CoreSession session ) throws Exception
    {
        normalizerMap = session.getDirectoryService().getRegistries()
            .getAttributeTypeRegistry().getNormalizerMapping();
        this.nexus = session.getDirectoryService().getPartitionNexus();
        AttributeTypeRegistry attributeTypeRegistry = session.getDirectoryService()
            .getRegistries().getAttributeTypeRegistry();
        OidRegistry oidRegistry = session.getDirectoryService().getRegistries().getOidRegistry();
        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeTypeRegistry, oidRegistry );
        aciParser = new ACIItemParser( ncn, normalizerMap );
        prescriptiveAciAT = attributeTypeRegistry.lookup( SchemaConstants.PRESCRIPTIVE_ACI_AT );
        initialize( session );
    }
View Full Code Here

    public void init() throws Exception
    {
        service = new DefaultDirectoryService();

        OidRegistry oidRegistry = service.getRegistries().getOidRegistry();
        AttributeTypeRegistry attributeRegistry = service.getRegistries().getAttributeTypeRegistry();
        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry, oidRegistry );
        normVisitor = new FilterNormalizingVisitor( ncn, service.getRegistries() );
    }
View Full Code Here

   
    @Test
    public void testDescendants() throws Exception
    {
        AttributeTypeRegistry attrRegistry = registries.getAttributeTypeRegistry();
        Iterator<AttributeType> list = attrRegistry.descendants( "name" );
        Set<String> nameAttrs = new HashSet<String>();
       
        while ( list.hasNext() )
        {
            AttributeType type = list.next();
View Full Code Here

     * @throws Exception on error
     */
    @Test
    public void testEnableSchema() throws Exception
    {
        AttributeTypeRegistry atr = getAttributeTypeRegistry();
       
        // check that the nis schema is not loaded
        assertTrue( IntegrationUtils.isDisabled( service, "nis" ) );
       
        // double check and make sure an attribute from that schema is
        // not in the AttributeTypeRegistry
        assertFalse( atr.hasAttributeType( TEST_ATTR_OID ) );
       
        // now enable the test schema
        IntegrationUtils.enableSchema( service, "nis" );
       
        // now test that the schema is loaded
        assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
       
        // double check and make sure the test attribute from the
        // test schema is now loaded and present within the attr registry
        assertTrue( atr.hasAttributeType( TEST_ATTR_OID ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.schema.registries.AttributeTypeRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.