package backtype.storm.utils;

import backtype.storm.Config;
import backtype.storm.security.auth.ThriftClient;
import backtype.storm.generated.Nimbus;
import java.util.Map;
import org.apache.thrift7.transport.TTransportException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class NimbusClient extends ThriftClient {	
    private Nimbus.Client _client;
    private static final Logger LOG = LoggerFactory.getLogger(NimbusClient.class);

    public static NimbusClient getConfiguredClient(Map conf) {
        try {
            String nimbusHost = (String) conf.get(Config.NIMBUS_HOST);
            int nimbusPort = Utils.getInt(conf.get(Config.NIMBUS_THRIFT_PORT));
            String timeoutStr = (String) conf.get(Config.NIMBUS_TASK_TIMEOUT_SECS);
            Integer timeout = new Integer(timeoutStr);
            return new NimbusClient(conf, nimbusHost, nimbusPort, timeout);
        } catch (TTransportException ex) {
            LOG.info(ex.getMessage(), ex);
            throw new RuntimeException(ex);
        }
    }

    public NimbusClient(Map conf, String host, int port, Integer timeout) throws TTransportException {
        super(conf, host, port, timeout);
        _client = new Nimbus.Client(_protocol);
    }

    public Nimbus.Client getClient() {
        return _client;
    }
}

@@ -694,22 +694,23 @@
     
-String
+Integer
  timeout
 Str 
@@ -709,23 +709,36 @@
 eout
-Str = (String) 
+ = new Integer(Utils.getInt(
 conf
@@ -778,62 +778,9 @@
 ECS)
-;%0A            Integer timeout = new Integer(timeoutStr
+)
 );%0A 
@@ -993,32 +993,163 @@
        %7D%0A    %7D%0A%0A
+    public NimbusClient(Map conf, String host, int port) throws TTransportException %7B%0A        this(conf, host, port, null);%0A    %7D%0A%0A
     public Nimbu

fix format conversion for NimbusClient, and make timeout optional