Author: anovarini
Date: Sun Mar 11 01:46:16 2012
New Revision: 1299322

URL: http://svn.apache.org/viewvc?rev=1299322&view=rev
Log:
Replaced logic around check on remote with the concept of 'connected'

Modified:
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Cd.groovy
    
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Connect.groovy
    
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Disconnect.groovy
    
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Domains.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Exit.groovy
    
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/GetAttribute.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Invoke.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Ls.groovy
    incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Pwd.groovy
    
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetAttribute.groovy
    
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetDomain.groovy

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/client/Client.groovy 
Sun Mar 11 01:46:16 2012
@@ -26,347 +26,316 @@ import org.apache.kitty.exceptions.*
 
 class Client {
 
-       def host
-       def port
-       def domain
-       def domainList
-       def mBeansPath
-       def remote
-       def connector
-       def url
-       def mbean
-
-       public connect(def host, def port) {
-               connect(host, port, null, null)
-       }
-
-       public connect(def host, def port, def username, def password) {
-
-               def serviceURL
-               def properties = new HashMap()
-
-               if (remote != null) {
-                       disconnect()
-               }
-
-               if ((username != null) && (password != null)) {
-                       properties.put JMXConnector.CREDENTIALS, [username, 
password] as String[]
-               }
-
-               try {
-                       serviceURL = 
"service:jmx:rmi:///jndi/rmi://$host:$port/jmxrmi"
-                       this.url = new JMXServiceURL(serviceURL)
-
-                       // TODO add auth & credentials to properties
-                       this.connector = JMXConnectorFactory.connect(this.url, 
properties)
-                       this.remote = this.connector.getMBeanServerConnection()
-               }
-               catch(Exception e) {
-                       connector = null
-                       remote = null
-                       println "ERROR! " + e.getMessage()
-               }
-               finally {
-                       if (this.remote != null) {
-                               this.host = host
-                               this.port = port
-                       }
-               }
-       }
-
-       public disconnect() {
-               try {
-                       if (this.remote != null) {
-                               connector.close()
-                       }
-               }
-               finally {
-                       this.host = null
-                       this.port = null
-                       this.remote = null
-                       this.connector = null
-                       this.domain = null
-                       this.mBeansPath = null
-               }
-       }
-
-       public domains() {
-               if (this.remote) {
-                       this.domainList = remote.getDomains()
-               }
-               else {
-                       println "The remote connection is null"
-               }
-       }
+    def host
+    def port
+    def domain
+    def domainList
+    def mBeansPath
+    def remote
+    def connector
+    def url
+    def mbean
+
+    public connect(def host, def port) {
+        connect(host, port, null, null)
+    }
 
-       public setDomain(def domain) {
-               if (this.remote) {
+    public connect(def host, def port, def username, def password) {
 
-                       this.domainList = remote.getDomains()
+        def serviceURL
+        def properties = new HashMap()
+
+        if (remote != null) {
+            disconnect()
+        }
+
+        if ((username != null) && (password != null)) {
+            properties.put JMXConnector.CREDENTIALS, [username, password] as 
String[]
+        }
+
+        try {
+            serviceURL = "service:jmx:rmi:///jndi/rmi://$host:$port/jmxrmi"
+            this.url = new JMXServiceURL(serviceURL)
+
+            // TODO add auth & credentials to properties
+            this.connector = JMXConnectorFactory.connect(this.url, properties)
+            this.remote = this.connector.getMBeanServerConnection()
+        }
+        catch (Exception e) {
+            connector = null
+            remote = null
+            println "ERROR! " + e.getMessage()
+        }
+        finally {
+            if (this.remote != null) {
+                this.host = host
+                this.port = port
+            }
+        }
+    }
+
+    public disconnect() {
+        try {
+            if (this.remote != null) {
+                connector.close()
+            }
+        }
+        finally {
+            this.host = null
+            this.port = null
+            this.remote = null
+            this.connector = null
+            this.domain = null
+            this.mBeansPath = null
+        }
+    }
+
+    public domains() {
+        if (this.remote) {
+            this.domainList = remote.getDomains()
+        }
+        else {
+            println "The remote connection is null"
+        }
+    }
+
+    public setDomain(def domain) {
+        if (this.remote) {
+
+            this.domainList = remote.getDomains()
 
             def domainFound = domainList.findAll { it == domain }
 
-                       if (domainFound.size() == 1) {
-                                       this.domain = domain
-                                       this.mBeansPath = []
-                       }
+            if (domainFound.size() == 1) {
+                this.domain = domain
+                this.mBeansPath = []
+            }
             else {
                 println "domain $domain not found"
             }
         }
-       }
+    }
+
+    public ls() {
+
+        if (!this.remote) {
+            println "No remote is set!"
+            return
+        }
+
+        if (!this.domain) {
+            println "No domain is set!"
+            return
+        }
+
+        def objectName = this.domain + ":"
+        def objectName2
+        if (mBeansPath.size() > 0) {
+            objectName += this.mBeansPath.join(',')  // make sure mBeansPath 
is a list, otherwise remove the .join() command
+            objectName2 = objectName + ","
+        }
+        else {
+            objectName2 = objectName
+        }
+
+        def pool = new ObjectName(objectName2 + "*")
+        def paths = [:]
+        println objectName
+        println "-----"
+
+        // List the MBeans names
+        def qNames = this.remote.queryNames(pool, null)
+        try {
+            qNames.each { mbean ->
+                def p = mbean.toString().split(objectName2)[1].split(',')[0]
+                paths[p] = p
+            }
+            paths.each { p, dummy ->  println "M " + p }
+        }
+        catch (Exception e) {
+            throw new DomainIsNoneException()
+        }
+
+        mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
+        for (attr in mbean.getAttributes()) {
+            def readable
+            def writable
+            def value
+            def valueStr
+
+            try {
+                value = this.remote.getAttribute(new ObjectName(objectName), 
attr.getName())
+                valueStr = (String) value
+            }
+            catch (Exception e) {
+                valueStr = "-- " + attr.getType() + " --"
+            }
+            if (attr.isReadable()) {
+                readable = "r"
+            }
+            else {
+                readable = "-"
+            }
+            if (attr.isWritable()) {
+                writable = "w"
+            }
+            else {
+                writable = "-"
+            }
+            println "A " + readable + writable + " " + attr.getName() + " : " 
+ valueStr
+        }
+
+        mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
+        for (ops in mbean.getOperations()) {
+            def params = []
+            for (p in ops.getSignature()) {
+                params.append(p.getType())
+            }
+            println "O " + ops.getReturnType() + " " + ops.getName() + " ( " + 
",".concat(params.join()) + ")"
+        }
 
-       public ls() {
+    }
 
-               if (!this.remote) {
-                       println "No remote is set!"
-                       return
-               }
-
-               if (!this.domain) {
-                       println "No domain is set!"
-                       return
-               }
-
-               if (this.remote) {
-                       if (this.domain) {
-                               def objectName = this.domain + ":"
-                               def objectName2
-                               if (mBeansPath.size() > 0) {
-                                       objectName += this.mBeansPath.join(',') 
 // make sure mBeansPath is a list, otherwise remove the .join() command
-                                       objectName2 = objectName + ","
-                               }
-                               else {
-                                       objectName2 = objectName
-                               }
-
-                               def pool = new ObjectName(objectName2 + "*")
-                               def paths = [:]
-                               println objectName
-                               println "-----"
-
-                // List the MBeans names
-                               def qNames = this.remote.queryNames(pool, null)
-                               try {
-                                       qNames.each { mbean ->
-                                               def p = 
mbean.toString().split(objectName2)[1].split(',')[0]
-                                               paths[p] = p
-                                       }
-                                       paths.each { p, dummy ->  println  "M " 
+ p }
-                               }
-                               catch(Exception e) {
-                                       throw new DomainIsNoneException()
-                               }
-
-                               try {
-                                       mbean = this.remote.getMBeanInfo( new 
ObjectName(objectName))
-                                       for (attr in mbean.getAttributes()) {
-                                               def readable
-                                               def writable
-                                               def value
-                                               def valueStr
-
-                                               try {
-                                                       value = 
this.remote.getAttribute(new ObjectName(objectName), attr.getName())
-                                                       valueStr = (String)value
-                                               }
-                                               catch(Exception e) {
-                                                       valueStr = "-- " + 
attr.getType() + " --"
-                                               }
-                                               if (attr.isReadable()) {
-                                                       readable = "r"
-                                               }
-                                               else {
-                                                       readable = "-"
-                                               }
-                                               if (attr.isWritable()) {
-                                                       writable = "w"
-                                               }
-                                               else {
-                                                       writable = "-"
-                                               }
-                                               println "A " + readable + 
writable + " " + attr.getName() + " : "  + valueStr
-                                       }
-                               }
-                               catch(Exception e) {
-                    // ObjectName not found
-                               }
-
-                               try {
-                                       mbean = this.remote.getMBeanInfo( new 
ObjectName(objectName))
-                                       for (ops in mbean.getOperations()) {
-                                               def params = []
-                                               for (p in ops.getSignature()) {
-                                                       
params.append(p.getType())
-                                               }
-                                               println "O " + 
ops.getReturnType()  + " " + ops.getName() + " ( "  + ",".concat(params.join()) 
+  ")"
-                                       }
-                               }
-                               catch(Exception e) {
-                    // ObjectName not found
-                               }
-                       }
-               }
-       }
-
-       public cd(String path) {
-               if (this.remote) {
-                       if (this.domain) {
-                               if (path == "..") {
-                                       if (!this.mBeansPath.isEmpty()) {
-                                               this.mBeansPath.pop()
-                                       }
-                               }
-                               else {
-                                       for (p in path.split(',')) {
-                                               this.mBeansPath << p
-                                       }
-                               }
-                       }
-               }
-       }
-
-       public get(att) {
-               if (this.remote) {
-                       if (this.domain) {
-                               def objectName = this.domain + ":"
-                               def readable
-                               def writable
-                               def value
-                               def valueStr
-                               def attr = null
-
-                               if (this.mBeansPath.length > 0) {
-                                       objectName = objectName + 
','.concat(this.mBeansPath.join())
-                               }
-                               try {
-                                       mbean = this.remote.getMBeanInfo(new 
ObjectName(objectName))
-                               }
-                               catch(Exception e) {
-                                       throw new MBeanNotFoundException()
-                               }
-
-                               for (a in mbean.getAttributes()) {
-                                       if (a.getName()  == att) {
-                                               attr = a
-                                               break
-                                       }
-                               }
-                               if (!attr) {
-                                       throw new 
MBeanAttributeNotFoundException()
-                               }
-                               try {
-                                       value = this.remote.getAttribute(new 
ObjectName(objectName), att)
-                                       valueStr = str(value)
-                               }
-                               catch(Exception e) {
-                                       valueStr = "-- " + attr.getType() + " 
--"
-                               }
-                               if (attr.isReadable()) {
-                                       readable = "Y"
-                               }
-                               else {
-                                       readable = "N"
-                               }
-                               if (attr.isWritable()) {
-                                       writable = "Y"
-                               }
-                               else {
-                                       writable = "N"
-                               }
-                               println "ObjectName : " + objectName
-                               println "Attribute  : " + attr.getName()
-                               println "Value      : " + valueStr
-                               println "isReadable : " + readable
-                               println "isWritable : " + writable
-                       }
-               }
-       }
-
-       public set(att, val) {
-               if (this.remote) {
-                       if (this.domain) {
-                               def objectName = this.domain + ":"
-                               def attr
-
-                               if (this.mBeansPath.length() > 0) {
-                                       objectName = objectName + 
','.concat(this.mBeansPath.join())
-                               }
-                               try {
-                                       mbean = this.remote.getMBeanInfo(new 
ObjectName(objectName))
-                               }
-                               catch(Exception e) {
-                                       throw new MBeanNotFoundException()
-                               }
-                               attr = null
-                               for (a in mbean.getAttributes()) {
-                                       if (a.getName()  == att)
-                                               attr = a
-                                       break
-                               }
-                               if (!attr) {
-                                       throw new 
MBeanAttributeNotFoundException()
-                               }
-                               if (attr.isWritable()) {
-                                       try {
-                                               def a = new Attribute(att, val)
-                                               this.remote.setAttribute(new 
ObjectName(objectName), a)
-                                       }
-                                       catch(Exception e) {
-                                               throw new 
SetAttributeException()
-                                       }
-                               }
-                               else {
-                                       throw new SetAttributeException()
-                               }
-                       }
-               }
-       }
-
-       public invoke(op, params) {
-               if (this.remote) {
-                       if (this.domain) {
-                               def objectName = this.domain + ":"
-                               if (this.mBeansPath.length()) {
-                                       objectName = objectName + 
','.concat(this.mBeansPath.join())
-                               }
-                               try{
-                                       mbean = this.remote.getMBeanInfo(new 
ObjectName(objectName))
-                               }
-                               catch(Exception) {
-                                       throw new MBeanNotFoundException()
-                               }
-                               def ops = null
-                               for (o in mbean.getOperations()) {
-                                       if (o.getName() == op) {
-                                               ops = o
-                                               break
-                                       }
-                               }
-                               if (!ops) {
-                                       throw new OperationNotFoundException()
-                               }
-                               def sig = []
-                               for (s in ops.getSignature()) {
-                                       sig.append(s.getType())
-                               }
-
-                               try {
-                                       this.remote.invoke(new 
ObjectName(objectName), op, params, sig)
-                               }
-                               catch(Exception e) {
-                                       throw new InvokeException()
-                               }
-                       }
-               }
-       }
-
-       public pwd() {
-               def name
-               if (this.domain) {
-                       name = this.domain + ":" + this.mBeansPath.join(',')
-               }
+    public cd(String path) {
+        if (this.remote) {
+            if (this.domain) {
+                if (path == "..") {
+                    if (!this.mBeansPath.isEmpty()) {
+                        this.mBeansPath.pop()
+                    }
+                }
+                else {
+                    for (p in path.split(',')) {
+                        this.mBeansPath << p
+                    }
+                }
+            }
+        }
+    }
+
+    public get(att) {
+        if (this.remote) {
+            if (this.domain) {
+                def objectName = this.domain + ":"
+                def readable
+                def writable
+                def value
+                def valueStr
+                def attr = null
+
+                if (this.mBeansPath.length > 0) {
+                    objectName = objectName + 
','.concat(this.mBeansPath.join())
+                }
+
+                mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
+
+                for (a in mbean.getAttributes()) {
+                    if (a.getName() == att) {
+                        attr = a
+                        break
+                    }
+                }
+                if (!attr) {
+                    throw new MBeanAttributeNotFoundException()
+                }
+                try {
+                    value = this.remote.getAttribute(new 
ObjectName(objectName), att)
+                    valueStr = str(value)
+                }
+                catch (Exception e) {
+                    valueStr = "-- " + attr.getType() + " --"
+                }
+                if (attr.isReadable()) {
+                    readable = "Y"
+                }
+                else {
+                    readable = "N"
+                }
+                if (attr.isWritable()) {
+                    writable = "Y"
+                }
+                else {
+                    writable = "N"
+                }
+                println "ObjectName : " + objectName
+                println "Attribute  : " + attr.getName()
+                println "Value      : " + valueStr
+                println "isReadable : " + readable
+                println "isWritable : " + writable
+            }
+        }
+    }
+
+    public set(att, val) {
+        if (this.remote) {
+            if (this.domain) {
+                def objectName = this.domain + ":"
+                def attr
+
+                if (this.mBeansPath.length() > 0) {
+                    objectName = objectName + 
','.concat(this.mBeansPath.join())
+                }
+
+                mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
+
+                attr = null
+                for (a in mbean.getAttributes()) {
+                    if (a.getName() == att)
+                        attr = a
+                    break
+                }
+                if (!attr) {
+                    throw new MBeanAttributeNotFoundException()
+                }
+                if (attr.isWritable()) {
+                    def a = new Attribute(att, val)
+                    this.remote.setAttribute(new ObjectName(objectName), a)
+                }
+                else {
+                    throw new SetAttributeException()
+                }
+            }
+        }
+    }
+
+    public invoke(op, params) {
+        if (this.remote) {
+            if (this.domain) {
+                def objectName = this.domain + ":"
+                if (this.mBeansPath.length()) {
+                    objectName = objectName + 
','.concat(this.mBeansPath.join())
+                }
+
+                mbean = this.remote.getMBeanInfo(new ObjectName(objectName))
+
+                def ops = null
+                for (o in mbean.getOperations()) {
+                    if (o.getName() == op) {
+                        ops = o
+                        break
+                    }
+                }
+                if (!ops) {
+                    throw new OperationNotFoundException()
+                }
+                def sig = []
+                for (s in ops.getSignature()) {
+                    sig.append(s.getType())
+                }
+
+                this.remote.invoke(new ObjectName(objectName), op, params, sig)
+            }
+        }
+    }
+
+    String pwd() {
+        if (this.domain) {
+            return this.domain + ":" + this.mBeansPath.join(',')
+        }
+        null
+    }
 
-               return name
-       }
+    boolean isConnected() {
+        remote != null
+    }
 }

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Cd.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Cd.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Cd.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Cd.groovy 
Sun Mar 11 01:46:16 2012
@@ -30,7 +30,7 @@ class Cd implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             client.cd(args[0])
         }
         else {

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Connect.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Connect.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Connect.groovy 
(original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Connect.groovy 
Sun Mar 11 01:46:16 2012
@@ -41,7 +41,7 @@ class Connect implements Command {
         else {
             client.connect(host, port)
         }
-        if (!client.remote) {
+        if (!client.connected) {
             ioDevice.write "Couldn't connect to $host:$port"
         }
     }

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Disconnect.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Disconnect.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Disconnect.groovy
 (original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Disconnect.groovy
 Sun Mar 11 01:46:16 2012
@@ -29,11 +29,9 @@ class Disconnect implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             client.disconnect()
-            if (!client.remote) {
-                ioDevice.write 'Disconnected'
-            }
+            ioDevice.write 'Disconnected'
         }
         else {
             ioDevice.write 'Not connected'

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Domains.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Domains.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Domains.groovy 
(original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Domains.groovy 
Sun Mar 11 01:46:16 2012
@@ -29,9 +29,11 @@ class Domains implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        def domains = client.domains()
-        if (domains) {
-            domains.eachWithIndex() { obj, i -> ioDevice.write " ${i}: ${obj}" 
}
+        if (client.connected) {
+            def domains = client.domains()
+            if (domains) {
+                domains.eachWithIndex() { obj, i -> ioDevice.write " ${i}: 
${obj}" }
+            }
         }
     }
 }

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Exit.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Exit.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Exit.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Exit.groovy 
Sun Mar 11 01:46:16 2012
@@ -29,7 +29,7 @@ class Exit implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             client.disconnect()
         }
         ioDevice.write 'Bye'

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/GetAttribute.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/GetAttribute.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/GetAttribute.groovy
 (original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/GetAttribute.groovy
 Sun Mar 11 01:46:16 2012
@@ -30,7 +30,7 @@ class GetAttribute implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             client.get(args[0])
         }
         else {

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Invoke.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Invoke.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Invoke.groovy 
(original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Invoke.groovy 
Sun Mar 11 01:46:16 2012
@@ -30,7 +30,7 @@ class Invoke implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             String operation = args[0]
             String params = args.tail()
             client.invoke(operation, params)

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Ls.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Ls.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Ls.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Ls.groovy 
Sun Mar 11 01:46:16 2012
@@ -30,7 +30,7 @@ class Ls implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             client.ls()
         }
         else {

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Pwd.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Pwd.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Pwd.groovy 
(original)
+++ incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/Pwd.groovy 
Sun Mar 11 01:46:16 2012
@@ -29,7 +29,7 @@ class Pwd implements Command {
 
     @Override
     void execute(org.apache.kitty.client.Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             String name = (String) client.pwd()
             ioDevice.write name
         }

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetAttribute.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetAttribute.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetAttribute.groovy
 (original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetAttribute.groovy
 Sun Mar 11 01:46:16 2012
@@ -30,7 +30,7 @@ class SetAttribute implements Command {
 
     @Override
     void execute(Client client, String... args) {
-        if (client.remote) {
+        if (client.connected) {
             String attr = args[0]
             String val = args[1]
             client.set(attr, val)

Modified: 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetDomain.groovy
URL: 
http://svn.apache.org/viewvc/incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetDomain.groovy?rev=1299322&r1=1299321&r2=1299322&view=diff
==============================================================================
--- 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetDomain.groovy 
(original)
+++ 
incubator/kitty/trunk/src/main/groovy/org/apache/kitty/command/SetDomain.groovy 
Sun Mar 11 01:46:16 2012
@@ -31,7 +31,7 @@ class SetDomain implements Command {
     @Override
     void execute(Client client, String... args) {
         String domain = args[0]
-        if (client.remote) {
+        if (client.connected) {
             client.domain = domain
         }
         else {


Reply via email to