manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1497027 - /manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java
Date Wed, 26 Jun 2013 17:57:28 GMT
Author: kwright
Date: Wed Jun 26 17:57:28 2013
New Revision: 1497027

URL: http://svn.apache.org/r1497027
Log:
Add additional check for deletion of mapping.

Modified:
    manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java

Modified: manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java?rev=1497027&r1=1497026&r2=1497027&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java
(original)
+++ manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java
Wed Jun 26 17:57:28 2013
@@ -398,6 +398,9 @@ public class MappingConnectionManager ex
     throws ManifoldCFException
   {
 
+    // Grab authority connection manager handle, to check on legality of deletion.
+    IAuthorityConnectionManager authManager = AuthorityConnectionManagerFactory.make(threadContext);
+
     StringSetBuffer ssb = new StringSetBuffer();
     ssb.add(getMappingConnectionsKey());
     ssb.add(getMappingConnectionKey(name));
@@ -412,6 +415,8 @@ public class MappingConnectionManager ex
         // MHL - need to check about authority references!!!
         if (isReferenced(name))
           throw new ManifoldCFException("Can't delete mapping connection '"+name+"': existing
mapping connections refer to it");
+        if (authManager.isMappingReferenced(name))
+          throw new ManifoldCFException("Can't delete mapping connection '"+name+"': existing
authority connections refer to it");
         ManifoldCF.noteConfigurationChange();
         mappingPrereqManager.deleteRows(name);
         ArrayList params = new ArrayList();



Mime
View raw message