@Override
    public Optional<Instant> deployTime(ApplicationId application) {
        Tenant tenant = tenantRepository.getTenant(application.tenant());
        if (tenant == null) return Optional.empty();

        // TODO: Fallback to empty instead if no deploy time (in Vespa 9)
        Optional<Long> lastDeployedSession = tenant.getApplicationRepo().applicationData(application)
                .flatMap(ApplicationData::lastDeployedSession);
        if (lastDeployedSession.isEmpty()) return activationTime(application);

        Optional<Instant> createTime;
        try {
            createTime = Optional.of(getRemoteSession(tenant, lastDeployedSession.get()).getCreateTime());
        }
        catch (Exception e) {
            // Fallback to activation time, e.g. when last deployment failed before writing session data for new session
            createTime = activationTime(application);
        }
        log.log(Level.FINEST, application + " last deployed " + createTime);

        return createTime;
    }
Creates a new deployment from the active application, if available.
This is used for system internal redeployments, not on application package changes.

@param application the active application to be redeployed
@param timeout the timeout to use for each individual deployment operation
@param bootstrap the deployment is done when bootstrapping
@return a new deployment from the local active, or empty if a local active application
        was not present for this id (meaning it either is not active or active on another
        node in the config server cluster)
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java