// Path: src/main/java/com/google/enterprise/cloudsearch/sharepoint/SharePointConfiguration.java
// enum SharePointDeploymentType {
//   ONLINE,
//   ON_PREMISES;
// }


import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
import com.google.enterprise.cloudsearch.sdk.identity.IdentitySourceConfiguration;
import com.google.enterprise.cloudsearch.sharepoint.SharePointConfiguration.SharePointDeploymentType;
import com.microsoft.schemas.sharepoint.soap.SiteDataSoap;
import com.microsoft.schemas.sharepoint.soap.directory.UserGroupSoap;
import com.microsoft.schemas.sharepoint.soap.people.PeopleSoap;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListMap;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.Service;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
/*
 * Copyright 2018 Google LLC
 *
 * 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 com.google.enterprise.cloudsearch.sharepoint;



class SiteConnectorFactoryImpl implements SiteConnectorFactory {
  private static final String XMLNS_DIRECTORY =
      "http://schemas.microsoft.com/sharepoint/soap/directory/";
  private static final String XMLNS = "http://schemas.microsoft.com/sharepoint/soap/";
  /** Map from Site or Web URL to SiteConnector object used to communicate with that Site/Web. */
  private final ConcurrentMap<String, SiteConnector> siteConnectors =
      new ConcurrentSkipListMap<String, SiteConnector>();
  private final SoapFactory soapFactory;
  private final SharePointRequestContext requestContext;
  private final boolean xmlValidation;
  private final Optional<ActiveDirectoryClient> activeDirectoryClient;
  private final ImmutableMap<String, IdentitySourceConfiguration>
      referenceIdentitySourceConfiguration;
  private final boolean stripDomainInUserPrincipals;
// Path: src/main/java/com/google/enterprise/cloudsearch/sharepoint/SharePointConfiguration.java
// enum SharePointDeploymentType {
//   ONLINE,
//   ON_PREMISES;
// }


// Path: src/main/java/com/google/enterprise/cloudsearch/sharepoint/SiteConnectorFactoryImpl.java
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableMap;
import com.google.enterprise.cloudsearch.sdk.identity.IdentitySourceConfiguration;
import com.google.enterprise.cloudsearch.sharepoint.SharePointConfiguration.SharePointDeploymentType;
import com.microsoft.schemas.sharepoint.soap.SiteDataSoap;
import com.microsoft.schemas.sharepoint.soap.directory.UserGroupSoap;
import com.microsoft.schemas.sharepoint.soap.people.PeopleSoap;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListMap;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.Service;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;

/*
 * Copyright 2018 Google LLC
 *
 * 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 com.google.enterprise.cloudsearch.sharepoint;



class SiteConnectorFactoryImpl implements SiteConnectorFactory {
  private static final String XMLNS_DIRECTORY =
      "http://schemas.microsoft.com/sharepoint/soap/directory/";
  private static final String XMLNS = "http://schemas.microsoft.com/sharepoint/soap/";
  /** Map from Site or Web URL to SiteConnector object used to communicate with that Site/Web. */
  private final ConcurrentMap<String, SiteConnector> siteConnectors =
      new ConcurrentSkipListMap<String, SiteConnector>();
  private final SoapFactory soapFactory;
  private final SharePointRequestContext requestContext;
  private final boolean xmlValidation;
  private final Optional<ActiveDirectoryClient> activeDirectoryClient;
  private final ImmutableMap<String, IdentitySourceConfiguration>
      referenceIdentitySourceConfiguration;
  private final boolean stripDomainInUserPrincipals;
  private final SharePointDeploymentType sharePointDeploymentType;