incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1214762 - in /incubator/lcf/branches/CONNECTORS-313/framework: example-multiprocess/ pull-agent/src/main/java/org/apache/manifoldcf/crawler/
Date Thu, 15 Dec 2011 13:55:55 GMT
Author: kwright
Date: Thu Dec 15 13:55:55 2011
New Revision: 1214762

URL: http://svn.apache.org/viewvc?rev=1214762&view=rev
Log:
Change name of command and script, accordingly

Added:
    incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
  (contents, props changed)
      - copied, changed from r1214737, incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterAll.java
Removed:
    incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterAll.java
Modified:
    incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.bat
    incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.sh
    incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java
  (contents, props changed)

Modified: incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.bat
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.bat?rev=1214762&r1=1214761&r2=1214762&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.bat (original)
+++ incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.bat Thu
Dec 15 13:55:55 2011
@@ -20,7 +20,7 @@ if not exist ".\properties.xml" goto nol
 rem set MCF_HOME
 set MCF_HOME=%CD%
 rem invoke the RegisterAll command
-cmd /c "processes\script\executecommand.bat org.apache.manifoldcf.crawler.RegisterAll"
+cmd /c "processes\script\executecommand.bat org.apache.manifoldcf.crawler.InitializeAndRegister"
 goto done
 :nojavahome
 echo Environment variable JAVA_HOME is not set properly.

Modified: incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.sh
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.sh?rev=1214762&r1=1214761&r2=1214762&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.sh (original)
+++ incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.sh Thu
Dec 15 13:55:55 2011
@@ -20,7 +20,7 @@ if [ -e "$JAVA_HOME"/bin/java ] ; then
     if [ -f ./properties.xml ] ; then
         # Set the MCF_HOME variable
         set MCF_HOME=$PWD
-        processes/script/executecommand org.apache.manifoldcf.crawler.RegisterAll
+        processes/script/executecommand org.apache.manifoldcf.crawler.InitializeAndRegister
         exit $?
         
     else

Copied: incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
(from r1214737, incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterAll.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java?p2=incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java&p1=incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterAll.java&r1=1214737&r2=1214762&rev=1214762&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterAll.java
(original)
+++ incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
Thu Dec 15 13:55:55 2011
@@ -1,3 +1,21 @@
+/* $Id$ */
+
+/**
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 package org.apache.manifoldcf.crawler;
 
 import java.io.File;
@@ -5,22 +23,16 @@ import java.io.File;
 import org.apache.manifoldcf.agents.system.ManifoldCF;
 import org.apache.manifoldcf.core.interfaces.*;
 
-public class RegisterAll extends TransactionalCrawlerInitializationCommand
+public class InitializeAndRegister
 {
-    public static final String _rcsid = "@(#)$Id: RegisterAll.java 988245 2010-08-23 18:39:35Z
kwright $";
+    public static final String _rcsid = "@(#)$Id$";
 
-    private RegisterAll()
+    private InitializeAndRegister()
     {
     }
     
-    @Override
     protected void doExecute(IThreadContext tc) throws ManifoldCFException 
     {
-      ManifoldCF.initializeEnvironment();
-
-      // Clear the shutdown signal
-      RegisterConnectors.clearShutdownSignal(tc);
-      
       // Get the specified superuser name and password, in case this isn't Derby we're using
       String superuserName = ManifoldCF.getProperty(RegisterConnectors.databaseSuperuserName);
       if (superuserName == null)
@@ -32,11 +44,14 @@ public class RegisterAll extends Transac
       // Do the basic initialization of the database and its schema
       RegisterConnectors.createDatabaseAndSchema(tc,superuserName,superuserPassword);
       RegisterConnectors.registerAgents(tc);
-	      
+      
       // Read connectors configuration file (to figure out what we need to register)
       File connectorConfigFile = ManifoldCF.getFileProperty(RegisterConnectors.connectorsConfigurationFile);
       Connectors c = RegisterConnectors.readConnectorDeclarations(connectorConfigFile);
 
+      // Unregister all connectors, prior to reregistering.  This allows connectors.xml to
control deletions too.
+      RegisterConnectors.unregisterAllConnectors(tc);
+      
       // Register connections specified by connectors.xml
       RegisterConnectors.registerConnectors(tc,c);	
     }
@@ -45,15 +60,19 @@ public class RegisterAll extends Transac
     {
       if (args.length > 0)
       {
-        System.err.println("Usage: RegisterAll");
+        System.err.println("Usage: InitializeAndRegister");
         System.exit(1);
       }
 
       try
       {
-        RegisterAll register = new RegisterAll();
-        register.execute();
-        System.err.println("Successfully registered all");
+        ManifoldCF.initializeEnvironment();
+        IThreadContext tc = ThreadContextFactory.make();
+      
+        InitializeAndRegister register = new InitializeAndRegister();
+        register.doExecute(tc);
+        
+        System.err.println("Successfully initialized database and registered all connectors");
       }
       catch (ManifoldCFException e)
       {

Propchange: incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
------------------------------------------------------------------------------
    svn:svn-eol-style = native

Modified: incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java?rev=1214762&r1=1214761&r2=1214762&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java
(original)
+++ incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java
Thu Dec 15 13:55:55 2011
@@ -34,7 +34,7 @@ import java.io.InputStream;
 public class RegisterConnectors
 {
 
-  public static final String _rcsid = "@(#)$Id: RegisterConnectors.java 989983 2010-08-27
00:10:12Z kwright $";
+  public static final String _rcsid = "@(#)$Id$";
 
   public static final String agentShutdownSignal = org.apache.manifoldcf.agents.AgentRun.agentShutdownSignal;
 

Propchange: incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/RegisterConnectors.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message