Author: kwright
Date: Wed Sep 24 18:26:02 2014
New Revision: 1627389

URL: http://svn.apache.org/r1627389
Log:
Do CONNECTORS-1046 for Documentum.

Modified:
    
manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java

Modified: 
manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java?rev=1627389&r1=1627388&r2=1627389&view=diff
==============================================================================
--- 
manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
 (original)
+++ 
manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
 Wed Sep 24 18:26:02 2014
@@ -38,7 +38,6 @@ public class AuthorityConnector extends 
   public static final String CONFIG_PARAM_USERNAME = "docbaseusername";
   public static final String CONFIG_PARAM_PASSWORD = "docbasepassword";
   public static final String CONFIG_PARAM_DOMAIN = "domain";
-  public static final String CONFIG_PARAM_CASEINSENSITIVE = 
"usernamecaseinsensitive";
   public static final String CONFIG_PARAM_USESYSTEMACLS = "usesystemacls";
   public static final String CONFIG_PARAM_CACHELIFETIME = "cachelifetimemins";
   public static final String CONFIG_PARAM_CACHELRUSIZE = "cachelrusize";
@@ -47,7 +46,6 @@ public class AuthorityConnector extends 
   protected String userName = null;
   protected String password = null;
   protected String domain = null;
-  protected boolean caseInsensitive = false;
   protected boolean useSystemAcls = true;
 
   // Documentum has no "deny" tokens, and its document acls cannot be empty, 
so no local authority deny token is required.
@@ -169,11 +167,6 @@ public class AuthorityConnector extends 
       else
         Logging.authorityConnectors.debug("DCTM: Domain = '" + domain + "'");
 
