Project

General

Profile

« Previous | Next » 

Revision 9041

Added by Jing Tao almost 10 years ago

Add the code to handle the deleted identifier in the checking v1 system metadata existing method.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
1694 1694
          throw new ServiceFailure(serviceFailureCode, serviceFailureMessage+" since "+e.getMessage());
1695 1695
      }
1696 1696
      if(!exists) {
1697
        //the v1 method only handles a pid.
1698
          throw new NotFound(noFoundCode, notFoundMessage);
1697
         //the v1 method only handles a pid. so it should throw a not-found exception.
1698
          // check if the pid was deleted.
1699
          try {
1700
              String localId = IdentifierManager.getInstance().getLocalId(identifier.getValue());
1701
              if(EventLog.getInstance().isDeleted(localId)) {
1702
                  notFoundMessage=notFoundMessage+" "+DELETEDMESSAGE;
1703
              } 
1704
            } catch (Exception e) {
1705
              logMetacat.info("Couldn't determine if the not-found identifier "+identifier.getValue()+" was deleted since "+e.getMessage());
1706
            }
1707
            throw new NotFound(noFoundCode, notFoundMessage);
1699 1708
      }
1700 1709
  }
1701 1710
  

Also available in: Unified diff