Project

General

Profile

« Previous | Next » 

Revision 6918

Remove null field tests in the IdentifierManager class. Schema-level required fields are checked on serialization/deserialization using JibX during the REST resource handler classes. Other required fields are checked in MNodeService and CNodeService, higher in the stack.

View differences:

IdentifierManager.java
1158 1158
    		replicationAllowed = replicationAllowed == null ? false: replicationAllowed;
1159 1159
    		numberReplicas = numberReplicas == null ? -1: numberReplicas;
1160 1160
    	}
1161

  
1162
    	// ensure certain system metadata fields are populated
1163
    	try {
1164
          sm.getIdentifier().getValue();
1165
          sm.getSerialVersion().intValue();
1166
          sm.getDateUploaded().getTime();
1167
          sm.getRightsHolder().getValue();
1168
          sm.getChecksum().getValue();
1169
          sm.getChecksum().getAlgorithm();
1170
          sm.getOriginMemberNode().getValue();
1171
          sm.getAuthoritativeMemberNode().getValue();
1172
          sm.getDateSysMetadataModified().getTime();
1173
          // sm.getSubmitter().getValue(); // filled in with identifier
1174
          sm.getFormatId().getValue();
1175
          sm.getArchived().booleanValue();
1176
    	    
1177
    	} catch (NullPointerException npe) {
1178
    	    throw new InvalidSystemMetadata("0000", npe.getMessage());
1179
    	    
1180
    	}
1181 1161
    	
1182 1162
    	// the main systemMetadata fields
1183 1163
		  updateSystemMetadataFields(

Also available in: Unified diff