Project

General

Profile

« Previous | Next » 

Revision 6256

Added by Chris Jones over 13 years ago

Add insertSystemMetadata() to D1NodeService, wrap the exception handling from calls to IdentifierManager.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
680 680
    
681 681
  }
682 682
  
683
  /**
683
  /*
684 684
   * parse a logEntry and get the relevant field from it
685 685
   * 
686 686
   * @param fieldname
......
698 698
    return s;
699 699
  }
700 700

  
701
  /** 
701
  /* 
702 702
   * Determine if a given object should be treated as an XML science metadata
703 703
   * object. 
704 704
   * 
......
937 937
    
   }
938 938

  
939
  /*
939
  /**
940
   * Insert a systemMetadata document and return its localId
941
   */
942
  protected void insertSystemMetadata(SystemMetadata sysmeta) 
943
    throws ServiceFailure {
944
    
945
  	logMetacat.debug("Starting to insert SystemMetadata...");
946
    sysmeta.setDateSysMetadataModified(new Date());
947
    logMetacat.debug("Inserting new system metadata with modified date " + 
948
        sysmeta.getDateSysMetadataModified());
949

  
950
    //insert the system metadata
951
		try {
952
	    IdentifierManager.getInstance().createSystemMetadata(sysmeta);
953
		  IdentifierManager.getInstance().updateSystemMetadata(sysmeta);
954
		  
955
		} catch (McdbDocNotFoundException e) {
956
      throw new ServiceFailure("1030", "Error inserting system metadata: " + 
957
      	e.getClass() + ": " + e.getMessage());
958
      
959
    }
960
      
961
  }
962

  
963
  /**
940 964
   * Update a systemMetadata document
941 965
   * 
942 966
   * @param sysMeta - the system metadata object in the system to update

Also available in: Unified diff