You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/06/23 15:10:03 UTC

svn commit: r1495814 [1/2] - in /manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities: authorities/ interfaces/ mapconnmgr/ mappers/ mapping/

Author: kwright
Date: Sun Jun 23 13:10:02 2013
New Revision: 1495814

URL: http://svn.apache.org/r1495814
Log:
First commit: Add UserRecord, extend IAuthorityConnector, add IMappingConnector, and all supporting database tables.

Added:
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java   (with props)
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java   (with props)
Modified:
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/AuthorityConnectorFactory.java
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java

Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java?rev=1495814&r1=1495813&r2=1495814&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java Sun Jun 23 13:10:02 2013
@@ -34,11 +34,37 @@ public abstract class BaseAuthorityConne
 {
   public static final String _rcsid = "@(#)$Id: BaseAuthorityConnector.java 988245 2010-08-23 18:39:35Z kwright $";
 
+  /** Obtain the access tokens for a given UserRecord.
+  * This method is typically the one that is implemented by an authority,
+  * unless the authority predates release 1.3.  In that case, the
+  * ActiveDirectory credentials are pulled from the UserRecord and
+  * are passed to the other variant of this method.
+  *@param userRecord is the identifying user record.
+  *@return the response tokens (according to the current authority).
+  * (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
+  */
+  @Override
+  public AuthorizationResponse getAuthorizationResponse(UserRecord userRecord)
+    throws ManifoldCFException
+  {
+    UserRecord activeDirectoryDomain = userRecord.getDomainValueAsUserRecord(UserRecord.DOMAIN_ACTIVEDIRECTORY);
+    if (activeDirectoryDomain == null || activeDirectoryDomain.getDomainCount() == 0)
+      return new AuthorizationResponse(new String[0],AuthorizationResponse.RESPONSE_USERNOTFOUND);
+    Iterator<String> adDomains = activeDirectoryDomain.iteratorDomains();
+    // Just pick the first one
+    String adDomain = adDomains.next();
+    String userName = activeDirectoryDomain.getDomainValueAsString(adDomain);
+    if (userName == null)
+      return new AuthorizationResponse(new String[0],AuthorizationResponse.RESPONSE_USERNOTFOUND);
+    return getAuthorizationResponse(userName + "@" + adDomain);
+  }
+
   /** Obtain the access tokens for a given user name.
   *@param userName is the user name or identifier.
   *@return the response tokens (according to the current authority).
   * (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
   */
+  @Override
   public AuthorizationResponse getAuthorizationResponse(String userName)
     throws ManifoldCFException
   {
@@ -63,10 +89,30 @@ public abstract class BaseAuthorityConne
     }
   }
 
+  /** Obtain the default access tokens for a given user record.
+  *@param userRecord is the identifying user record.
+  *@return the default response tokens, presuming that the connect method fails.
+  */
+  @Override
+  public AuthorizationResponse getDefaultAuthorizationResponse(UserRecord userRecord)
+  {
+    UserRecord activeDirectoryDomain = userRecord.getDomainValueAsUserRecord(UserRecord.DOMAIN_ACTIVEDIRECTORY);
+    if (activeDirectoryDomain == null || activeDirectoryDomain.getDomainCount() == 0)
+      return new AuthorizationResponse(new String[0],AuthorizationResponse.RESPONSE_USERNOTFOUND);
+    Iterator<String> adDomains = activeDirectoryDomain.iteratorDomains();
+    // Just pick the first one
+    String adDomain = adDomains.next();
+    String userName = activeDirectoryDomain.getDomainValueAsString(adDomain);
+    if (userName == null)
+      return new AuthorizationResponse(new String[0],AuthorizationResponse.RESPONSE_USERNOTFOUND);
+    return getDefaultAuthorizationResponse(userName + "@" + adDomain);
+  }
+
   /** Obtain the default access tokens for a given user name.
   *@param userName is the user name or identifier.
   *@return the default response tokens, presuming that the connect method fails.
   */
