Log warning when Adaptor is configured to use Virtual server URL not avaible in alternate access mapping as public URL
Code Review : https://codereview.appspot.com/114380043/
diff --git a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
index 018e237..6f4ddb7 100644
--- a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
+++ b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
@@ -593,6 +593,7 @@
isSp2007 = (version == null);
log.log(Level.FINE, "isSP2007 : {0}", isSp2007);
+ boolean urlAvailableInAlternateAccessMapping = false;
// Loop through all host-named site collections and add them to
// whitelist for authenticator.
for (ContentDatabases.ContentDatabase cdcd :
@@ -612,9 +613,21 @@
for (Sites.Site siteListing : cd.getSites().getSite()) {
String siteString
= vsAdaptor.encodeDocId(siteListing.getURL()).getUniqueId();
+ if (virtualServer.equalsIgnoreCase(siteString)) {
+ urlAvailableInAlternateAccessMapping = true;
+ }
ntlmAuthenticator.addPermitForHost(spUrlToUri(siteString).toURL());
}
}
+ if (!urlAvailableInAlternateAccessMapping) {
+ log.log(Level.WARNING, "Virtual Server URL {0} is not availble in "
+ + "SharePoint Alternate Access Mapping as Public URL. "
+ + "Due to this mismatch some of the adaptor functionality might "
+ + "not work as expected. Also include / exclude patterns "
+ + "configured on GSA as per Virtual server URL might not "
+ + "work as expected. Please make sure that adaptor is configured "
+ + "to use Public URL instead on internal URL.", virtualServer);
+ }
} catch (WebServiceIOException ex) {
String warning;
Throwable cause = ex.getCause();