Author: kwright
Date: Wed Jun 26 16:32:32 2013
New Revision: 1496997
URL: http://svn.apache.org/r1496997
Log:
Add mapping prereqs to authorities; no UI or API support yet.
Added:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java
(with props)
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingConnectionManager.java
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingPrereqManager.java
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java?rev=1496997&r1=1496996&r2=1496997&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java
(original)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java
Wed Jun 26 16:32:32 2013
@@ -37,6 +37,8 @@ public class AuthorityConnection impleme
protected ConfigParams configParams = new ConfigParams();
protected int maxCount = 100;
+ protected Set<String> prerequisites = new HashSet<String>();
+
/** Constructor.
*/
public AuthorityConnection()
@@ -55,6 +57,10 @@ public class AuthorityConnection impleme
rval.className = className;
rval.maxCount = maxCount;
rval.configParams = configParams.duplicate();
+ for (String s : prerequisites)
+ {
+ rval.prerequisites.add(s);
+ }
return rval;
}
@@ -146,4 +152,12 @@ public class AuthorityConnection impleme
return maxCount;
}
+ /** Get the prerequisite mappers.
+ *@return the set of mapping connections (by name) that must be run prior to
this one.
+ */
+ public Set<String> getPrerequisites()
+ {
+ return prerequisites;
+ }
+
}
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java?rev=1496997&r1=1496996&r2=1496997&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
(original)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
Wed Jun 26 16:32:32 2013
@@ -56,7 +56,8 @@ public class AuthorityConnectionManager
protected final static String maxCountField = "maxcount";
protected final static String configField = "configxml";
- protected static Random random = new Random();
+ // Handle for prereq storage
+ protected AuthorityPrereqManager authPrereqManager;
// Cache manager
ICacheManager cacheManager;
@@ -71,12 +72,14 @@ public class AuthorityConnectionManager
{
super(database,"authconnections");
+ authPrereqManager = new AuthorityPrereqManager(database);
cacheManager = CacheManagerFactory.make(threadContext);
this.threadContext = threadContext;
}
/** Install the manager.
*/
+ @Override
public void install()
throws ManifoldCFException
{
@@ -100,6 +103,9 @@ public class AuthorityConnectionManager
// Upgrade code goes here
}
+ // Install dependent tables.
+ authPrereqManager.install(getTableName(),nameField);
+
// Index management goes here
break;
@@ -108,18 +114,39 @@ public class AuthorityConnectionManager
/** Uninstall the manager.
*/
+ @Override
public void deinstall()
throws ManifoldCFException
{
- performDrop(null);
+ beginTransaction();
+ try
+ {
+ authPrereqManager.deinstall();
+ performDrop(null);
+ }
+ catch (ManifoldCFException e)
+ {
+ signalRollback();
+ throw e;
+ }
+ catch (Error e)
+ {
+ signalRollback();
+ throw e;
+ }
+ finally
+ {
+ endTransaction();
+ }
}
/** Export configuration */
+ @Override
public void exportConfiguration(java.io.OutputStream os)
throws java.io.IOException, ManifoldCFException
{
// Write a version indicator
- ManifoldCF.writeDword(os,1);
+ ManifoldCF.writeDword(os,2);
// Get the authority list
IAuthorityConnection[] list = getAllConnections();
// Write the number of authorities
@@ -134,15 +161,23 @@ public class AuthorityConnectionManager
ManifoldCF.writeString(os,conn.getClassName());
ManifoldCF.writeString(os,conn.getConfigParams().toXML());
ManifoldCF.writeDword(os,conn.getMaxConnections());
+
+ Set<String> prereqs = conn.getPrerequisites();
+ ManifoldCF.writeDword(os,prereqs.size());
+ for (String s : prereqs)
+ {
+ ManifoldCF.writeString(os,s);
+ }
}
}
/** Import configuration */
+ @Override
public void importConfiguration(java.io.InputStream is)
throws java.io.IOException, ManifoldCFException
{
int version = ManifoldCF.readDword(is);
- if (version != 1)
+ if (version < 1 || version > 2)
throw new java.io.IOException("Unknown authority configuration version:
"+Integer.toString(version));
int count = ManifoldCF.readDword(is);
int i = 0;
@@ -154,6 +189,14 @@ public class AuthorityConnectionManager
conn.setClassName(ManifoldCF.readString(is));
conn.getConfigParams().fromXML(ManifoldCF.readString(is));
conn.setMaxConnections(ManifoldCF.readDword(is));
+ if (version >= 2)
+ {
+ int prereqCount = ManifoldCF.readDword(is);
+ for (int j = 0; j < prereqCount; j++)
+ {
+ conn.getPrerequisites().add(ManifoldCF.readString(is));
+ }
+ }
// Attempt to save this connection
save(conn);
i++;
@@ -163,6 +206,7 @@ public class AuthorityConnectionManager
/** Obtain a list of the repository connections, ordered by name.
*@return an array of connection objects.
*/
+ @Override
public IAuthorityConnection[] getAllConnections()
throws ManifoldCFException
{
@@ -205,6 +249,7 @@ public class AuthorityConnectionManager
*@param name is the name of the repository connection.
*@return the loaded connection object, or null if not found.
*/
+ @Override
public IAuthorityConnection load(String name)
throws ManifoldCFException
{
@@ -215,6 +260,7 @@ public class AuthorityConnectionManager
*@param names are the names to load.
*@return the loaded connection objects.
*/
+ @Override
public IAuthorityConnection[] loadMultiple(String[] names)
throws ManifoldCFException
{
@@ -238,6 +284,7 @@ public class AuthorityConnectionManager
/** Create a new repository connection object.
*@return the new object.
*/
+ @Override
public IAuthorityConnection create()
throws ManifoldCFException
{
@@ -249,6 +296,7 @@ public class AuthorityConnectionManager
*@param object is the object to save.
*@return true if the object is created, false otherwise.
*/
+ @Override
public boolean save(IAuthorityConnection object)
throws ManifoldCFException
{
@@ -308,6 +356,9 @@ public class AuthorityConnectionManager
performInsert(values,null);
}
+ // Write secondary table stuff
+ authPrereqManager.writeRows(object.getName(),object);
+
cacheManager.invalidateKeys(ch);
return isCreated;
}
@@ -349,6 +400,7 @@ public class AuthorityConnectionManager
*@param name is the name of the connection to delete. If the
* name does not exist, no error is returned.
*/
+ @Override
public void delete(String name)
throws ManifoldCFException
{
@@ -369,6 +421,7 @@ public class AuthorityConnectionManager
if (repoManager.isReferenced(name))
throw new ManifoldCFException("Can't delete authority connection
'"+name+"': existing repository connections refer to it");
ManifoldCF.noteConfigurationChange();
+ authPrereqManager.deleteRows(name);
ArrayList params = new ArrayList();
String query = buildConjunctionClause(params,new ClauseDescription[]{
new UnitaryClause(nameField,name)});
@@ -400,11 +453,31 @@ public class AuthorityConnectionManager
/** Get the authority connection name column.
*@return the name column.
*/
+ @Override
public String getAuthorityNameColumn()
{
return nameField;
}
+ /** Return true if the specified mapping name is referenced.
+ *@param mappingName is the mapping name.
+ *@return true if referenced, false otherwise.
+ */
+ @Override
+ public boolean isMappingReferenced(String mappingName)
+ throws ManifoldCFException
+ {
+ StringSetBuffer ssb = new StringSetBuffer();
+ ssb.add(getAuthorityConnectionsKey());
+ StringSet localCacheKeys = new StringSet(ssb);
+ ArrayList params = new ArrayList();
+ String query = buildConjunctionClause(params,new ClauseDescription[]{
+ new UnitaryClause(authPrereqManager.prereqField,mappingName)});
+ IResultSet set = performQuery("SELECT "+nameField+" FROM
"+authPrereqManager.getTableName()+" WHERE "+query,params,
+ localCacheKeys,null);
+ return set.getRowCount() > 0;
+ }
+
// Caching strategy: Individual connection descriptions are cached, and
there is a global cache key for the list of
// repository connections.
@@ -486,7 +559,8 @@ public class AuthorityConnectionManager
*/
protected int maxClauseGetAuthorityConnectionsChunk()
{
- return findConjunctionClauseMax(new ClauseDescription[]{});
+ return Math.min(findConjunctionClauseMax(new ClauseDescription[]{}),
+ authPrereqManager.maxClauseGetRows());
}
/** Read a chunk of authority connections.
@@ -519,6 +593,8 @@ public class AuthorityConnectionManager
rc.getConfigParams().fromXML(xml);
rval[index] = rc;
}
+ // Do prereq part
+ authPrereqManager.getRows(rval,returnIndex,params);
}
// The cached instance will be a AuthorityConnection. The cached version
will be duplicated when it is returned
Added:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java?rev=1496997&view=auto
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java
(added)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java
Wed Jun 26 16:32:32 2013
@@ -0,0 +1,200 @@
+/* $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.authority;
+
+import org.apache.manifoldcf.core.interfaces.*;
+import org.apache.manifoldcf.authorities.interfaces.*;
+import java.util.*;
+
+/** This class manages the "authprereq" table, which contains the mapping
connection prerequisites for each authority connection.
+*
+* <br><br>
+* <b>authprereq</b>
+* <table border="1" cellpadding="3" cellspacing="0">
+* <tr class="TableHeadingColor">
+*
<th>Field</th><th>Type</th><th>Description </th>
+*
<tr><td>ownername</td><td>VARCHAR(32)</td><td>Reference:authconnections.connectionname</td></tr>
+*
<tr><td>prereq</td><td>VARCHAR(32)</td><td>Reference:mappingconnections.connectionname</td></tr>
+* </table>
+* <br><br>
+*
+*/
+public class AuthorityPrereqManager extends
org.apache.manifoldcf.core.database.BaseTable
+{
+ public static final String _rcsid = "@(#)$Id$";
+
+ // Schema
+ public final static String ownerNameField = "ownername";
+ public final static String prereqField = "prereq";
+
+ /** Constructor.
+ *@param database is the database instance.
+ */
+ public AuthorityPrereqManager(IDBInterface database)
+ throws ManifoldCFException
+ {
+ super(database,"authprereq");
+ }
+
+ /** Install or upgrade.
+ *@param ownerTable is the name of the table that owns this one.
+ *@param owningTablePrimaryKey is the primary key of the owning table.
+ */
+ public void install(String ownerTable, String owningTablePrimaryKey)
+ throws ManifoldCFException
+ {
+ // Always use a loop, in case upgrade needs it.
+ while (true)
+ {
+ Map existing = getTableSchema(null,null);
+ if (existing == null)
+ {
+ HashMap map = new HashMap();
+ map.put(ownerNameField,new
ColumnDescription("VARCHAR(32)",false,false,ownerTable,owningTablePrimaryKey,false));
+ map.put(prereqField,new
ColumnDescription("VARCHAR(32)",false,false,null,null,false));
+ performCreate(map,null);
+ }
+
+ // Index management
+ IndexDescription ownerIndex = new IndexDescription(false,new
String[]{ownerNameField});
+
+ // 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 (ownerIndex != null && id.equals(ownerIndex))
+ ownerIndex = 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 (ownerIndex != null)
+ performAddIndex(null,ownerIndex);
+
+ break;
+ }
+ }
+
+ /** Uninstall.
+ */
+ public void deinstall()
+ throws ManifoldCFException
+ {
+ performDrop(null);
+ }
+
+ /** Read rows for a given owner name.
+ *@param name is the owner name.
+ *@return a list, with columns: "prereq"
+ */
+ public IResultSet readRows(String name)
+ throws ManifoldCFException
+ {
+ ArrayList list = new ArrayList();
+ String query = buildConjunctionClause(list,new ClauseDescription[]{
+ new UnitaryClause(ownerNameField,name)});
+ return performQuery("SELECT "+prereqField+" AS prereq FROM "+
+ getTableName()+" WHERE "+query,list,null,null);
+ }
+
+ /** Calculate the maximum number of clauses we can use with getRows.
+ */
+ public int maxClauseGetRows()
+ {
+ return findConjunctionClauseMax(new ClauseDescription[]{});
+ }
+
+ /** Fill in a set of prereqs corresponding to a set of connection names.
+ *@param connections is the set of connections to fill in.
+ *@param indexMap maps the connection name to the index in the connections
array.
+ *@param ownerNameParams is the corresponding set of connection name
parameters.
+ */
+ public void getRows(IAuthorityConnection[] connections, Map indexMap,
ArrayList ownerNameParams)
+ throws ManifoldCFException
+ {
+ ArrayList list = new ArrayList();
+ String query = buildConjunctionClause(list,new ClauseDescription[]{
+ new MultiClause(ownerNameField,ownerNameParams)});
+ IResultSet set = performQuery("SELECT * FROM "+getTableName()+" WHERE
"+query,list,
+ null,null);
+ for (int i = 0; i < set.getRowCount(); i++)
+ {
+ IResultRow row = set.getRow(i);
+ String ownerName = (String)row.getValue(ownerNameField);
+ int index = ((Integer)indexMap.get(ownerName)).intValue();
+ String prereq = (String)row.getValue(prereqField);
+ connections[index].getPrerequisites().add(prereq);
+ }
+ }
+
+ /** Write a set of prereqs into the database.
+ *@param owner is the owning connection name.
+ *@param connection is the connection to write prereqs for.
+ */
+ public void writeRows(String owner, IAuthorityConnection connection)
+ throws ManifoldCFException
+ {
+ beginTransaction();
+ try
+ {
+ HashMap map = new HashMap();
+ Set<String> prereqs = connection.getPrerequisites();
+ for (String prereq : prereqs)
+ {
+ map.clear();
+ map.put(prereqField,prereq);
+ map.put(ownerNameField,owner);
+ performInsert(map,null);
+ }
+ }
+ catch (ManifoldCFException e)
+ {
+ signalRollback();
+ throw e;
+ }
+ catch (Error e)
+ {
+ signalRollback();
+ throw e;
+ }
+ finally
+ {
+ endTransaction();
+ }
+ }
+
+ /** Delete rows.
+ *@param owner is the owner whose rows to delete.
+ */
+ public void deleteRows(String owner)
+ throws ManifoldCFException
+ {
+ ArrayList list = new ArrayList();
+ String query = buildConjunctionClause(list,new ClauseDescription[]{
+ new UnitaryClause(ownerNameField,owner)});
+ performDelete("WHERE "+query,list,null);
+ }
+
+}
Propchange:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityPrereqManager.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java?rev=1496997&r1=1496996&r2=1496997&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java
(original)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java
Wed Jun 26 16:32:32 2013
@@ -80,4 +80,9 @@ public interface IAuthorityConnection
*/
public int getMaxConnections();
+ /** Get the prerequisite mappers.
+ *@return the set of mapping connections (by name) that must be run prior to
this one.
+ */
+ public Set<String> getPrerequisites();
+
}
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java?rev=1496997&r1=1496996&r2=1496997&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java
(original)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java
Wed Jun 26 16:32:32 2013
@@ -58,6 +58,13 @@ public interface IAuthorityConnectionMan
public IAuthorityConnection load(String name)
throws ManifoldCFException;
+ /** Load multiple repository connections by name.
+ *@param names are the names to load.
+ *@return the loaded connection objects.
+ */
+ public IAuthorityConnection[] loadMultiple(String[] names)
+ throws ManifoldCFException;
+
/** Create a new authority connection object.
*@return the new object.
*/
@@ -90,4 +97,11 @@ public interface IAuthorityConnectionMan
*/
public String getAuthorityNameColumn();
+ /** Return true if the specified mapping name is referenced.
+ *@param mappingName is the mapping name.
+ *@return true if referenced, false otherwise.
+ */
+ public boolean isMappingReferenced(String mappingName)
+ throws ManifoldCFException;
+
}
Modified:
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=1496997&r1=1496996&r2=1496997&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
(original)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
Wed Jun 26 16:32:32 2013
@@ -58,6 +58,13 @@ public interface IMappingConnectionManag
public IMappingConnection load(String name)
throws ManifoldCFException;
+ /** Load multiple mapping connections by name.
+ *@param names are the names to load.
+ *@return the loaded connection objects.
+ */
+ public IMappingConnection[] loadMultiple(String[] names)
+ throws ManifoldCFException;
+
/** Create a new mapping connection object.
*@return the new object.
*/
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=1496997&r1=1496996&r2=1496997&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 16:32:32 2013
@@ -53,7 +53,7 @@ public class MappingConnectionManager ex
protected final static String maxCountField = "maxcount";
protected final static String configField = "configxml";
- // Handle for throttle spec storage
+ // Handle for prereq storage
protected MappingPrereqManager mappingPrereqManager;
// Cache manager
@@ -76,6 +76,7 @@ public class MappingConnectionManager ex
/** Install the manager.
*/
+ @Override
public void install()
throws ManifoldCFException
{
@@ -112,6 +113,7 @@ public class MappingConnectionManager ex
/** Uninstall the manager.
*/
+ @Override
public void deinstall()
throws ManifoldCFException
{
@@ -138,6 +140,7 @@ public class MappingConnectionManager ex
}
/** Export configuration */
+ @Override
public void exportConfiguration(java.io.OutputStream os)
throws java.io.IOException, ManifoldCFException
{
@@ -167,6 +170,7 @@ public class MappingConnectionManager ex
}
/** Import configuration */
+ @Override
public void importConfiguration(java.io.InputStream is)
throws java.io.IOException, ManifoldCFException
{
@@ -195,6 +199,7 @@ public class MappingConnectionManager ex
/** Obtain a list of the repository connections, ordered by name.
*@return an array of connection objects.
*/
+ @Override
public IMappingConnection[] getAllConnections()
throws ManifoldCFException
{
@@ -237,6 +242,7 @@ public class MappingConnectionManager ex
*@param name is the name of the mapping connection.
*@return the loaded connection object, or null if not found.
*/
+ @Override
public IMappingConnection load(String name)
throws ManifoldCFException
{
@@ -247,6 +253,7 @@ public class MappingConnectionManager ex
*@param names are the names to load.
*@return the loaded connection objects.
*/
+ @Override
public IMappingConnection[] loadMultiple(String[] names)
throws ManifoldCFException
{
@@ -270,6 +277,7 @@ public class MappingConnectionManager ex
/** Create a new repository connection object.
*@return the new object.
*/
+ @Override
public IMappingConnection create()
throws ManifoldCFException
{
@@ -281,6 +289,7 @@ public class MappingConnectionManager ex
*@param object is the object to save.
*@return true if the object is created, false otherwise.
*/
+ @Override
public boolean save(IMappingConnection object)
throws ManifoldCFException
{
@@ -384,6 +393,7 @@ public class MappingConnectionManager ex
*@param name is the name of the connection to delete. If the
* name does not exist, no error is returned.
*/
+ @Override
public void delete(String name)
throws ManifoldCFException
{
@@ -399,6 +409,7 @@ public class MappingConnectionManager ex
try
{
// Check if any other mapping refers to this connection name
+ // 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");
ManifoldCF.noteConfigurationChange();
@@ -434,6 +445,7 @@ public class MappingConnectionManager ex
/** Get the mapping connection name column.
*@return the name column.
*/
+ @Override
public String getMappingNameColumn()
{
return nameField;
Modified:
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingPrereqManager.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingPrereqManager.java?rev=1496997&r1=1496996&r2=1496997&view=diff
==============================================================================
---
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingPrereqManager.java
(original)
+++
manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/MappingPrereqManager.java
Wed Jun 26 16:32:32 2013
@@ -29,8 +29,8 @@ import java.util.*;
* <table border="1" cellpadding="3" cellspacing="0">
* <tr class="TableHeadingColor">
*
<th>Field</th><th>Type</th><th>Description </th>
-*
<tr><td>ownername</td><td>VARCHAR(32)</td><td>Reference:repoconnections.connectionname</td></tr>
-*
<tr><td>prereq</td><td>VARCHAR(32)</td><td>Reference:repoconnections.connectionname</td></tr>
+*
<tr><td>ownername</td><td>VARCHAR(32)</td><td>Reference:mappingconnections.connectionname</td></tr>
+*
<tr><td>prereq</td><td>VARCHAR(32)</td><td>Reference:mappingconnections.connectionname</td></tr>
* </table>
* <br><br>
*
@@ -67,7 +67,7 @@ public class MappingPrereqManager extend
{
HashMap map = new HashMap();
map.put(ownerNameField,new
ColumnDescription("VARCHAR(32)",false,false,ownerTable,owningTablePrimaryKey,false));
- map.put(prereqField,new
ColumnDescription("VARCHAR(32)",false,false,ownerTable,owningTablePrimaryKey,false));
+ map.put(prereqField,new
ColumnDescription("VARCHAR(32)",false,false,null,null,false));
performCreate(map,null);
}