Project

General

Profile

« Previous | Next » 

Revision 8553

can only log events with a valid localId.

View differences:

src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
417 417

  
418 418
		  }
419 419

  
420
          // Log the delete
421
          EventLog.getInstance().log(request.getRemoteAddr(), 
422
                  request.getHeader("User-Agent"), session.getSubject().getValue(), 
423
                  pid.getValue(), Event.DELETE.xmlValue());
420
          // NOTE: cannot log the delete without localId
421
//          EventLog.getInstance().log(request.getRemoteAddr(), 
422
//                  request.getHeader("User-Agent"), session.getSubject().getValue(), 
423
//                  pid.getValue(), Event.DELETE.xmlValue());
424 424

  
425 425
      }
426 426

  
......
562 562

  
563 563
		  }
564 564

  
565
          // Log the archive
566
          EventLog.getInstance().log(request.getRemoteAddr(), 
567
                  request.getHeader("User-Agent"), session.getSubject().getValue(), 
568
                  pid.getValue(), Event.DELETE.xmlValue());
565
          // NOTE: cannot log the archive without localId
566
//          EventLog.getInstance().log(request.getRemoteAddr(), 
567
//                  request.getHeader("User-Agent"), session.getSubject().getValue(), 
568
//                  pid.getValue(), Event.DELETE.xmlValue());
569 569

  
570 570
      }
571 571

  
......
1170 1170

  
1171 1171
      
1172 1172
      logMetacat.debug("Returning from registerSystemMetadata");
1173
      EventLog.getInstance().log(request.getRemoteAddr(), 
1174
          request.getHeader("User-Agent"), session.getSubject().getValue(), 
1175
          pid.getValue(), "registerSystemMetadata");
1173
      
1174
      try {
1175
    	  String localId = IdentifierManager.getInstance().getLocalId(pid.getValue());
1176
    	  EventLog.getInstance().log(request.getRemoteAddr(), 
1177
    	          request.getHeader("User-Agent"), session.getSubject().getValue(), 
1178
    	          localId, "registerSystemMetadata");
1179
      } catch (McdbDocNotFoundException e) {
1180
    	  // do nothing, no localId to log with
1181
    	  logMetacat.warn("Could not log 'registerSystemMetadata' event because no localId was found for pid: " + pid.getValue());
1182
      }
1183
      
1184
      
1176 1185
      return pid;
1177 1186
  }
1178 1187
  

Also available in: Unified diff