public static AIP earkSIPToAIPUpdate(SIP sip, IndexedAIP indexedAIP, ModelService model, String username,
Optional<String> searchScope, String ingestJobId, Report reportItem, Plugin<?> plugin)
throws RequestNotValidException, NotFoundException, GenericException, AlreadyExistsException,
AuthorizationDeniedException, ValidationException, LockingException {
boolean notify = false;
AIP aip;
PluginHelper.acquireObjectLock(indexedAIP, plugin);
processIPInformation(model, sip, indexedAIP.getId(), notify, true);
for (IPRepresentation representation : sip.getRepresentations()) {
processIPRepresentationInformation(model, representation, indexedAIP.getId(), notify, true, username, reportItem);
}
aip = model.retrieveAIP(indexedAIP.getId());
aip.setGhost(false);
if (searchScope.isPresent()) {
aip.setParentId(searchScope.get());
}
aip.addIngestUpdateJobId(ingestJobId);
for (String id : sip.getIds()) {
if (!aip.getIngestSIPIds().contains(id)) {
aip.getIngestSIPIds().add(id);
}
}
return model.updateAIP(aip, username);
}