Project

General

Profile

« Previous | Next » 

Revision 6904

Added by Chris Jones over 12 years ago

In IdentifierManager.updateSystemMetadata(), add a check for invalid system metadata (fields that throw a NullPointerException on access) to ensure that system metadata is populated correctly. Updated calling classes to handle the exception.

View differences:

HazelcastService.java
33 33
import java.util.concurrent.locks.Lock;
34 34

  
35 35
import org.apache.log4j.Logger;
36
import org.dataone.service.exceptions.InvalidSystemMetadata;
36 37
import org.dataone.service.types.v1.Identifier;
37 38
import org.dataone.service.types.v1.Node;
38 39
import org.dataone.service.types.v1.NodeReference;
......
435 436
		try {
436 437
			if (!IdentifierManager.getInstance().systemMetadataExists(sm.getIdentifier().getValue())) {
437 438
				IdentifierManager.getInstance().createSystemMetadata(sm);
439
				
438 440
			} else {
439 441
				IdentifierManager.getInstance().updateSystemMetadata(sm);
442
				
440 443
			}
441 444
		} catch (McdbDocNotFoundException e) {
442
			logMetacat.error(
443
					"Could not save System Metadata to local store.", e);
445
			logMetacat.error("Could not save System Metadata to local store.", e);
446
			
444 447
		} catch (SQLException e) {
445
	      logMetacat.error(
446
	              "Could not save System Metadata to local store.", e);
447
        }
448
	      logMetacat.error("Could not save System Metadata to local store.", e);
449
	      
450
    } catch (InvalidSystemMetadata e) {
451
        logMetacat.error("Could not save System Metadata to local store.", e);
452
        
453
    }
448 454
	}
449 455
	
450 456
	public void resynch() throws Exception {

Also available in: Unified diff