void write(SessionZooKeeperClient zooKeeperClient, ApplicationId applicationId,
               Instant created, Optional<FileReference> fileReference, Optional<DockerImage> dockerImageRepository,
               Version vespaVersion, Optional<Version> versionToBuildFirst,
               Optional<AthenzDomain> athenzDomain, Optional<Quota> quota,
               List<TenantVault> tenantVaults, List<TenantSecretStore> tenantSecretStores,
               List<X509Certificate> operatorCertificates, Optional<CloudAccount> cloudAccount,
               List<DataplaneToken> dataplaneTokens, ActivationTriggers activationTriggers,
               BooleanFlag writeSessionData) {

        // Note: Any changes to SessionData needs to be reflected in the calls below and in the call to writeSessionData()
        // and readSessionDataFromLegacyPaths
        zooKeeperClient.writeApplicationId(applicationId);
        zooKeeperClient.writeApplicationPackageReference(fileReference);
        zooKeeperClient.writeVespaVersion(vespaVersion);
        zooKeeperClient.writeVersionToBuildFirst(versionToBuildFirst);
        zooKeeperClient.writeDockerImageRepository(dockerImageRepository);
        zooKeeperClient.writeAthenzDomain(athenzDomain);
        zooKeeperClient.writeQuota(quota);
        zooKeeperClient.writeTenantVaults(tenantVaults);
        zooKeeperClient.writeTenantSecretStores(tenantSecretStores);
        zooKeeperClient.writeOperatorCertificates(operatorCertificates);
        zooKeeperClient.writeCloudAccount(cloudAccount);
        zooKeeperClient.writeDataplaneTokens(dataplaneTokens);
        zooKeeperClient.writeActivationTriggers(activationTriggers);

        if (writeSessionData.value())
            zooKeeperClient.writeSessionData(new SessionData(applicationId,
                                                             fileReference,
                                                             vespaVersion,
                                                             versionToBuildFirst,
                                                             created,
                                                             dockerImageRepository,
                                                             athenzDomain,
                                                             quota,
                                                             tenantVaults,
                                                             tenantSecretStores,
                                                             operatorCertificates,
                                                             cloudAccount,
                                                             dataplaneTokens,
                                                             activationTriggers));
    }
Serialization and deserialization of session data to/from ZooKeeper.
@author hmusum
configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionSerializer.java