Project

General

Profile

« Previous | Next » 

Revision 5459

Added by berkley over 14 years ago

reformatting logs for robert

View differences:

src/edu/ucsb/nceas/metacat/dataone/CrudService.java
364 364
        logMetacat.debug("Returning from CrudService.create()");
365 365
        EventLog.getInstance().log(metacatUrl,
366 366
                username, localId, "create");
367
        logCrud.info("create localId:" + localId + " guid:" + guid.getValue());
367
        logCrud.info("create D1GUID:" + guid.getValue() + ":D1SCIMETADATA:" + localId + 
368
                ":D1SYSMETA:"+ sysMetaLocalId + ":");
368 369
        return guid;
369 370
    }
370 371
    
......
393 394
            //change the obsoletes field of the new systemMetadata (sm.new) to point to the id of the old one
394 395
            sysmeta.addObsolete(obsoletedGuid);
395 396
            //insert sm.new
396
            insertSystemMetadata(sysmeta, sessionData);
397
            String sysMetaLocalId = insertSystemMetadata(sysmeta, sessionData);
398
            String localId;
397 399
            
398 400
            boolean isScienceMetadata = isScienceMetadata(sysmeta);
399 401
            if(isScienceMetadata)
400 402
            {
401 403
                //update the doc
402
                updateDocument(object, obsoletedGuid, guid, sessionData, false);
404
                localId = updateDocument(object, obsoletedGuid, guid, sessionData, false);
403 405
            }
404 406
            else
405 407
            {
406 408
                //update a data file, not xml
407
                insertDataObject(object, guid, sessionData);
409
                localId = insertDataObject(object, guid, sessionData);
408 410
            }
409 411
            
410 412
            IdentifierManager im = IdentifierManager.getInstance();
......
415 417
            }
416 418
            EventLog.getInstance().log(metacatUrl,
417 419
                    username, im.getLocalId(guid.getValue()), "update");
418
            logCrud.info("update localId:" + im.getLocalId(guid.getValue()) + " guid:" + guid.getValue());
420
            logCrud.info("update D1GUID:" + guid.getValue() + ":D1SCIMETADATA:" + localId + 
421
                    ":D1SYSMETA:"+ sysMetaLocalId + ":");
419 422
            return guid;
420 423
        }
421 424
        catch(Exception e)
......
889 892
            
890 893
            EventLog.getInstance().log(metacatUrl,
891 894
                    username, im.getLocalId(guid.getValue()), "read");
892
            logCrud.info("get localId:" + localId + " guid:" + guid.getValue());
895
            logCrud.info("get D1GUID:" + guid.getValue() + ":D1SCIMETADATA:" + localId + 
896
                    ":");
893 897
            return objectStream;
894 898

  
895 899
        } catch (McdbDocNotFoundException e) {
......
1132 1136
            }
1133 1137
            EventLog.getInstance().log(metacatUrl,
1134 1138
                    username, im.getLocalId(guid.getValue()), "read");
1135
            logCrud.info("getSystemMetadata localId: " + localId + " guid:" + guid.getValue());
1139
            logCrud.info("getsystemmetadata D1GUID:" + guid.getValue()  + 
1140
                    ":D1SYSMETA:"+ localId + ":");
1136 1141
            return sysmeta;
1137 1142
            
1138 1143
        } catch (McdbDocNotFoundException e) {
......
1257 1262
     * @param guid
1258 1263
     * @param sessionData
1259 1264
     * @throws ServiceFailure
1265
     * @returns localId of the data object inserted
1260 1266
     */
1261
    private void insertDataObject(InputStream object, Identifier guid, 
1267
    private String insertDataObject(InputStream object, Identifier guid, 
1262 1268
            SessionData sessionData) throws ServiceFailure {
1263 1269
        
1264 1270
        String username = "public";
......
1329 1335
                } catch (PropertyNotFoundException e) {
1330 1336
                    throw new ServiceFailure("1190", "Could not lock file for writing:" + e.getMessage());
1331 1337
                }
1332
    
1333 1338
            }
1339
            return localId;
1334 1340
        } catch (Exception e) {
1335 1341
            // Could not get a lock on the document, so we can not update the file now
1336 1342
            throw new ServiceFailure("1190", "Failed to lock file: " + e.getMessage());
src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java
437 437
      
438 438
      if(guid != null)
439 439
      {
440
          logReplication.info("replicate localId:" + accNumber + " guid:" + guid);
440
          if(!docName.trim().equals("systemMetadata"))
441
          {
442
              logReplication.info("replicate D1GUID:" + guid + ":D1SCIMETADATA:" + 
443
                      accNumber + ":");
444
          }
445
          else
446
          {
447
              logReplication.info("replicate D1GUID:" + guid + ":D1SYSMETADATA:" + 
448
                      accNumber + ":");
449
          }
441 450
      }
442 451
      
443 452
      logReplication.info("ReplicationHandler.handleSingleXMLDocument - Successfully replicated doc " + accNumber);
src/edu/ucsb/nceas/metacat/replication/ReplicationService.java
492 492
		//    int serverCode = 1;
493 493
		DBConnection dbConn = null;
494 494
		int serialNumber = -1;
495
		String docName = null;
495 496

  
496 497
		try {
497 498
			//if the url contains a dbaction then the default action is overridden
......
540 541
        logReplication.info("YYYYYYYYYYYYYY Creating guid/docid mapping for docid " + 
541 542
          docinfoHash.get("docid") + " and guid: " + guid);
542 543
        
543
        String docName = (String) docinfoHash.get("docname");
544
        docName = (String) docinfoHash.get("docname");
544 545
        logReplication.info("ZZZZZZZZZZZZ docName: " + docName);
545 546
        if(docName.trim().equals("systemMetadata"))
546 547
        {
......
629 630
				
630 631
				if(guid != null)
631 632
                {
632
                    logReplication.info("replicate localId:" + docid + " guid:" + guid);
633
                    if(!docName.trim().equals("systemMetadata"))
634
                    {
635
                        logReplication.info("replicate D1GUID:" + guid + ":D1SCIMETADATA:" + 
636
                                docid + ":");
637
                    }
638
                    else
639
                    {
640
                        logReplication.info("replicate D1GUID:" + guid + ":D1SYSMETADATA:" + 
641
                                docid + ":");
642
                    }
633 643
                }
634 644
				EventLog.getInstance().log(request.getRemoteAddr(), REPLICATIONUSER, docid,
635 645
						dbaction);

Also available in: Unified diff