class FileConnection implements ObjectStoreConnection {

    @Override
    public boolean updateServiceIdentity(String domainName, ServiceIdentity service) {
        DomainStruct domainStruct = getDomainStruct(domainName);
        if (domainStruct == null) {
            throw ZMSUtils.error(ResourceException.NOT_FOUND, "domain not found", "updateServiceIdentity");
        }
        
        if (domainStruct.getServices() == null) {
            domainStruct.setServices(new HashMap<>());
        }
        HashMap<String, ServiceIdentity> services = domainStruct.getServices();
        
        service.setModified(Timestamp.fromCurrentTime());
        String serviceName = ZMSUtils.extractServiceName(domainName, service.getName());

        // here we only need to update the main attrs and not
        // the public keys and hosts

        List<PublicKeyEntry> publicKeys = service.getPublicKeys();
        List<String> hosts = service.getHosts();
        ServiceIdentity originalService = getServiceObject(domainStruct, serviceName);
        if (originalService != null) {
            service.setPublicKeys(originalService.getPublicKeys());
            service.setHosts(originalService.getHosts());
        } else {
            service.setPublicKeys(null);
            service.setHosts(null);
        }
        service.setModified(Timestamp.fromCurrentTime());
        services.put(serviceName, service);
        putDomainStruct(domainName, domainStruct);
        service.setPublicKeys(publicKeys);
        service.setHosts(hosts);
        return true;
    }

    public  FileConnection(File rootDir, File quotaDir);

}