private Model getActiveModelOrThrow(ApplicationId id) {
        return applicationRepository.getActiveApplicationVersions(id)
                                    .orElseThrow(() -> new NotFoundException("Application '" + id + "' not found"))
                                    .getForVersionOrLatest(Optional.empty(), applicationRepository.clock().instant())
                .getModel();
    }
Operations on applications (delete, wait for config convergence, restart, application content etc.)

@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java