Project

General

Profile

Revision 4408

Added by daigle about 12 years ago

Add debug statements to the bypass config section

View differences:

src/edu/ucsb/nceas/metacat/service/PropertyService.java
519 519
		// bypass the configuration.  We don't want to run through all of
520 520
		// this every time  we hit metacat. 
521 521
		if (bypassAlreadyChecked) {
522
			logMetacat.debug("bypassConfiguration not performing full bypass check.  Bypass set to " + bypass);
522 523
			return bypass;
523 524
		}
524 525
		
......
526 527
			// check how dev.runConfiguration is set in metacat.properties
527 528
			String strRunConfiguration = PropertyService.getProperty("dev.runConfiguration");
528 529
			bypass = !(Boolean.parseBoolean(strRunConfiguration));
530
			logMetacat.debug("bypassConfiguration: dev.runConfiguration property set to: " + bypass);
529 531
			
530
			// if the deb.runConfiguration is true, return false here.
532
			// if the dev.runConfiguration is true, return false here.
531 533
			if (!bypass) {
532 534
				bypassAlreadyChecked = true;
533 535
				return false;
......
536 538
			// The system is bypassing the configuration utility. We need to
537 539
			// get the backup properties and replace existing properties with
538 540
			// backup values.  We do this for main and org properties.		
541
			logMetacat.debug("bypassConfiguration: setting main backup properties.");
539 542
			SortedProperties mainBackupProperties = getMainBackupProperties();
540 543
			Vector<String> backupPropertyNames = 
541 544
				mainBackupProperties.getPropertyNames();
......
544 547
				setPropertyNoPersist(backupPropertyName, value);
545 548
			}
546 549
				
547
			SortedProperties orgBackupProperties = getOrgBackupProperties();
548
			Vector<String> orgBackupPropertyNames = 
549
				orgBackupProperties.getPropertyNames();
550
			for (String orgBackupPropertyName : orgBackupPropertyNames) {
551
				String value = orgBackupProperties.getProperty(orgBackupPropertyName);
552
				setPropertyNoPersist(orgBackupPropertyName, value);
553
			}
554
			
550
//			SortedProperties orgBackupProperties = getOrgBackupProperties();
551
//			Vector<String> orgBackupPropertyNames = 
552
//				orgBackupProperties.getPropertyNames();
553
//			for (String orgBackupPropertyName : orgBackupPropertyNames) {
554
//				String value = orgBackupProperties.getProperty(orgBackupPropertyName);
555
//				setPropertyNoPersist(orgBackupPropertyName, value);
556
//			}
557

  
558
			logMetacat.debug("bypassConfiguration: setting ldap backup properties.");
555 559
			SortedProperties ldapBackupProperties = getLDAPBackupProperties();
556 560
			Vector<String> ldapBackupPropertyNames = 
557 561
				ldapBackupProperties.getPropertyNames();
......
559 563
				String value = ldapBackupProperties.getProperty(ldapBackupPropertyName);
560 564
				setPropertyNoPersist(ldapBackupPropertyName, value);
561 565
			}
562
			
566

  
567
			logMetacat.debug("bypassConfiguration: setting configutil sections to true.");
563 568
			setPropertyNoPersist("configutil.propertiesConfigured", "true");
564 569
			setPropertyNoPersist("configutil.ldapConfigured", "true");
565 570
//			setPropertyNoPersist("configutil.organizationsConfigured", "true");
......
570 575
			persistProperties();
571 576

  
572 577
		} catch (PropertyNotFoundException pnfe) {
573
			logMetacat.error("Could not find property: " + pnfe.getMessage());
578
			logMetacat.error("bypassConfiguration: Could not find property: " + pnfe.getMessage());
574 579
		} catch (GeneralPropertyException gpe) {
575
			logMetacat.error("General property error: " + gpe.getMessage());
580
			logMetacat.error("bypassConfiguration: General property error: " + gpe.getMessage());
576 581
		}
577 582

  
578 583
		bypassAlreadyChecked = true;

Also available in: Unified diff