Examples of ModificationOperation


Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

                    attrType = schemaManager.lookupAttributeTypeRegistry( attr.getUpId() );
                }
            }
           
           
            ModificationOperation modOp = mod.getOperation();
           
            if ( ( ( modOp == ModificationOperation.ADD_ATTRIBUTE ) || ( modOp == ModificationOperation.REPLACE_ATTRIBUTE ) ) &&
                attrType.isCollective() )
            {
                return true;
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

        // If it's absent, and if we have it in the previous entry, that mean we want
        // to enable the schema
        if ( disabledModification != null )
        {
            // We are trying to modify the m-disabled attribute.
            ModificationOperation modification = disabledModification.getOperation();
            ServerAttribute attribute = (ServerAttribute)disabledModification.getAttribute();
           
            hasModification = modifyDisable( opContext, modification, attribute, disabledInEntry );
        }
        else if ( disabledInEntry != null )
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

     */
    @Test
    public void testPreventStructuralClassRemovalOnModifyReplace() throws Exception
    {
        DN name = new DN( "uid=akarasulu,ou=users,dc=example,dc=com" );
        ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
        ServerEntry modifyAttributes = new DefaultServerEntry( schemaManager );
        AttributeType atCN = schemaManager.lookupAttributeTypeRegistry( "cn" );
        modifyAttributes.put( new DefaultServerAttribute( atCN ) );

        // this should pass
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

     * operations remove RDN attributes.
     */
    @Test
    public void testPreventRdnChangeOnModifyRemove() throws Exception
    {
        ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
        DN name = new DN( "ou=user,dc=example,dc=com" );
        ServerEntry attributes = new DefaultServerEntry( schemaManager, name );
        attributes.put( "cn", "does not matter" );

        // postive test which should pass
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

     * operations replace RDN attributes.
     */
    @Test
    public void testPreventRdnChangeOnModifyReplace() throws Exception
    {
        ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
        DN name = new DN( "ou=user,dc=example,dc=com" );
        ServerEntry attributes = new DefaultServerEntry( schemaManager, name );
        attributes.put( "cn", "does not matter" );

        // postive test which should pass
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

        AttributeType OBJECT_CLASS = schemaManager.lookupAttributeTypeRegistry( "objectClass" );
        AttributeType CN_AT = schemaManager.lookupAttributeTypeRegistry( "cn" );

        // this should pass
        DN name = new DN( "uid=akarasulu,ou=users,dc=example,dc=com" );
        ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
        SchemaChecker.preventStructuralClassRemovalOnModifyReplace( schemaManager, name, mod, new DefaultServerAttribute( "cn", CN_AT ) );

        // this should succeed since person is still in replaced set and is structural
        ServerAttribute objectClassesReplaced = new DefaultServerAttribute( "objectClass", OBJECT_CLASS );
        objectClassesReplaced.add( "top" );
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

     */
    @Test
    public void testPreventStructuralClassRemovalOnModifyRemoveAttribute() throws Exception
    {
        DN name = new DN( "uid=akarasulu,ou=users,dc=example,dc=com" );
        ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
        AttributeType ocAt = schemaManager.lookupAttributeTypeRegistry( "objectClass" );
       
        ServerAttribute entryObjectClasses = new DefaultServerAttribute( "objectClass", ocAt );
        entryObjectClasses.add( "top", "person", "organizationalPerson" );

View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

     */
    @Test
    public void testPreventRdnChangeOnModifyRemoveAttribute() throws Exception
    {
        Map<String, OidNormalizer> oidNormalizers = schemaManager.getAttributeTypeRegistry().getNormalizerMapping();
        ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
        DN name = new DN( "ou=user,dc=example,dc=com" ).normalize( oidNormalizers );
        AttributeType cnAt = schemaManager.lookupAttributeTypeRegistry( "cn" );
        AttributeType ouAt = schemaManager.lookupAttributeTypeRegistry( "ou" );
        AttributeType snAt = schemaManager.lookupAttributeTypeRegistry( "sn" );

View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

                    attrType = schemaManager.lookupAttributeTypeRegistry( attr.getUpId() );
                }
            }
           
           
            ModificationOperation modOp = mod.getOperation();
           
            if ( ( ( modOp == ModificationOperation.ADD_ATTRIBUTE ) || ( modOp == ModificationOperation.REPLACE_ATTRIBUTE ) ) &&
                attrType.isCollective() )
            {
                return true;
View Full Code Here

Examples of org.apache.directory.shared.ldap.entry.ModificationOperation

     */
    @Test
    public void testPreventStructuralClassRemovalOnModifyReplace() throws Exception
    {
        DN name = new DN( "uid=akarasulu,ou=users,dc=example,dc=com" );
        ModificationOperation mod = ModificationOperation.REPLACE_ATTRIBUTE;
        ServerEntry modifyAttributes = new DefaultServerEntry( schemaManager );
        AttributeType atCN = schemaManager.lookupAttributeTypeRegistry( "cn" );
        modifyAttributes.put( new DefaultServerAttribute( atCN ) );

        // this should pass
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.