<commit_before>/*! ******************************************************************************
 *
 * Pentaho Data Integration
 *
 * Copyright (C) 2002-2019 by <NAME> : http://www.pentaho.com
 *
 *******************************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ******************************************************************************/

package org.pentaho.di.ui.repo.controller;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang.ClassUtils;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Shell;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.logging.KettleLogStore;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.core.plugins.PluginInterface;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.plugins.RepositoryPluginType;
import org.pentaho.di.core.util.ExecutorUtil;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.repository.AbstractRepository;
import org.pentaho.di.repository.ReconnectableRepository;
import org.pentaho.di.repository.RepositoriesMeta;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.repository.RepositoryMeta;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.ui.core.PropsUI;
import org.pentaho.di.ui.core.database.dialog.DatabaseDialog;
import org.pentaho.di.ui.repo.IConnectedRepositoryInstance;
import org.pentaho.di.ui.repo.model.RepositoryModel;
import org.pentaho.di.ui.repo.timeout.RepositorySessionTimeoutHandler;
import org.pentaho.di.ui.repo.model.UserRepositoriesMeta;
import org.pentaho.di.ui.spoon.Spoon;
import org.pentaho.di.ui.util.HelpUtils;

import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.function.Supplier;

/**
 * Created by bmorrise on 4/18/16.
 */
public class RepositoryConnectController implements IConnectedRepositoryInstance {

  public static final String DISPLAY_NAME = "displayName";
  public static final String DESCRIPTION = "description";
  public static final String IS_DEFAULT = "isDefault";
  public static final String URL = "url";
  public static final String DATABASE_CONNECTION = "databaseConnection";
  public static final String SHOW_HIDDEN_FOLDERS = "showHiddenFolders";
  public static final String LOCATION = "location";
  public static final String DO_NOT_MODIFY = "doNotModify";
  public static final String ORIGINAL_NAME = "originalName";

  public static final String DEFAULT_URL = "defaultUrl";
  public static final String MESSAGE = "message";
  public static final String SUCCESS = "success";
  public static final String ERROR_401 = "401";

  private static Class<?> PKG = RepositoryConnectController.class;
  private static LogChannelInterface log =
    KettleLogStore.getLogChannelInterfaceFactory().create( RepositoryConnectController.class );

  public static final String HELP_URL =
    Const.getDocUrl( BaseMessages.getString( PKG, "RepositoryDialog.Dialog.Help" ) );

  private PluginRegistry pluginRegistry;
  private Supplier<Spoon> spoonSupplier;
  private List<RepositoryContollerListener> listeners = new ArrayList<>();
  private boolean relogin = false;
  private Shell parentShell;

  public RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier ) {
    this.pluginRegistry = pluginRegistry;
    this.spoonSupplier = spoonSupplier;
  }

  public RepositoryConnectController() {
    this( PluginRegistry.getInstance(), Spoon::getInstance );
  }

  public void setParentShell( Shell shell ) {
    this.parentShell = shell;<commit_msg>Remove variables that are no longer used due to a55b60e9<commit_after>/*! ******************************************************************************
 *
 * Pentaho Data Integration
 *
 * Copyright (C) 2002-2019 by <NAME> : http://www.pentaho.com
 *
 *******************************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ******************************************************************************/

package org.pentaho.di.ui.repo.controller;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.lang.ClassUtils;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Shell;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.pentaho.di.core.Const;
import org.pentaho.di.core.database.DatabaseMeta;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.logging.KettleLogStore;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.core.plugins.PluginInterface;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.plugins.RepositoryPluginType;
import org.pentaho.di.core.util.ExecutorUtil;
import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.repository.AbstractRepository;
import org.pentaho.di.repository.ReconnectableRepository;
import org.pentaho.di.repository.RepositoriesMeta;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.repository.RepositoryMeta;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.ui.core.PropsUI;
import org.pentaho.di.ui.core.database.dialog.DatabaseDialog;
import org.pentaho.di.ui.repo.IConnectedRepositoryInstance;
import org.pentaho.di.ui.repo.model.RepositoryModel;
import org.pentaho.di.ui.repo.timeout.RepositorySessionTimeoutHandler;
import org.pentaho.di.ui.repo.model.UserRepositoriesMeta;
import org.pentaho.di.ui.spoon.Spoon;
import org.pentaho.di.ui.util.HelpUtils;

import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.function.Supplier;

/**
 * Created by bmorrise on 4/18/16.
 */
public class RepositoryConnectController implements IConnectedRepositoryInstance {

  public static final String DISPLAY_NAME = "displayName";
  public static final String DESCRIPTION = "description";
  public static final String IS_DEFAULT = "isDefault";
  public static final String URL = "url";
  public static final String DATABASE_CONNECTION = "databaseConnection";
  public static final String SHOW_HIDDEN_FOLDERS = "showHiddenFolders";
  public static final String LOCATION = "location";
  public static final String DO_NOT_MODIFY = "doNotModify";
  public static final String ORIGINAL_NAME = "originalName";

  public static final String DEFAULT_URL = "defaultUrl";
  public static final String ERROR_401 = "401";

  private static Class<?> PKG = RepositoryConnectController.class;
  private static LogChannelInterface log =
    KettleLogStore.getLogChannelInterfaceFactory().create( RepositoryConnectController.class );

  public static final String HELP_URL =
    Const.getDocUrl( BaseMessages.getString( PKG, "RepositoryDialog.Dialog.Help" ) );

  private PluginRegistry pluginRegistry;
  private Supplier<Spoon> spoonSupplier;
  private List<RepositoryContollerListener> listeners = new ArrayList<>();
  private boolean relogin = false;
  private Shell parentShell;

  public RepositoryConnectController( PluginRegistry pluginRegistry, Supplier<Spoon> spoonSupplier ) {
    this.pluginRegistry = pluginRegistry;
    this.spoonSupplier = spoonSupplier;
  }

  public RepositoryConnectController() {
    this( PluginRegistry.getInstance(), Spoon::getInstance );
  }

  public void setParentShell( Shell shell ) {
    this.parentShell = shell;
{'fraction_non_alphanumeric': 0.14054767403497195, 'fraction_numerical': 0.006048608819971406, 'mean_word_length': 5.589855072463768, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5568956', 'n_tokens_mistral': 2564, 'n_tokens_neox': 2464, 'n_words': 632}