Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-93

Add server detection for ApacheDS and TivoliDS on RootDSE property page

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.7.0
    • Fix Version/s: 1.0.0
    • Component/s: studio-ldapbrowser
    • Labels:
      None

      Description

      Currently, the property page for the RootDSE does not correctly detects ApacheDS. I have added a conditional for this, and for Tivoli Directory Server (IBM) as well.The method createContents gets longer and longer; thus I have created some detection methods. Feel free to consider the following patch.

      From my point of view, a cleaner and more extensible solution would be to an interface for server detection, which solely operates on the RootDSE attributes. Implementations would be easier to test as well.

      1. patch.txt
        16 kB
        Stefan Zoerner

        Activity

        Hide
        Stefan Zoerner added a comment -

        A patch which contains the server detection for ApacheDS and TivoliDS. Some refactoring has done to keep the method getContents short.

        Show
        Stefan Zoerner added a comment - A patch which contains the server detection for ApacheDS and TivoliDS. Some refactoring has done to keep the method getContents short.
        Hide
        Stefan Seelmann added a comment -

        Thanks Stefan, I applied the patch: http://svn.apache.org/viewvc?view=rev&rev=534230

        You are totally right, the big method isn't very nice. With Eclipse/OSGi it is very easy to realise your suggestion. We could define an Interface and a new eclipse extension point for that. Then new detection code could be plugged-in without changing existing code. A simple interface could look like that:

        -------------------------------------------------------------------------
        public interface DirectoryTypeDetector

        { /** * Tries to detect the directory type from the given Root DSE. * * @param rootDSE the Root DSE * @return the directory type or null if not detectable */ public String detectDirectoryType( IRootDSE rootDSE ); }

        -------------------------------------------------------------------------

        Of course there could be some conflicts if more than one registered detector returns a type. But I think we should keep it simple.

        Show
        Stefan Seelmann added a comment - Thanks Stefan, I applied the patch: http://svn.apache.org/viewvc?view=rev&rev=534230 You are totally right, the big method isn't very nice. With Eclipse/OSGi it is very easy to realise your suggestion. We could define an Interface and a new eclipse extension point for that. Then new detection code could be plugged-in without changing existing code. A simple interface could look like that: ------------------------------------------------------------------------- public interface DirectoryTypeDetector { /** * Tries to detect the directory type from the given Root DSE. * * @param rootDSE the Root DSE * @return the directory type or null if not detectable */ public String detectDirectoryType( IRootDSE rootDSE ); } ------------------------------------------------------------------------- Of course there could be some conflicts if more than one registered detector returns a type. But I think we should keep it simple.
        Hide
        Stefan Zoerner added a comment -

        Another option would be to create an interface with parameter type javax.naming.directory.Attributes representing the attributes of the Root DSE instead of IRootDSE, because with this the classes would easily used in an arbitrary context, and JUnit test would be easier to create as well.

        Show
        Stefan Zoerner added a comment - Another option would be to create an interface with parameter type javax.naming.directory.Attributes representing the attributes of the Root DSE instead of IRootDSE, because with this the classes would easily used in an arbitrary context, and JUnit test would be easier to create as well.
        Hide
        Stefan Zoerner added a comment -

        Detection works for the two relevant servers now.

        Show
        Stefan Zoerner added a comment - Detection works for the two relevant servers now.

          People

          • Assignee:
            Unassigned
            Reporter:
            Stefan Zoerner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development