class DBService implements RolesProvider {

    ServiceIdentity updateTemplateServiceIdentity(ServiceIdentity serviceIdentity,
            String domainName, List<TemplateParam> params) {
        
        String templateServiceName = serviceIdentity.getName().replace(TEMPLATE_DOMAIN_NAME, domainName);
        if (params != null) {
            for (TemplateParam param : params) {
                final String paramKey = "_" + param.getName() + "_";
                templateServiceName = templateServiceName.replace(paramKey, param.getValue());
            }
        }
        
        ServiceIdentity templateServiceIdentity = new ServiceIdentity().setName(templateServiceName);
        
        templateServiceIdentity.setDescription(serviceIdentity.getDescription());
        templateServiceIdentity.setExecutable(serviceIdentity.getExecutable());
        templateServiceIdentity.setGroup(serviceIdentity.getGroup());
        templateServiceIdentity.setUser(serviceIdentity.getUser());
        templateServiceIdentity.setProviderEndpoint(serviceIdentity.getProviderEndpoint());
        
        List<PublicKeyEntry> publicKeyEntries = serviceIdentity.getPublicKeys();
        List<PublicKeyEntry> newPublicKeyEntries = new ArrayList<>();
        if (publicKeyEntries != null && !publicKeyEntries.isEmpty()) {
            for (PublicKeyEntry publicKeyEntry : publicKeyEntries) {
                PublicKeyEntry newPublicKeyEntry = new PublicKeyEntry();
                newPublicKeyEntry.setId(publicKeyEntry.getId());
                newPublicKeyEntry.setKey(publicKeyEntry.getKey());
                newPublicKeyEntries.add(newPublicKeyEntry);
            }
        }
        templateServiceIdentity.setPublicKeys(newPublicKeyEntries);
        
        List<String> hosts = serviceIdentity.getHosts();
        
        if (hosts != null) {
            templateServiceIdentity.setHosts(new ArrayList<>(hosts));
        }
        
        return templateServiceIdentity;
    }

    public  DBService(ObjectStore store, AuditLogger auditLogger, ZMSConfig zmsConfig, AuditReferenceValidator auditReferenceValidator);

}