class AbstractArchivistService extends AbstractWorkspaceAwareResourceService<T> {

    @Override
    public T delete(T resource) {
        Map<String, String> mdcContextMap = MDCBuilder.getMdcContextMap();
        MDCBuilder.buildMdcContext(resource);
        LOGGER.debug("Archiving {} with name: {}", resource.getResourceName(), resource.getName());
        prepareDeletion(resource);
        resource.setArchived(true);
        resource.setDeletionTimestamp(clock.getCurrentTimeMillis());
        resource.unsetRelationsToEntitiesToBeDeleted();
        repository().save(resource);
        MDCBuilder.buildMdcContextFromMap(mdcContextMap);
        return resource;
    }

}