private PrepareAndActivateResult deploy(File applicationDir, PrepareParams prepareParams, DeployHandlerLogger logger) {
        long sessionId = createSession(prepareParams.getApplicationId(),
                                       prepareParams.getTimeoutBudget(),
                                       applicationDir,
                                       logger);
        Deployment deployment = prepare(sessionId, prepareParams, logger);

        RuntimeException activationFailure = null;
        if ( ! prepareParams.isDryRun()) try {
            deployment.activate();
        }
        catch (ParentHostUnavailableException | ApplicationLockException e) {
            activationFailure = e;
        }
        return new PrepareAndActivateResult(new PrepareResult(sessionId, deployment.configChangeActions(), logger), activationFailure);
    }
The API for managing applications.

@author bratseth
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java