You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by ks...@apache.org on 2011/05/24 23:40:38 UTC

svn commit: r1127309 - /juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java

Author: kstam
Date: Tue May 24 21:40:38 2011
New Revision: 1127309

URL: http://svn.apache.org/viewvc?rev=1127309&view=rev
Log:
JUDDI-481, skip reinstalling the root data on 'juddi.seed.always' is true.

Modified:
    juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java?rev=1127309&r1=1127308&r2=1127309&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java Tue May 24 21:40:38 2011
@@ -86,9 +86,11 @@ public class Install {
 		try {
 			tx.begin();
 			boolean seedAlways = config.getBoolean("juddi.seed.always", false);
-			if (!seedAlways && alreadyInstalled(config))
+			boolean alreadyInstalled = alreadyInstalled(config);
+			if (!seedAlways && alreadyInstalled)
 				new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
 			
+			
 			String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
 			String fileRootTModelKeygen = rootPublisherStr + FILE_TMODELKEYGEN;
 			TModel rootTModelKeyGen = (TModel)buildInstallEntity(fileRootTModelKeygen, "org.uddi.api_v3", config);
@@ -99,13 +101,16 @@ public class Install {
 			String nodeId = getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition);
 			
 			String fileRootPublisher = rootPublisherStr + FILE_PUBLISHER;
-			log.info("Loading the root Publisher from file " + fileRootPublisher);
-			rootPublisher = installPublisher(em, fileRootPublisher, config);
+			if (!alreadyInstalled) {
+				log.info("Loading the root Publisher from file " + fileRootPublisher);
 			
-			installRootPublisherKeyGen(em, rootTModelKeyGen, rootPartition, rootPublisher, nodeId);
-
-			rootBusinessEntity.setBusinessKey(nodeId);
-			installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config);
+				rootPublisher = installPublisher(em, fileRootPublisher, config);
+				installRootPublisherKeyGen(em, rootTModelKeyGen, rootPartition, rootPublisher, nodeId);
+				rootBusinessEntity.setBusinessKey(nodeId);
+				installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config);
+			} else {
+				log.debug("juddi.seed.always reapplies all seed files except for the root data.");
+			}
 			
 			List<String> juddiPublishers = getPublishers(config);
 			for (String publisherStr : juddiPublishers) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org