package com.emc.ecs.managementClient;

import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;

import com.emc.ecs.managementClient.model.NamespaceQuotaDetails;
import com.emc.ecs.serviceBroker.EcsManagementClientException;

public class NamespaceQuotaAction {

    private NamespaceQuotaAction() {
    }

    public static void create(Connection connection, String namespace,
	    int limit, int warn) throws EcsManagementClientException {
	UriBuilder uri = connection.getUriBuilder().segment("object",
		"namespaces", "namespace", namespace, "quota");
	connection.handleRemoteCall("put", uri,
		new NamespaceQuotaParam(namespace, limit, warn));
    }

    public static NamespaceQuotaDetails get(Connection connection,
	    String namespace) throws EcsManagementClientException {
	UriBuilder uri = connection.getUriBuilder().segment("object",
		"namespaces", "namespace", namespace, "quota");
	Response response = connection.handleRemoteCall("get", uri, null);
	return response.readEntity(NamespaceQuotaDetails.class);
    }

    public static void delete(Connection connection, String namespace)
	    throws EcsManagementClientException {
	UriBuilder uri = connection.getUriBuilder().segment("object",
		"namespaces", "namespace", namespace, "quota");
	connection.handleRemoteCall("delete", uri, null);
    }
}

@@ -269,16 +269,233 @@
 tion %7B%0A%0A
+    private static final String QUOTA = %22quota%22;%0A    private static final String OBJECT = %22object%22;%0A    private static final String NAMESPACE = %22namespace%22;%0A    private static final String NAMESPACES = %22namespaces%22;%0A%0A
     priv
@@ -523,16 +523,16 @@
 ion() %7B%0A
-
     %7D%0A%0A 
@@ -722,45 +722,39 @@
 ent(
-%22object%22,%0A%09%09%22namespaces%22, %22namespace%22
+OBJECT,%0A%09%09NAMESPACES, NAMESPACE
 , na
@@ -754,39 +754,37 @@
 ACE, namespace, 
-%22quota%22
+QUOTA
 );%0A%09connection.h
@@ -1055,45 +1055,39 @@
 ent(
-%22object%22,%0A%09%09%22namespaces%22, %22namespace%22
+OBJECT,%0A%09%09NAMESPACES, NAMESPACE
 , na
@@ -1091,31 +1091,29 @@
  namespace, 
-%22quota%22
+QUOTA
 );%0A%09Response
@@ -1407,45 +1407,39 @@
 ent(
-%22object%22,%0A%09%09%22namespaces%22, %22namespace%22
+OBJECT,%0A%09%09NAMESPACES, NAMESPACE
 , na
@@ -1447,23 +1447,21 @@
 espace, 
-%22quota%22
+QUOTA
 );%0A%09conn

Extract strings to constants