You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Aleksander Adamowski (JIRA)" <ji...@apache.org> on 2009/01/06 16:50:44 UTC

[jira] Created: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Only adding from LDIF is possible with injectEntries() in IntegrationUtils
--------------------------------------------------------------------------

                 Key: DIRSERVER-1300
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
             Project: Directory ApacheDS
          Issue Type: Bug
          Components: core-integ
    Affects Versions: 1.5.4
            Reporter: Aleksander Adamowski


The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.

So the following LDIF cannot be currently processed by injectEntries:

version:   1
dn: cn=schema
changetype: modify
add: attributeTypes
attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
    DESC 'custom attribute 1'
    EQUALITY caseIgnoreMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    SINGLE-VALUE )
attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
    DESC 'custom attribute 2'
    EQUALITY caseIgnoreMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    SINGLE-VALUE )
-
add: objectClasses
objectClasses: ( .3.6.1.4.1.12345.2.1
    NAME 'customClass1'
    SUP top
    STRUCTURAL
    MUST ( cn $ customAttr1 )
    MAY ( customAttr2 ) )


I've tracked down the problem and found out it's quite simple to add support for the remaining change types:

Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
===================================================================
--- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
+++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
@@ -99,8 +99,19 @@
 
         for ( LdifEntry entry : entries )
         {
-            service.getAdminSession().add( 
-                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
+            if ( entry.isChangeAdd() )
+            {
+                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
+
+            }
+            else if ( entry.isChangeModify() )
+            {
+                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
+            }
+            else
+            {
+                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
+            }
         }
     }
 

I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Aleksander Adamowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674581#action_12674581 ] 

Aleksander Adamowski commented on DIRSERVER-1300:
-------------------------------------------------

Confirming that the fix works with the latest 1.5.5-SNAPSHOT.

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668403#action_12668403 ] 

Emmanuel Lecharny commented on DIRSERVER-1300:
----------------------------------------------

what a dumb a** I'm !

Let me fix that...

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Aleksander Adamowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668397#action_12668397 ] 

Aleksander Adamowski commented on DIRSERVER-1300:
-------------------------------------------------

I think the patch didn't apply correctly because the old unconditional add is still there

        for ( LdifEntry entry : entries )
        {
HERE-->     service.getAdminSession().add( 
                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
            if ( entry.isChangeAdd() )
            {
                service.getAdminSession().add( 
                    new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
            }
            else if ( entry.isChangeModify() )
            {
                service.getAdminSession().modify( 
                    entry.getDn(), entry.getModificationItems() );
            }
            else
            {
                String message = "Unsupported changetype found in LDIF: " + 
                    entry.getChangeType();
                LOG.error( message );
                throw new NamingException( message );
            }
        }

I think it will throw the Exception before getting to the conditional check. These two lines should be deleted, there's already an add() invocation after entry.isChangeAdd()  gets checked. If you try to add() unconditionally, you'll get an exception if the change isn't actually an add.



> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRSERVER-1300:
-----------------------------------------

    Fix Version/s: 1.5.5

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668392#action_12668392 ] 

Emmanuel Lecharny commented on DIRSERVER-1300:
----------------------------------------------

1.5.5 is not out yet :)

I just edited the issue and set the fix for version 1.5.5. It's still open (check the Status).

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Steve Jones (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12765386#action_12765386 ] 

Steve Jones commented on DIRSERVER-1300:
----------------------------------------

I think the same issue is present in AbstractState.injectLdifs (which is used by the @ApplyLdifFiles annotation).

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRSERVER-1300.
----------------------------------------


closed

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Aleksander Adamowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksander Adamowski updated DIRSERVER-1300:
--------------------------------------------

    Attachment: apacheds-core-integ_inject_ldif-changetype_modify_support.patch

The patch that adds support for changetype modify.

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Aleksander Adamowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668386#action_12668386 ] 

Aleksander Adamowski commented on DIRSERVER-1300:
-------------------------------------------------

You've marked this as fixed for 1.5.5, however I don't see any changes on the trunk:
http://svn.apache.org/repos/asf/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRSERVER-1300.
------------------------------------------

    Resolution: Fixed

Applied Aleksander's patch :
http://svn.apache.org/viewvc?rev=738811&view=rev 

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRSERVER-1300) Only adding from LDIF is possible with injectEntries() in IntegrationUtils

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668405#action_12668405 ] 

Emmanuel Lecharny commented on DIRSERVER-1300:
----------------------------------------------

Fixed in :
http://svn.apache.org/viewvc?rev=738820&view=rev

> Only adding from LDIF is possible with injectEntries() in IntegrationUtils
> --------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1300
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1300
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core-integ
>    Affects Versions: 1.5.4
>            Reporter: Aleksander Adamowski
>             Fix For: 1.5.5
>
>         Attachments: apacheds-core-integ_inject_ldif-changetype_modify_support.patch
>
>
> The method org.apache.directory.server.core.integ.IntegrationUtils.injectEntries(DirectoryService, String) only supports adding entries - it assumes that there are no changetype: something-other-than-add entries in the LDIF. This greatly complicates modifying the intergration testing server's schema.
> So the following LDIF cannot be currently processed by injectEntries:
> version:   1
> dn: cn=schema
> changetype: modify
> add: attributeTypes
> attributeTypes: ( 1.3.6.1.4.1.12345.1.1 NAME 'customAttr1'
>     DESC 'custom attribute 1'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> attributeTypes: ( 1.3.6.1.4.1.12345.1.2 NAME 'customAttr2'
>     DESC 'custom attribute 2'
>     EQUALITY caseIgnoreMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
>     SINGLE-VALUE )
> -
> add: objectClasses
> objectClasses: ( .3.6.1.4.1.12345.2.1
>     NAME 'customClass1'
>     SUP top
>     STRUCTURAL
>     MUST ( cn $ customAttr1 )
>     MAY ( customAttr2 ) )
> I've tracked down the problem and found out it's quite simple to add support for the remaining change types:
> Index: src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
> ===================================================================
> --- src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(revision 731909)
> +++ src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java	(working copy)
> @@ -99,8 +99,19 @@
>  
>          for ( LdifEntry entry : entries )
>          {
> -            service.getAdminSession().add( 
> -                new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) ); 
> +            if ( entry.isChangeAdd() )
> +            {
> +                service.getAdminSession().add( new DefaultServerEntry( service.getRegistries(), entry.getEntry() ) );
> +
> +            }
> +            else if ( entry.isChangeModify() )
> +            {
> +                service.getAdminSession().modify( entry.getDn(), entry.getModificationItems() );
> +            }
> +            else
> +            {
> +                throw new NamingException( "Unsupported changetype found in LDIF: " + entry.getChangeType() );
> +            }
>          }
>      }
>  
> I'll attach the patch in a minute.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.