Examples of AttributeTypeRegistry


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

     * operations remove objectClasses.
     */
    @Test
    public void testPreventStructuralClassRemovalOnModifyRemoveAttribute() throws Exception
    {
        AttributeTypeRegistry atReg = registries.getAttributeTypeRegistry();
        LdapDN name = new LdapDN( "uid=akarasulu,ou=users,dc=example,dc=com" );
        ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
        AttributeType ocAt = atReg.lookup( "objectClass" );
       
        ServerAttribute entryObjectClasses = new DefaultServerAttribute( "objectClass", ocAt );
        entryObjectClasses.add( "top", "person", "organizationalPerson" );

        ObjectClassRegistry ocRegistry = registries.getObjectClassRegistry();

        // this should pass
        SchemaChecker.preventStructuralClassRemovalOnModifyRemove(
            ocRegistry,
            name,
            mod,
            new DefaultServerAttribute( "cn", atReg.lookup( "cn" ) ),
            entryObjectClasses );

        // this should succeed since person is left and is structural
        ServerAttribute objectClassesRemoved = new DefaultServerAttribute(
            "objectClass", ocAt );
View Full Code Here

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

   
    public boolean compare( CompareOperationContext compareContext ) throws Exception
    {
        Partition partition = getPartition( compareContext.getDn() );
        AttributeTypeRegistry registry = registries.getAttributeTypeRegistry();
       
        // complain if we do not recognize the attribute being compared
        if ( !registry.hasAttributeType( compareContext.getOid() ) )
        {
            throw new LdapInvalidAttributeIdentifierException( compareContext.getOid() + " not found within the attributeType registry" );
        }

        AttributeType attrType = registry.lookup( compareContext.getOid() );
       
        EntryAttribute attr = partition.lookup( compareContext.newLookupContext(
            compareContext.getDn() ) ).get( attrType.getName() );

        // complain if the attribute being compared does not exist in the entry
View Full Code Here

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

        GROUP_BASE_DN.normalize( normalizerMapping );
    
        ADMIN_GROUP_DN = new LdapDN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
        ADMIN_GROUP_DN.normalize( normalizerMapping );

        AttributeTypeRegistry attrRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
       
        uniqueMemberAT = attrRegistry.lookup( SchemaConstants.UNIQUE_MEMBER_AT_OID );
       
        loadAdministrators( directoryService );
    }
View Full Code Here

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

     */
    public GroupCache( CoreSession session ) throws Exception
    {
        normalizerMap = session.getDirectoryService().getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
        nexus = session.getDirectoryService().getPartitionNexus();
        AttributeTypeRegistry attributeTypeRegistry = session.getDirectoryService()
            .getRegistries().getAttributeTypeRegistry();

        memberAT = attributeTypeRegistry.lookup( SchemaConstants.MEMBER_AT_OID );
        uniqueMemberAT = attributeTypeRegistry.lookup( SchemaConstants.UNIQUE_MEMBER_AT_OID );

        // stuff for dealing with the admin group
        administratorsGroupDn = parseNormalized( ServerDNConstants.ADMINISTRATORS_GROUP_DN );

        initialize( session );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry

            OpenLdapSchemaParser olsp = new OpenLdapSchemaParser();
            olsp.setQuirksMode( true );
            olsp.parse( schemaFile );

            List<AttributeType> atList = olsp.getAttributeTypes();
            AttributeTypeRegistry atRegistry = schemaManager.getRegistries().getAttributeTypeRegistry();

            for ( AttributeType atType : atList )
            {
                atRegistry.addMappingFor( atType );
            }

            List<ObjectClass> ocList = olsp.getObjectClassTypes();
            ObjectClassRegistry ocRegistry = schemaManager.getRegistries().getObjectClassRegistry();
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry

    /**
     * Build and check the MUST AT for this ObjectClass.
     */
    private static void buildMust( ObjectClass objectClass, List<Throwable> errors, Registries registries )
    {
        AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
        List<String> mustAttributeTypeOids = objectClass.getMustAttributeTypeOids();

        if ( mustAttributeTypeOids != null )
        {
            objectClass.getMustAttributeTypes().clear();

            for ( String mustAttributeTypeName : mustAttributeTypeOids )
            {
                try
                {
                    AttributeType attributeType = atRegistry.lookup( mustAttributeTypeName );

                    if ( attributeType.isCollective() )
                    {
                        // Collective Attributes are not allowed in MAY or MUST
                        String msg = I18n.err( I18n.ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST, mustAttributeTypeName,
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry

    /**
     * Build and check the MAY AT for this ObjectClass
     */
    private static void buildMay( ObjectClass objectClass, List<Throwable> errors, Registries registries )
    {
        AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
        List<String> mayAttributeTypeOids = objectClass.getMayAttributeTypeOids();

        if ( mayAttributeTypeOids != null )
        {
            objectClass.getMayAttributeTypes().clear();

            for ( String mayAttributeTypeName : mayAttributeTypeOids )
            {
                try
                {
                    AttributeType attributeType = atRegistry.lookup( mayAttributeTypeName );

                    if ( attributeType.isCollective() )
                    {
                        // Collective Attributes are not allowed in MAY or MUST
                        String msg = I18n.err( I18n.ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY, mayAttributeTypeName, objectClass.getOid() );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry

        if ( registries != null )
        {
            try
            {
                ditContentRule.unlock();
                AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
                ObjectClassRegistry ocRegistry = registries.getObjectClassRegistry();
   
                if ( ditContentRule.getMayAttributeTypeOids() != null )
                {
                    ditContentRule.getMayAttributeTypes().clear();
   
                    for ( String oid : ditContentRule.getMayAttributeTypeOids() )
                    {
                        ditContentRule.getMayAttributeTypes().add( atRegistry.lookup( oid ) );
                    }
                }
   
                if ( ditContentRule.getMustAttributeTypeOids() != null )
                {
                    ditContentRule.getMustAttributeTypes().clear();
   
                    for ( String oid : ditContentRule.getMustAttributeTypeOids() )
                    {
                        ditContentRule.getMustAttributeTypes().add( atRegistry.lookup( oid ) );
                    }
                }
   
                if ( ditContentRule.getNotAttributeTypeOids() != null )
                {
                    ditContentRule.getNotAttributeTypes().clear();
   
                    for ( String oid : ditContentRule.getNotAttributeTypeOids() )
                    {
                        ditContentRule.getNotAttributeTypes().add( atRegistry.lookup( oid ) );
                    }
                }
   
                if ( ditContentRule.getAuxObjectClassOids() != null )
                {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry

     */
    public void removeFromRegistries( List<Throwable> errors, Registries registries ) throws LdapException
    {
        if ( registries != null )
        {
            AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();

            // Remove the attributeType from the oid/normalizer map
            attributeTypeRegistry.removeMappingFor( this );

            // Unregister this AttributeType into the Descendant map
            attributeTypeRegistry.unregisterDescendants( this, superior );

            /**
             * Remove the AT references (using and usedBy) :
             * AT -> MR (for EQUALITY, ORDERING and SUBSTR)
             * AT -> S
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.schema.registries.AttributeTypeRegistry

            throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
        }

        if ( registries != null )
        {
            AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();

            if ( applicableAttributeOids != null )
            {
                applicableAttributes = new ArrayList<AttributeType>( applicableAttributeOids.size() );

                for ( String oid : applicableAttributeOids )
                {
                    applicableAttributes.add( atRegistry.lookup( 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.