package com.hubspot.singularity.data;

import org.apache.curator.framework.CuratorFramework;

import com.codahale.metrics.MetricRegistry;
import com.google.inject.Inject;
import com.hubspot.singularity.config.SingularityConfiguration;

public class UserManager extends CuratorManager {

  @Inject
  public UserManager(CuratorFramework curator, SingularityConfiguration configuration, MetricRegistry metricRegistry) {
    super(curator, configuration, metricRegistry);
  }

}

@@ -85,16 +85,57 @@
 amework;
+%0Aimport org.apache.curator.utils.ZKPaths;
 %0A%0Aimport
@@ -172,16 +172,56 @@
 gistry;%0A
+import com.google.common.base.Optional;%0A
 import c
@@ -280,271 +280,1363 @@
 ity.
-config.SingularityConfiguration;%0A%0Apublic class UserManager extends CuratorManager %7B%0A%0A  @Inject%0A  public UserManager(CuratorFramework curator, SingularityConfiguration configuration, MetricRegistry metricRegistry) %7B%0A    super(curator, configuration, metricRegistry
+SingularityUserSettings;%0Aimport com.hubspot.singularity.config.SingularityConfiguration;%0Aimport com.hubspot.singularity.data.transcoders.Transcoder;%0A%0Apublic class UserManager extends CuratorManager %7B%0A%0A  private final Transcoder%3CSingularityUserSettings%3E settingsTranscoder;%0A%0A  private static final String USER_ROOT = %22/users%22;%0A%0A  private static final String SETTINGS_ROOT = USER_ROOT + %22/settings%22;%0A%0A  @Inject%0A  public UserManager(CuratorFramework curator, SingularityConfiguration configuration, MetricRegistry metricRegistry,%0A                     Transcoder%3CSingularityUserSettings%3E settingsTranscoder) %7B%0A    super(curator, configuration, metricRegistry);%0A    this.settingsTranscoder = settingsTranscoder;%0A  %7D%0A%0A  private String getUserSettingsPath(String id) %7B%0A    return ZKPaths.makePath(SETTINGS_ROOT, id);%0A  %7D%0A%0A  public void createUserSettings(String id, SingularityUserSettings userSettings) %7B%0A    create(getUserSettingsPath(id), userSettings, settingsTranscoder);%0A  %7D%0A%0A  public void deleteUserSettings(String id) %7B%0A    delete(getUserSettingsPath(id));%0A  %7D%0A%0A  public Optional%3CSingularityUserSettings%3E getUserSettings(String id) %7B%0A    return getData(getUserSettingsPath(id), settingsTranscoder);%0A  %7D%0A%0A  public void updateUserSettings(String id, SingularityUserSettings userSettings) %7B%0A    save(getUserSettingsPath(id), userSettings, settingsTranscoder
 );%0A 

Implement ZK methods for UserSettings