if ( dn.toString().equals( "" ) ) { String msg = "The rootDSE cannot be moved or renamed!"; throw new LdapNoPermissionException( msg ); }
    private void protectDnAlterations( Name dn ) throws LdapNoPermissionException    {        Invocation invocation = getInvocation();        if ( invocation.getState() == InvocationStateEnum.PREINVOCATION )        {            Name principalDn = getPrincipal( invocation ).getDn();            if ( dn == ADMIN_DN || dn.equals( ADMIN_DN ) )            {                String msg = "User '" + principalDn;                msg += "' does not have permission to move or rename the admin";                msg += " account.  No one not even the admin can move or";                msg += " rename " + dn + "!";                throw new LdapNoPermissionException( msg );            }            if ( dn.size() > 2 && dn.startsWith( USER_BASE_DN ) && ! principalDn.equals( ADMIN_DN ) )            {                String msg = "User '" + principalDn;                msg += "' does not have permission to move or rename the user";                msg += " account: " + dn + ". Only the admin can move or";                msg += " rename user accounts.";                throw new LdapNoPermissionException( msg );            }            if ( dn.size() > 2 && dn.startsWith( GROUP_BASE_DN ) && ! principalDn.equals( ADMIN_DN ) )            {                String msg = "User " + principalDn;                msg += " does not have permission to move or rename the group entry ";                msg += dn + ".\nGroups can only be moved or renamed by the admin.";                throw new LdapNoPermissionException( msg );            }        }    }