Package org.apache.directory.server.core.entry

Examples of org.apache.directory.server.core.entry.ServerModification


    {
        List<Modification> items = new ArrayList<Modification>( serverEntry.size() );
       
        for ( EntryAttribute attribute:serverEntry )
        {
            items.add( new ServerModification( modOp, attribute ) );
        }

        return items;
    }
View Full Code Here


                        if ( opAttr.size() < 1 )
                        {
                            op = ModificationOperation.REMOVE_ATTRIBUTE;
                        }

                        modList.add( new ServerModification( op, opAttr ) );
                    }
                }
            }
            // need to add references to the subentry
            else if ( isNewNameSelected && !isOldNameSelected )
            {
                for ( String aSUBENTRY_OPATTRS : SUBENTRY_OPATTRS )
                {
                    ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
                    ServerAttribute opAttr = new DefaultServerAttribute( aSUBENTRY_OPATTRS, atRegistry
                        .lookup( aSUBENTRY_OPATTRS ) );
                    opAttr.add( subentryDn );
                    modList.add( new ServerModification( op, opAttr ) );
                }
            }
        }

        return modList;
View Full Code Here

            {
                operational.remove( oldName.toString() );
                operational.add( newName.toString() );
            }

            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
        }

        if ( subentry.isSchemaSubentry() )
        {
            operational = ( ServerAttribute ) entry.get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).clone();

            if ( operational == null )
            {
                operational = new DefaultServerAttribute( SchemaConstants.SUBSCHEMA_SUBENTRY_AT, atRegistry
                    .lookup( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) );
                operational.add( newName.toString() );
            }
            else
            {
                operational.remove( oldName.toString() );
                operational.add( newName.toString() );
            }

            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
        }

        if ( subentry.isCollectiveSubentry() )
        {
            operational = ( ServerAttribute ) entry.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ).clone();

            if ( operational == null )
            {
                operational = new DefaultServerAttribute( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT,
                    atRegistry.lookup( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT ) );
                operational.add( newName.toString() );
            }
            else
            {
                operational.remove( oldName.toString() );
                operational.add( newName.toString() );
            }

            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
        }

        if ( subentry.isTriggerSubentry() )
        {
            operational = ( ServerAttribute ) entry.get( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ).clone();

            if ( operational == null )
            {
                operational = new DefaultServerAttribute( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT, atRegistry
                    .lookup( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT ) );
                operational.add( newName.toString() );
            }
            else
            {
                operational.remove( oldName.toString() );
                operational.add( newName.toString() );
            }

            modList.add( new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, operational ) );
        }

        return modList;
    }
View Full Code Here

            if ( ( opAttr != null ) && opAttr.contains( dn ) )
            {
                AttributeType attributeType = atRegistry.lookup( opAttrId );
                ServerAttribute attr = new DefaultServerAttribute( opAttrId, attributeType, dn );
                modList.add( new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr ) );
            }
        }

        return modList;
    }
View Full Code Here

            else
            {
                op = ModificationOperation.ADD_ATTRIBUTE;
            }

            modList.add( new ServerModification( op, result ) );
        }

        return modList;
    }
View Full Code Here

                        if ( opAttr.size() < 1 )
                        {
                            op = ModificationOperation.REMOVE_ATTRIBUTE;
                        }

                        modList.add( new ServerModification( op, opAttr ) );
                    }
                }
            }
            // need to add references to the subentry
            else if ( isNewEntrySelected && !isOldEntrySelected )
            {
                for ( String attribute : SUBENTRY_OPATTRS )
                {
                    ModificationOperation op = ModificationOperation.ADD_ATTRIBUTE;
                    AttributeType type = atRegistry.lookup( attribute );
                    ServerAttribute opAttr = new DefaultServerAttribute( attribute, type );
                    opAttr.add( subentryDn );
                    modList.add( new ServerModification( op, opAttr ) );
                }
            }
        }

        return modList;
View Full Code Here

       
        List<Modification> serverModifications = new ArrayList<Modification>( mods.size() );
       
        for ( Modification mod:mods )
        {
            serverModifications.add( new ServerModification( directoryService.getRegistries(), mod ) );
        }
       
        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );

        opContext.setLogChange( log );
View Full Code Here

       
        List<Modification> serverModifications = new ArrayList<Modification>( mods.size() );
       
        for ( Modification mod:mods )
        {
            serverModifications.add( new ServerModification( directoryService.getRegistries(), mod ) );
        }

        ModifyOperationContext opContext = new ModifyOperationContext( this, dn, serverModifications );
       
        setReferralHandling( opContext, ignoreReferral );
View Full Code Here

        AttributeType at;
        try
        {
            at = directoryService.getRegistries().getAttributeTypeRegistry().lookup( key );
            ServerAttribute attr = new DefaultServerAttribute( at );
            Modification mi = new ServerModification( ModificationOperation.REMOVE_ATTRIBUTE, attr );
            addDelta( mi );
        }
        catch ( NamingException e )
        {
            e.printStackTrace();
View Full Code Here

        AttributeType at;
        try
        {
            at = directoryService.getRegistries().getAttributeTypeRegistry().lookup( key );
            ServerAttribute attr = new DefaultServerAttribute( at, value );
            Modification mi = new ServerModification( ModificationOperation.REPLACE_ATTRIBUTE, attr );
            addDelta( mi );
        }
        catch ( NamingException e )
        {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.entry.ServerModification

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.