@Override public InstantType copy() { InstantType ret = new InstantType(getValueAsString()); copyValues(ret); return ret; }
@Override public IBaseResource readByPid(Long thePid) { StopWatch w = new StopWatch(); Optional<ResourceTable> entity = myResourceTableDao.findById(thePid); if (!entity.isPresent()) { throw new ResourceNotFoundException("No resource found with PID " + thePid); } if (entity.get().getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.get().getDeleted()).getValueAsString()); } T retVal = toResource(myResourceType, entity.get(), null, false); ourLog.debug("Processed read on {} in {}ms", thePid, w.getMillis()); return retVal; }
@Override public T read(IIdType theId, RequestDetails theRequestDetails, boolean theDeletedOk) { validateResourceTypeAndThrowIllegalArgumentException(theId); // Notify interceptors if (theRequestDetails != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); RestOperationTypeEnum operationType = theId.hasVersionIdPart() ? RestOperationTypeEnum.VREAD : RestOperationTypeEnum.READ; notifyInterceptors(operationType, requestDetails); } StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theId); validateResourceType(entity); T retVal = toResource(myResourceType, entity, null, false); if (theDeletedOk == false) { if (entity.getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.getDeleted()).getValueAsString()); } } ourLog.debug("Processed read on {} in {}ms", theId.getValue(), w.getMillisAndRestart()); return retVal; }
@Override public InstantType copy() { InstantType ret = new InstantType(getValueAsString()); copyValues(ret); return ret; }
@Override public IBaseResource readByPid(Long thePid) { StopWatch w = new StopWatch(); Optional<ResourceTable> entity = myResourceTableDao.findById(thePid); if (!entity.isPresent()) { throw new ResourceNotFoundException("No resource found with PID " + thePid); } if (entity.get().getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.get().getDeleted()).getValueAsString()); } T retVal = toResource(myResourceType, entity.get(), null, false); ourLog.debug("Processed read on {} in {}ms", thePid, w.getMillis()); return retVal; }
@Override public T read(IIdType theId, RequestDetails theRequestDetails, boolean theDeletedOk) { validateResourceTypeAndThrowIllegalArgumentException(theId); // Notify interceptors if (theRequestDetails != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); RestOperationTypeEnum operationType = theId.hasVersionIdPart() ? RestOperationTypeEnum.VREAD : RestOperationTypeEnum.READ; notifyInterceptors(operationType, requestDetails); } StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theId); validateResourceType(entity); T retVal = toResource(myResourceType, entity, null, false); if (theDeletedOk == false) { if (entity.getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.getDeleted()).getValueAsString()); } } ourLog.debug("Processed read on {} in {}ms", theId.getValue(), w.getMillisAndRestart()); return retVal; }