+  @Override
   public AuthorizationResponse getDefaultAuthorizationResponse(String userName)
   {
     String[] acls = getDefaultAccessTokens(userName);

Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/AuthorityConnectorFactory.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/AuthorityConnectorFactory.java?rev=1495814&r1=1495813&r2=1495814&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/AuthorityConnectorFactory.java (original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/AuthorityConnectorFactory.java Sun Jun 23 13:10:02 2013
@@ -58,6 +58,17 @@ public class AuthorityConnectorFactory
 
   /** Get the default response from a connector.  Called if the connection attempt fails.
   */
+  public static AuthorizationResponse getDefaultAuthorizationResponse(IThreadContext threadContext, String className, UserRecord userRecord)
+    throws ManifoldCFException
+  {
+    IAuthorityConnector connector = getConnector(threadContext,className);
+    if (connector == null)
+      return null;
+    return connector.getDefaultAuthorizationResponse(userRecord);
+  }
+
+  /** Get the default response from a connector.  Called if the connection attempt fails.
+  */
   public static AuthorizationResponse getDefaultAuthorizationResponse(IThreadContext threadContext, String className, String userName)
     throws ManifoldCFException
   {

Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java?rev=1495814&r1=1495813&r2=1495814&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java (original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java Sun Jun 23 13:10:02 2013
@@ -45,4 +45,21 @@ public class CacheKeyFactory extends org
     return "AUTHORITYCONNECTION_"+connectionName;
   }
 
+  /** Construct a key which represents the general list of mapping connectors.
+  *@return the cache key.
+  */
+  public static String makeMappingConnectionsKey()
+  {
+    return "MAPPINGCONNECTIONS";
+  }
+
+  /** Construct a key which represents an individual mapping connection.
+  *@param connectionName is the name of the connection.
+  *@return the cache key.
+  */
+  public static String makeMappingConnectionKey(String connectionName)
+  {
+    return "MAPPINGCONNECTION_"+connectionName;
+  }
+
 }

Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java?rev=1495814&r1=1495813&r2=1495814&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java Sun Jun 23 13:10:02 2013
@@ -32,7 +32,22 @@ import java.io.*;
 public interface IAuthorityConnector extends IConnector
 {
 
-  /** Obtain the access tokens for a given user name.
+  /** Obtain the access tokens for a given UserRecord.
+  * This method is typically the one that is implemented by an authority,
+  * unless the authority predates release 1.3.  In that case, the
+  * ActiveDirectory credentials are pulled from the UserRecord and
+  * are passed to the other variant of this method.
+  *@param userRecord is the identifying user record.
+  *@return the response tokens (according to the current authority).
+  * (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
+  */
+  public AuthorizationResponse getAuthorizationResponse(UserRecord userRecord)
+    throws ManifoldCFException;
+
+  /** Obtain the access tokens for a given Active Directory user name.
+  * This method is typically not the one that an authority will implement;
+  * instead, most authorities implement the UserRecord version, and have
+  * this method call that one.
   *@param userName is the user name or identifier.
   *@return the response tokens (according to the current authority).
   * (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
@@ -40,6 +55,12 @@ public interface IAuthorityConnector ext
   public AuthorizationResponse getAuthorizationResponse(String userName)
     throws ManifoldCFException;
 
+  /** Obtain the default access tokens for a given user record.
+  *@param userRecord is the identifying user record.
+  *@return the default response tokens, presuming that the connect method fails.
+  */
+  public AuthorizationResponse getDefaultAuthorizationResponse(UserRecord userRecord);
+
   /** Obtain the default access tokens for a given user name.
   *@param userName is the user name or identifier.
   *@return the default response tokens, presuming that the connect method fails.

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,83 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import java.util.*;
+
+/** This interface describes a paper object which is an mapping connection.
+*/
+public interface IMappingConnection
+{
+  /** Set 'isnew' condition.
+  *@param isnew true if this is a new instance.
+  */
+  public void setIsNew(boolean isnew);
+  
+  /** Get 'isnew' condition.
+  *@return true if this is a new connection, false otherwise.
+  */
+  public boolean getIsNew();
+
+  /** Set name.
+  *@param name is the name.
+  */
+  public void setName(String name);
+
+  /** Get name.
+  *@return the name
+  */
+  public String getName();
+
+  /** Set description.
+  *@param description is the description.
+  */
+  public void setDescription(String description);
+
+  /** Get description.
+  *@return the description
+  */
+  public String getDescription();
+
+  /** Set the class name.
+  *@param className is the class name.
+  */
+  public void setClassName(String className);
+
+  /** Get the class name.
+  *@return the class name
+  */
+  public String getClassName();
+
+  /** Get the configuration parameters.
+  *@return the map.  Can be modified.
+  */
+  public ConfigParams getConfigParams();
+
+  /** Set the maximum size of the connection pool.
+  *@param maxCount is the maximum connection count per JVM.
+  */
+  public void setMaxConnections(int maxCount);
+
+  /** Get the maximum size of the connection pool.
+  *@return the maximum size.
+  */
+  public int getMaxConnections();
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,93 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import java.util.*;
+
+/** This interface describes the functionality in the mapping connection manager.
+* The authority connection manager manages the definitions of individual connections,
+* and allows them to be defined, edited, and removed.
+*/
+public interface IMappingConnectionManager
+{
+  /** Install the manager.
+  */
+  public void install()
+    throws ManifoldCFException;
+
+  /** Uninstall the manager.
+  */
+  public void deinstall()
+    throws ManifoldCFException;
+
+  /** Export configuration */
+  public void exportConfiguration(java.io.OutputStream os)
+    throws java.io.IOException, ManifoldCFException;
+
+  /** Import configuration */
+  public void importConfiguration(java.io.InputStream is)
+    throws java.io.IOException, ManifoldCFException;
+
+  /** Obtain a list of the mapping connections, ordered by name.
+  *@return an array of connection objects.
+  */
+  public IMappingConnection[] getAllConnections()
+    throws ManifoldCFException;
+
+  /** Load a mapping connection by name.
+  *@param name is the name of the mapping connection.
+  *@return the loaded connection object, or null if not found.
+  */
+  public IMappingConnection load(String name)
+    throws ManifoldCFException;
+
+  /** Create a new mapping connection object.
+  *@return the new object.
+  */
+  public IMappingConnection create()
+    throws ManifoldCFException;
+
+  /** Save an mapping connection object.
+  *@param object is the object to save.
+  *@return true if the object was created, false otherwise.
+  */
+  public boolean save(IMappingConnection object)
+    throws ManifoldCFException;
+
+  /** Delete an mapping connection.
+  *@param name is the name of the connection to delete.  If the
+  * name does not exist, no error is returned.
+  */
+  public void delete(String name)
+    throws ManifoldCFException;
+
+  // Schema related
+
+  /** Get the authority connection table name.
+  *@return the table name.
+  */
+  public String getTableName();
+
+  /** Get the mapping connection name column.
+  *@return the name column.
+  */
+  public String getMappingNameColumn();
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,37 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+
+/** A Mapping Connector helps fill out the user identification information for a user.
+*
+* An instance of this interface provides this functionality.  Mapping connector instances are pooled, so that session
+* setup does not need to be done repeatedly.  The pool is segregated by specific sets of configuration parameters.
+*/
+public interface IMappingConnector extends IConnector
+{
+
+  /** Modify a user record, according to whatever mapping is desired.
+  *@param record is the user record to read data from, and to modify.
+  */
+  public void mapUser(UserRecord record)
+    throws ManifoldCFException;
+  
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,81 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+
+/** This interface describes the mapping connector registry.  Mapping connectors are registered here, so that
+* they can be made available when an mapping connection is created.
+*/
+public interface IMappingConnectorManager
+{
+  /** Install.
+  */
+  public void install()
+    throws ManifoldCFException;
+
+  /** Uninstall.  This also unregisters all connectors.
+  */
+  public void deinstall()
+    throws ManifoldCFException;
+
+  /** Register a new connector.
+  * The connector's install method will also be called.
+  *@param description is the description to use in the UI.
+  *@param className is the class name.
+  */
+  public void registerConnector(String description, String className)
+    throws ManifoldCFException;
+
+  /** Unregister a connector.
+  * The connector's deinstall method will also be called.
+  *@param className is the connector class to unregister.
+  */
+  public void unregisterConnector(String className)
+    throws ManifoldCFException;
+
+  /** Remove a connector.
+  * Call this when the connector cannot be instantiated.
+  *@param className is the connector class to remove.
+  */
+  public void removeConnector(String className)
+    throws ManifoldCFException;
+
+  /** Get ordered list of connectors.
+  *@return a resultset with the columns "description" and "classname".
+  * These will be ordered by description.
+  */
+  public IResultSet getConnectors()
+    throws ManifoldCFException;
+
+  /** Get a description given a class name.
+  *@param className is the class name.
+  *@return the description, or null if the class is not registered.
+  */
+  public String getDescription(String className)
+    throws ManifoldCFException;
+
+  /** Check if a particular connector is installed or not.
+  *@param className is the class name of the connector.
+  *@return true if installed, false otherwise.
+  */
+  public boolean isInstalled(String className)
+    throws ManifoldCFException;
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,57 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import java.util.*;
+import org.apache.manifoldcf.authorities.system.ManifoldCF;
+
+/** This is the factory class for mapping connection manager objects.
+*/
+public class MappingConnectionManagerFactory
+{
+  // name to use in thread context pool of objects
+  private final static String objectName = "_MapConnectionMgr_";
+
+  private MappingConnectionManagerFactory()
+  {
+  }
+
+  /** Make an authority connection manager handle.
+  *@param tc is the thread context.
+  *@return the handle.
+  */
+  public static IMappingConnectionManager make(IThreadContext tc)
+    throws ManifoldCFException
+  {
+    Object o = tc.get(objectName);
+    if (o == null || !(o instanceof IMappingConnectionManager))
+    {
+      IDBInterface database = DBInterfaceFactory.make(tc,
+        ManifoldCF.getMasterDatabaseName(),
+        ManifoldCF.getMasterDatabaseUsername(),
+        ManifoldCF.getMasterDatabasePassword());
+
+      o = new org.apache.manifoldcf.authorities.mapping.MappingConnectionManager(tc,database);
+      tc.save(objectName,o);
+    }
+    return (IMappingConnectionManager)o;
+  }
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,580 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.core.system.ManifoldCF;
+import java.util.*;
+import java.io.*;
+import java.lang.reflect.*;
+
+/** This class manages a pool of mapping connectors.
+*/
+public class MappingConnectorFactory
+{
+  // Pool hash table.
+  // Keyed by PoolKey; value is Pool
+  protected static Map poolHash = new HashMap();
+
+  private MappingConnectorFactory()
+  {
+  }
+
+  /** Install connector.
+  *@param className is the class name.
+  */
+  public static void install(IThreadContext threadContext, String className)
+    throws ManifoldCFException
+  {
+    IMappingConnector connector = getConnectorNoCheck(className);
+    connector.install(threadContext);
+  }
+
+  /** Uninstall connector.
+  *@param className is the class name.
+  */
+  public static void deinstall(IThreadContext threadContext, String className)
+    throws ManifoldCFException
+  {
+    IMappingConnector connector = getConnectorNoCheck(className);
+    connector.deinstall(threadContext);
+  }
+
+  /** Output the configuration header section.
+  */
+  public static void outputConfigurationHeader(IThreadContext threadContext, String className, IHTTPOutput out, Locale locale, ConfigParams parameters, ArrayList tabsArray)
+    throws ManifoldCFException, IOException
+  {
+    IMappingConnector connector = getConnector(threadContext, className);
+    if (connector == null)
+      return;
+    connector.outputConfigurationHeader(threadContext,out,locale,parameters,tabsArray);
+  }
+
+  /** Output the configuration body section.
+  */
+  public static void outputConfigurationBody(IThreadContext threadContext, String className, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
+    throws ManifoldCFException, IOException
+  {
+    IMappingConnector connector = getConnector(threadContext, className);
+    if (connector == null)
+      return;
+    connector.outputConfigurationBody(threadContext,out,locale,parameters,tabName);
+  }
+
+  /** Process configuration post data for a connector.
+  */
+  public static String processConfigurationPost(IThreadContext threadContext, String className, IPostParameters variableContext, Locale locale, ConfigParams configParams)
+    throws ManifoldCFException
+  {
+    IMappingConnector connector = getConnector(threadContext, className);
+    if (connector == null)
+      return null;
+    return connector.processConfigurationPost(threadContext,variableContext,locale,configParams);
+  }
+  
+  /** View connector configuration.
+  */
+  public static void viewConfiguration(IThreadContext threadContext, String className, IHTTPOutput out, Locale locale, ConfigParams configParams)
+    throws ManifoldCFException, IOException
+  {
+    IMappingConnector connector = getConnector(threadContext, className);
+    // We want to be able to view connections even if they have unregistered connectors.
+    if (connector == null)
+      return;
+    connector.viewConfiguration(threadContext,out,locale,configParams);
+  }
+
+  /** Get a mapping connector instance, but do NOT check if class is installed first!
+  *@param className is the class name.
+  *@return the instance.
+  */
+  public static IMappingConnector getConnectorNoCheck(String className)
+    throws ManifoldCFException
+  {
+    try
+    {
+      Class theClass = ManifoldCF.findClass(className);
+      Class[] argumentClasses = new Class[0];
+      // Look for a constructor
+      Constructor c = theClass.getConstructor(argumentClasses);
+      Object[] arguments = new Object[0];
+      Object o = c.newInstance(arguments);
+      if (!(o instanceof IMappingConnector))
+        throw new ManifoldCFException("Class '"+className+"' does not implement IMappingConnector.");
+      return (IMappingConnector)o;
+    }
+    catch (InvocationTargetException e)
+    {
+      Throwable z = e.getTargetException();
+      if (z instanceof Error)
+        throw (Error)z;
+      else if (z instanceof RuntimeException)
+        throw (RuntimeException)z;
+      else
+        throw (ManifoldCFException)z;
+    }
+    catch (ClassNotFoundException e)
+    {
+      throw new ManifoldCFException("No mapping connector class '"+className+"' was found.",
+        e);
+    }
+    catch (NoSuchMethodException e)
+    {
+      throw new ManifoldCFException("No appropriate constructor for IMappingConnector implementation '"+
+        className+"'.  Need xxx().",
+        e);
+    }
+    catch (SecurityException e)
+    {
+      throw new ManifoldCFException("Protected constructor for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+    catch (IllegalAccessException e)
+    {
+      throw new ManifoldCFException("Unavailable constructor for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+    catch (IllegalArgumentException e)
+    {
+      throw new ManifoldCFException("Shouldn't happen!!!",e);
+    }
+    catch (InstantiationException e)
+    {
+      throw new ManifoldCFException("InstantiationException for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+    catch (ExceptionInInitializerError e)
+    {
+      throw new ManifoldCFException("ExceptionInInitializerError for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+
+  }
+
+  /** Get a mapping connector instance.
+  *@param className is the class name.
+  *@return the instance.
+  */
+  protected static IMappingConnector getConnector(IThreadContext threadContext, String className)
+    throws ManifoldCFException
+  {
+    IMappingConnectorManager connMgr = MappingConnectorManagerFactory.make(threadContext);
+    if (connMgr.isInstalled(className) == false)
+      return null;
+
+    try
+    {
+      Class theClass = ManifoldCF.findClass(className);
+      Class[] argumentClasses = new Class[0];
+      // Look for a constructor
+      Constructor c = theClass.getConstructor(argumentClasses);
+      Object[] arguments = new Object[0];
+      Object o = c.newInstance(arguments);
+      if (!(o instanceof IMappingConnector))
+        throw new ManifoldCFException("Class '"+className+"' does not implement IMappingConnector.");
+      return (IMappingConnector)o;
+    }
+    catch (InvocationTargetException e)
+    {
+      Throwable z = e.getTargetException();
+      if (z instanceof Error)
+        throw (Error)z;
+      else if (z instanceof RuntimeException)
+        throw (RuntimeException)z;
+      else
+        throw (ManifoldCFException)z;
+    }
+    catch (ClassNotFoundException e)
+    {
+      // If we get this exception, it may mean that the mapping is not registered.
+      if (connMgr.isInstalled(className) == false)
+        return null;
+
+      throw new ManifoldCFException("No mapping connector class '"+className+"' was found.",
+        e);
+    }
+    catch (NoSuchMethodException e)
+    {
+      throw new ManifoldCFException("No appropriate constructor for IMappingConnector implementation '"+
+        className+"'.  Need xxx().",
+        e);
+    }
+    catch (SecurityException e)
+    {
+      throw new ManifoldCFException("Protected constructor for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+    catch (IllegalAccessException e)
+    {
+      throw new ManifoldCFException("Unavailable constructor for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+    catch (IllegalArgumentException e)
+    {
+      throw new ManifoldCFException("Shouldn't happen!!!",e);
+    }
+    catch (InstantiationException e)
+    {
+      throw new ManifoldCFException("InstantiationException for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+    catch (ExceptionInInitializerError e)
+    {
+      throw new ManifoldCFException("ExceptionInInitializerError for IMappingConnector implementation '"+className+"'",
+        e);
+    }
+
+  }
+
+  /** Get a mapping connector.
+  * The connector is specified by its class and its parameters.
+  *@param threadContext is the current thread context.
+  *@param className is the name of the class to get a connector for.
+  *@param configInfo are the name/value pairs constituting configuration info
+  * for this class.
+  */
+  public static IMappingConnector grab(IThreadContext threadContext,
+    String className, ConfigParams configInfo, int maxPoolSize)
+    throws ManifoldCFException
+  {
+    // We want to get handles off the pool and use them.  But the
+    // handles we fetch have to have the right config information.
+
+    // Use the classname and config info to build a pool key
+    PoolKey pk = new PoolKey(className,configInfo);
+    Pool p;
+    synchronized (poolHash)
+    {
+      p = (Pool)poolHash.get(pk);
+      if (p == null)
+      {
+        // Build it again, this time making a copy
+        pk = new PoolKey(className,configInfo.duplicate());
+        p = new Pool(pk,maxPoolSize);
+        poolHash.put(pk,p);
+      }
+    }
+
+    IMappingConnector rval = p.getConnector(threadContext);
+    return rval;
+  }
+
+  /** Release a repository connector.
+  *@param connector is the connector to release.
+  */
+  public static void release(IMappingConnector connector)
+    throws ManifoldCFException
+  {
+    if (connector == null)
+      return;
+
+    // Figure out which pool this goes on, and put it there
+    PoolKey pk = new PoolKey(connector.getClass().getName(),connector.getConfiguration());
+    Pool p;
+    synchronized (poolHash)
+    {
+      p = (Pool)poolHash.get(pk);
+    }
+
+    p.releaseConnector(connector);
+    // System.out.println("Done releasing");
+  }
+
+  /** Idle notification for inactive mapping connector handles.
+  * This method polls all inactive handles.
+  */
+  public static void pollAllConnectors(IThreadContext threadContext)
+    throws ManifoldCFException
+  {
+    // Go through the whole pool and notify everyone
+    synchronized (poolHash)
+    {
+      Iterator iter = poolHash.values().iterator();
+      while (iter.hasNext())
+      {
+        Pool p = (Pool)iter.next();
+        p.pollAll(threadContext);
+      }
+    }
+
+  }
+
+  /** Clean up all open mapping connector handles.
+  * This method is called when the connector pool needs to be flushed,
+  * to free resources.
+  *@param threadContext is the local thread context.
+  */
+  public static void closeAllConnectors(IThreadContext threadContext)
+    throws ManifoldCFException
+  {
+    // Go through the whole pool and clean it out
+    synchronized (poolHash)
+    {
+      Iterator iter = poolHash.values().iterator();
+      while (iter.hasNext())
+      {
+        Pool p = (Pool)iter.next();
+        p.releaseAll(threadContext);
+      }
+    }
+  }
+
+  /** This is an immutable pool key class, which describes a pool in terms of two independent keys.
+  */
+  public static class PoolKey
+  {
+    protected String className;
+    protected ConfigParams configInfo;
+
+    /** Constructor.
+    */
+    public PoolKey(String className, Map configInfo)
+    {
+      this.className = className;
+      this.configInfo = new ConfigParams(configInfo);
+    }
+
+    public PoolKey(String className, ConfigParams configInfo)
+    {
+      this.className = className;
+      this.configInfo = configInfo;
+    }
+
+    /** Get the class name.
+    *@return the class name.
+    */
+    public String getClassName()
+    {
+      return className;
+    }
+
+    /** Get the config info.
+    *@return the params
+    */
+    public ConfigParams getParams()
+    {
+      return configInfo;
+    }
+
+    /** Hash code.
+    */
+    public int hashCode()
+    {
+      return className.hashCode() + configInfo.hashCode();
+    }
+
+    /** Equals operator.
+    */
+    public boolean equals(Object o)
+    {
+      if (!(o instanceof PoolKey))
+        return false;
+
+      PoolKey pk = (PoolKey)o;
+      return pk.className.equals(className) && pk.configInfo.equals(configInfo);
+    }
+
+  }
+
+  /** This class represents a value in the pool hash, which corresponds to a given key.
+  */
+  public static class Pool
+  {
+    protected ArrayList stack = new ArrayList();
+    protected PoolKey key;
+    protected int numFree;
+
+    /** Constructor
+    */
+    public Pool(PoolKey pk, int maxCount)
+    {
+      key = pk;
+      numFree = maxCount;
+    }
+
+    /** Grab a mapping connector.
+    * If none exists, construct it using the information in the pool key.
+    *@return the connector.
+    */
+    public synchronized IMappingConnector getConnector(IThreadContext threadContext)
+      throws ManifoldCFException
+    {
+      while (numFree == 0)
+      {
+        try
+        {
+          wait();
+        }
+        catch (InterruptedException e)
+        {
+          throw new ManifoldCFException("Interrupted",e,ManifoldCFException.INTERRUPTED);
+        }
+      }
+
+      if (stack.size() == 0)
+      {
+        String className = key.getClassName();
+        ConfigParams configParams = key.getParams();
+
+        IMappingConnectorManager connMgr = MappingConnectorManagerFactory.make(threadContext);
+        if (connMgr.isInstalled(className) == false)
+          return null;
+
+        try
+        {
+          Class theClass = ManifoldCF.findClass(className);
+          Class[] argumentClasses = new Class[0];
+          // Look for a constructor
+          Constructor c = theClass.getConstructor(argumentClasses);
+          Object[] arguments = new Object[0];
+          Object o = c.newInstance(arguments);
+          if (!(o instanceof IMappingConnector))
+            throw new ManifoldCFException("Class '"+className+"' does not implement IMappingConnector.");
+          IMappingConnector newrc = (IMappingConnector)o;
+          newrc.connect(configParams);
+	  stack.add(newrc);
+        }
+        catch (InvocationTargetException e)
+        {
+          Throwable z = e.getTargetException();
+          if (z instanceof Error)
+            throw (Error)z;
+          else if (z instanceof RuntimeException)
+            throw (RuntimeException)z;
+          else
+            throw (ManifoldCFException)z;
+        }
+        catch (ClassNotFoundException e)
+        {
+          // If we get this exception, it may mean that the mapping is not registered.
+          if (connMgr.isInstalled(className) == false)
+            return null;
+
+          throw new ManifoldCFException("No mapping connector class '"+className+"' was found.",
+            e);
+        }
+        catch (NoSuchMethodException e)
+        {
+          throw new ManifoldCFException("No appropriate constructor for IMappingConnector implementation '"+
+            className+"'.  Need xxx(ConfigParams).",
+            e);
+        }
+        catch (SecurityException e)
+        {
+          throw new ManifoldCFException("Protected constructor for IMappingConnector implementation '"+className+"'",
+            e);
+        }
+        catch (IllegalAccessException e)
+        {
+          throw new ManifoldCFException("Unavailable constructor for IMappingConnector implementation '"+className+"'",
+            e);
+        }
+        catch (IllegalArgumentException e)
+        {
+          throw new ManifoldCFException("Shouldn't happen!!!",e);
+        }
+        catch (InstantiationException e)
+        {
+          throw new ManifoldCFException("InstantiationException for IMappingConnector implementation '"+className+"'",
+            e);
+        }
+        catch (ExceptionInInitializerError e)
+        {
+          throw new ManifoldCFException("ExceptionInInitializerError for IMappingConnector implementation '"+className+"'",
+            e);
+        }
+      }
+      
+      // Since thread context set can fail, do that before we remove it from the pool.
+      IMappingConnector rc = (IMappingConnector)stack.get(stack.size()-1);
+      rc.setThreadContext(threadContext);
+      stack.remove(stack.size()-1);
+      numFree--;
+
+      return rc;
+    }
+
+    /** Release a repository connector to the pool.
+    *@param connector is the connector.
+    */
+    public synchronized void releaseConnector(IMappingConnector connector)
+      throws ManifoldCFException
+    {
+      if (connector == null)
+        return;
+
+      // Make sure connector knows it's released
+      connector.clearThreadContext();
+      // Append
+      stack.add(connector);
+      numFree++;
+      notifyAll();
+    }
+
+    /** Notify all free connectors.
+    */
+    public synchronized void pollAll(IThreadContext threadContext)
+      throws ManifoldCFException
+    {
+      int i = 0;
+      while (i < stack.size())
+      {
+        IConnector rc = (IConnector)stack.get(i++);
+        // Notify
+        rc.setThreadContext(threadContext);
+        try
+        {
+          rc.poll();
+        }
+        finally
+        {
+          rc.clearThreadContext();
+        }
+      }
+    }
+
+    /** Release all free connectors.
+    */
+    public synchronized void releaseAll(IThreadContext threadContext)
+      throws ManifoldCFException
+    {
+      while (stack.size() > 0)
+      {
+        // Disconnect
+        IConnector rc = (IConnector)stack.get(stack.size()-1);
+        rc.setThreadContext(threadContext);
+        try
+        {
+          rc.disconnect();
+          stack.remove(stack.size()-1);
+        }
+        finally
+        {
+          rc.clearThreadContext();
+        }
+      }
+    }
+
+  }
+
+
+
+}
+

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,58 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import java.util.*;
+import org.apache.manifoldcf.authorities.system.ManifoldCF;
+
+/** This class is the factory for the Mapping Connector Manager.
+*/
+public class MappingConnectorManagerFactory
+{
+  protected static final String connMgr = "_MappingConnectorManager_";
+
+  private MappingConnectorManagerFactory()
+  {
+  }
+
+  /** Construct a connector manager.
+  *@param tc is the thread context.
+  *@return the connector manager handle.
+  */
+  public static IMappingConnectorManager make(IThreadContext tc)
+    throws ManifoldCFException
+  {
+    Object o = tc.get(connMgr);
+    if (o == null || !(o instanceof IMappingConnectorManager))
+    {
+
+      IDBInterface database = DBInterfaceFactory.make(tc,
+        ManifoldCF.getMasterDatabaseName(),
+        ManifoldCF.getMasterDatabaseUsername(),
+        ManifoldCF.getMasterDatabasePassword());
+
+      o = new org.apache.manifoldcf.authorities.mapconnmgr.MappingConnectorManager(tc,database);
+      tc.save(connMgr,o);
+    }
+    return (IMappingConnectorManager)o;
+  }
+
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,111 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.interfaces;
+
+import java.util.*;
+
+/** An instance of this class represents everything known about a specific
+* user's identification.  Since we don't know in advance how many and what
+* kinds of systems are involved, it has been made as flexible as possible, within
+* certain constraints.
+*
+* The overall idea is that there are multiple "domains" (not to be confused with
+* Active Directory domains), each with a corresponding bit of user information.
+* The user information itself can include further domain specification. For
+* example, "activedirectory"->"qa.ad.76.foo.com"->"johnqpublic".
+*
+* An authority usually looks for a username with a specific domain.  If the domain
+* for the user doesn't exist, the authority will consider itself to be offline, and
+* lock out any documents that are under jurisdiction of that authority.  Essentially
+* it is the equivalent of "user not found".
+*
+* Authorities can be written to understand multiple domains.  In this case, there's
+* usually a priority; one domain takes precedence of the other.
+*
+* Finally, the way domains get created in the UserRecord is through a Mapper.
+* Mappers are plugins which have their own UI and can be configured.  One
+* mapper supplied out-of-the-box with ManifoldCF right now is a simple regular-
+* expression mapper, which converts the active-directory id to a user name in
+* any other specified domain.
+*/
+public class UserRecord
+{
+  
+  // Public well-known domains
+  
+  /** Active directory domain */
+  public final static String DOMAIN_ACTIVEDIRECTORY = "activedirectory";
+  
+  protected Map<String,Object> userInfo = new HashMap<String,Object>();
+  
+  /** Constructor */
+  public UserRecord()
+  {
+  }
+  
+  /** Set a domain value to be a user record */
+  public void setDomainValue(String domain, UserRecord record)
+  {
+    userInfo.put(domain, record);
+  }
+  
+  /** Set a domain value to be a string */
+  public void setDomainValue(String domain, String name)
+  {
+    userInfo.put(domain, name);
+  }
+  
+  /** Delete a domain value */
+  public void deleteDomainValue(String domain)
+  {
+    userInfo.remove(domain);
+  }
+  
+  /** Get a domain value, expecting a String */
+  public String getDomainValueAsString(String domain)
+  {
+    Object o = userInfo.get(domain);
+    if (o == null || !(o instanceof String))
+      return null;
+    return (String)o;
+  }
+  
+  /** Get a domain value, expecting a UserRecord */
+  public UserRecord getDomainValueAsUserRecord(String domain)
+  {
+    Object o = userInfo.get(domain);
+    if (o == null || !(o instanceof UserRecord))
+      return null;
+    return (UserRecord)o;
+  }
+  
+  /** Get an iterator over the list of domains */
+  public Iterator<String> iteratorDomains()
+  {
+    return userInfo.keySet().iterator();
+  }
+  
+  /** Get the number of domains */
+  public int getDomainCount()
+  {
+    return userInfo.size();
+  }
+}
+

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/UserRecord.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,302 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.mapconnmgr;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.authorities.interfaces.*;
+import java.util.*;
+import org.apache.manifoldcf.authorities.interfaces.CacheKeyFactory;
+
+/** This is the implementation of that authority connector manager.
+ * 
+ * <br><br>
+ * <b>mapconnectors</b>
+ * <table border="1" cellpadding="3" cellspacing="0">
+ * <tr class="TableHeadingColor">
+ * <th>Field</th><th>Type</th><th>Description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ * <tr><td>description</td><td>VARCHAR(255)</td><td></td></tr>
+ * <tr><td>classname</td><td>VARCHAR(255)</td><td>Primary Key</td></tr>
+ * </table>
+ * <br><br>
+ * 
+ */
+public class MappingConnectorManager extends org.apache.manifoldcf.core.database.BaseTable implements IMappingConnectorManager
+{
+  public static final String _rcsid = "@(#)$Id$";
+
+  // Fields
+  protected static final String descriptionField = "description";
+  protected static final String classNameField = "classname";
+
+  // Thread context
+  protected IThreadContext threadContext;
+
+  /** Constructor.
+  *@param threadContext is the thread context.
+  *@param database is the database handle.
+  */
+  public MappingConnectorManager(IThreadContext threadContext, IDBInterface database)
+    throws ManifoldCFException
+  {
+    super(database,"mapconnectors");
+    this.threadContext = threadContext;
+  }
+
+
+  /** Install or upgrade.
+  */
+  public void install()
+    throws ManifoldCFException
+  {
+    // Always use a loop, in case there's upgrade retries needed.
+    while (true)
+    {
+      Map existing = getTableSchema(null,null);
+      if (existing == null)
+      {
+        HashMap map = new HashMap();
+        map.put(descriptionField,new ColumnDescription("VARCHAR(255)",false,false,null,null,false));
+        map.put(classNameField,new ColumnDescription("VARCHAR(255)",true,false,null,null,false));
+
+        performCreate(map,null);
+      }
+      else
+      {
+        // Schema upgrade code goes here, if needed.
+      }
+
+      // Index management
+      IndexDescription descriptionIndex = new IndexDescription(true,new String[]{descriptionField});
+
+      // Get rid of indexes that shouldn't be there
+      Map indexes = getTableIndexes(null,null);
+      Iterator iter = indexes.keySet().iterator();
+      while (iter.hasNext())
+      {
+        String indexName = (String)iter.next();
+        IndexDescription id = (IndexDescription)indexes.get(indexName);
+
+        if (descriptionIndex != null && id.equals(descriptionIndex))
+          descriptionIndex = null;
+        else if (indexName.indexOf("_pkey") == -1)
+          // This index shouldn't be here; drop it
+          performRemoveIndex(indexName);
+      }
+
+      // Add the ones we didn't find
+      if (descriptionIndex != null)
+        performAddIndex(null,descriptionIndex);
+
+      break;
+    }
+  }
+
+
+  /** Uninstall.  This also unregisters all connectors.
+  */
+  public void deinstall()
+    throws ManifoldCFException
+  {
+    StringSet invKeys = new StringSet(getCacheKey());
+
+    // First, go through all registered connectors.  This is all inside a transaction.
+    beginTransaction();
+    try
+    {
+      IResultSet set = performQuery("SELECT "+classNameField+" FROM "+getTableName(),null,null,null);
+      int i = 0;
+      while (i < set.getRowCount())
+      {
+        IResultRow row = set.getRow(i++);
+        String className = row.getValue(classNameField).toString();
+        // Call the deinstall method
+        MappingConnectorFactory.deinstall(threadContext,className);
+      }
+      performDrop(invKeys);
+    }
+    catch (ManifoldCFException e)
+    {
+      signalRollback();
+      throw e;
+    }
+    catch (Error e)
+    {
+      signalRollback();
+      throw e;
+    }
+    finally
+    {
+      endTransaction();
+    }
+  }
+
+  /** Register a new connector.
+  * The connector's install method will also be called.
+  *@param description is the description to use in the UI.
+  *@param className is the class name.
+  */
+  public void registerConnector(String description, String className)
+    throws ManifoldCFException
+  {
+    StringSet invKeys = new StringSet(getCacheKey());
+    beginTransaction();
+    try
+    {
+      //performLock();
+      // See if already there.
+      ArrayList params = new ArrayList();
+      params.add(className);
+      IResultSet set = performQuery("SELECT * FROM "+getTableName()+" WHERE "+classNameField+"=? FOR UPDATE",params,null,null);
+      HashMap map = new HashMap();
+      map.put(descriptionField,description);
+      if (set.getRowCount() == 0)
+      {
+        // Insert it into table first.
+        map.put(classNameField,className);
+        performInsert(map,invKeys);
+      }
+      else
+      {
+        performUpdate(map,"WHERE "+classNameField+"=?",params,invKeys);
+      }
+
+      // Either way, we must do the install/upgrade itself.
+      MappingConnectorFactory.install(threadContext,className);
+    }
+    catch (ManifoldCFException e)
+    {
+      signalRollback();
+      throw e;
+    }
+    catch (Error e)
+    {
+      signalRollback();
+      throw e;
+    }
+    finally
+    {
+      endTransaction();
+    }
+  }
+
+  /** Unregister a connector.
+  * The connector's deinstall method will also be called.
+  *@param className is the class name of the connector to unregister.
+  */
+  public void unregisterConnector(String className)
+    throws ManifoldCFException
+  {
+    StringSet invKeys = new StringSet(getCacheKey());
+    beginTransaction();
+    try
+    {
+      // Uninstall first
+      MappingConnectorFactory.deinstall(threadContext,className);
+
+      removeConnector(className);
+    }
+    catch (ManifoldCFException e)
+    {
+      signalRollback();
+      throw e;
+    }
+    catch (Error e)
+    {
+      signalRollback();
+      throw e;
+    }
+    finally
+    {
+      endTransaction();
+    }
+  }
+
+  /** Remove a connector.
+  * Call this when the connector cannot be instantiated.
+  *@param className is the connector class to remove.
+  */
+  public void removeConnector(String className)
+    throws ManifoldCFException
+  {
+    StringSet invKeys = new StringSet(getCacheKey());
+    ArrayList list = new ArrayList();
+    list.add(className);
+    performDelete("WHERE "+classNameField+"=?",list,invKeys);
+  }
+
+  /** Get ordered list of connectors.
+  *@return a resultset with the columns "description" and "classname".
+  * These will be ordered by description.
+  */
+  public IResultSet getConnectors()
+    throws ManifoldCFException
+  {
+    StringSet invKeys = new StringSet(getCacheKey());
+
+    return performQuery("SELECT "+descriptionField+" AS description,"+classNameField+" AS classname FROM "+
+      getTableName()+" ORDER BY "+descriptionField+" ASC",null,invKeys,null);
+  }
+
+  /** Get a description given a class name.
+  *@param className is the class name.
+  *@return the description, or null if the class is not registered.
+  */
+  public String getDescription(String className)
+    throws ManifoldCFException
+  {
+    StringSet invKeys = new StringSet(getCacheKey());
+
+    ArrayList list = new ArrayList();
+    list.add(className);
+    IResultSet set = performQuery("SELECT "+descriptionField+" FROM "+
+      getTableName()+" WHERE "+classNameField+"=?",list,invKeys,null);
+    if (set.getRowCount() == 0)
+      return null;
+    IResultRow row = set.getRow(0);
+    return row.getValue(descriptionField).toString();
+  }
+
+  /** Check if a particular connector is installed or not.
+  *@param className is the class name of the connector.
+  *@return true if installed, false otherwise.
+  */
+  public boolean isInstalled(String className)
+    throws ManifoldCFException
+  {
+    // Use the global table key; that's good enough because we don't expect stuff to change out from under very often.
+    StringSet invKeys = new StringSet(getCacheKey());
+
+    ArrayList list = new ArrayList();
+    list.add(className);
+    IResultSet set = performQuery("SELECT * FROM "+
+      getTableName()+" WHERE "+classNameField+"=?",list,invKeys,null);
+    return set.getRowCount() > 0;
+  }
+
+  // Protected methods
+
+  /** Get the cache key for the connector manager table.
+  *@return the cache key
+  */
+  protected String getCacheKey()
+  {
+    return CacheKeyFactory.makeTableKey(null,getTableName(),getDBInterface().getDatabaseName());
+  }
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/MappingConnectorManager.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,36 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.mappers;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.authorities.interfaces.*;
+
+/** A mapping connector massages a UserRecord to augment the user identification information within.
+*
+* An instance of this interface provides this functionality.  Mapping connector instances are pooled, so that session
+* setup does not need to be done repeatedly.  The pool is segregated by specific sets of configuration parameters.
+*/
+public abstract class BaseMappingConnector extends org.apache.manifoldcf.core.connector.BaseConnector implements IMappingConnector
+{
+  public static final String _rcsid = "@(#)$Id$";
+
+  // This class is provided for future backwards compatibility reasons, so it is wise to
+  // extend it.
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/BaseMappingConnector.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java?rev=1495814&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java (added)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java Sun Jun 23 13:10:02 2013
@@ -0,0 +1,149 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You 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.apache.manifoldcf.authorities.mapping;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.authorities.interfaces.*;
+import java.util.*;
+
+/** This is the implementation of the authority connection interface, which describes a paper object
+* to be manipulated in order to create, edit, or save an authority definition.
+*/
+public class MappingConnection implements IMappingConnection
+{
+  public static final String _rcsid = "@(#)$Id$";
+
+  // data
+  protected boolean isNew = true;
+  protected String name = null;
+  protected String description = null;
+  protected String className = null;
+  protected ConfigParams configParams = new ConfigParams();
+  protected int maxCount = 100;
+
+  /** Constructor.
+  */
+  public MappingConnection()
+  {
+  }
+
+  /** Clone this object.
+  *@return the cloned object.
+  */
+  public MappingConnection duplicate()
+  {
+    MappingConnection rval = new MappingConnection();
+    rval.isNew = isNew;
+    rval.name = name;
+    rval.description = description;
+    rval.className = className;
+    rval.maxCount = maxCount;
+    rval.configParams = configParams.duplicate();
+    return rval;
+  }
+
+  /** Set 'isnew' condition.
+  *@param isnew true if this is a new instance.
+  */
+  public void setIsNew(boolean isnew)
+  {
+    this.isNew = isnew;
+  }
+  
+  /** Get 'isnew' condition.
+  *@return true if this is a new connection, false otherwise.
+  */
+  public boolean getIsNew()
+  {
+    return isNew;
+  }
+
+  /** Set name.
+  *@param name is the name.
+  */
+  public void setName(String name)
+  {
+    this.name = name;
+  }
+
+  /** Get name.
+  *@return the name
+  */
+  public String getName()
+  {
+    return name;
+  }
+
+  /** Set description.
+  *@param description is the description.
+  */
+  public void setDescription(String description)
+  {
+    this.description = description;
+  }
+
+  /** Get description.
+  *@return the description
+  */
+  public String getDescription()
+  {
+    return description;
+  }
+
+  /** Set the class name.
+  *@param className is the class name.
+  */
+  public void setClassName(String className)
+  {
+    this.className = className;
+  }
+
+  /** Get the class name.
+  *@return the class name
+  */
+  public String getClassName()
+  {
+    return className;
+  }
+
+  /** Get the configuration parameters.
+  *@return the map.  Can be modified.
+  */
+  public ConfigParams getConfigParams()
+  {
+    return configParams;
+  }
+
+  /** Set the maximum size of the connection pool.
+  *@param maxCount is the maximum connection count per JVM.
+  */
+  public void setMaxConnections(int maxCount)
+  {
+    this.maxCount = maxCount;
+  }
+
+  /** Get the maximum size of the connection pool.
+  *@return the maximum size.
+  */
+  public int getMaxConnections()
+  {
+    return maxCount;
+  }
+
+}

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnection.java
------------------------------------------------------------------------------
    svn:keywords = Id