-      if (caseInsensitive)
-      {
-        Logging.authorityConnectors.debug("DCTM: Case insensitivity enabled");
-      }
-
       if (useSystemAcls)
       {
         Logging.authorityConnectors.debug("DCTM: Use system acls enabled");
@@ -516,9 +509,9 @@ public class AuthorityConnector extends 
         try
         {
           if (hasLoginNameColumn)
-            object = getObjectByQualification("dm_user where 
"+insensitiveMatch(caseInsensitive,"user_login_name",strUserName));
+            object = getObjectByQualification("dm_user where 
"+insensitiveMatch(false,"user_login_name",strUserName));
           if (!object.exists())
-            object = getObjectByQualification("dm_user where 
"+insensitiveMatch(caseInsensitive,"user_os_name",strUserName));
+            object = getObjectByQualification("dm_user where 
"+insensitiveMatch(false,"user_os_name",strUserName));
           if (!object.exists())
           {
             if (Logging.authorityConnectors.isDebugEnabled())
@@ -642,7 +635,7 @@ public class AuthorityConnector extends 
     
     // Construct a cache description object
     ICacheDescription objectDescription = new 
AuthorizationResponseDescription(strUserNamePassedIn,docbaseName,userName,password,
-      domain,caseInsensitive,useSystemAcls,responseLifetime,LRUsize);
+      domain,useSystemAcls,responseLifetime,LRUsize);
     
     // Enter the cache
     ICacheHandle ch = cacheManager.enterCache(new 
ICacheDescription[]{objectDescription},null,null);
@@ -682,18 +675,7 @@ public class AuthorityConnector extends 
 
     try
     {
-      String strUserName;
-
-      // Strip off domain from username passed in
-      int intDomainLoc = strUserNamePassedIn.indexOf("@");
-      if (intDomainLoc > 1)
-      {
-        strUserName = strUserNamePassedIn.substring(0, intDomainLoc);
-      }
-      else
-      {
-        strUserName = strUserNamePassedIn;
-      }
+      String strUserName = strUserNamePassedIn;
 
       String strAccessToken;
       while (true)
@@ -701,9 +683,9 @@ public class AuthorityConnector extends 
         boolean noSession = (session==null);
         getSession();
         GetUserAccessIDThread t = new GetUserAccessIDThread(strUserName);
+        t.start();
         try
         {
-          t.start();
           t.join();
           Throwable thr = t.getException();
           if (thr != null)
@@ -772,9 +754,9 @@ public class AuthorityConnector extends 
         getSession();
         ArrayList list =  new ArrayList();
         GetAccessTokensThread t = new GetAccessTokensThread(strDQL,list);
+        t.start();
         try
         {
-          t.start();
           t.join();
           Throwable thr = t.getException();
           if (thr != null)
@@ -855,7 +837,7 @@ public class AuthorityConnector extends 
       sb.append(field);
     sb.append("=");
     if (insensitive)
-      sb.append(quoteDQLString(value.toUpperCase()));
+      sb.append(quoteDQLString(value.toUpperCase(Locale.ROOT)));
     else
       sb.append(quoteDQLString(value));
     return sb.toString();
@@ -922,14 +904,6 @@ public class AuthorityConnector extends 
       domain = null;
     }
 
-    String strCaseInsensitive = 
configParams.getParameter(CONFIG_PARAM_CASEINSENSITIVE);
-    if (strCaseInsensitive != null && strCaseInsensitive.equals("true"))
-    {
-      caseInsensitive = true;
-    }
-    else
-      caseInsensitive = false;
-
     String strUseSystemAcls = 
configParams.getParameter(CONFIG_PARAM_USESYSTEMACLS);
     if (strUseSystemAcls == null || strUseSystemAcls.equals("true"))
     {
@@ -1053,7 +1027,6 @@ public class AuthorityConnector extends 
     throws ManifoldCFException, IOException
   {
     tabsArray.add(Messages.getString(locale,"DCTM.Docbase"));
-    tabsArray.add(Messages.getString(locale,"DCTM.UserMapping"));
     tabsArray.add(Messages.getString(locale,"DCTM.SystemACLs"));
     tabsArray.add(Messages.getString(locale,"DCTM.Cache"));
 
@@ -1151,10 +1124,6 @@ public class AuthorityConnector extends 
     if (docbaseDomain == null)
       docbaseDomain = "";
 
-    String caseInsensitiveUser = 
parameters.getParameter(CONFIG_PARAM_CASEINSENSITIVE);
-    if (caseInsensitiveUser == null)
-      caseInsensitiveUser = "false";
-
     String useSystemAcls = parameters.getParameter(CONFIG_PARAM_USESYSTEMACLS);
     if (useSystemAcls == null)
       useSystemAcls = "true";
@@ -1203,38 +1172,6 @@ public class AuthorityConnector extends 
       );
     }
 
-    // "User Mapping" tab
-    if (tabName.equals(Messages.getString(locale,"DCTM.UserMapping")))
-    {
-      out.print(
-"<table class=\"displaytable\">\n"+
-"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\"><nobr>" + 
Messages.getBodyString(locale,"DCTM.AuthenticationUsernameMatching") + 
"</nobr></td>\n"+
-"    <td class=\"value\">\n"+
-"      <table class=\"displaytable\">\n"+
-"        <tr>\n"+
-"          <td class=\"description\"><input name=\"usernamecaseinsensitive\" 
type=\"radio\" value=\"true\" 
"+((caseInsensitiveUser.equals("true"))?"checked=\"true\"":"")+" /></td>\n"+
-"          <td class=\"value\"><nobr>" + 
Messages.getBodyString(locale,"DCTM.CaseInsensitive") + "</nobr></td>\n"+
-"        </tr>\n"+
-"        <tr>\n"+
-"          <td class=\"description\"><input name=\"usernamecaseinsensitive\" 
type=\"radio\" value=\"false\" 
"+((!caseInsensitiveUser.equals("true"))?"checked=\"true\"":"")+" /></td>\n"+
-"          <td class=\"value\"><nobr>" + 
Messages.getBodyString(locale,"DCTM.CaseSensitive") + "</nobr></td>\n"+
-"        </tr>\n"+
-"      </table>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"</table>\n"
-      );
-    }
-    else
-    {
-      // Hiddens for "User Mapping" tab
-      out.print(
-"<input type=\"hidden\" name=\"usernamecaseinsensitive\" 
value=\""+caseInsensitiveUser+"\"/>\n"
-      );
-    }
-
     // "System ACLs" tab
     if (tabName.equals(Messages.getString(locale,"DCTM.SystemACLs")))
     {
@@ -1324,10 +1261,6 @@ public class AuthorityConnector extends 
     if (docbaseDomain != null)
       parameters.setParameter(CONFIG_PARAM_DOMAIN,docbaseDomain);
 
-    String caseInsensitiveUser = 
variableContext.getParameter("usernamecaseinsensitive");
-    if (caseInsensitiveUser != null)
-      
parameters.setParameter(CONFIG_PARAM_CASEINSENSITIVE,caseInsensitiveUser);
-
     String useSystemAcls = variableContext.getParameter("usesystemacls");
     if (useSystemAcls != null)
       parameters.setParameter(CONFIG_PARAM_USESYSTEMACLS,useSystemAcls);
@@ -1401,22 +1334,21 @@ public class AuthorityConnector extends 
   protected static class AuthorizationResponseDescription extends 
org.apache.manifoldcf.core.cachemanager.BaseDescription
   {
     // The parameters upon which the cached results are based.
-    protected String userName;
-    protected String docbaseName;
-    protected String adminUserName;
-    protected String adminPassword;
-    protected String domain;
-    protected boolean caseInsensitive;
-    protected boolean useSystemACLs;
+    protected final String userName;
+    protected final String docbaseName;
+    protected final String adminUserName;
+    protected final String adminPassword;
+    protected final String domain;
+    protected final boolean useSystemACLs;
     /** The expiration time */
     protected long expirationTime = -1;
     /** The response lifetime */
-    protected long responseLifetime;
+    protected final long responseLifetime;
     
     /** Constructor. */
     public AuthorizationResponseDescription(String userName, String 
docbaseName,
       String adminUserName, String adminPassword, String domain,
-      boolean caseInsensitive, boolean useSystemACLs,
+      boolean useSystemACLs,
       long responseLifetime, int LRUsize)
     {
       super("DocumentumDirectoryAuthority",LRUsize);
@@ -1425,7 +1357,6 @@ public class AuthorityConnector extends 
       this.adminUserName = adminUserName;
       this.adminPassword = adminPassword;
       this.domain = domain;
-      this.caseInsensitive = caseInsensitive;
       this.useSystemACLs = useSystemACLs;
       this.responseLifetime = responseLifetime;
     }
@@ -1441,7 +1372,7 @@ public class AuthorityConnector extends 
     {
       return getClass().getName() + "-" + userName + "-" + docbaseName +
         "-" + adminUserName + "-" + adminPassword + "-" + 
((domain==null)?"NULL":domain) + "-" +
-        (caseInsensitive?"true":"false") + "-" + 
(useSystemACLs?"true":"false");
+        (useSystemACLs?"true":"false");
     }
 
     /** Return the object expiration interval */
@@ -1456,7 +1387,7 @@ public class AuthorityConnector extends 
     {
       return userName.hashCode() + docbaseName.hashCode() + 
adminUserName.hashCode() +
         adminPassword.hashCode() + ((domain==null)?0:domain.hashCode()) +
-        (caseInsensitive?1:0) + (useSystemACLs?1:0);
+        (useSystemACLs?1:0);
     }
     
     public boolean equals(Object o)
@@ -1467,7 +1398,7 @@ public class AuthorityConnector extends 
       return ard.userName.equals(userName) && 
ard.docbaseName.equals(docbaseName) &&
         ard.adminUserName.equals(adminUserName) && 
ard.adminPassword.equals(adminPassword) &&
         ((ard.domain==null||domain==null)?(ard.domain == 
domain):(ard.domain.equals(domain))) &&
-        ard.caseInsensitive == caseInsensitive && ard.useSystemACLs == 
useSystemACLs;
+        ard.useSystemACLs == useSystemACLs;
     }
     
   }


Reply via email to