package org.ovirt.engine.core.bll.adbroker;

import javax.naming.NamingException;
import javax.naming.directory.Attributes;



/**
 * Holds information queried from a root DSE
 */
public class ADRootDSE implements RootDSE {


    private boolean mixedFunctionalityLevel;
    private String defaultNamingContext;

    public ADRootDSE() {
    }

    public ADRootDSE(boolean mixedFunctionalityLevel, String defaultNamingContext) {
        this.mixedFunctionalityLevel = mixedFunctionalityLevel;
        this.defaultNamingContext = defaultNamingContext;
    }

    public ADRootDSE(Attributes rootDseRecords) throws NumberFormatException, NamingException {
        boolean mixedMode =
                Integer.parseInt(rootDseRecords.get(ADRootDSEAttributes.domainControllerFunctionality.name()).get().toString()) == 4;
        String namingContext = rootDseRecords.get(ADRootDSEAttributes.defaultNamingContext.name()).get().toString();
        this.mixedFunctionalityLevel = mixedMode;
        this.defaultNamingContext = namingContext;
    }

    @Override
    public void setDefaultNamingContext(String defaultNamingContext) {
        this.defaultNamingContext = defaultNamingContext;
    }

    @Override
    public String getDefaultNamingContext() {
        return defaultNamingContext;
    }

    public void setMixedFunctionalityLevel(boolean mixedFunctionalityLevel) {
        this.mixedFunctionalityLevel = mixedFunctionalityLevel;
    }

    public boolean isMixedFunctionalityLevel() {
        return mixedFunctionalityLevel;
    }

}

@@ -118,18 +118,16 @@
 butes;%0A%0A
-%0A%0A
 /**%0A * H
@@ -220,54 +220,8 @@
  %7B%0A%0A
-%0A    private boolean mixedFunctionalityLevel;%0A
     
@@ -283,490 +283,59 @@
 DSE(
-) %7B%0A    %7D%0A%0A    public ADRootDSE(boolean mixedFunctionalityLevel, String defaultNamingContext) %7B%0A        this.mixedFunctionalityLevel = mixedFunctionalityLevel;%0A        this.defaultNamingContext = defaultNamingContext;%0A    %7D%0A%0A    public ADRootDSE(Attributes rootDseRecords) throws NumberFormatException, NamingException %7B%0A        boolean mixedMode =%0A                Integer.parseInt(rootDseRecords.get(ADRootDSEAttributes.domainControllerFunctionality.name()).get().toString()) == 4;
+Attributes rootDseRecords) throws NamingException %7B
 %0A   
@@ -452,58 +452,8 @@
 ();%0A
-        this.mixedFunctionalityLevel = mixedMode;%0A
     
@@ -763,252 +763,6 @@
   %7D%0A
-%0A    public void setMixedFunctionalityLevel(boolean mixedFunctionalityLevel) %7B%0A        this.mixedFunctionalityLevel = mixedFunctionalityLevel;%0A    %7D%0A%0A    public boolean isMixedFunctionalityLevel() %7B%0A        return mixedFunctionalityLevel;%0A    %7D%0A%0A
 %7D%0A

Remove unused code from ADRootDSE