private ApplicationPackage createApplicationPackage(File applicationDirectory,
                                                        ApplicationId applicationId,
                                                        long sessionId,
                                                        boolean internalRedeploy,
                                                        Optional<DeployLogger> deployLogger) throws IOException {
        // Synchronize to avoid threads trying to create an application package concurrently
        // (e.g. a maintainer and an external deployment)
        synchronized (monitor) {
            Optional<Long> activeSessionId = getActiveSessionId(applicationId);
            File userApplicationDir = getSessionAppDir(sessionId);
            copyApp(applicationDirectory, userApplicationDir);
            ApplicationPackage applicationPackage = createApplication(userApplicationDir,
                                                                      applicationId,
                                                                      sessionId,
                                                                      activeSessionId,
                                                                      internalRedeploy,
                                                                      deployLogger);
            applicationPackage.writeMetaData();
            return applicationPackage;
        }
    }
A session for which we don't have a watcher, i.e. hitherto unknown to us.

@param sessionId session id for the new session
configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java