Examples of AttributeTypeRegistry


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

        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

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

        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

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

    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

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

    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

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

   
    @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

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

     * @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

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

     * @throws Exception on error
     */
    @Test
    public void testEnableSchemaAlreadyEnabled() 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" );
       
        // and enable it again (it should not do anything)
        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

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

     * @throws Exception on error
     */
    @Test
    public void testDisableSchemaAlreadyDisabled() 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 disable the test schema
        IntegrationUtils.disableSchema( service, "nis" );
       
        // now test that the schema is loaded
        assertTrue( IntegrationUtils.isDisabled( service, "nis" ) );
       
        // and disable it again (it should not do anything)
        IntegrationUtils.disableSchema( service, "nis" );
       
        // and test again that the schema is still disabled
        assertTrue( IntegrationUtils.isDisabled( service, "nis" ) );
       
        // double check and make sure the test attribute from the
        // test schema is now loaded and present within the attr registry
        assertFalse( atr.hasAttributeType( TEST_ATTR_OID ) );
    }
View Full Code Here

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

    public void testDisableSchema() throws Exception
    {
        // let's enable the test schema
        testEnableSchema();
       
        AttributeTypeRegistry atr = getAttributeTypeRegistry();
       
        // check that the nis schema is enabled
        assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
       
        // double check and make sure an attribute from that schema is
        // in the AttributeTypeRegistry
        assertTrue( atr.hasAttributeType( TEST_ATTR_OID ) );
       
        // now disable the test schema
        IntegrationUtils.disableSchema( service, "samba" );
        IntegrationUtils.disableSchema( service, "nis" );
       
        // now test that the schema is NOT loaded
        assertTrue( IntegrationUtils.isDisabled( service, "nis" ) );
       
        // double check and make sure the test attribute from the test 
        // schema is now NOT loaded and present within the attr registry
        assertFalse( atr.hasAttributeType( TEST_ATTR_OID ) );
    }
View Full Code Here

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

       
        // check that the nis schema is loaded and the dummy schema is loaded
        assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
       
        AttributeTypeRegistry atr = getAttributeTypeRegistry();
       
        // double check and make sure an attribute from that schema is
        // in the AttributeTypeRegistry
        assertTrue( atr.hasAttributeType( TEST_ATTR_OID ) );
       
        // now try to disable the test schema which should fail
        // since it's dependent, the dummy schema, is enabled
        ModificationItem[] mods = new ModificationItem[1];
        Attribute attr = new BasicAttribute( "m-disabled", "TRUE" );
        mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
       
        try
        {
            schemaRoot.modifyAttributes( "cn=nis", mods );
            fail( "attempt to disable schema with enabled dependents should fail" );
        }
        catch ( LdapOperationNotSupportedException e )
        {
            assertTrue( e.getResultCode().equals( ResultCodeEnum.UNWILLING_TO_PERFORM ) );
        }
       
        // now test that both schema are still loaded
        assertTrue( IntegrationUtils.isEnabled( service, "nis" ) );
        assertNotNull( IntegrationUtils.getLoadedSchemas( service ).get( "dummy" ) );
       
        // double check and make sure the test attribute from the test 
        // schema is still loaded and present within the attr registry
        assertTrue( atr.hasAttributeType( TEST_ATTR_OID ) );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.