You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/09/28 15:18:42 UTC
svn commit: r1527183 [2/2] - in /manifoldcf/trunk: ./
connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/
connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/
connectors/jdbc/connecto...
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java Sat Sep 28 13:18:40 2013
@@ -51,8 +51,8 @@ public class DefineAuthorityConnection
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IAuthorityConnectionManager mgr = AuthorityConnectionManagerFactory.make(tc);
IAuthorityConnection conn = mgr.create();
conn.setName(connectionName);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineMappingConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineMappingConnection.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineMappingConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineMappingConnection.java Sat Sep 28 13:18:40 2013
@@ -51,8 +51,8 @@ public class DefineMappingConnection
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IMappingConnectionManager mgr = MappingConnectionManagerFactory.make(tc);
IMappingConnection conn = mgr.create();
conn.setName(connectionName);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java Sat Sep 28 13:18:40 2013
@@ -46,8 +46,8 @@ public class DeleteAuthorityConnection
String connectionName = args[0];
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IAuthorityConnectionManager mgr = AuthorityConnectionManagerFactory.make(tc);
mgr.delete(connectionName);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteMappingConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteMappingConnection.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteMappingConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteMappingConnection.java Sat Sep 28 13:18:40 2013
@@ -46,8 +46,8 @@ public class DeleteMappingConnection
String connectionName = args[0];
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IMappingConnectionManager mgr = MappingConnectionManagerFactory.make(tc);
mgr.delete(connectionName);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java Sat Sep 28 13:18:40 2013
@@ -48,26 +48,26 @@ public class ManifoldCF extends org.apac
/** Initialize environment.
*/
- public static void initializeEnvironment()
+ public static void initializeEnvironment(IThreadContext tc)
throws ManifoldCFException
{
synchronized (initializeFlagLock)
{
- org.apache.manifoldcf.core.system.ManifoldCF.initializeEnvironment();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
+ org.apache.manifoldcf.core.system.ManifoldCF.initializeEnvironment(tc);
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
}
}
- public static void cleanUpEnvironment()
+ public static void cleanUpEnvironment(IThreadContext tc)
{
synchronized (initializeFlagLock)
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.core.system.ManifoldCF.cleanUpEnvironment();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.core.system.ManifoldCF.cleanUpEnvironment(tc);
}
}
- public static void localInitialize()
+ public static void localInitialize(IThreadContext tc)
throws ManifoldCFException
{
synchronized (initializeFlagLock)
@@ -76,12 +76,12 @@ public class ManifoldCF extends org.apac
return;
Logging.initializeLoggers();
- Logging.setLogLevels();
+ Logging.setLogLevels(tc);
authoritiesInitialized = true;
}
}
- public static void localCleanup()
+ public static void localCleanup(IThreadContext tc)
{
}
@@ -177,17 +177,11 @@ public class ManifoldCF extends org.apac
throws ManifoldCFException
{
// Read any parameters
- String maxThreads = getProperty(authCheckThreadCountProperty);
- if (maxThreads == null)
- maxThreads = "10";
- numAuthCheckThreads = new Integer(maxThreads).intValue();
+ numAuthCheckThreads = LockManagerFactory.getIntProperty(threadContext, authCheckThreadCountProperty, 10);
if (numAuthCheckThreads < 1 || numAuthCheckThreads > 100)
throw new ManifoldCFException("Illegal value for the number of auth check threads");
- String maxMappingThreads = getProperty(mappingThreadCountProperty);
- if (maxMappingThreads == null)
- maxMappingThreads = "10";
- numMappingThreads = new Integer(maxMappingThreads).intValue();
+ numMappingThreads = LockManagerFactory.getIntProperty(threadContext, mappingThreadCountProperty, 10);
if (numMappingThreads < 1 || numMappingThreads > 100)
throw new ManifoldCFException("Illegal value for the number of mapping threads");
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AbortJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AbortJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AbortJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AbortJob.java Sat Sep 28 13:18:40 2013
@@ -28,38 +28,38 @@ import java.util.*;
*/
public class AbortJob
{
- public static final String _rcsid = "@(#)$Id: AbortJob.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: AbortJob.java 988245 2010-08-23 18:39:35Z kwright $";
- private AbortJob()
- {
- }
-
- // Add: throttle, priority, recrawl interval
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: AbortJob <jobid>");
- System.exit(1);
- }
-
- String jobID = args[0];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- jobManager.manualAbort(new Long(jobID));
- System.err.println("Job aborting");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ private AbortJob()
+ {
+ }
+
+ // Add: throttle, priority, recrawl interval
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: AbortJob <jobid>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ jobManager.manualAbort(new Long(jobID));
+ System.err.println("Job aborting");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AddScheduledTime.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AddScheduledTime.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AddScheduledTime.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/AddScheduledTime.java Sat Sep 28 13:18:40 2013
@@ -69,8 +69,8 @@ public class AddScheduledTime
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
IJobDescription desc = jobManager.load(new Long(jobID));
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/BaseCrawlerInitializationCommand.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/BaseCrawlerInitializationCommand.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/BaseCrawlerInitializationCommand.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/BaseCrawlerInitializationCommand.java Sat Sep 28 13:18:40 2013
@@ -32,8 +32,8 @@ public abstract class BaseCrawlerInitial
{
public void execute() throws ManifoldCFException
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
doExecute(tc);
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ChangeJobDocSpec.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ChangeJobDocSpec.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ChangeJobDocSpec.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ChangeJobDocSpec.java Sat Sep 28 13:18:40 2013
@@ -28,46 +28,46 @@ import java.util.*;
*/
public class ChangeJobDocSpec
{
- public static final String _rcsid = "@(#)$Id: ChangeJobDocSpec.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: ChangeJobDocSpec.java 988245 2010-08-23 18:39:35Z kwright $";
- private ChangeJobDocSpec()
- {
- }
-
- public static void main(String[] args)
- {
- if (args.length != 2)
- {
- System.err.println("Usage: ChangeJobDocSpec <jobid> <filespec_xml>");
- System.exit(1);
- }
-
- String jobID = args[0];
- String filespecXML = args[1];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- IJobDescription desc = jobManager.load(new Long(jobID));
- if (desc == null)
- {
- System.err.println("No such job: "+jobID);
- System.exit(3);
- }
- desc.getSpecification().fromXML(filespecXML);
-
- // Now, save
- jobManager.save(desc);
- System.err.println("Job doc spec has been changed");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ private ChangeJobDocSpec()
+ {
+ }
+
+ public static void main(String[] args)
+ {
+ if (args.length != 2)
+ {
+ System.err.println("Usage: ChangeJobDocSpec <jobid> <filespec_xml>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+ String filespecXML = args[1];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ IJobDescription desc = jobManager.load(new Long(jobID));
+ if (desc == null)
+ {
+ System.err.println("No such job: "+jobID);
+ System.exit(3);
+ }
+ desc.getSpecification().fromXML(filespecXML);
+
+ // Now, save
+ jobManager.save(desc);
+ System.err.println("Job doc spec has been changed");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/CheckConfigured.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/CheckConfigured.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/CheckConfigured.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/CheckConfigured.java Sat Sep 28 13:18:40 2013
@@ -28,37 +28,37 @@ import java.util.*;
*/
public class CheckConfigured
{
- public static final String _rcsid = "@(#)$Id: CheckConfigured.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: CheckConfigured.java 988245 2010-08-23 18:39:35Z kwright $";
- private CheckConfigured()
- {
- }
+ private CheckConfigured()
+ {
+ }
- // Add: throttle, priority, recrawl interval
+ // Add: throttle, priority, recrawl interval
- public static void main(String[] args)
- {
- if (args.length != 0)
- {
- System.err.println("Usage: CheckConfigured");
- System.exit(1);
- }
+ public static void main(String[] args)
+ {
+ if (args.length != 0)
+ {
+ System.err.println("Usage: CheckConfigured");
+ System.exit(1);
+ }
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
- if (connManager.getAllConnections().length > 0)
- UTF8Stdout.println("CONFIGURED");
- else
- UTF8Stdout.println("OK");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
+ if (connManager.getAllConnections().length > 0)
+ UTF8Stdout.println("CONFIGURED");
+ else
+ UTF8Stdout.println("OK");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineJob.java Sat Sep 28 13:18:40 2013
@@ -28,117 +28,115 @@ import java.util.*;
*/
public class DefineJob
{
- public static final String _rcsid = "@(#)$Id: DefineJob.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: DefineJob.java 988245 2010-08-23 18:39:35Z kwright $";
- private DefineJob()
+ private DefineJob()
+ {
+ }
+
+ public static void main(String[] args)
+ {
+ if (args.length != 13)
+ {
+ System.err.println("Usage: DefineJob <description> <connection_name> <output_name> <type> <start_method> <hopcount_method> <recrawl_interval> <expiration_interval> <reseed_interval> <job_priority> <hop_filters> <filespec_xml> <outputspec_xml>");
+ System.err.println("<type> is one of: continuous or specified");
+ System.err.println("<start_method> is one of: windowbegin, windowinside, disable");
+ System.err.println("<hopcount_method> is one of: accurate, nodelete, neverdelete");
+ System.err.println("<recrawl_interval> is the default document recrawl interval in minutes");
+ System.err.println("<expiration_interval> is the default document expiration interval in minutes");
+ System.err.println("<reseed_interval> is the default document reseed interval in minutes");
+ System.err.println("<job_priority> is the job priority (and integer between 0 and 10)");
+ System.err.println("<hop_filters> is a comma-separated list of tuples, of the form 'linktype=maxhops'");
+ System.err.println("<filespec_xml> is the document specification XML, its form dependent on the connection type");
+ System.err.println("<outputspec_xml> is the output specification XML, its form dependent on the output connection type");
+ System.exit(-1);
+ }
+
+ String description = args[0];
+ String connectionName = args[1];
+ String outputConnectionName = args[2];
+ String typeString = args[3];
+ String startString = args[4];
+ String hopcountString = args[5];
+ String recrawlInterval = args[6];
+ String expirationInterval = args[7];
+ String reseedInterval = args[8];
+ String jobPriority = args[9];
+ String hopFilters = args[10];
+ String filespecXML = args[11];
+ String outputspecXML = args[12];
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ IJobDescription desc = jobManager.createJob();
+
+ desc.setDescription(description);
+ desc.setConnectionName(connectionName);
+ desc.setOutputConnectionName(outputConnectionName);
+
+ if (typeString.equals("continuous"))
+ desc.setType(IJobDescription.TYPE_CONTINUOUS);
+ else if (typeString.equals("specified"))
+ desc.setType(IJobDescription.TYPE_SPECIFIED);
+ else
+ throw new ManifoldCFException("Unknown type: '"+typeString+"'");
+ if (startString.equals("windowbegin"))
+ desc.setStartMethod(IJobDescription.START_WINDOWBEGIN);
+ else if (startString.equals("windowinside"))
+ desc.setStartMethod(IJobDescription.START_WINDOWINSIDE);
+ else if (startString.equals("disable"))
+ desc.setStartMethod(IJobDescription.START_DISABLE);
+ else
+ throw new ManifoldCFException("Unknown start method: '"+startString+"'");
+
+ if (hopcountString.equals("accurate"))
+ desc.setHopcountMode(IJobDescription.HOPCOUNT_ACCURATE);
+ else if (hopcountString.equals("nodelete"))
+ desc.setHopcountMode(IJobDescription.HOPCOUNT_NODELETE);
+ else if (hopcountString.equals("neverdelete"))
+ desc.setHopcountMode(IJobDescription.HOPCOUNT_NEVERDELETE);
+ else
+ throw new ManifoldCFException("Unknown hopcount mode: '"+hopcountString+"'");
+
+ if (recrawlInterval.length() > 0)
+ desc.setInterval(new Long(recrawlInterval));
+ if (expirationInterval.length() > 0)
+ desc.setExpiration(new Long(expirationInterval));
+ if (reseedInterval.length() > 0)
+ desc.setReseedInterval(new Long(reseedInterval));
+ desc.setPriority(Integer.parseInt(jobPriority));
+
+ String[] hopFilterSet = hopFilters.split(",");
+ int i = 0;
+ while (i < hopFilterSet.length)
+ {
+ String hopFilter = hopFilterSet[i++];
+ if (hopFilter != null && hopFilter.length() > 0)
{
+ String[] stuff = hopFilter.trim().split("=");
+ if (stuff != null && stuff.length == 2)
+ desc.addHopCountFilter(stuff[0],((stuff[1].length()>0)?new Long(stuff[1]):null));
}
-
- public static void main(String[] args)
- {
- if (args.length != 13)
- {
- System.err.println("Usage: DefineJob <description> <connection_name> <output_name> <type> <start_method> <hopcount_method> <recrawl_interval> <expiration_interval> <reseed_interval> <job_priority> <hop_filters> <filespec_xml> <outputspec_xml>");
- System.err.println("<type> is one of: continuous or specified");
- System.err.println("<start_method> is one of: windowbegin, windowinside, disable");
- System.err.println("<hopcount_method> is one of: accurate, nodelete, neverdelete");
- System.err.println("<recrawl_interval> is the default document recrawl interval in minutes");
- System.err.println("<expiration_interval> is the default document expiration interval in minutes");
- System.err.println("<reseed_interval> is the default document reseed interval in minutes");
- System.err.println("<job_priority> is the job priority (and integer between 0 and 10)");
- System.err.println("<hop_filters> is a comma-separated list of tuples, of the form 'linktype=maxhops'");
- System.err.println("<filespec_xml> is the document specification XML, its form dependent on the connection type");
- System.err.println("<outputspec_xml> is the output specification XML, its form dependent on the output connection type");
- System.exit(-1);
- }
-
- String description = args[0];
- String connectionName = args[1];
- String outputConnectionName = args[2];
- String typeString = args[3];
- String startString = args[4];
- String hopcountString = args[5];
- String recrawlInterval = args[6];
- String expirationInterval = args[7];
- String reseedInterval = args[8];
- String jobPriority = args[9];
- String hopFilters = args[10];
- String filespecXML = args[11];
- String outputspecXML = args[12];
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- IJobDescription desc = jobManager.createJob();
-
- desc.setDescription(description);
- desc.setConnectionName(connectionName);
- desc.setOutputConnectionName(outputConnectionName);
-
- if (typeString.equals("continuous"))
- desc.setType(IJobDescription.TYPE_CONTINUOUS);
- else if (typeString.equals("specified"))
- desc.setType(IJobDescription.TYPE_SPECIFIED);
- else
- throw new ManifoldCFException("Unknown type: '"+typeString+"'");
- if (startString.equals("windowbegin"))
- desc.setStartMethod(IJobDescription.START_WINDOWBEGIN);
- else if (startString.equals("windowinside"))
- desc.setStartMethod(IJobDescription.START_WINDOWINSIDE);
- else if (startString.equals("disable"))
- desc.setStartMethod(IJobDescription.START_DISABLE);
- else
- throw new ManifoldCFException("Unknown start method: '"+startString+"'");
-
- if (hopcountString.equals("accurate"))
- desc.setHopcountMode(IJobDescription.HOPCOUNT_ACCURATE);
- else if (hopcountString.equals("nodelete"))
- desc.setHopcountMode(IJobDescription.HOPCOUNT_NODELETE);
- else if (hopcountString.equals("neverdelete"))
- desc.setHopcountMode(IJobDescription.HOPCOUNT_NEVERDELETE);
- else
- throw new ManifoldCFException("Unknown hopcount mode: '"+hopcountString+"'");
-
- if (recrawlInterval.length() > 0)
- desc.setInterval(new Long(recrawlInterval));
- if (expirationInterval.length() > 0)
- desc.setExpiration(new Long(expirationInterval));
- if (reseedInterval.length() > 0)
- desc.setReseedInterval(new Long(reseedInterval));
- desc.setPriority(Integer.parseInt(jobPriority));
-
- String[] hopFilterSet = hopFilters.split(",");
- int i = 0;
- while (i < hopFilterSet.length)
- {
- String hopFilter = hopFilterSet[i++];
- if (hopFilter != null && hopFilter.length() > 0)
- {
- String[] stuff = hopFilter.trim().split("=");
- if (stuff != null && stuff.length == 2)
- desc.addHopCountFilter(stuff[0],((stuff[1].length()>0)?new Long(stuff[1]):null));
- }
- }
-
- desc.getSpecification().fromXML(filespecXML);
- if (outputspecXML.length() > 0)
- desc.getOutputSpecification().fromXML(outputspecXML);
-
- // Now, save
- jobManager.save(desc);
-
- System.out.print(desc.getID().toString());
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(-2);
- }
- }
-
+ }
+
+ desc.getSpecification().fromXML(filespecXML);
+ if (outputspecXML.length() > 0)
+ desc.getOutputSpecification().fromXML(outputspecXML);
+
+ // Now, save
+ jobManager.save(desc);
+
+ System.out.print(desc.getID().toString());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(-2);
+ }
+ }
-
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineRepositoryConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineRepositoryConnection.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineRepositoryConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DefineRepositoryConnection.java Sat Sep 28 13:18:40 2013
@@ -28,69 +28,66 @@ import java.util.*;
*/
public class DefineRepositoryConnection
{
- public static final String _rcsid = "@(#)$Id: DefineRepositoryConnection.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: DefineRepositoryConnection.java 988245 2010-08-23 18:39:35Z kwright $";
- private DefineRepositoryConnection()
- {
- }
-
-
- public static void main(String[] args)
- {
- if (args.length < 5)
- {
- System.err.println("Usage: DefineRepositoryConnection <connection_name> <description> <connector_class> <authority_name> <pool_max> <param1>=<value1> ...");
- System.exit(1);
- }
-
- String connectionName = args[0];
- String description = args[1];
- String connectorClass = args[2];
- String authorityName = args[3];
- String poolMax = args[4];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IRepositoryConnectionManager mgr = RepositoryConnectionManagerFactory.make(tc);
- IRepositoryConnection conn = mgr.create();
- conn.setName(connectionName);
- conn.setDescription(description);
- conn.setClassName(connectorClass);
- if (authorityName.length() > 0)
- conn.setACLAuthority(authorityName);
- conn.setMaxConnections(new Integer(poolMax).intValue());
- ConfigParams x = conn.getConfigParams();
- int i = 5;
- while (i < args.length)
- {
- String arg = args[i++];
- // Parse
- int pos = arg.indexOf("=");
- if (pos == -1)
- throw new ManifoldCFException("Argument missing =");
- String name = arg.substring(0,pos);
- String value = arg.substring(pos+1);
- if (name.endsWith("assword"))
- x.setObfuscatedParameter(name,value);
- else
- x.setParameter(name,value);
- }
-
- // Now, save
- mgr.save(conn);
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
+ private DefineRepositoryConnection()
+ {
+ }
+
+
+ public static void main(String[] args)
+ {
+ if (args.length < 5)
+ {
+ System.err.println("Usage: DefineRepositoryConnection <connection_name> <description> <connector_class> <authority_name> <pool_max> <param1>=<value1> ...");
+ System.exit(1);
+ }
+
+ String connectionName = args[0];
+ String description = args[1];
+ String connectorClass = args[2];
+ String authorityName = args[3];
+ String poolMax = args[4];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IRepositoryConnectionManager mgr = RepositoryConnectionManagerFactory.make(tc);
+ IRepositoryConnection conn = mgr.create();
+ conn.setName(connectionName);
+ conn.setDescription(description);
+ conn.setClassName(connectorClass);
+ if (authorityName.length() > 0)
+ conn.setACLAuthority(authorityName);
+ conn.setMaxConnections(new Integer(poolMax).intValue());
+ ConfigParams x = conn.getConfigParams();
+ int i = 5;
+ while (i < args.length)
+ {
+ String arg = args[i++];
+ // Parse
+ int pos = arg.indexOf("=");
+ if (pos == -1)
+ throw new ManifoldCFException("Argument missing =");
+ String name = arg.substring(0,pos);
+ String value = arg.substring(pos+1);
+ if (name.endsWith("assword"))
+ x.setObfuscatedParameter(name,value);
+ else
+ x.setParameter(name,value);
+ }
+
+ // Now, save
+ mgr.save(conn);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
-
-
-
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteJob.java Sat Sep 28 13:18:40 2013
@@ -28,36 +28,36 @@ import java.util.*;
*/
public class DeleteJob
{
- public static final String _rcsid = "@(#)$Id: DeleteJob.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: DeleteJob.java 988245 2010-08-23 18:39:35Z kwright $";
- private DeleteJob()
- {
- }
+ private DeleteJob()
+ {
+ }
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: DeleteJob <jobid>");
- System.exit(1);
- }
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: DeleteJob <jobid>");
+ System.exit(1);
+ }
- String jobID = args[0];
+ String jobID = args[0];
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- jobManager.deleteJob(new Long(jobID));
- System.out.println("Job deleting");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ jobManager.deleteJob(new Long(jobID));
+ System.out.println("Job deleting");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteRepositoryConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteRepositoryConnection.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteRepositoryConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/DeleteRepositoryConnection.java Sat Sep 28 13:18:40 2013
@@ -28,38 +28,38 @@ import java.util.*;
*/
public class DeleteRepositoryConnection
{
- public static final String _rcsid = "@(#)$Id: DeleteRepositoryConnection.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: DeleteRepositoryConnection.java 988245 2010-08-23 18:39:35Z kwright $";
- private DeleteRepositoryConnection()
- {
- }
-
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: DeleteRepositoryConnection <connection_name>");
- System.exit(1);
- }
-
- String connectionName = args[0];
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IRepositoryConnectionManager mgr = RepositoryConnectionManagerFactory.make(tc);
- mgr.delete(connectionName);
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
+ private DeleteRepositoryConnection()
+ {
+ }
+
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: DeleteRepositoryConnection <connection_name>");
+ System.exit(1);
+ }
+
+ String connectionName = args[0];
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IRepositoryConnectionManager mgr = RepositoryConnectionManagerFactory.make(tc);
+ mgr.delete(connectionName);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
-
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/FindJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/FindJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/FindJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/FindJob.java Sat Sep 28 13:18:40 2013
@@ -48,8 +48,8 @@ public class FindJob
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
IJobDescription[] jobs = jobManager.getAllJobs();
int i = 0;
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/GetJobSchedule.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/GetJobSchedule.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/GetJobSchedule.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/GetJobSchedule.java Sat Sep 28 13:18:40 2013
@@ -49,8 +49,8 @@ public class GetJobSchedule
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
IJobDescription job = jobManager.load(new Long(jobID));
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java Sat Sep 28 13:18:40 2013
@@ -53,8 +53,8 @@ public class InitializeAndRegister
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
InitializeAndRegister register = new InitializeAndRegister();
register.doExecute(tc);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobStatuses.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobStatuses.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobStatuses.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobStatuses.java Sat Sep 28 13:18:40 2013
@@ -47,8 +47,8 @@ public class ListJobStatuses
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
JobStatus[] jobStatuses = jobManager.getAllStatus();
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobs.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobs.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobs.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/ListJobs.java Sat Sep 28 13:18:40 2013
@@ -47,8 +47,8 @@ public class ListJobs
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
IJobDescription[] jobs = jobManager.getAllJobs();
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/PauseJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/PauseJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/PauseJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/PauseJob.java Sat Sep 28 13:18:40 2013
@@ -28,38 +28,38 @@ import java.util.*;
*/
public class PauseJob
{
- public static final String _rcsid = "@(#)$Id: PauseJob.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: PauseJob.java 988245 2010-08-23 18:39:35Z kwright $";
- private PauseJob()
- {
- }
-
- // Add: throttle, priority, recrawl interval
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: PauseJob <jobid>");
- System.exit(1);
- }
-
- String jobID = args[0];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- jobManager.pauseJob(new Long(jobID));
- System.out.println("Job paused");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ private PauseJob()
+ {
+ }
+
+ // Add: throttle, priority, recrawl interval
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: PauseJob <jobid>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ jobManager.pauseJob(new Long(jobID));
+ System.out.println("Job paused");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RestartJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RestartJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RestartJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RestartJob.java Sat Sep 28 13:18:40 2013
@@ -28,38 +28,38 @@ import java.util.*;
*/
public class RestartJob
{
- public static final String _rcsid = "@(#)$Id: RestartJob.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: RestartJob.java 988245 2010-08-23 18:39:35Z kwright $";
- private RestartJob()
- {
- }
-
- // Add: throttle, priority, recrawl interval
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: RestartJob <jobid>");
- System.exit(1);
- }
-
- String jobID = args[0];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- jobManager.restartJob(new Long(jobID));
- System.err.println("Job resuming");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ private RestartJob()
+ {
+ }
+
+ // Add: throttle, priority, recrawl interval
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: RestartJob <jobid>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ jobManager.restartJob(new Long(jobID));
+ System.err.println("Job resuming");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunDocumentStatus.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunDocumentStatus.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunDocumentStatus.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunDocumentStatus.java Sat Sep 28 13:18:40 2013
@@ -75,8 +75,8 @@ public class RunDocumentStatus
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
StatusFilterCriteria filter = parseFilterCriteria(jobList,currentTime,matchRegexp,matchStateList,matchStatusList);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxActivityHistory.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxActivityHistory.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxActivityHistory.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxActivityHistory.java Sat Sep 28 13:18:40 2013
@@ -72,8 +72,8 @@ public class RunMaxActivityHistory
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
FilterCriteria filter = parseFilterCriteria(activityList,startTime,endTime,entityRegexp,resultCodeRegexp);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxBandwidthHistory.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxBandwidthHistory.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxBandwidthHistory.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunMaxBandwidthHistory.java Sat Sep 28 13:18:40 2013
@@ -72,8 +72,8 @@ public class RunMaxBandwidthHistory
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
FilterCriteria filter = parseFilterCriteria(activityList,startTime,endTime,entityRegexp,resultCodeRegexp);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunQueueStatus.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunQueueStatus.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunQueueStatus.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunQueueStatus.java Sat Sep 28 13:18:40 2013
@@ -77,8 +77,8 @@ public class RunQueueStatus
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
StatusFilterCriteria filter = parseFilterCriteria(jobList,currentTime,matchRegexp,matchStateList,matchStatusList);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunResultHistory.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunResultHistory.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunResultHistory.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunResultHistory.java Sat Sep 28 13:18:40 2013
@@ -73,8 +73,8 @@ public class RunResultHistory
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
FilterCriteria filter = parseFilterCriteria(activityList,startTime,endTime,entityRegexp,resultCodeRegexp);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunSimpleHistory.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunSimpleHistory.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunSimpleHistory.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RunSimpleHistory.java Sat Sep 28 13:18:40 2013
@@ -70,8 +70,8 @@ public class RunSimpleHistory
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
FilterCriteria filter = parseFilterCriteria(activityList,startTime,endTime,entityRegexp,resultCodeRegexp);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/StartJob.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/StartJob.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/StartJob.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/StartJob.java Sat Sep 28 13:18:40 2013
@@ -49,8 +49,8 @@ public class StartJob
try
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IJobManager jobManager = JobManagerFactory.make(tc);
jobManager.manualStart(new Long(jobID));
System.out.println("Job starting");
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/TransactionalCrawlerInitializationCommand.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/TransactionalCrawlerInitializationCommand.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/TransactionalCrawlerInitializationCommand.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/TransactionalCrawlerInitializationCommand.java Sat Sep 28 13:18:40 2013
@@ -30,8 +30,8 @@ public abstract class TransactionalCrawl
{
public void execute() throws ManifoldCFException
{
- ManifoldCF.initializeEnvironment();
IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
IDBInterface database = DBInterfaceFactory.make(tc,
org.apache.manifoldcf.agents.system.ManifoldCF.getMasterDatabaseName(),
org.apache.manifoldcf.agents.system.ManifoldCF.getMasterDatabaseUsername(),
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobDeleted.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobDeleted.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobDeleted.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobDeleted.java Sat Sep 28 13:18:40 2013
@@ -28,44 +28,44 @@ import java.util.*;
*/
public class WaitForJobDeleted
{
- public static final String _rcsid = "@(#)$Id: WaitForJobDeleted.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: WaitForJobDeleted.java 988245 2010-08-23 18:39:35Z kwright $";
+
+ private WaitForJobDeleted()
+ {
+ }
+
+ // Add: throttle, priority, recrawl interval
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: WaitForJobDeleted <jobid>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ while (true)
+ {
+ JobStatus status = jobManager.getStatus(new Long(jobID));
+ if (status == null)
+ break;
+ ManifoldCF.sleep(10000);
+ }
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
- private WaitForJobDeleted()
- {
- }
-
- // Add: throttle, priority, recrawl interval
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: WaitForJobDeleted <jobid>");
- System.exit(1);
- }
-
- String jobID = args[0];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- while (true)
- {
- JobStatus status = jobManager.getStatus(new Long(jobID));
- if (status == null)
- break;
- ManifoldCF.sleep(10000);
- }
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobInactive.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobInactive.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobInactive.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitForJobInactive.java Sat Sep 28 13:18:40 2013
@@ -28,61 +28,61 @@ import java.util.*;
*/
public class WaitForJobInactive
{
- public static final String _rcsid = "@(#)$Id: WaitForJobInactive.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: WaitForJobInactive.java 988245 2010-08-23 18:39:35Z kwright $";
- private WaitForJobInactive()
+ private WaitForJobInactive()
+ {
+ }
+
+ // Add: throttle, priority, recrawl interval
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: WaitForJobInactive <jobid>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+
+ while (true)
+ {
+ JobStatus status = jobManager.getStatus(new Long(jobID));
+ if (status == null)
+ throw new ManifoldCFException("No such job: '"+jobID+"'");
+ int statusValue = status.getStatus();
+ switch (statusValue)
{
+ case JobStatus.JOBSTATUS_NOTYETRUN:
+ System.out.println("Never run");
+ break;
+ case JobStatus.JOBSTATUS_COMPLETED:
+ System.out.println("OK");
+ break;
+ case JobStatus.JOBSTATUS_ERROR:
+ System.out.println("Error: "+status.getErrorText());
+ break;
+ default:
+ ManifoldCF.sleep(10000);
+ continue;
}
+ break;
+ }
- // Add: throttle, priority, recrawl interval
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: WaitForJobInactive <jobid>");
- System.exit(1);
- }
-
- String jobID = args[0];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
-
- while (true)
- {
- JobStatus status = jobManager.getStatus(new Long(jobID));
- if (status == null)
- throw new ManifoldCFException("No such job: '"+jobID+"'");
- int statusValue = status.getStatus();
- switch (statusValue)
- {
- case JobStatus.JOBSTATUS_NOTYETRUN:
- System.out.println("Never run");
- break;
- case JobStatus.JOBSTATUS_COMPLETED:
- System.out.println("OK");
- break;
- case JobStatus.JOBSTATUS_ERROR:
- System.out.println("Error: "+status.getErrorText());
- break;
- default:
- ManifoldCF.sleep(10000);
- continue;
- }
- break;
- }
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitJobPaused.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitJobPaused.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitJobPaused.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/WaitJobPaused.java Sat Sep 28 13:18:40 2013
@@ -28,46 +28,46 @@ import java.util.*;
*/
public class WaitJobPaused
{
- public static final String _rcsid = "@(#)$Id: WaitJobPaused.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: WaitJobPaused.java 988245 2010-08-23 18:39:35Z kwright $";
- private WaitJobPaused()
+ private WaitJobPaused()
+ {
+ }
+
+ // Add: throttle, priority, recrawl interval
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: WaitJobPaused <jobid>");
+ System.exit(1);
+ }
+
+ String jobID = args[0];
+
+
+ try
+ {
+ IThreadContext tc = ThreadContextFactory.make();
+ ManifoldCF.initializeEnvironment(tc);
+ IJobManager jobManager = JobManagerFactory.make(tc);
+ while (true)
+ {
+ if (jobManager.checkJobBusy(new Long(jobID)))
{
+ ManifoldCF.sleep(5000);
+ continue;
}
-
- // Add: throttle, priority, recrawl interval
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: WaitJobPaused <jobid>");
- System.exit(1);
- }
-
- String jobID = args[0];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IJobManager jobManager = JobManagerFactory.make(tc);
- while (true)
- {
- if (jobManager.checkJobBusy(new Long(jobID)))
- {
- ManifoldCF.sleep(5000);
- continue;
- }
- break;
- }
- System.err.println("Job no longer busy");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(2);
- }
- }
-
+ break;
+ }
+ System.err.println("Job no longer busy");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ System.exit(2);
+ }
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/CrawlerAgent.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/CrawlerAgent.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/CrawlerAgent.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/CrawlerAgent.java Sat Sep 28 13:18:40 2013
@@ -62,8 +62,8 @@ public class CrawlerAgent implements IAg
public void startAgent()
throws ManifoldCFException
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(threadContext);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(threadContext);
ManifoldCF.startSystem(threadContext);
}
@@ -73,8 +73,8 @@ public class CrawlerAgent implements IAg
throws ManifoldCFException
{
ManifoldCF.stopSystem(threadContext);
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(threadContext);
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(threadContext);
}
/** Request permission from agent to delete an output connection.
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java Sat Sep 28 13:18:40 2013
@@ -105,35 +105,35 @@ public class ManifoldCF extends org.apac
protected static final String connectorsConfigurationFileProperty = "org.apache.manifoldcf.connectorsconfigurationfile";
protected static final String databaseSuperuserNameProperty = "org.apache.manifoldcf.dbsuperusername";
protected static final String databaseSuperuserPasswordProperty = "org.apache.manifoldcf.dbsuperuserpassword";
- protected static final String salt = "org.apache.manifoldcf.salt";
+ protected static final String saltProperty = "org.apache.manifoldcf.salt";
/** This object is used to make sure the initialization sequence is atomic. Shutdown cannot occur until the system is in a known state. */
protected static Integer startupLock = new Integer(0);
/** Initialize environment.
*/
- public static void initializeEnvironment()
+ public static void initializeEnvironment(IThreadContext tc)
throws ManifoldCFException
{
synchronized (initializeFlagLock)
{
- org.apache.manifoldcf.agents.system.ManifoldCF.initializeEnvironment();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ org.apache.manifoldcf.agents.system.ManifoldCF.initializeEnvironment(tc);
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(tc);
}
}
- public static void cleanUpEnvironment()
+ public static void cleanUpEnvironment(IThreadContext tc)
{
synchronized (initializeFlagLock)
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.agents.system.ManifoldCF.cleanUpEnvironment();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.agents.system.ManifoldCF.cleanUpEnvironment(tc);
}
}
- public static void localInitialize()
+ public static void localInitialize(IThreadContext tc)
throws ManifoldCFException
{
synchronized (initializeFlagLock)
@@ -143,12 +143,12 @@ public class ManifoldCF extends org.apac
return;
Logging.initializeLoggers();
- Logging.setLogLevels();
+ Logging.setLogLevels(tc);
crawlerInitialized = true;
}
}
- public static void localCleanup()
+ public static void localCleanup(IThreadContext tc)
{
}
@@ -158,12 +158,8 @@ public class ManifoldCF extends org.apac
throws ManifoldCFException
{
// Get the specified superuser name and password, in case this isn't Derby we're using
- String superuserName = getProperty(databaseSuperuserNameProperty);
- if (superuserName == null)
- superuserName = "";
- String superuserPassword = getProperty(databaseSuperuserPasswordProperty);
- if (superuserPassword == null)
- superuserPassword = "";
+ String superuserName = LockManagerFactory.getStringProperty(threadContext, databaseSuperuserNameProperty, "");
+ String superuserPassword = LockManagerFactory.getStringProperty(threadContext, databaseSuperuserPasswordProperty, "");
createSystemDatabase(threadContext,superuserName,superuserPassword);
}
@@ -569,40 +565,22 @@ public class ManifoldCF extends org.apac
synchronized (startupLock)
{
// Now, start all the threads
- String maxThreads = getProperty(workerThreadCountProperty);
- if (maxThreads == null)
- maxThreads = "100";
- numWorkerThreads = new Integer(maxThreads).intValue();
+ numWorkerThreads = LockManagerFactory.getIntProperty(threadContext,workerThreadCountProperty,100);
if (numWorkerThreads < 1 || numWorkerThreads > 300)
throw new ManifoldCFException("Illegal value for the number of worker threads");
- String maxDeleteThreads = getProperty(deleteThreadCountProperty);
- if (maxDeleteThreads == null)
- maxDeleteThreads = "10";
- String maxCleanupThreads = getProperty(cleanupThreadCountProperty);
- if (maxCleanupThreads == null)
- maxCleanupThreads = "10";
- String maxExpireThreads = getProperty(expireThreadCountProperty);
- if (maxExpireThreads == null)
- maxExpireThreads = "10";
- numDeleteThreads = new Integer(maxDeleteThreads).intValue();
+ numDeleteThreads = LockManagerFactory.getIntProperty(threadContext,deleteThreadCountProperty,10);
+ numCleanupThreads = LockManagerFactory.getIntProperty(threadContext,cleanupThreadCountProperty,10);
+ numExpireThreads = LockManagerFactory.getIntProperty(threadContext,expireThreadCountProperty,10);
if (numDeleteThreads < 1 || numDeleteThreads > 300)
throw new ManifoldCFException("Illegal value for the number of delete threads");
- numCleanupThreads = new Integer(maxCleanupThreads).intValue();
if (numCleanupThreads < 1 || numCleanupThreads > 300)
throw new ManifoldCFException("Illegal value for the number of cleanup threads");
- numExpireThreads = new Integer(maxExpireThreads).intValue();
if (numExpireThreads < 1 || numExpireThreads > 300)
throw new ManifoldCFException("Illegal value for the number of expire threads");
- String lowWaterFactorString = getProperty(lowWaterFactorProperty);
- if (lowWaterFactorString == null)
- lowWaterFactorString = "5";
- lowWaterFactor = new Float(lowWaterFactorString).floatValue();
+ lowWaterFactor = (float)LockManagerFactory.getDoubleProperty(threadContext,lowWaterFactorProperty,5.0);
if (lowWaterFactor < 1.0 || lowWaterFactor > 1000.0)
throw new ManifoldCFException("Illegal value for the low water factor");
- String stuffAmtFactorString = getProperty(stuffAmtFactorProperty);
- if (stuffAmtFactorString == null)
- stuffAmtFactorString = "2";
- stuffAmtFactor = new Float(stuffAmtFactorString).floatValue();
+ stuffAmtFactor = (float)LockManagerFactory.getDoubleProperty(threadContext,stuffAmtFactorProperty,2.0);
if (stuffAmtFactor < 0.1 || stuffAmtFactor > 1000.0)
throw new ManifoldCFException("Illegal value for the stuffing amount factor");
@@ -1139,7 +1117,7 @@ public class ManifoldCF extends org.apac
Cipher cipher = null;
try
{
- cipher = getCipher(Cipher.ENCRYPT_MODE, passCode, iv);
+ cipher = getCipher(threadContext, Cipher.ENCRYPT_MODE, passCode, iv);
}
catch (GeneralSecurityException gse)
{
@@ -1266,7 +1244,7 @@ public class ManifoldCF extends org.apac
Cipher cipher = null;
try
{
- cipher = getCipher(Cipher.DECRYPT_MODE, passCode, iv);
+ cipher = getCipher(threadContext, Cipher.DECRYPT_MODE, passCode, iv);
}
catch (GeneralSecurityException gse)
{
@@ -1661,10 +1639,10 @@ public class ManifoldCF extends org.apac
private static final int IV_LENGTH = 16;
- private static Cipher getCipher(final int mode, final String passCode, final byte[] iv) throws GeneralSecurityException,
+ private static Cipher getCipher(IThreadContext threadContext, final int mode, final String passCode, final byte[] iv) throws GeneralSecurityException,
ManifoldCFException
{
- final String saltValue = getProperty(salt);
+ final String saltValue = LockManagerFactory.getProperty(threadContext, saltProperty);
if (saltValue == null || saltValue.length() == 0)
throw new ManifoldCFException("Missing required SALT value");
Modified: manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseDerby.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseDerby.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseDerby.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseDerby.java Sat Sep 28 13:18:40 2013
@@ -116,15 +116,17 @@ public class BaseDerby extends org.apach
throws Exception
{
super.initializeSystem();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(tc);
}
protected void cleanupSystem()
throws Exception
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(tc);
super.cleanupSystem();
}
Modified: manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDB.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDB.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDB.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDB.java Sat Sep 28 13:18:40 2013
@@ -114,15 +114,17 @@ public class BaseHSQLDB extends org.apac
throws Exception
{
super.initializeSystem();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(tc);
}
protected void cleanupSystem()
throws Exception
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(tc);
super.cleanupSystem();
}
Modified: manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDBext.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDBext.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDBext.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseHSQLDBext.java Sat Sep 28 13:18:40 2013
@@ -114,15 +114,17 @@ public class BaseHSQLDBext extends org.a
throws Exception
{
super.initializeSystem();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(tc);
}
protected void cleanupSystem()
throws Exception
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(tc);
super.cleanupSystem();
}
Modified: manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseMySQL.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseMySQL.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseMySQL.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BaseMySQL.java Sat Sep 28 13:18:40 2013
@@ -114,15 +114,17 @@ public class BaseMySQL extends org.apach
throws Exception
{
super.initializeSystem();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(tc);
}
protected void cleanupSystem()
throws Exception
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(tc);
super.cleanupSystem();
}
Modified: manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BasePostgresql.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BasePostgresql.java?rev=1527183&r1=1527182&r2=1527183&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BasePostgresql.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/test/java/org/apache/manifoldcf/crawler/tests/BasePostgresql.java Sat Sep 28 13:18:40 2013
@@ -114,15 +114,17 @@ public class BasePostgresql extends org.
throws Exception
{
super.initializeSystem();
- org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localInitialize(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localInitialize(tc);
}
protected void cleanupSystem()
throws Exception
{
- org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup();
- org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup();
+ IThreadContext tc = ThreadContextFactory.make();
+ org.apache.manifoldcf.authorities.system.ManifoldCF.localCleanup(tc);
+ org.apache.manifoldcf.crawler.system.ManifoldCF.localCleanup(tc);
super.cleanupSystem();
}