Index: trunk/ippToPsps/jython/ipptopspsdb.py
===================================================================
--- trunk/ippToPsps/jython/ipptopspsdb.py	(revision 33266)
+++ trunk/ippToPsps/jython/ipptopspsdb.py	(revision 33293)
@@ -717,4 +717,58 @@
 
     '''
+    Remove client
+    '''
+    def removeClient(self, host, pid):
+        self.execute("DELETE FROM clients WHERE host = '" + host + "' AND pid = " + str(pid))
+
+    '''
+    Insert client
+    '''
+    def insertClient(self, host, pid):
+        self.execute("INSERT INTO clients (timestamp, host, pid) VALUES (now(), '" + host + "', " + str(pid) + ")")
+
+    '''
+    Update clients, or inserts it for the first time
+    '''
+    def updateClient(self, host, pid):
+
+        try:
+            self.insertClient(host, pid)
+        except:
+            self.execute("UPDATE clients SET timestamp = now() WHERE host = '" + host + "' AND pid = " + str(pid))
+
+    '''
+    Is this client paused?
+    '''
+    def isPaused(self, host, pid):
+        return self.getClientsColumnBoolean("paused", host, pid)
+
+    '''
+    Is this client killed?
+    '''
+    def isKilled(self, host, pid):
+        return self.getClientsColumnBoolean("killed", host, pid)
+
+    '''
+    Returns boolean value for this column in clients table
+    '''
+    def getClientsColumnBoolean(self, col, host, pid):
+
+        sql = "SELECT " + col + " \
+               FROM clients \
+               WHERE host = '" + host + "' AND pid = " + str(pid)
+
+        try:
+            rs = self.executeQuery(sql)
+            rs.first()
+            if rs.getInt(1) == 1: return True
+            else: return False
+        except:
+            self.logger.exception("Unable to check whether " + col + " is true or false in clients table")
+
+        return False
+
+
+    '''
     Destructor
     '''
