Return-Path: Delivered-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Received: (qmail 48409 invoked from network); 4 Oct 2010 14:33:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Oct 2010 14:33:29 -0000 Received: (qmail 85390 invoked by uid 500); 4 Oct 2010 14:33:29 -0000 Delivered-To: apmail-incubator-connectors-commits-archive@incubator.apache.org Received: (qmail 85329 invoked by uid 500); 4 Oct 2010 14:33:28 -0000 Mailing-List: contact connectors-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-dev@incubator.apache.org Delivered-To: mailing list connectors-commits@incubator.apache.org Received: (qmail 85319 invoked by uid 99); 4 Oct 2010 14:33:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Oct 2010 14:33:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,T_FILL_THIS_FORM_SHORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Oct 2010 14:33:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE9042388C2D; Mon, 4 Oct 2010 14:32:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1004255 [13/24] - in /incubator/lcf/trunk: modules/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ modules/connectors/documentum/connector/src/main/java/org/apache/manifoldc... Date: Mon, 04 Oct 2010 14:32:28 -0000 To: connectors-commits@incubator.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101004143234.BE9042388C2D@eris.apache.org> Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/DBInterfaceFactory.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/DBInterfaceFactory.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/DBInterfaceFactory.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/DBInterfaceFactory.java Mon Oct 4 14:32:19 2010 @@ -18,7 +18,7 @@ */ package org.apache.manifoldcf.core.interfaces; -import org.apache.manifoldcf.core.system.ACF; +import org.apache.manifoldcf.core.system.ManifoldCF; import java.lang.reflect.*; /** This is the factory class for an IDBInterface. @@ -34,13 +34,13 @@ public class DBInterfaceFactory } public static IDBInterface make(IThreadContext context, String databaseName, String userName, String password) - throws ACFException + throws ManifoldCFException { String dbName = dbinterfaceInstancePrefix + databaseName; Object x = context.get(dbName); if (x == null || !(x instanceof IDBInterface)) { - String implementationClass = ACF.getProperty(ACF.databaseImplementation); + String implementationClass = ManifoldCF.getProperty(ManifoldCF.databaseImplementation); if (implementationClass == null) implementationClass = "org.apache.manifoldcf.core.database.DBInterfacePostgreSQL"; try @@ -49,36 +49,36 @@ public class DBInterfaceFactory Constructor constructor = c.getConstructor(new Class[]{IThreadContext.class,String.class,String.class,String.class}); x = constructor.newInstance(new Object[]{context,databaseName,userName,password}); if (!(x instanceof IDBInterface)) - throw new ACFException("Database implementation class "+implementationClass+" does not implement IDBInterface",ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" does not implement IDBInterface",ManifoldCFException.SETUP_ERROR); context.save(dbName,x); } catch (ClassNotFoundException e) { - throw new ACFException("Database implementation class "+implementationClass+" could not be found: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" could not be found: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (ExceptionInInitializerError e) { - throw new ACFException("Database implementation class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (LinkageError e) { - throw new ACFException("Database implementation class "+implementationClass+" could not be linked: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" could not be linked: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (InstantiationException e) { - throw new ACFException("Database implementation class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (InvocationTargetException e) { - throw new ACFException("Database implementation class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (NoSuchMethodException e) { - throw new ACFException("Database implementation class "+implementationClass+" had no constructor taking (IThreadContext, String, String, String): "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" had no constructor taking (IThreadContext, String, String, String): "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (IllegalAccessException e) { - throw new ACFException("Database implementation class "+implementationClass+" had no public constructor taking (IThreadContext, String, String, String): "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Database implementation class "+implementationClass+" had no public constructor taking (IThreadContext, String, String, String): "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } } return (IDBInterface)x; Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheExecutor.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheExecutor.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheExecutor.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheExecutor.java Mon Oct 4 14:32:19 2010 @@ -49,7 +49,7 @@ public interface ICacheExecutor * @return the newly created objects to cache, or null, if any object cannot be created. * The order of the returned objects must correspond to the order of the object descriptinos. */ - public Object[] create(ICacheDescription[] objectDescriptions) throws ACFException; + public Object[] create(ICacheDescription[] objectDescriptions) throws ManifoldCFException; /** Notify the implementing class of the existence of a cached version of the @@ -59,12 +59,12 @@ public interface ICacheExecutor * @param objectDescription is the unique identifier of the object. * @param cachedObject is the cached object. */ - public void exists(ICacheDescription objectDescription, Object cachedObject) throws ACFException; + public void exists(ICacheDescription objectDescription, Object cachedObject) throws ManifoldCFException; /** Perform the desired operation. This method is called after either createGetObject() * or exists() is called for every requested object. */ - public void execute() throws ACFException; + public void execute() throws ManifoldCFException; } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheManager.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheManager.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheManager.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ICacheManager.java Mon Oct 4 14:32:19 2010 @@ -54,7 +54,7 @@ public interface ICacheManager */ public void findObjectsAndExecute(ICacheDescription[] locateObjectDescriptions, StringSet invalidateKeys, ICacheExecutor execObject, String transactionID) - throws ACFException; + throws ManifoldCFException; /** Second way of doing cache management. * Basically, this approach breaks the findObjectsAndExecute() method down into bite-sized chunks. @@ -74,7 +74,7 @@ public interface ICacheManager */ public ICacheHandle enterCache(ICacheDescription[] locateObjectDescriptions, StringSet invalidateKeys, String transactionID) - throws ACFException; + throws ManifoldCFException; /** Enter a creation critical section. This insures that only one thread is * creating the specified objects at a time. This MUST be paired with @@ -82,7 +82,7 @@ public interface ICacheManager *@param handle is the cache handle. */ public ICacheCreateHandle enterCreateSection(ICacheHandle handle) - throws ACFException; + throws ManifoldCFException; /** Lookup an object. Returns null if object not found. If it is found, * object's LRU and expiration info are updated. The objectDescription passed @@ -91,7 +91,7 @@ public interface ICacheManager *@param objectDescription is the description of the object to look up. */ public Object lookupObject(ICacheCreateHandle handle, ICacheDescription objectDescription) - throws ACFException; + throws ManifoldCFException; /** Save a newly created object. The object MUST be one of those identified in the * enterCache() method. @@ -101,25 +101,25 @@ public interface ICacheManager */ public void saveObject(ICacheCreateHandle handle, ICacheDescription objectDescription, Object object) - throws ACFException; + throws ManifoldCFException; /** Leave the create section. *@param handle is the handle created by the corresponding enterCreateSection() method. */ public void leaveCreateSection(ICacheCreateHandle handle) - throws ACFException; + throws ManifoldCFException; /** Invalidate keys. The keys invalidated are what got passed to the enterCache() method. *@param handle is the cache handle. Does nothing if a null set of keys was passed in. */ public void invalidateKeys(ICacheHandle handle) - throws ACFException; + throws ManifoldCFException; /** Leave the cache. Must be paired with enterCache, above. *@param handle is the handle of the cache we are leaving. */ public void leaveCache(ICacheHandle handle) - throws ACFException; + throws ManifoldCFException; // The following methods are used to communicate transaction information to the cache. @@ -129,7 +129,7 @@ public interface ICacheManager *@param enclosingTransactionID is the id of the transaction that is in effect, or null. */ public void startTransaction(String startingTransactionID, String enclosingTransactionID) - throws ACFException; + throws ManifoldCFException; /** Commit a cache transaction. * This method MUST be called when a transaction successfully ends, or open locks will not be closed!!! @@ -138,7 +138,7 @@ public interface ICacheManager *@param transactionID is the id of the transaction that is ending. */ public void commitTransaction(String transactionID) - throws ACFException; + throws ManifoldCFException; /** Roll back a cache transaction. * This method releases all objects cached against the ending transaction ID, and releases all locks @@ -146,7 +146,7 @@ public interface ICacheManager *@param transactionID is the id of the transaction that is ending. */ public void rollbackTransaction(String transactionID) - throws ACFException; + throws ManifoldCFException; // This is a maintenance method; call it when convenient. @@ -154,6 +154,6 @@ public interface ICacheManager *@param currentTimestamp is the current time in milliseconds since epoch. */ public void expireObjects(long currentTimestamp) - throws ACFException; + throws ManifoldCFException; } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IConnector.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IConnector.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IConnector.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IConnector.java Mon Oct 4 14:32:19 2010 @@ -34,7 +34,7 @@ public interface IConnector *@param threadContext is the current thread context. */ public void install(IThreadContext threadContext) - throws ACFException; + throws ManifoldCFException; /** Uninstall the connector. * This method is called to remove persistent storage for the connector, such as database tables etc. @@ -42,7 +42,7 @@ public interface IConnector *@param threadContext is the current thread context. */ public void deinstall(IThreadContext threadContext) - throws ACFException; + throws ManifoldCFException; /** Connect. The configuration parameters are included. *@param configParams are the configuration parameters for this connection. @@ -56,18 +56,18 @@ public interface IConnector *@return the connection's status as a displayable string. */ public String check() - throws ACFException; + throws ManifoldCFException; /** This method is periodically called for all connectors that are connected but not * in active use. */ public void poll() - throws ACFException; + throws ManifoldCFException; /** Close the connection. Call this before discarding the repository connector. */ public void disconnect() - throws ACFException; + throws ManifoldCFException; /** Get configuration information. *@return the configuration information for this class. @@ -99,7 +99,7 @@ public interface IConnector *@param tabsArray is an array of tab names. Add to this array any tab names that are specific to the connector. */ public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, ArrayList tabsArray) - throws ACFException, IOException; + throws ManifoldCFException, IOException; /** Output the configuration body section. * This method is called in the body section of the authority connector's configuration page. Its purpose is to present the required form elements for editing. @@ -111,7 +111,7 @@ public interface IConnector *@param tabName is the current tab name. */ public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, String tabName) - throws ACFException, IOException; + throws ManifoldCFException, IOException; /** Process a configuration post. * This method is called at the start of the authority connector's configuration page, whenever there is a possibility that form data for a connection has been @@ -123,7 +123,7 @@ public interface IConnector *@return null if all is well, or a string error message if there is an error that should prevent saving of the connection (and cause a redirection to an error page). */ public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters) - throws ACFException; + throws ManifoldCFException; /** View configuration. * This method is called in the body section of the authority connector's view configuration page. Its purpose is to present the connection information to the user. @@ -133,6 +133,6 @@ public interface IConnector *@param parameters are the configuration parameters, as they currently exist, for this connection being configured. */ public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters) - throws ACFException, IOException; + throws ManifoldCFException, IOException; } \ No newline at end of file Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDBInterface.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDBInterface.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDBInterface.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDBInterface.java Mon Oct 4 14:32:19 2010 @@ -43,13 +43,13 @@ public interface IDBInterface * database communication. */ public void openDatabase() - throws ACFException; + throws ManifoldCFException; /** Uninitialize. This method is called during JVM shutdown, in order to close * all database communication. */ public void closeDatabase() - throws ACFException; + throws ManifoldCFException; /** Get the database name. *@return the database name. @@ -70,7 +70,7 @@ public interface IDBInterface *@param tableName is the name of the table. */ public void performLock(String tableName) - throws ACFException; + throws ManifoldCFException; /** Perform an insert operation. *@param tableName is the name of the table. @@ -79,7 +79,7 @@ public interface IDBInterface *@param parameterMap is the map of column name/values to write. */ public void performInsert(String tableName, Map parameterMap, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Perform an update operation. *@param tableName is the name of the table. @@ -89,7 +89,7 @@ public interface IDBInterface *@param whereParameters are the parameters that come with the where clause, if any. */ public void performUpdate(String tableName, Map parameterMap, String whereClause, ArrayList whereParameters, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Perform a delete operation. *@param tableName is the name of the table to delete from. @@ -98,7 +98,7 @@ public interface IDBInterface *@param whereParameters are the parameters that come with the where clause, if any. */ public void performDelete(String tableName, String whereClause, ArrayList whereParameters, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Perform a table creation operation. *@param tableName is the name of the table to create. @@ -108,7 +108,7 @@ public interface IDBInterface *@param invalidateKeys are the cache keys that should be invalidated, if any. */ public void performCreate(String tableName, Map columnMap, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Perform a table alter operation. *@param tableName is the name of the table to alter. @@ -122,7 +122,7 @@ public interface IDBInterface */ public void performAlter(String tableName, Map columnMap, Map columnModifyMap, ArrayList columnDeleteList, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Add an index to a table. *@param tableName is the name of the table to add the index for. @@ -131,7 +131,7 @@ public interface IDBInterface * in the index, in order. */ public void addTableIndex(String tableName, boolean unique, ArrayList columnList) - throws ACFException; + throws ManifoldCFException; /** Add an index to a table. *@param tableName is the name of the table to add the index for. @@ -139,32 +139,32 @@ public interface IDBInterface *@param description is the index description. */ public void performAddIndex(String indexName, String tableName, IndexDescription description) - throws ACFException; + throws ManifoldCFException; /** Remove an index. *@param indexName is the name of the index to remove. */ public void performRemoveIndex(String indexName) - throws ACFException; + throws ManifoldCFException; /** Analyze a table. *@param tableName is the name of the table to analyze/calculate statistics for. */ public void analyzeTable(String tableName) - throws ACFException; + throws ManifoldCFException; /** Reindex a table. *@param tableName is the name of the table to rebuild indexes for. */ public void reindexTable(String tableName) - throws ACFException; + throws ManifoldCFException; /** Perform a table drop operation. *@param tableName is the name of the table to drop. *@param invalidateKeys are the cache keys that should be invalidated, if any. */ public void performDrop(String tableName, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Create user and database. *@param adminUserName is the admin user name. @@ -172,7 +172,7 @@ public interface IDBInterface *@param invalidateKeys are the cache keys that should be invalidated, if any. */ public void createUserAndDatabase(String adminUserName, String adminPassword, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Drop user and database. *@param adminUserName is the admin user name. @@ -180,7 +180,7 @@ public interface IDBInterface *@param invalidateKeys are the cache keys that should be invalidated, if any. */ public void dropUserAndDatabase(String adminUserName, String adminPassword, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Get a table's schema. *@param tableName is the name of the table. @@ -189,7 +189,7 @@ public interface IDBInterface *@return a map of column names and ColumnDescription objects, describing the schema. */ public Map getTableSchema(String tableName, StringSet cacheKeys, String queryClass) - throws ACFException; + throws ManifoldCFException; /** Get a table's indexes. *@param tableName is the name of the table. @@ -198,7 +198,7 @@ public interface IDBInterface *@return a map of index names and IndexDescription objects, describing the indexes. */ public Map getTableIndexes(String tableName, StringSet cacheKeys, String queryClass) - throws ACFException; + throws ManifoldCFException; /** Get a database's tables. *@param cacheKeys are the cache keys for the query, or null. @@ -206,7 +206,7 @@ public interface IDBInterface *@return the set of tables. */ public StringSet getAllTables(StringSet cacheKeys, String queryClass) - throws ACFException; + throws ManifoldCFException; /** Perform a general database modification query. *@param query is the query string. @@ -214,7 +214,7 @@ public interface IDBInterface *@param invalidateKeys are the cache keys to invalidate. */ public void performModification(String query, ArrayList params, StringSet invalidateKeys) - throws ACFException; + throws ManifoldCFException; /** Perform a general "data fetch" query. *@param query is the query string. @@ -225,7 +225,7 @@ public interface IDBInterface *@return a resultset. */ public IResultSet performQuery(String query, ArrayList params, StringSet cacheKeys, String queryClass) - throws ACFException; + throws ManifoldCFException; /** Perform a general "data fetch" query. *@param query is the query string. @@ -239,7 +239,7 @@ public interface IDBInterface */ public IResultSet performQuery(String query, ArrayList params, StringSet cacheKeys, String queryClass, int maxResults, ILimitChecker returnLimit) - throws ACFException; + throws ManifoldCFException; /** Perform a general "data fetch" query. *@param query is the query string. @@ -254,7 +254,7 @@ public interface IDBInterface */ public IResultSet performQuery(String query, ArrayList params, StringSet cacheKeys, String queryClass, int maxResults, ResultSpecification resultSpec, ILimitChecker returnLimit) - throws ACFException; + throws ManifoldCFException; /** Construct a regular-expression match clause. * This method builds a regular-expression match expression. @@ -331,7 +331,7 @@ public interface IDBInterface * if not otherwise determined). */ public void beginTransaction() - throws ACFException; + throws ManifoldCFException; /** Begin a database transaction. This method call MUST be paired with an endTransaction() call, * or database handles will be lost. If the transaction should be rolled back, then signalRollback() should @@ -343,7 +343,7 @@ public interface IDBInterface *@param transactionType is the kind of transaction desired. */ public void beginTransaction(int transactionType) - throws ACFException; + throws ManifoldCFException; /** Signal that a rollback should occur on the next endTransaction(). */ @@ -353,7 +353,7 @@ public interface IDBInterface * signalRollback() was called within the transaction). */ public void endTransaction() - throws ACFException; + throws ManifoldCFException; } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDFactory.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDFactory.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDFactory.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IDFactory.java Mon Oct 4 14:32:19 2010 @@ -18,7 +18,7 @@ */ package org.apache.manifoldcf.core.interfaces; -import org.apache.manifoldcf.core.system.ACF; +import org.apache.manifoldcf.core.system.ManifoldCF; import org.apache.manifoldcf.core.system.Logging; import java.io.*; import java.util.*; @@ -48,7 +48,7 @@ public class IDFactory } public static String make(IThreadContext tc) - throws ACFException + throws ManifoldCFException { ILockManager lockManager = LockManagerFactory.make(tc); // Enter critical section before we look at the pool @@ -87,7 +87,7 @@ public class IDFactory } catch (UnsupportedEncodingException e) { - throw new ACFException(e.getMessage(),e); + throw new ManifoldCFException(e.getMessage(),e); } finally { Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IKeystoreManager.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IKeystoreManager.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IKeystoreManager.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IKeystoreManager.java Mon Oct 4 14:32:19 2010 @@ -22,7 +22,7 @@ import java.io.*; /** This interface describes a class that manages keys and certificates in a secure manner. * It's built on top of the JDK 1.4+ JSSE integration, and provides all the necessary logic -* to work well within the ACF java environment. +* to work well within the ManifoldCF java environment. */ public interface IKeystoreManager { @@ -32,48 +32,48 @@ public interface IKeystoreManager *@return the list, as a string array. */ public String[] getContents() - throws ACFException; + throws ManifoldCFException; /** For an alias, get some descriptive information from the object in the keystore. *@param alias is the alias name. *@return a description of what's in the alias. */ public String getDescription(String alias) - throws ACFException; + throws ManifoldCFException; /** Import a certificate or key into the list. The data must be added as binary. *@param alias is the name of the certificate. *@param certData is the binary data for the certificate. */ public void importCertificate(String alias, InputStream certData) - throws ACFException; + throws ManifoldCFException; /** Remove a certificate. *@param alias is the name of the certificate to remove. */ public void remove(String alias) - throws ACFException; + throws ManifoldCFException; /** Convert to a base64 string. *@return the base64-encoded string. */ public String getString() - throws ACFException; + throws ManifoldCFException; /** Read a certificate from the keystore. */ public java.security.cert.Certificate getCertificate(String alias) - throws ACFException; + throws ManifoldCFException; /** Add a certificate to the keystore. */ public void addCertificate(String alias, java.security.cert.Certificate certificate) - throws ACFException; + throws ManifoldCFException; /** Build a secure socket factory based on this keystore. */ public javax.net.ssl.SSLSocketFactory getSecureSocketFactory() - throws ACFException; + throws ManifoldCFException; Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILimitChecker.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILimitChecker.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILimitChecker.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILimitChecker.java Mon Oct 4 14:32:19 2010 @@ -61,11 +61,11 @@ public interface ILimitChecker *@return true if it should be included, false otherwise. */ public boolean checkInclude(IResultRow row) - throws ACFException; + throws ManifoldCFException; /** See if we should examine another row. *@return true if we need to keep going, or false if we are done. */ public boolean checkContinue() - throws ACFException; + throws ManifoldCFException; } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILockManager.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILockManager.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILockManager.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ILockManager.java Mon Oct 4 14:32:19 2010 @@ -31,20 +31,20 @@ public interface ILockManager *@param flagName is the name of the flag to set. */ public void setGlobalFlag(String flagName) - throws ACFException; + throws ManifoldCFException; /** Clear a flag. Use this method to clear a condition, or retract a global signal. *@param flagName is the name of the flag to clear. */ public void clearGlobalFlag(String flagName) - throws ACFException; + throws ManifoldCFException; /** Check the condition of a specified flag. *@param flagName is the name of the flag to check. *@return true if the flag is set, false otherwise. */ public boolean checkGlobalFlag(String flagName) - throws ACFException; + throws ManifoldCFException; /** Read data from a shared data resource. Use this method to read any existing data, or get a null back if there is no such resource. * Note well that this is not necessarily an atomic operation, and it must thus be protected by a lock. @@ -52,7 +52,7 @@ public interface ILockManager *@return a byte array containing the data, or null. */ public byte[] readData(String resourceName) - throws ACFException; + throws ManifoldCFException; /** Write data to a shared data resource. Use this method to write a body of data into a shared resource. * Note well that this is not necessarily an atomic operation, and it must thus be protected by a lock. @@ -60,7 +60,7 @@ public interface ILockManager *@param data is the byte array containing the data. Pass null if you want to delete the resource completely. */ public void writeData(String resourceName, byte[] data) - throws ACFException; + throws ManifoldCFException; /** Wait for a time before retrying a lock. Use this method to wait * after a LockException has been thrown. )If this is not done, the application @@ -70,7 +70,7 @@ public interface ILockManager * thread. */ public void timedWait(int time) - throws ACFException; + throws ManifoldCFException; /** Enter a write locked code area (i.e., block out both readers and other writers). * Write locks permit only ONE thread to be in the named section, across JVM's @@ -79,7 +79,7 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void enterWriteLock(String lockKey) - throws ACFException; + throws ManifoldCFException; /** Enter a write locked code area (i.e., block out both readers and other writers), * but do not wait if the lock cannot be obtained. @@ -89,14 +89,14 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void enterWriteLockNoWait(String lockKey) - throws ACFException, LockException; + throws ManifoldCFException, LockException; /** Leave a write locked code area. Use this method to exit a write-locked section. The lockKey * parameter must correspond to the key used for the enter method. * @param lockKey is the name of the lock. */ public void leaveWriteLock(String lockKey) - throws ACFException; + throws ManifoldCFException; /** Enter a non-exclusive write-locked area (blocking out all readers, but letting in other "writers"). * This kind of lock is designed to be used in conjunction with read locks. It is used typically in @@ -107,7 +107,7 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void enterNonExWriteLock(String lockKey) - throws ACFException; + throws ManifoldCFException; /** Enter a non-exclusive write-locked area (blocking out all readers, but letting in other "writers"). * This kind of lock is designed to be used in conjunction with read locks. It is used typically in @@ -118,7 +118,7 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void enterNonExWriteLockNoWait(String lockKey) - throws ACFException, LockException; + throws ManifoldCFException, LockException; /** Leave a non-exclusive write locked code area. Use this method to exit a non-ex-write-locked section. * The lockKey @@ -126,7 +126,7 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void leaveNonExWriteLock(String lockKey) - throws ACFException; + throws ManifoldCFException; /** Enter a read-only locked area (i.e., block ONLY if there's a writer). This kind of lock * permits multiple threads inside the same code area, but only if there is no "writer" in the @@ -135,7 +135,7 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void enterReadLock(String lockKey) - throws ACFException; + throws ManifoldCFException; /** Enter a read-only locked area (i.e., block ONLY if there's a writer). This kind of lock * permits multiple threads inside the same code area, but only if there is no "writer" in the @@ -144,14 +144,14 @@ public interface ILockManager *@param lockKey is the name of the lock. */ public void enterReadLockNoWait(String lockKey) - throws ACFException, LockException; + throws ManifoldCFException, LockException; /** Leave a read-locked code area. Use this method to exit a read-locked section. The lockKey * parameter must correspond to the key used for the enter method. *@param lockKey is the name of the lock. */ public void leaveReadLock(String lockKey) - throws ACFException; + throws ManifoldCFException; /** Enter multiple locks simultaneously. Use this method if a series or set of locks needs to be * thrown for an operation to take place. This operation will avoid deadlock if all the locks are @@ -162,7 +162,7 @@ public interface ILockManager *@param writeLocks is an array of write lock names, or null if there are none desired. */ public void enterLocks(String[] readLocks, String[] nonExWriteLocks, String[] writeLocks) - throws ACFException; + throws ManifoldCFException; /** Enter multiple locks simultaneously. Use this method if a series or set of locks needs to be * thrown for an operation to take place. This operation will avoid deadlock if all the locks are @@ -173,7 +173,7 @@ public interface ILockManager *@param writeLocks is an array of write lock names, or null if there are none desired. */ public void enterLocksNoWait(String[] readLocks, String[] nonExWriteLocks, String[] writeLocks) - throws ACFException, LockException; + throws ManifoldCFException, LockException; /** Leave multiple locks. Use this method to leave a section started with enterLocks() or * enterLocksNoWait(). The parameters must correspond to those passed to the enter method. @@ -182,13 +182,13 @@ public interface ILockManager *@param writeLocks is an array of write lock names, or null if there are none desired. */ public void leaveLocks(String[] readLocks, String[] nonExWriteLocks, String[] writeLocks) - throws ACFException; + throws ManifoldCFException; /** Clear all outstanding locks in the system. * This is a very dangerous method to use (obviously)... */ public void clearLocks() - throws ACFException; + throws ManifoldCFException; /** Enter a named, read critical section (NOT a lock). Critical sections never cross JVM boundaries. * Critical section names do not collide with lock names; they have a distinct namespace. @@ -196,7 +196,7 @@ public interface ILockManager * section at a time. */ public void enterReadCriticalSection(String sectionKey) - throws ACFException; + throws ManifoldCFException; /** Leave a named, read critical section (NOT a lock). Critical sections never cross JVM boundaries. * Critical section names do not collide with lock names; they have a distinct namespace. @@ -204,7 +204,7 @@ public interface ILockManager * section at a time. */ public void leaveReadCriticalSection(String sectionKey) - throws ACFException; + throws ManifoldCFException; /** Enter a named, non-exclusive write critical section (NOT a lock). Critical sections never cross JVM boundaries. * Critical section names do not collide with lock names; they have a distinct namespace. @@ -212,7 +212,7 @@ public interface ILockManager * section at a time. */ public void enterNonExWriteCriticalSection(String sectionKey) - throws ACFException; + throws ManifoldCFException; /** Leave a named, non-exclusive write critical section (NOT a lock). Critical sections never cross JVM boundaries. * Critical section names do not collide with lock names; they have a distinct namespace. @@ -220,7 +220,7 @@ public interface ILockManager * section at a time. */ public void leaveNonExWriteCriticalSection(String sectionKey) - throws ACFException; + throws ManifoldCFException; /** Enter a named, exclusive write critical section (NOT a lock). Critical sections never cross JVM boundaries. @@ -229,7 +229,7 @@ public interface ILockManager * section at a time. */ public void enterWriteCriticalSection(String sectionKey) - throws ACFException; + throws ManifoldCFException; /** Leave a named, exclusive write critical section (NOT a lock). Critical sections never cross JVM boundaries. * Critical section names do not collide with lock names; they have a distinct namespace. @@ -237,7 +237,7 @@ public interface ILockManager * section at a time. */ public void leaveWriteCriticalSection(String sectionKey) - throws ACFException; + throws ManifoldCFException; /** Enter multiple critical sections simultaneously. *@param readSectionKeys is an array of read section descriptors, or null if there are no read sections desired. @@ -245,7 +245,7 @@ public interface ILockManager *@param writeSectionKeys is an array of write section descriptors, or null if there are none desired. */ public void enterCriticalSections(String[] readSectionKeys, String[] nonExSectionKeys, String[] writeSectionKeys) - throws ACFException; + throws ManifoldCFException; /** Leave multiple critical sections simultaneously. *@param readSectionKeys is an array of read section descriptors, or null if there are no read sections desired. @@ -253,6 +253,6 @@ public interface ILockManager *@param writeSectionKeys is an array of write section descriptors, or null if there are none desired. */ public void leaveCriticalSections(String[] readSectionKeys, String[] nonExSectionKeys, String[] writeSectionKeys) - throws ACFException; + throws ManifoldCFException; } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java Mon Oct 4 14:32:19 2010 @@ -43,7 +43,7 @@ public interface IPostParameters *@return the value, or null if it doesn't exist. */ public BinaryInput getBinaryStream(String name) - throws ACFException; + throws ManifoldCFException; /** Get file parameter, as a byte array. *@param name is the parameter name. Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IShutdownHook.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IShutdownHook.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IShutdownHook.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IShutdownHook.java Mon Oct 4 14:32:19 2010 @@ -24,6 +24,6 @@ public interface IShutdownHook /** Do the requisite cleanup. */ public void doCleanup() - throws ACFException; + throws ManifoldCFException; } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/KeystoreManagerFactory.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/KeystoreManagerFactory.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/KeystoreManagerFactory.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/KeystoreManagerFactory.java Mon Oct 4 14:32:19 2010 @@ -31,7 +31,7 @@ public class KeystoreManagerFactory /** Mint a keystore manager. */ public static IKeystoreManager make(String passcode) - throws ACFException + throws ManifoldCFException { return new KeystoreManager(passcode); } @@ -39,7 +39,7 @@ public class KeystoreManagerFactory /** Mint a keystore manager from a base-64 encoded string. */ public static IKeystoreManager make(String passcode, String base64String) - throws ACFException + throws ManifoldCFException { return new KeystoreManager(passcode,base64String); } @@ -49,7 +49,7 @@ public class KeystoreManagerFactory /** Build a secure socket factory that pays no attention to certificates in trust store, and just trusts everything. */ public static javax.net.ssl.SSLSocketFactory getTrustingSecureSocketFactory() - throws ACFException + throws ManifoldCFException { try { @@ -63,11 +63,11 @@ public class KeystoreManagerFactory } catch (java.security.NoSuchAlgorithmException e) { - throw new ACFException("No such algorithm: "+e.getMessage(),e); + throw new ManifoldCFException("No such algorithm: "+e.getMessage(),e); } catch (java.security.KeyManagementException e) { - throw new ACFException("Key management exception: "+e.getMessage(),e); + throw new ManifoldCFException("Key management exception: "+e.getMessage(),e); } } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/LockManagerFactory.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/LockManagerFactory.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/LockManagerFactory.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/LockManagerFactory.java Mon Oct 4 14:32:19 2010 @@ -18,7 +18,7 @@ */ package org.apache.manifoldcf.core.interfaces; -import org.apache.manifoldcf.core.system.ACF; +import org.apache.manifoldcf.core.system.ManifoldCF; public class LockManagerFactory { @@ -35,12 +35,12 @@ public class LockManagerFactory * thread). */ public static ILockManager make(IThreadContext context) - throws ACFException + throws ManifoldCFException { Object x = context.get(lockManager); if (x == null || !(x instanceof ILockManager)) { - String implementationClass = ACF.getProperty(ACF.lockManagerImplementation); + String implementationClass = ManifoldCF.getProperty(ManifoldCF.lockManagerImplementation); if (implementationClass == null) implementationClass = "org.apache.manifoldcf.core.lockmanager.LockManager"; try @@ -48,28 +48,28 @@ public class LockManagerFactory Class c = Class.forName(implementationClass); x = c.newInstance(); if (!(x instanceof ILockManager)) - throw new ACFException("Lock manager class "+implementationClass+" does not implement ILockManager",ACFException.SETUP_ERROR); + throw new ManifoldCFException("Lock manager class "+implementationClass+" does not implement ILockManager",ManifoldCFException.SETUP_ERROR); context.save(lockManager,x); } catch (ClassNotFoundException e) { - throw new ACFException("Lock manager class "+implementationClass+" could not be found: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Lock manager class "+implementationClass+" could not be found: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (ExceptionInInitializerError e) { - throw new ACFException("Lock manager class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Lock manager class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (LinkageError e) { - throw new ACFException("Lock manager class "+implementationClass+" could not be linked: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Lock manager class "+implementationClass+" could not be linked: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (InstantiationException e) { - throw new ACFException("Lock manager class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Lock manager class "+implementationClass+" could not be instantiated: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } catch (IllegalAccessException e) { - throw new ACFException("Lock manager class "+implementationClass+" had no public default initializer: "+e.getMessage(),e,ACFException.SETUP_ERROR); + throw new ManifoldCFException("Lock manager class "+implementationClass+" had no public default initializer: "+e.getMessage(),e,ManifoldCFException.SETUP_ERROR); } } return (ILockManager)x; Added: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ManifoldCFException.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ManifoldCFException.java?rev=1004255&view=auto ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ManifoldCFException.java (added) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/ManifoldCFException.java Mon Oct 4 14:32:19 2010 @@ -0,0 +1,78 @@ +/* $Id: ManifoldCFException.java 988245 2010-08-23 18:39:35Z kwright $ */ + +/** +* 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.core.interfaces; + +public class ManifoldCFException extends Exception +{ + public static final String _rcsid = "@(#)$Id: ManifoldCFException.java 988245 2010-08-23 18:39:35Z kwright $"; + + public final static int GENERAL_ERROR = 0; + public final static int DATABASE_ERROR = 1; + public final static int INTERRUPTED = 2; + public final static int SETUP_ERROR = 3; + public final static int DATABASE_CONNECTION_ERROR = 4; + public final static int REPOSITORY_CONNECTION_ERROR = 5; + public final static int DATABASE_TRANSACTION_ABORT = 6; + // MHL + + protected int errcode; + + public ManifoldCFException(String errString) + { + super(errString); + this.errcode = GENERAL_ERROR; + } + + public ManifoldCFException(String errString, int errcode) + { + super(errString); + this.errcode = errcode; + } + + public ManifoldCFException(String errString, Throwable cause, int errcode) + { + super(errString,cause); + this.errcode = errcode; + } + + public ManifoldCFException(String errString, Throwable cause) + { + super(errString,cause); + this.errcode = GENERAL_ERROR; + } + + public ManifoldCFException(Throwable cause, int errcode) + { + super(cause); + this.errcode = errcode; + } + + public ManifoldCFException(Throwable cause) + { + super(cause); + this.errcode = GENERAL_ERROR; + } + + public int getErrorCode() + { + return errcode; + } + + +} Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Specification.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Specification.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Specification.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/Specification.java Mon Oct 4 14:32:19 2010 @@ -39,7 +39,7 @@ public class Specification extends Confi *@param xml is the input XML. */ public Specification(String xml) - throws ACFException + throws ManifoldCFException { super("specification"); fromXML(xml); Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileCharacterInput.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileCharacterInput.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileCharacterInput.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileCharacterInput.java Mon Oct 4 14:32:19 2010 @@ -19,7 +19,7 @@ package org.apache.manifoldcf.core.interfaces; import java.io.*; -import org.apache.manifoldcf.core.system.ACF; +import org.apache.manifoldcf.core.system.ManifoldCF; /** This class represents a temporary file character input * stream. Call the "done" method to clean up the @@ -42,7 +42,7 @@ public class TempFileCharacterInput exte * and hash value for the data. */ public TempFileCharacterInput(Reader is) - throws ACFException + throws ManifoldCFException { super(); try @@ -52,12 +52,12 @@ public class TempFileCharacterInput exte try { // Register the file for autodeletion, using our infrastructure. - ACF.addFile(outfile); + ManifoldCF.addFile(outfile); // deleteOnExit() causes memory leakage! // outfile.deleteOnExit(); // Set up hash digest and character length counter before we start anything. - java.security.MessageDigest md = ACF.startHash(); + java.security.MessageDigest md = ManifoldCF.startHash(); FileOutputStream outStream = new FileOutputStream(outfile); // Create a Writer corresponding to the file output stream, and encode using utf-8 @@ -74,12 +74,12 @@ public class TempFileCharacterInput exte if (readsize == -1) break; outWriter.write(buffer,0,readsize); - ACF.addToHash(md,new String(buffer,0,readsize)); + ManifoldCF.addToHash(md,new String(buffer,0,readsize)); totalMoved += readsize; } charLength = totalMoved; - hashValue = ACF.getHashValue(md); + hashValue = ManifoldCF.getHashValue(md); } finally { @@ -95,7 +95,7 @@ public class TempFileCharacterInput exte { // Delete the temp file we created on any error condition // outfile.delete(); - ACF.deleteFile(outfile); + ManifoldCF.deleteFile(outfile); if (e instanceof Error) throw (Error)e; if (e instanceof RuntimeException) @@ -107,11 +107,11 @@ public class TempFileCharacterInput exte } catch (InterruptedIOException e) { - throw new ACFException("Interrupted: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (Exception e) { - throw new ACFException("Cannot write temporary file: "+e.getMessage(),e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("Cannot write temporary file: "+e.getMessage(),e,ManifoldCFException.GENERAL_ERROR); } } @@ -123,7 +123,7 @@ public class TempFileCharacterInput exte { super(); file = tempFile; - ACF.addFile(file); + ManifoldCF.addFile(file); // deleteOnExit() causes memory leakage; better to leak files on hard shutdown than memory. // file.deleteOnExit(); } @@ -135,7 +135,7 @@ public class TempFileCharacterInput exte /** Open a Utf8 stream directly from the backing file */ public InputStream getUtf8Stream() - throws ACFException + throws ManifoldCFException { if (file != null) { @@ -145,14 +145,14 @@ public class TempFileCharacterInput exte } catch (FileNotFoundException e) { - throw new ACFException("No such file: "+e.getMessage(),e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("No such file: "+e.getMessage(),e,ManifoldCFException.GENERAL_ERROR); } } return null; } protected void openStream() - throws ACFException + throws ManifoldCFException { try { @@ -162,11 +162,11 @@ public class TempFileCharacterInput exte } catch (FileNotFoundException e) { - throw new ACFException("Can't create stream: "+e.getMessage(),e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("Can't create stream: "+e.getMessage(),e,ManifoldCFException.GENERAL_ERROR); } catch (UnsupportedEncodingException e) { - throw new ACFException("Can't create stream: "+e.getMessage(),e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("Can't create stream: "+e.getMessage(),e,ManifoldCFException.GENERAL_ERROR); } } @@ -187,33 +187,33 @@ public class TempFileCharacterInput exte } public void discard() - throws ACFException + throws ManifoldCFException { super.discard(); // Delete the underlying file if (file != null) { - ACF.deleteFile(file); + ManifoldCF.deleteFile(file); file = null; } } /** Calculate the datum's length in characters */ protected void calculateLength() - throws ACFException + throws ManifoldCFException { scanFile(); } /** Calculate the datum's hash value */ protected void calculateHashValue() - throws ACFException + throws ManifoldCFException { scanFile(); } private void scanFile() - throws ACFException + throws ManifoldCFException { // Scan the file in order to figure out the hash value and the character length try @@ -224,7 +224,7 @@ public class TempFileCharacterInput exte try { // Set up hash digest and character length counter before we start anything. - java.security.MessageDigest md = ACF.startHash(); + java.security.MessageDigest md = ManifoldCF.startHash(); char[] buffer = new char[CHUNK_SIZE]; long totalMoved = 0; while (true) @@ -234,12 +234,12 @@ public class TempFileCharacterInput exte int readsize = reader.read(buffer,0,moveAmount); if (readsize == -1) break; - ACF.addToHash(md,new String(buffer,0,readsize)); + ManifoldCF.addToHash(md,new String(buffer,0,readsize)); totalMoved += readsize; } charLength = totalMoved; - hashValue = ACF.getHashValue(md); + hashValue = ManifoldCF.getHashValue(md); } finally { @@ -248,11 +248,11 @@ public class TempFileCharacterInput exte } catch (InterruptedIOException e) { - throw new ACFException("Interrupted: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (IOException e) { - throw new ACFException("Can't scan file: "+e.getMessage(),e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("Can't scan file: "+e.getMessage(),e,ManifoldCFException.GENERAL_ERROR); } } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileInput.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileInput.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileInput.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/TempFileInput.java Mon Oct 4 14:32:19 2010 @@ -19,7 +19,7 @@ package org.apache.manifoldcf.core.interfaces; import java.io.*; -import org.apache.manifoldcf.core.system.ACF; +import org.apache.manifoldcf.core.system.ManifoldCF; /** This class represents a temporary file data input * stream. Call the "done" method to clean up the @@ -42,7 +42,7 @@ public class TempFileInput extends Binar *@param is is the input stream to use to construct the temporary file. */ public TempFileInput(InputStream is) - throws ACFException + throws ManifoldCFException { this(is,-1L); } @@ -52,7 +52,7 @@ public class TempFileInput extends Binar *@param length is the maximum number of bytes to transfer, or -1 if no limit. */ public TempFileInput(InputStream is, long length) - throws ACFException + throws ManifoldCFException { super(); try @@ -62,7 +62,7 @@ public class TempFileInput extends Binar try { // Register the file for autodeletion, using our infrastructure. - ACF.addFile(outfile); + ManifoldCF.addFile(outfile); // deleteOnExit() causes memory leakage! // outfile.deleteOnExit(); FileOutputStream outStream = new FileOutputStream(outfile); @@ -103,7 +103,7 @@ public class TempFileInput extends Binar { // Delete the temp file we created on any error condition // outfile.delete(); - ACF.deleteFile(outfile); + ManifoldCF.deleteFile(outfile); if (e instanceof Error) throw (Error)e; if (e instanceof RuntimeException) @@ -115,11 +115,11 @@ public class TempFileInput extends Binar } catch (InterruptedIOException e) { - throw new ACFException("Interrupted: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (Exception e) { - throw new ACFException("Cannot write temporary file",e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("Cannot write temporary file",e,ManifoldCFException.GENERAL_ERROR); } } @@ -131,7 +131,7 @@ public class TempFileInput extends Binar { super(); file = tempFile; - ACF.addFile(file); + ManifoldCF.addFile(file); // deleteOnExit() causes memory leakage; better to leak files on hard shutdown than memory. // file.deleteOnExit(); } @@ -155,18 +155,18 @@ public class TempFileInput extends Binar } public void discard() - throws ACFException + throws ManifoldCFException { super.discard(); if (file != null) { - ACF.deleteFile(file); + ManifoldCF.deleteFile(file); file = null; } } protected void openStream() - throws ACFException + throws ManifoldCFException { try { @@ -175,12 +175,12 @@ public class TempFileInput extends Binar } catch (FileNotFoundException e) { - throw new ACFException("Can't create stream: "+e.getMessage(),e,ACFException.GENERAL_ERROR); + throw new ManifoldCFException("Can't create stream: "+e.getMessage(),e,ManifoldCFException.GENERAL_ERROR); } } protected void calculateLength() - throws ACFException + throws ManifoldCFException { this.length = file.length(); } Modified: incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/keystore/KeystoreManager.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/keystore/KeystoreManager.java?rev=1004255&r1=1004254&r2=1004255&view=diff ============================================================================== --- incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/keystore/KeystoreManager.java (original) +++ incubator/lcf/trunk/modules/framework/core/src/main/java/org/apache/manifoldcf/core/keystore/KeystoreManager.java Mon Oct 4 14:32:19 2010 @@ -29,7 +29,7 @@ import java.io.*; /** This interface describes a class that manages keys and certificates in a secure manner. * It's built on top of the JDK 1.4+ JSSE integration, and provides all the necessary logic -* to work well within the ACF java environment. +* to work well within the ManifoldCF java environment. */ public class KeystoreManager implements IKeystoreManager { @@ -43,7 +43,7 @@ public class KeystoreManager implements /** Create the keystore object. */ public KeystoreManager(String passcode) - throws ACFException + throws ManifoldCFException { this.passcode = passcode; try @@ -53,30 +53,30 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore exception: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore exception: "+e.getMessage(),e); } catch (InterruptedIOException e) { - throw new ACFException("Interrupted IO: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted IO: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (IOException e) { - throw new ACFException("IO error creating keystore: "+e.getMessage(),e); + throw new ManifoldCFException("IO error creating keystore: "+e.getMessage(),e); } catch (NoSuchAlgorithmException e) { - throw new ACFException("Unknown algorithm exception creating keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Unknown algorithm exception creating keystore: "+e.getMessage(),e); } catch (CertificateException e) { - throw new ACFException("Unknown certificate exception creating keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Unknown certificate exception creating keystore: "+e.getMessage(),e); } } /** Create the keystore object from an existing base 64 string. */ public KeystoreManager(String passcode, String base64String) - throws ACFException + throws ManifoldCFException { this.passcode = passcode; try @@ -95,23 +95,23 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore exception: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore exception: "+e.getMessage(),e); } catch (InterruptedIOException e) { - throw new ACFException("Interrupted IO: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted IO: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (IOException e) { - throw new ACFException("IO error creating keystore: "+e.getMessage(),e); + throw new ManifoldCFException("IO error creating keystore: "+e.getMessage(),e); } catch (NoSuchAlgorithmException e) { - throw new ACFException("Unknown algorithm exception creating keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Unknown algorithm exception creating keystore: "+e.getMessage(),e); } catch (CertificateException e) { - throw new ACFException("Unknown certificate exception creating keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Unknown certificate exception creating keystore: "+e.getMessage(),e); } } @@ -119,7 +119,7 @@ public class KeystoreManager implements *@return the list, as a string array. */ public String[] getContents() - throws ACFException + throws ManifoldCFException { try { @@ -135,7 +135,7 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore not initialized: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore not initialized: "+e.getMessage(),e); } } @@ -146,7 +146,7 @@ public class KeystoreManager implements *@return a description of what's in the alias. */ public String getDescription(String alias) - throws ACFException + throws ManifoldCFException { try { @@ -157,7 +157,7 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore not initialized: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore not initialized: "+e.getMessage(),e); } } @@ -166,7 +166,7 @@ public class KeystoreManager implements *@param certData is the binary data for the certificate. */ public void importCertificate(String alias, InputStream certData) - throws ACFException + throws ManifoldCFException { try { @@ -183,18 +183,18 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore exception: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore exception: "+e.getMessage(),e); } catch (CertificateException e) { - throw new ACFException("Certificate error: "+e.getMessage(),e); + throw new ManifoldCFException("Certificate error: "+e.getMessage(),e); } } /** Read a certificate from the keystore. */ public java.security.cert.Certificate getCertificate(String alias) - throws ACFException + throws ManifoldCFException { try { @@ -202,14 +202,14 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore exception: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore exception: "+e.getMessage(),e); } } /** Add a certificate to the keystore. */ public void addCertificate(String alias, java.security.cert.Certificate certificate) - throws ACFException + throws ManifoldCFException { try { @@ -224,7 +224,7 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Keystore exception: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore exception: "+e.getMessage(),e); } } @@ -232,7 +232,7 @@ public class KeystoreManager implements *@param alias is the name of the certificate to remove. */ public void remove(String alias) - throws ACFException + throws ManifoldCFException { try { @@ -240,7 +240,7 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Error deleting keystore entry",e); + throw new ManifoldCFException("Error deleting keystore entry",e); } } @@ -248,7 +248,7 @@ public class KeystoreManager implements *@return the base64-encoded string. */ public String getString() - throws ACFException + throws ManifoldCFException { try { @@ -260,23 +260,23 @@ public class KeystoreManager implements } catch (KeyStoreException e) { - throw new ACFException("Error accessing keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Error accessing keystore: "+e.getMessage(),e); } catch (InterruptedIOException e) { - throw new ACFException("Interrupted IO: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted IO: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (IOException e) { - throw new ACFException("IO error saving keystore: "+e.getMessage(),e); + throw new ManifoldCFException("IO error saving keystore: "+e.getMessage(),e); } catch (NoSuchAlgorithmException e) { - throw new ACFException("Unknown algorithm exception saving keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Unknown algorithm exception saving keystore: "+e.getMessage(),e); } catch (CertificateException e) { - throw new ACFException("Certificate exception saving keystore: "+e.getMessage(),e); + throw new ManifoldCFException("Certificate exception saving keystore: "+e.getMessage(),e); } finally { @@ -285,18 +285,18 @@ public class KeystoreManager implements } catch (InterruptedIOException e) { - throw new ACFException("Interrupted IO: "+e.getMessage(),e,ACFException.INTERRUPTED); + throw new ManifoldCFException("Interrupted IO: "+e.getMessage(),e,ManifoldCFException.INTERRUPTED); } catch (IOException e) { - throw new ACFException("IO exception storing keystore: "+e.getMessage(),e); + throw new ManifoldCFException("IO exception storing keystore: "+e.getMessage(),e); } } /** Build a secure socket factory based on this keystore. */ public javax.net.ssl.SSLSocketFactory getSecureSocketFactory() - throws ACFException + throws ManifoldCFException { try { @@ -358,15 +358,15 @@ public class KeystoreManager implements } catch (java.security.NoSuchAlgorithmException e) { - throw new ACFException("No such algorithm: "+e.getMessage(),e); + throw new ManifoldCFException("No such algorithm: "+e.getMessage(),e); } catch (java.security.KeyStoreException e) { - throw new ACFException("Keystore exception: "+e.getMessage(),e); + throw new ManifoldCFException("Keystore exception: "+e.getMessage(),e); } catch (java.security.KeyManagementException e) { - throw new ACFException("Key management exception: "+e.getMessage(),e); + throw new ManifoldCFException("Key management exception: "+e.getMessage(),e); } }