From 25b2116fdae211b1b9ac7a45fb0f4459d5f3cc11 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 29 Jan 2013 19:35:35 -0800 Subject: [PATCH 001/109] Initial commit. --- extensions/guacamole-auth-mysql/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/.gitignore diff --git a/extensions/guacamole-auth-mysql/.gitignore b/extensions/guacamole-auth-mysql/.gitignore new file mode 100644 index 000000000..42f4a1a64 --- /dev/null +++ b/extensions/guacamole-auth-mysql/.gitignore @@ -0,0 +1,2 @@ +target/ +*~ From f96cd9a30d7e9350161f4f61ca7d1dbb2771bec9 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 1 Feb 2013 00:03:51 -0800 Subject: [PATCH 002/109] Ticket 269: Initial Schema --- .../resources/guacamole-auth-mysql-schema.sql | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql diff --git a/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql new file mode 100644 index 000000000..134996e3b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql @@ -0,0 +1,179 @@ +-- MySQL dump 10.13 Distrib 5.5.29, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: guacamole +-- ------------------------------------------------------ +-- Server version 5.5.29-0ubuntu0.12.10.1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `guacamole_connection` +-- + +DROP TABLE IF EXISTS `guacamole_connection`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guacamole_connection` ( + `connection_id` int(11) NOT NULL, + `connection_name` varchar(128) NOT NULL, + PRIMARY KEY (`connection_id`), + UNIQUE KEY `connection_name` (`connection_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guacamole_connection` +-- + +LOCK TABLES `guacamole_connection` WRITE; +/*!40000 ALTER TABLE `guacamole_connection` DISABLE KEYS */; +/*!40000 ALTER TABLE `guacamole_connection` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guacamole_connection_parameter` +-- + +DROP TABLE IF EXISTS `guacamole_connection_parameter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guacamole_connection_parameter` ( + `connection_id` int(11) NOT NULL DEFAULT '0', + `parameter_name` varchar(128) NOT NULL DEFAULT '', + `parameter_value` varchar(4096) DEFAULT NULL, + PRIMARY KEY (`connection_id`,`parameter_name`), + CONSTRAINT `guacamole_connection_parameter_ibfk_1` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guacamole_connection_parameter` +-- + +LOCK TABLES `guacamole_connection_parameter` WRITE; +/*!40000 ALTER TABLE `guacamole_connection_parameter` DISABLE KEYS */; +/*!40000 ALTER TABLE `guacamole_connection_parameter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guacamole_connection_permission` +-- + +DROP TABLE IF EXISTS `guacamole_connection_permission`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guacamole_connection_permission` ( + `user_id` int(11) NOT NULL DEFAULT '0', + `connection_id` int(11) NOT NULL DEFAULT '0', + `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`connection_id`,`permission`), + CONSTRAINT `guacamole_connection_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_connection` (`connection_id`), + CONSTRAINT `guacamole_connection_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guacamole_connection_permission` +-- + +LOCK TABLES `guacamole_connection_permission` WRITE; +/*!40000 ALTER TABLE `guacamole_connection_permission` DISABLE KEYS */; +/*!40000 ALTER TABLE `guacamole_connection_permission` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guacamole_system_permission` +-- + +DROP TABLE IF EXISTS `guacamole_system_permission`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guacamole_system_permission` ( + `user_id` int(11) NOT NULL DEFAULT '0', + `permission` enum('CREATE_CONFIGURATION','CREATE_USER') NOT NULL, + PRIMARY KEY (`user_id`,`permission`), + CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guacamole_system_permission` +-- + +LOCK TABLES `guacamole_system_permission` WRITE; +/*!40000 ALTER TABLE `guacamole_system_permission` DISABLE KEYS */; +/*!40000 ALTER TABLE `guacamole_system_permission` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guacamole_user` +-- + +DROP TABLE IF EXISTS `guacamole_user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guacamole_user` ( + `user_id` int(11) NOT NULL, + `username` varchar(128) NOT NULL, + `password_hash` binary(32) NOT NULL, + `password_salt` varchar(100) NOT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guacamole_user` +-- + +LOCK TABLES `guacamole_user` WRITE; +/*!40000 ALTER TABLE `guacamole_user` DISABLE KEYS */; +/*!40000 ALTER TABLE `guacamole_user` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `guacamole_user_permission` +-- + +DROP TABLE IF EXISTS `guacamole_user_permission`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `guacamole_user_permission` ( + `user_id` int(11) NOT NULL DEFAULT '0', + `other_user_id` int(11) NOT NULL DEFAULT '0', + `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`other_user_id`,`permission`), + KEY `other_user_id` (`other_user_id`), + CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`other_user_id`) REFERENCES `guacamole_user` (`user_id`), + CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `guacamole_user_permission` +-- + +LOCK TABLES `guacamole_user_permission` WRITE; +/*!40000 ALTER TABLE `guacamole_user_permission` DISABLE KEYS */; +/*!40000 ALTER TABLE `guacamole_user_permission` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2013-02-01 0:02:13 From 960d5f76022482a73312f43679d941c1666619ae Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 1 Feb 2013 00:06:15 -0800 Subject: [PATCH 003/109] Ticket 269: Removing superflous index --- .../src/resources/guacamole-auth-mysql-schema.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql index 134996e3b..f8fa9afe8 100644 --- a/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql @@ -152,7 +152,6 @@ CREATE TABLE `guacamole_user_permission` ( `other_user_id` int(11) NOT NULL DEFAULT '0', `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, PRIMARY KEY (`user_id`,`other_user_id`,`permission`), - KEY `other_user_id` (`other_user_id`), CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`other_user_id`) REFERENCES `guacamole_user` (`user_id`), CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From cb83ceaf78edc1ff041c238c1d5c34eef6299d9b Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 1 Feb 2013 00:26:38 -0800 Subject: [PATCH 004/109] Ticket #269: Cleaned up schema, added protocol to connection, and moved out of maven directory. --- .../schema/guacamole-auth-mysql-schema.sql | 74 ++++++++ .../resources/guacamole-auth-mysql-schema.sql | 178 ------------------ 2 files changed, 74 insertions(+), 178 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql delete mode 100644 extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql new file mode 100644 index 000000000..7ea675e54 --- /dev/null +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -0,0 +1,74 @@ +-- +-- Table structure for table `guacamole_connection` +-- + +CREATE TABLE `guacamole_connection` ( + `connection_id` int(11) NOT NULL, + `connection_name` varchar(128) NOT NULL, + `protocol` varchar(32) NOT NULL, + PRIMARY KEY (`connection_id`), + UNIQUE KEY `connection_name` (`connection_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `guacamole_user` +-- + +CREATE TABLE `guacamole_user` ( + `user_id` int(11) NOT NULL, + `username` varchar(128) NOT NULL, + `password_hash` binary(32) NOT NULL, + `password_salt` varchar(100) NOT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `guacamole_connection_parameter` +-- + +CREATE TABLE `guacamole_connection_parameter` ( + `connection_id` int(11) NOT NULL DEFAULT '0', + `parameter_name` varchar(128) NOT NULL DEFAULT '', + `parameter_value` varchar(4096) DEFAULT NULL, + PRIMARY KEY (`connection_id`,`parameter_name`), + CONSTRAINT `guacamole_connection_parameter_ibfk_1` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `guacamole_connection_permission` +-- + +CREATE TABLE `guacamole_connection_permission` ( + `user_id` int(11) NOT NULL DEFAULT '0', + `connection_id` int(11) NOT NULL DEFAULT '0', + `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`connection_id`,`permission`), + CONSTRAINT `guacamole_connection_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_connection` (`connection_id`), + CONSTRAINT `guacamole_connection_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `guacamole_system_permission` +-- + +CREATE TABLE `guacamole_system_permission` ( + `user_id` int(11) NOT NULL DEFAULT '0', + `permission` enum('CREATE_CONFIGURATION','CREATE_USER') NOT NULL, + PRIMARY KEY (`user_id`,`permission`), + CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `guacamole_user_permission` +-- + +CREATE TABLE `guacamole_user_permission` ( + `user_id` int(11) NOT NULL DEFAULT '0', + `affected_user_id` int(11) NOT NULL DEFAULT '0', + `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`affected_user_id`,`permission`), + CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`affected_user_id`) REFERENCES `guacamole_user` (`user_id`), + CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + diff --git a/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql deleted file mode 100644 index f8fa9afe8..000000000 --- a/extensions/guacamole-auth-mysql/src/resources/guacamole-auth-mysql-schema.sql +++ /dev/null @@ -1,178 +0,0 @@ --- MySQL dump 10.13 Distrib 5.5.29, for debian-linux-gnu (x86_64) --- --- Host: localhost Database: guacamole --- ------------------------------------------------------ --- Server version 5.5.29-0ubuntu0.12.10.1 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `guacamole_connection` --- - -DROP TABLE IF EXISTS `guacamole_connection`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guacamole_connection` ( - `connection_id` int(11) NOT NULL, - `connection_name` varchar(128) NOT NULL, - PRIMARY KEY (`connection_id`), - UNIQUE KEY `connection_name` (`connection_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `guacamole_connection` --- - -LOCK TABLES `guacamole_connection` WRITE; -/*!40000 ALTER TABLE `guacamole_connection` DISABLE KEYS */; -/*!40000 ALTER TABLE `guacamole_connection` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `guacamole_connection_parameter` --- - -DROP TABLE IF EXISTS `guacamole_connection_parameter`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guacamole_connection_parameter` ( - `connection_id` int(11) NOT NULL DEFAULT '0', - `parameter_name` varchar(128) NOT NULL DEFAULT '', - `parameter_value` varchar(4096) DEFAULT NULL, - PRIMARY KEY (`connection_id`,`parameter_name`), - CONSTRAINT `guacamole_connection_parameter_ibfk_1` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `guacamole_connection_parameter` --- - -LOCK TABLES `guacamole_connection_parameter` WRITE; -/*!40000 ALTER TABLE `guacamole_connection_parameter` DISABLE KEYS */; -/*!40000 ALTER TABLE `guacamole_connection_parameter` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `guacamole_connection_permission` --- - -DROP TABLE IF EXISTS `guacamole_connection_permission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guacamole_connection_permission` ( - `user_id` int(11) NOT NULL DEFAULT '0', - `connection_id` int(11) NOT NULL DEFAULT '0', - `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, - PRIMARY KEY (`user_id`,`connection_id`,`permission`), - CONSTRAINT `guacamole_connection_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_connection` (`connection_id`), - CONSTRAINT `guacamole_connection_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `guacamole_connection_permission` --- - -LOCK TABLES `guacamole_connection_permission` WRITE; -/*!40000 ALTER TABLE `guacamole_connection_permission` DISABLE KEYS */; -/*!40000 ALTER TABLE `guacamole_connection_permission` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `guacamole_system_permission` --- - -DROP TABLE IF EXISTS `guacamole_system_permission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guacamole_system_permission` ( - `user_id` int(11) NOT NULL DEFAULT '0', - `permission` enum('CREATE_CONFIGURATION','CREATE_USER') NOT NULL, - PRIMARY KEY (`user_id`,`permission`), - CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `guacamole_system_permission` --- - -LOCK TABLES `guacamole_system_permission` WRITE; -/*!40000 ALTER TABLE `guacamole_system_permission` DISABLE KEYS */; -/*!40000 ALTER TABLE `guacamole_system_permission` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `guacamole_user` --- - -DROP TABLE IF EXISTS `guacamole_user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guacamole_user` ( - `user_id` int(11) NOT NULL, - `username` varchar(128) NOT NULL, - `password_hash` binary(32) NOT NULL, - `password_salt` varchar(100) NOT NULL, - PRIMARY KEY (`user_id`), - UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `guacamole_user` --- - -LOCK TABLES `guacamole_user` WRITE; -/*!40000 ALTER TABLE `guacamole_user` DISABLE KEYS */; -/*!40000 ALTER TABLE `guacamole_user` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `guacamole_user_permission` --- - -DROP TABLE IF EXISTS `guacamole_user_permission`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `guacamole_user_permission` ( - `user_id` int(11) NOT NULL DEFAULT '0', - `other_user_id` int(11) NOT NULL DEFAULT '0', - `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, - PRIMARY KEY (`user_id`,`other_user_id`,`permission`), - CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`other_user_id`) REFERENCES `guacamole_user` (`user_id`), - CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `guacamole_user_permission` --- - -LOCK TABLES `guacamole_user_permission` WRITE; -/*!40000 ALTER TABLE `guacamole_user_permission` DISABLE KEYS */; -/*!40000 ALTER TABLE `guacamole_user_permission` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2013-02-01 0:02:13 From f5529376b6bc2227bf5e03705dd4eaafb0d3f6dd Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 1 Feb 2013 00:33:38 -0800 Subject: [PATCH 005/109] Ticket #269: Cleaning up default values and null constraints. --- .../schema/guacamole-auth-mysql-schema.sql | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index 7ea675e54..de262a2e3 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -28,9 +28,9 @@ CREATE TABLE `guacamole_user` ( -- CREATE TABLE `guacamole_connection_parameter` ( - `connection_id` int(11) NOT NULL DEFAULT '0', - `parameter_name` varchar(128) NOT NULL DEFAULT '', - `parameter_value` varchar(4096) DEFAULT NULL, + `connection_id` int(11) NOT NULL, + `parameter_name` varchar(128) NOT NULL, + `parameter_value` varchar(4096) NOT NULL, PRIMARY KEY (`connection_id`,`parameter_name`), CONSTRAINT `guacamole_connection_parameter_ibfk_1` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -40,8 +40,8 @@ CREATE TABLE `guacamole_connection_parameter` ( -- CREATE TABLE `guacamole_connection_permission` ( - `user_id` int(11) NOT NULL DEFAULT '0', - `connection_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL, + `connection_id` int(11) NOT NULL, `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, PRIMARY KEY (`user_id`,`connection_id`,`permission`), CONSTRAINT `guacamole_connection_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_connection` (`connection_id`), @@ -53,7 +53,7 @@ CREATE TABLE `guacamole_connection_permission` ( -- CREATE TABLE `guacamole_system_permission` ( - `user_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL, `permission` enum('CREATE_CONFIGURATION','CREATE_USER') NOT NULL, PRIMARY KEY (`user_id`,`permission`), CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) @@ -64,8 +64,8 @@ CREATE TABLE `guacamole_system_permission` ( -- CREATE TABLE `guacamole_user_permission` ( - `user_id` int(11) NOT NULL DEFAULT '0', - `affected_user_id` int(11) NOT NULL DEFAULT '0', + `user_id` int(11) NOT NULL, + `affected_user_id` int(11) NOT NULL, `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, PRIMARY KEY (`user_id`,`affected_user_id`,`permission`), CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`affected_user_id`) REFERENCES `guacamole_user` (`user_id`), From 212c59b6ce5f276a83d1408f9e73deff77c2d0d8 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 1 Feb 2013 01:00:22 -0800 Subject: [PATCH 006/109] Ticket #269: Added AUTO_INCREMENT where appropriate. --- .../schema/guacamole-auth-mysql-schema.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index de262a2e3..ffb94771f 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -3,7 +3,7 @@ -- CREATE TABLE `guacamole_connection` ( - `connection_id` int(11) NOT NULL, + `connection_id` int(11) NOT NULL AUTO_INCREMENT, `connection_name` varchar(128) NOT NULL, `protocol` varchar(32) NOT NULL, PRIMARY KEY (`connection_id`), @@ -15,7 +15,7 @@ CREATE TABLE `guacamole_connection` ( -- CREATE TABLE `guacamole_user` ( - `user_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(128) NOT NULL, `password_hash` binary(32) NOT NULL, `password_salt` varchar(100) NOT NULL, From 37d09698874df8bb3be4c0e243ad814ee8d13a28 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 5 Feb 2013 21:13:22 -0800 Subject: [PATCH 007/109] Ticket #257: Created some documentation and included generated MyBatis mappings.D --- extensions/guacamole-auth-mysql/README | 93 ++++ .../guacamole-auth-mysql/README.mybatis | 37 ++ .../doc/examples/mybatisGeneratorConfig.xml | 68 +++ .../mysql/dao/guacamole/ConnectionMapper.java | 96 ++++ .../guacamole/ConnectionParameterMapper.java | 97 ++++ .../guacamole/ConnectionPermissionMapper.java | 72 +++ .../dao/guacamole/SystemPermissionMapper.java | 72 +++ .../auth/mysql/dao/guacamole/UserMapper.java | 120 +++++ .../dao/guacamole/UserPermissionMapper.java | 72 +++ .../mysql/model/guacamole/Connection.java | 99 ++++ .../model/guacamole/ConnectionExample.java | 502 ++++++++++++++++++ .../model/guacamole/ConnectionParameter.java | 35 ++ .../guacamole/ConnectionParameterExample.java | 502 ++++++++++++++++++ .../guacamole/ConnectionParameterKey.java | 67 +++ .../ConnectionPermissionExample.java | 492 +++++++++++++++++ .../guacamole/ConnectionPermissionKey.java | 99 ++++ .../guacamole/SystemPermissionExample.java | 432 +++++++++++++++ .../model/guacamole/SystemPermissionKey.java | 67 +++ .../net/auth/mysql/model/guacamole/User.java | 131 +++++ .../mysql/model/guacamole/UserExample.java | 502 ++++++++++++++++++ .../guacamole/UserPermissionExample.java | 492 +++++++++++++++++ .../model/guacamole/UserPermissionKey.java | 99 ++++ .../mysql/xml/guacamole/ConnectionMapper.xml | 256 +++++++++ .../guacamole/ConnectionParameterMapper.xml | 256 +++++++++ .../guacamole/ConnectionPermissionMapper.xml | 219 ++++++++ .../xml/guacamole/SystemPermissionMapper.xml | 205 +++++++ .../auth/mysql/xml/guacamole/UserMapper.xml | 334 ++++++++++++ .../xml/guacamole/UserPermissionMapper.xml | 219 ++++++++ 28 files changed, 5735 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/README create mode 100644 extensions/guacamole-auth-mysql/README.mybatis create mode 100644 extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml diff --git a/extensions/guacamole-auth-mysql/README b/extensions/guacamole-auth-mysql/README new file mode 100644 index 000000000..af229b944 --- /dev/null +++ b/extensions/guacamole-auth-mysql/README @@ -0,0 +1,93 @@ + +------------------------------------------------------------ + About this README +------------------------------------------------------------ + +This README is intended to provide quick and to-the-point documentation for +technical users intending to compile parts of Guacamole themselves. + +Distribution-specific packages are available from the files section of the main +project page: + + http://sourceforge.net/projects/guacamole/files/ + +Distribution-specific documentation is provided on the Guacamole wiki: + + http://guac-dev.org/ + + +------------------------------------------------------------ + What is guacamole-auth-mysql? +------------------------------------------------------------ + +guacamole-auth-ldap is a Java library for use with the Guacamole web +application to provide mysql based authentication. + +guacamole-auth-mysql provides an authentication provider which can be +set in guacamole.properties to allow mysql authentication of Guacamole +users. Additional properties are required to configure the mysql +connection parameters. + +A schema file are provided to create the required tables in your +mysql database. + + +------------------------------------------------------------ + Compiling and installing guacamole-auth-mysql +------------------------------------------------------------ + +guacamole-auth-mysql is built using Maven. Building guacamole-auth-mysql +compiles all classes and packages them into a redistributable .jar file. This +.jar file can be installed in the library directory configured in +guacamole.properties such that the authentication provider is available. + +1) Run mvn package + + $ mvn package + + Maven will download any needed dependencies for building the .jar file. + Once all dependencies have been downloaded, the .jar file will be + created in the target/ subdirectory of the current directory. + +2) Copy the .jar file into the library directory specified in your + guacamole.properties + + You will likely need to do this as root. + + If you do not have a library directory configured in your + guacamole.properties, you will need to specify one. The directory + is specified using the "lib-directory" property. + +3) Set up your MySQL database to authenticate Guacamole users + + A schema file is provided in the schema directory for creating + the guacamole authentication tables in your MySQL database. + +4) Configure guacamole.properties for MySQL + + There are additional properties required by the MySQL JDBC driver + which must be added/changed in your guacamole.properties: + + # Configuration for MySQL connection + mysql-hostname: mysql.host.name + mysql-port: 3306 + mysql-database: guacamole.database.name + mysql-username: user + mysql-password: pass + + +------------------------------------------------------------ + Generating MyBatis ORM mappings +------------------------------------------------------------ + +See the README.mybatis file. + +------------------------------------------------------------ + Reporting problems +------------------------------------------------------------ + +Please report any bugs encountered by opening a new ticket at the Trac system +hosted at: + + http://guac-dev.org/trac/ + diff --git a/extensions/guacamole-auth-mysql/README.mybatis b/extensions/guacamole-auth-mysql/README.mybatis new file mode 100644 index 000000000..559b88ef0 --- /dev/null +++ b/extensions/guacamole-auth-mysql/README.mybatis @@ -0,0 +1,37 @@ + +------------------------------------------------------------ + About this README +------------------------------------------------------------ + +This README is intended to provide quick and to-the-point documentation for +technical users intending to generate MyBatis ORM code for the +guacamole-auth-mysql project. + +------------------------------------------------------------ + MyBatis? +------------------------------------------------------------ + +MyBatis is the orm used for connection to MySQL in the +guacamole-auth-mysql project. For more information about MyBatis, see +http://code.google.com/p/mybatis/ + +------------------------------------------------------------ + Generating the MyBatis mappings +------------------------------------------------------------ + +1) Download the MyBatis mapping generator + + Go to http://code.google.com/p/mybatis/wiki/Generator to download + the MyBatis mapping generator jar. + +2) Set up the MyBatis mapping generator configuration xml + + A commented sample file is provided in docs/examples. + For more information, see the documentation provided in the download from step 1. + +3) Generate the source files + + java -jar mybatis-generator-core-1.3.2.jar -configfile mybatisconfig.xml [-overwrite] + + This command will create the generated java and xml source in the location specified + in the configuration xml. diff --git a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml new file mode 100644 index 000000000..b2110b992 --- /dev/null +++ b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ +
+
+ diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java new file mode 100644 index 000000000..5366034c6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java @@ -0,0 +1,96 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.Connection; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionExample; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(Integer connection_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + Connection selectByPrimaryKey(Integer connection_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(Connection record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java new file mode 100644 index 000000000..f17368249 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java @@ -0,0 +1,97 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameter; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterKey; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionParameterMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(ConnectionParameterKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(ConnectionParameter record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java new file mode 100644 index 000000000..4c2d60456 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(ConnectionPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(ConnectionPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(ConnectionPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java new file mode 100644 index 000000000..1669809b4 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface SystemPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(SystemPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(SystemPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(SystemPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java new file mode 100644 index 000000000..27a5b3d2b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java @@ -0,0 +1,120 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; +import org.apache.ibatis.annotations.Param; + +public interface UserMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(Integer user_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExampleWithBLOBs(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + User selectByPrimaryKey(Integer user_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeyWithBLOBs(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(User record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java new file mode 100644 index 000000000..1f4356e90 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface UserPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(UserPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(UserPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(UserPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java new file mode 100644 index 000000000..25ae414f3 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class Connection { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String connection_name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String protocol; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.connection_id + * + * @return the value of guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.connection_name + * + * @return the value of guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getConnection_name() { + return connection_name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.connection_name + * + * @param connection_name the value for guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_name(String connection_name) { + this.connection_name = connection_name == null ? null : connection_name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.protocol + * + * @return the value of guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getProtocol() { + return protocol; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.protocol + * + * @param protocol the value for guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setProtocol(String protocol) { + this.protocol = protocol == null ? null : protocol.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java new file mode 100644 index 000000000..374a1cd78 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_nameIsNull() { + addCriterion("connection_name is null"); + return (Criteria) this; + } + + public Criteria andConnection_nameIsNotNull() { + addCriterion("connection_name is not null"); + return (Criteria) this; + } + + public Criteria andConnection_nameEqualTo(String value) { + addCriterion("connection_name =", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotEqualTo(String value) { + addCriterion("connection_name <>", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameGreaterThan(String value) { + addCriterion("connection_name >", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameGreaterThanOrEqualTo(String value) { + addCriterion("connection_name >=", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLessThan(String value) { + addCriterion("connection_name <", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLessThanOrEqualTo(String value) { + addCriterion("connection_name <=", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLike(String value) { + addCriterion("connection_name like", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotLike(String value) { + addCriterion("connection_name not like", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameIn(List values) { + addCriterion("connection_name in", values, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotIn(List values) { + addCriterion("connection_name not in", values, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameBetween(String value1, String value2) { + addCriterion("connection_name between", value1, value2, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotBetween(String value1, String value2) { + addCriterion("connection_name not between", value1, value2, "connection_name"); + return (Criteria) this; + } + + public Criteria andProtocolIsNull() { + addCriterion("protocol is null"); + return (Criteria) this; + } + + public Criteria andProtocolIsNotNull() { + addCriterion("protocol is not null"); + return (Criteria) this; + } + + public Criteria andProtocolEqualTo(String value) { + addCriterion("protocol =", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotEqualTo(String value) { + addCriterion("protocol <>", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolGreaterThan(String value) { + addCriterion("protocol >", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolGreaterThanOrEqualTo(String value) { + addCriterion("protocol >=", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLessThan(String value) { + addCriterion("protocol <", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLessThanOrEqualTo(String value) { + addCriterion("protocol <=", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLike(String value) { + addCriterion("protocol like", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotLike(String value) { + addCriterion("protocol not like", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolIn(List values) { + addCriterion("protocol in", values, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotIn(List values) { + addCriterion("protocol not in", values, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolBetween(String value1, String value2) { + addCriterion("protocol between", value1, value2, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotBetween(String value1, String value2) { + addCriterion("protocol not between", value1, value2, "protocol"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java new file mode 100644 index 000000000..2a2d73bc1 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java @@ -0,0 +1,35 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionParameter extends ConnectionParameterKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String parameter_value; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @return the value of guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getParameter_value() { + return parameter_value; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setParameter_value(String parameter_value) { + this.parameter_value = parameter_value == null ? null : parameter_value.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java new file mode 100644 index 000000000..be25c918b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionParameterExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionParameterExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andParameter_nameIsNull() { + addCriterion("parameter_name is null"); + return (Criteria) this; + } + + public Criteria andParameter_nameIsNotNull() { + addCriterion("parameter_name is not null"); + return (Criteria) this; + } + + public Criteria andParameter_nameEqualTo(String value) { + addCriterion("parameter_name =", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotEqualTo(String value) { + addCriterion("parameter_name <>", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameGreaterThan(String value) { + addCriterion("parameter_name >", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameGreaterThanOrEqualTo(String value) { + addCriterion("parameter_name >=", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLessThan(String value) { + addCriterion("parameter_name <", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLessThanOrEqualTo(String value) { + addCriterion("parameter_name <=", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLike(String value) { + addCriterion("parameter_name like", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotLike(String value) { + addCriterion("parameter_name not like", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameIn(List values) { + addCriterion("parameter_name in", values, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotIn(List values) { + addCriterion("parameter_name not in", values, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameBetween(String value1, String value2) { + addCriterion("parameter_name between", value1, value2, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotBetween(String value1, String value2) { + addCriterion("parameter_name not between", value1, value2, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_valueIsNull() { + addCriterion("parameter_value is null"); + return (Criteria) this; + } + + public Criteria andParameter_valueIsNotNull() { + addCriterion("parameter_value is not null"); + return (Criteria) this; + } + + public Criteria andParameter_valueEqualTo(String value) { + addCriterion("parameter_value =", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotEqualTo(String value) { + addCriterion("parameter_value <>", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueGreaterThan(String value) { + addCriterion("parameter_value >", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueGreaterThanOrEqualTo(String value) { + addCriterion("parameter_value >=", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLessThan(String value) { + addCriterion("parameter_value <", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLessThanOrEqualTo(String value) { + addCriterion("parameter_value <=", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLike(String value) { + addCriterion("parameter_value like", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotLike(String value) { + addCriterion("parameter_value not like", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueIn(List values) { + addCriterion("parameter_value in", values, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotIn(List values) { + addCriterion("parameter_value not in", values, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueBetween(String value1, String value2) { + addCriterion("parameter_value between", value1, value2, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotBetween(String value1, String value2) { + addCriterion("parameter_value not between", value1, value2, "parameter_value"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java new file mode 100644 index 000000000..986dbb4e4 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionParameterKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String parameter_name; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.connection_id + * + * @return the value of guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @return the value of guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getParameter_name() { + return parameter_name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setParameter_name(String parameter_name) { + this.parameter_name = parameter_name == null ? null : parameter_name.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java new file mode 100644 index 000000000..a65cde408 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java @@ -0,0 +1,492 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java new file mode 100644 index 000000000..7e496190e --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.user_id + * + * @return the value of guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.user_id + * + * @param user_id the value for guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.connection_id + * + * @return the value of guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.permission + * + * @return the value of guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.permission + * + * @param permission the value for guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java new file mode 100644 index 000000000..7c972fd93 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java @@ -0,0 +1,432 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class SystemPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public SystemPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java new file mode 100644 index 000000000..920341d47 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class SystemPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_system_permission.user_id + * + * @return the value of guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_system_permission.user_id + * + * @param user_id the value for guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_system_permission.permission + * + * @return the value of guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_system_permission.permission + * + * @param permission the value for guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java new file mode 100644 index 000000000..3f2da3baa --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java @@ -0,0 +1,131 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class User { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String username; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String password_salt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private byte[] password_hash; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.user_id + * + * @return the value of guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.user_id + * + * @param user_id the value for guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.username + * + * @return the value of guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getUsername() { + return username; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.username + * + * @param username the value for guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_salt + * + * @return the value of guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPassword_salt() { + return password_salt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_salt + * + * @param password_salt the value for guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPassword_salt(String password_salt) { + this.password_salt = password_salt == null ? null : password_salt.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_hash + * + * @return the value of guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public byte[] getPassword_hash() { + return password_hash; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_hash + * + * @param password_hash the value for guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPassword_hash(byte[] password_hash) { + this.password_hash = password_hash; + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java new file mode 100644 index 000000000..3b8d8f09c --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class UserExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public UserExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andPassword_saltIsNull() { + addCriterion("password_salt is null"); + return (Criteria) this; + } + + public Criteria andPassword_saltIsNotNull() { + addCriterion("password_salt is not null"); + return (Criteria) this; + } + + public Criteria andPassword_saltEqualTo(String value) { + addCriterion("password_salt =", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotEqualTo(String value) { + addCriterion("password_salt <>", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltGreaterThan(String value) { + addCriterion("password_salt >", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltGreaterThanOrEqualTo(String value) { + addCriterion("password_salt >=", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLessThan(String value) { + addCriterion("password_salt <", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLessThanOrEqualTo(String value) { + addCriterion("password_salt <=", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLike(String value) { + addCriterion("password_salt like", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotLike(String value) { + addCriterion("password_salt not like", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltIn(List values) { + addCriterion("password_salt in", values, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotIn(List values) { + addCriterion("password_salt not in", values, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltBetween(String value1, String value2) { + addCriterion("password_salt between", value1, value2, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotBetween(String value1, String value2) { + addCriterion("password_salt not between", value1, value2, "password_salt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java new file mode 100644 index 000000000..6902d9515 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java @@ -0,0 +1,492 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class UserPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public UserPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIsNull() { + addCriterion("affected_user_id is null"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIsNotNull() { + addCriterion("affected_user_id is not null"); + return (Criteria) this; + } + + public Criteria andAffected_user_idEqualTo(Integer value) { + addCriterion("affected_user_id =", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotEqualTo(Integer value) { + addCriterion("affected_user_id <>", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idGreaterThan(Integer value) { + addCriterion("affected_user_id >", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idGreaterThanOrEqualTo(Integer value) { + addCriterion("affected_user_id >=", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idLessThan(Integer value) { + addCriterion("affected_user_id <", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idLessThanOrEqualTo(Integer value) { + addCriterion("affected_user_id <=", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIn(List values) { + addCriterion("affected_user_id in", values, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotIn(List values) { + addCriterion("affected_user_id not in", values, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idBetween(Integer value1, Integer value2) { + addCriterion("affected_user_id between", value1, value2, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotBetween(Integer value1, Integer value2) { + addCriterion("affected_user_id not between", value1, value2, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java new file mode 100644 index 000000000..f9e966bb7 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class UserPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer affected_user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.user_id + * + * @return the value of guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.user_id + * + * @param user_id the value for guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.affected_user_id + * + * @return the value of guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getAffected_user_id() { + return affected_user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.affected_user_id + * + * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setAffected_user_id(Integer affected_user_id) { + this.affected_user_id = affected_user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.permission + * + * @return the value of guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.permission + * + * @param permission the value for guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml new file mode 100644 index 000000000..376ac3269 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + connection_id, connection_name, protocol + + + + + + delete from guacamole..guacamole_connection + where connection_id = #{connection_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_connection + + + + + + + insert into guacamole..guacamole_connection (connection_id, connection_name, protocol + ) + values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} + ) + + + + insert into guacamole..guacamole_connection + + + connection_id, + + + connection_name, + + + protocol, + + + + + #{connection_id,jdbcType=INTEGER}, + + + #{connection_name,jdbcType=VARCHAR}, + + + #{protocol,jdbcType=VARCHAR}, + + + + + + + update guacamole..guacamole_connection + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + connection_name = #{record.connection_name,jdbcType=VARCHAR}, + + + protocol = #{record.protocol,jdbcType=VARCHAR}, + + + + + + + + + update guacamole..guacamole_connection + set connection_id = #{record.connection_id,jdbcType=INTEGER}, + connection_name = #{record.connection_name,jdbcType=VARCHAR}, + protocol = #{record.protocol,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_connection + + + connection_name = #{connection_name,jdbcType=VARCHAR}, + + + protocol = #{protocol,jdbcType=VARCHAR}, + + + where connection_id = #{connection_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_connection + set connection_name = #{connection_name,jdbcType=VARCHAR}, + protocol = #{protocol,jdbcType=VARCHAR} + where connection_id = #{connection_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml new file mode 100644 index 000000000..44b175d1f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + connection_id, parameter_name, parameter_value + + + + + + delete from guacamole..guacamole_connection_parameter + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + + + delete from guacamole..guacamole_connection_parameter + + + + + + + insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value + ) + values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} + ) + + + + insert into guacamole..guacamole_connection_parameter + + + connection_id, + + + parameter_name, + + + parameter_value, + + + + + #{connection_id,jdbcType=INTEGER}, + + + #{parameter_name,jdbcType=VARCHAR}, + + + #{parameter_value,jdbcType=VARCHAR}, + + + + + + + update guacamole..guacamole_connection_parameter + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, + + + parameter_value = #{record.parameter_value,jdbcType=VARCHAR}, + + + + + + + + + update guacamole..guacamole_connection_parameter + set connection_id = #{record.connection_id,jdbcType=INTEGER}, + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, + parameter_value = #{record.parameter_value,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_connection_parameter + + + parameter_value = #{parameter_value,jdbcType=VARCHAR}, + + + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + + + update guacamole..guacamole_connection_parameter + set parameter_value = #{parameter_value,jdbcType=VARCHAR} + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml new file mode 100644 index 000000000..8f522958b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, connection_id, permission + + + + + delete from guacamole..guacamole_connection_permission + where user_id = #{user_id,jdbcType=INTEGER} + and connection_id = #{connection_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_connection_permission + + + + + + + insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission + ) + values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} + ) + + + + insert into guacamole..guacamole_connection_permission + + + user_id, + + + connection_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{connection_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_connection_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_connection_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + connection_id = #{record.connection_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml new file mode 100644 index 000000000..40f3da6bc --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, permission + + + + + delete from guacamole..guacamole_system_permission + where user_id = #{user_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_system_permission + + + + + + + insert into guacamole..guacamole_system_permission (user_id, permission) + values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) + + + + insert into guacamole..guacamole_system_permission + + + user_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_system_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_system_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml new file mode 100644 index 000000000..d1abca0f6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, username, password_salt + + + + password_hash + + + + + + + delete from guacamole..guacamole_user + where user_id = #{user_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_user + + + + + + + insert into guacamole..guacamole_user (user_id, username, password_salt, + password_hash) + values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_salt,jdbcType=VARCHAR}, + #{password_hash,jdbcType=BINARY}) + + + + insert into guacamole..guacamole_user + + + user_id, + + + username, + + + password_salt, + + + password_hash, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{username,jdbcType=VARCHAR}, + + + #{password_salt,jdbcType=VARCHAR}, + + + #{password_hash,jdbcType=BINARY}, + + + + + + + update guacamole..guacamole_user + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + password_salt = #{record.password_salt,jdbcType=VARCHAR}, + + + password_hash = #{record.password_hash,jdbcType=BINARY}, + + + + + + + + + update guacamole..guacamole_user + set user_id = #{record.user_id,jdbcType=INTEGER}, + username = #{record.username,jdbcType=VARCHAR}, + password_salt = #{record.password_salt,jdbcType=VARCHAR}, + password_hash = #{record.password_hash,jdbcType=BINARY} + + + + + + + update guacamole..guacamole_user + set user_id = #{record.user_id,jdbcType=INTEGER}, + username = #{record.username,jdbcType=VARCHAR}, + password_salt = #{record.password_salt,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_user + + + username = #{username,jdbcType=VARCHAR}, + + + password_salt = #{password_salt,jdbcType=VARCHAR}, + + + password_hash = #{password_hash,jdbcType=BINARY}, + + + where user_id = #{user_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_user + set username = #{username,jdbcType=VARCHAR}, + password_salt = #{password_salt,jdbcType=VARCHAR}, + password_hash = #{password_hash,jdbcType=BINARY} + where user_id = #{user_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_user + set username = #{username,jdbcType=VARCHAR}, + password_salt = #{password_salt,jdbcType=VARCHAR} + where user_id = #{user_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml new file mode 100644 index 000000000..5d27de207 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, affected_user_id, permission + + + + + delete from guacamole..guacamole_user_permission + where user_id = #{user_id,jdbcType=INTEGER} + and affected_user_id = #{affected_user_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_user_permission + + + + + + + insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission + ) + values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} + ) + + + + insert into guacamole..guacamole_user_permission + + + user_id, + + + affected_user_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{affected_user_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_user_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_user_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file From b32e34e9ed7c304955142e410a4f6e451a180139 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 5 Feb 2013 21:13:22 -0800 Subject: [PATCH 008/109] Ticket #269: Created some documentation and included generated MyBatis mappings. --- extensions/guacamole-auth-mysql/README | 93 ++++ .../guacamole-auth-mysql/README.mybatis | 37 ++ .../doc/examples/mybatisGeneratorConfig.xml | 68 +++ .../mysql/dao/guacamole/ConnectionMapper.java | 96 ++++ .../guacamole/ConnectionParameterMapper.java | 97 ++++ .../guacamole/ConnectionPermissionMapper.java | 72 +++ .../dao/guacamole/SystemPermissionMapper.java | 72 +++ .../auth/mysql/dao/guacamole/UserMapper.java | 120 +++++ .../dao/guacamole/UserPermissionMapper.java | 72 +++ .../mysql/model/guacamole/Connection.java | 99 ++++ .../model/guacamole/ConnectionExample.java | 502 ++++++++++++++++++ .../model/guacamole/ConnectionParameter.java | 35 ++ .../guacamole/ConnectionParameterExample.java | 502 ++++++++++++++++++ .../guacamole/ConnectionParameterKey.java | 67 +++ .../ConnectionPermissionExample.java | 492 +++++++++++++++++ .../guacamole/ConnectionPermissionKey.java | 99 ++++ .../guacamole/SystemPermissionExample.java | 432 +++++++++++++++ .../model/guacamole/SystemPermissionKey.java | 67 +++ .../net/auth/mysql/model/guacamole/User.java | 131 +++++ .../mysql/model/guacamole/UserExample.java | 502 ++++++++++++++++++ .../guacamole/UserPermissionExample.java | 492 +++++++++++++++++ .../model/guacamole/UserPermissionKey.java | 99 ++++ .../mysql/xml/guacamole/ConnectionMapper.xml | 256 +++++++++ .../guacamole/ConnectionParameterMapper.xml | 256 +++++++++ .../guacamole/ConnectionPermissionMapper.xml | 219 ++++++++ .../xml/guacamole/SystemPermissionMapper.xml | 205 +++++++ .../auth/mysql/xml/guacamole/UserMapper.xml | 334 ++++++++++++ .../xml/guacamole/UserPermissionMapper.xml | 219 ++++++++ 28 files changed, 5735 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/README create mode 100644 extensions/guacamole-auth-mysql/README.mybatis create mode 100644 extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml diff --git a/extensions/guacamole-auth-mysql/README b/extensions/guacamole-auth-mysql/README new file mode 100644 index 000000000..af229b944 --- /dev/null +++ b/extensions/guacamole-auth-mysql/README @@ -0,0 +1,93 @@ + +------------------------------------------------------------ + About this README +------------------------------------------------------------ + +This README is intended to provide quick and to-the-point documentation for +technical users intending to compile parts of Guacamole themselves. + +Distribution-specific packages are available from the files section of the main +project page: + + http://sourceforge.net/projects/guacamole/files/ + +Distribution-specific documentation is provided on the Guacamole wiki: + + http://guac-dev.org/ + + +------------------------------------------------------------ + What is guacamole-auth-mysql? +------------------------------------------------------------ + +guacamole-auth-ldap is a Java library for use with the Guacamole web +application to provide mysql based authentication. + +guacamole-auth-mysql provides an authentication provider which can be +set in guacamole.properties to allow mysql authentication of Guacamole +users. Additional properties are required to configure the mysql +connection parameters. + +A schema file are provided to create the required tables in your +mysql database. + + +------------------------------------------------------------ + Compiling and installing guacamole-auth-mysql +------------------------------------------------------------ + +guacamole-auth-mysql is built using Maven. Building guacamole-auth-mysql +compiles all classes and packages them into a redistributable .jar file. This +.jar file can be installed in the library directory configured in +guacamole.properties such that the authentication provider is available. + +1) Run mvn package + + $ mvn package + + Maven will download any needed dependencies for building the .jar file. + Once all dependencies have been downloaded, the .jar file will be + created in the target/ subdirectory of the current directory. + +2) Copy the .jar file into the library directory specified in your + guacamole.properties + + You will likely need to do this as root. + + If you do not have a library directory configured in your + guacamole.properties, you will need to specify one. The directory + is specified using the "lib-directory" property. + +3) Set up your MySQL database to authenticate Guacamole users + + A schema file is provided in the schema directory for creating + the guacamole authentication tables in your MySQL database. + +4) Configure guacamole.properties for MySQL + + There are additional properties required by the MySQL JDBC driver + which must be added/changed in your guacamole.properties: + + # Configuration for MySQL connection + mysql-hostname: mysql.host.name + mysql-port: 3306 + mysql-database: guacamole.database.name + mysql-username: user + mysql-password: pass + + +------------------------------------------------------------ + Generating MyBatis ORM mappings +------------------------------------------------------------ + +See the README.mybatis file. + +------------------------------------------------------------ + Reporting problems +------------------------------------------------------------ + +Please report any bugs encountered by opening a new ticket at the Trac system +hosted at: + + http://guac-dev.org/trac/ + diff --git a/extensions/guacamole-auth-mysql/README.mybatis b/extensions/guacamole-auth-mysql/README.mybatis new file mode 100644 index 000000000..559b88ef0 --- /dev/null +++ b/extensions/guacamole-auth-mysql/README.mybatis @@ -0,0 +1,37 @@ + +------------------------------------------------------------ + About this README +------------------------------------------------------------ + +This README is intended to provide quick and to-the-point documentation for +technical users intending to generate MyBatis ORM code for the +guacamole-auth-mysql project. + +------------------------------------------------------------ + MyBatis? +------------------------------------------------------------ + +MyBatis is the orm used for connection to MySQL in the +guacamole-auth-mysql project. For more information about MyBatis, see +http://code.google.com/p/mybatis/ + +------------------------------------------------------------ + Generating the MyBatis mappings +------------------------------------------------------------ + +1) Download the MyBatis mapping generator + + Go to http://code.google.com/p/mybatis/wiki/Generator to download + the MyBatis mapping generator jar. + +2) Set up the MyBatis mapping generator configuration xml + + A commented sample file is provided in docs/examples. + For more information, see the documentation provided in the download from step 1. + +3) Generate the source files + + java -jar mybatis-generator-core-1.3.2.jar -configfile mybatisconfig.xml [-overwrite] + + This command will create the generated java and xml source in the location specified + in the configuration xml. diff --git a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml new file mode 100644 index 000000000..b2110b992 --- /dev/null +++ b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ +
+
+ diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java new file mode 100644 index 000000000..5366034c6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java @@ -0,0 +1,96 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.Connection; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionExample; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(Integer connection_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + Connection selectByPrimaryKey(Integer connection_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(Connection record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java new file mode 100644 index 000000000..f17368249 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java @@ -0,0 +1,97 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameter; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterKey; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionParameterMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(ConnectionParameterKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(ConnectionParameter record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java new file mode 100644 index 000000000..4c2d60456 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(ConnectionPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(ConnectionPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(ConnectionPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java new file mode 100644 index 000000000..1669809b4 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface SystemPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(SystemPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(SystemPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(SystemPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java new file mode 100644 index 000000000..27a5b3d2b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java @@ -0,0 +1,120 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; +import org.apache.ibatis.annotations.Param; + +public interface UserMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(Integer user_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExampleWithBLOBs(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + User selectByPrimaryKey(Integer user_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeyWithBLOBs(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(User record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java new file mode 100644 index 000000000..1f4356e90 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface UserPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(UserPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(UserPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(UserPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java new file mode 100644 index 000000000..25ae414f3 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class Connection { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String connection_name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String protocol; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.connection_id + * + * @return the value of guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.connection_name + * + * @return the value of guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getConnection_name() { + return connection_name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.connection_name + * + * @param connection_name the value for guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_name(String connection_name) { + this.connection_name = connection_name == null ? null : connection_name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.protocol + * + * @return the value of guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getProtocol() { + return protocol; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.protocol + * + * @param protocol the value for guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setProtocol(String protocol) { + this.protocol = protocol == null ? null : protocol.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java new file mode 100644 index 000000000..374a1cd78 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_nameIsNull() { + addCriterion("connection_name is null"); + return (Criteria) this; + } + + public Criteria andConnection_nameIsNotNull() { + addCriterion("connection_name is not null"); + return (Criteria) this; + } + + public Criteria andConnection_nameEqualTo(String value) { + addCriterion("connection_name =", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotEqualTo(String value) { + addCriterion("connection_name <>", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameGreaterThan(String value) { + addCriterion("connection_name >", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameGreaterThanOrEqualTo(String value) { + addCriterion("connection_name >=", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLessThan(String value) { + addCriterion("connection_name <", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLessThanOrEqualTo(String value) { + addCriterion("connection_name <=", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLike(String value) { + addCriterion("connection_name like", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotLike(String value) { + addCriterion("connection_name not like", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameIn(List values) { + addCriterion("connection_name in", values, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotIn(List values) { + addCriterion("connection_name not in", values, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameBetween(String value1, String value2) { + addCriterion("connection_name between", value1, value2, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotBetween(String value1, String value2) { + addCriterion("connection_name not between", value1, value2, "connection_name"); + return (Criteria) this; + } + + public Criteria andProtocolIsNull() { + addCriterion("protocol is null"); + return (Criteria) this; + } + + public Criteria andProtocolIsNotNull() { + addCriterion("protocol is not null"); + return (Criteria) this; + } + + public Criteria andProtocolEqualTo(String value) { + addCriterion("protocol =", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotEqualTo(String value) { + addCriterion("protocol <>", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolGreaterThan(String value) { + addCriterion("protocol >", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolGreaterThanOrEqualTo(String value) { + addCriterion("protocol >=", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLessThan(String value) { + addCriterion("protocol <", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLessThanOrEqualTo(String value) { + addCriterion("protocol <=", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLike(String value) { + addCriterion("protocol like", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotLike(String value) { + addCriterion("protocol not like", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolIn(List values) { + addCriterion("protocol in", values, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotIn(List values) { + addCriterion("protocol not in", values, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolBetween(String value1, String value2) { + addCriterion("protocol between", value1, value2, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotBetween(String value1, String value2) { + addCriterion("protocol not between", value1, value2, "protocol"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java new file mode 100644 index 000000000..2a2d73bc1 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java @@ -0,0 +1,35 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionParameter extends ConnectionParameterKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String parameter_value; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @return the value of guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getParameter_value() { + return parameter_value; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setParameter_value(String parameter_value) { + this.parameter_value = parameter_value == null ? null : parameter_value.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java new file mode 100644 index 000000000..be25c918b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionParameterExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionParameterExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andParameter_nameIsNull() { + addCriterion("parameter_name is null"); + return (Criteria) this; + } + + public Criteria andParameter_nameIsNotNull() { + addCriterion("parameter_name is not null"); + return (Criteria) this; + } + + public Criteria andParameter_nameEqualTo(String value) { + addCriterion("parameter_name =", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotEqualTo(String value) { + addCriterion("parameter_name <>", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameGreaterThan(String value) { + addCriterion("parameter_name >", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameGreaterThanOrEqualTo(String value) { + addCriterion("parameter_name >=", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLessThan(String value) { + addCriterion("parameter_name <", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLessThanOrEqualTo(String value) { + addCriterion("parameter_name <=", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLike(String value) { + addCriterion("parameter_name like", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotLike(String value) { + addCriterion("parameter_name not like", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameIn(List values) { + addCriterion("parameter_name in", values, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotIn(List values) { + addCriterion("parameter_name not in", values, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameBetween(String value1, String value2) { + addCriterion("parameter_name between", value1, value2, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotBetween(String value1, String value2) { + addCriterion("parameter_name not between", value1, value2, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_valueIsNull() { + addCriterion("parameter_value is null"); + return (Criteria) this; + } + + public Criteria andParameter_valueIsNotNull() { + addCriterion("parameter_value is not null"); + return (Criteria) this; + } + + public Criteria andParameter_valueEqualTo(String value) { + addCriterion("parameter_value =", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotEqualTo(String value) { + addCriterion("parameter_value <>", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueGreaterThan(String value) { + addCriterion("parameter_value >", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueGreaterThanOrEqualTo(String value) { + addCriterion("parameter_value >=", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLessThan(String value) { + addCriterion("parameter_value <", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLessThanOrEqualTo(String value) { + addCriterion("parameter_value <=", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLike(String value) { + addCriterion("parameter_value like", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotLike(String value) { + addCriterion("parameter_value not like", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueIn(List values) { + addCriterion("parameter_value in", values, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotIn(List values) { + addCriterion("parameter_value not in", values, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueBetween(String value1, String value2) { + addCriterion("parameter_value between", value1, value2, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotBetween(String value1, String value2) { + addCriterion("parameter_value not between", value1, value2, "parameter_value"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java new file mode 100644 index 000000000..986dbb4e4 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionParameterKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String parameter_name; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.connection_id + * + * @return the value of guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @return the value of guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getParameter_name() { + return parameter_name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setParameter_name(String parameter_name) { + this.parameter_name = parameter_name == null ? null : parameter_name.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java new file mode 100644 index 000000000..a65cde408 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java @@ -0,0 +1,492 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java new file mode 100644 index 000000000..7e496190e --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.user_id + * + * @return the value of guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.user_id + * + * @param user_id the value for guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.connection_id + * + * @return the value of guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.permission + * + * @return the value of guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.permission + * + * @param permission the value for guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java new file mode 100644 index 000000000..7c972fd93 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java @@ -0,0 +1,432 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class SystemPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public SystemPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java new file mode 100644 index 000000000..920341d47 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class SystemPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_system_permission.user_id + * + * @return the value of guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_system_permission.user_id + * + * @param user_id the value for guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_system_permission.permission + * + * @return the value of guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_system_permission.permission + * + * @param permission the value for guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java new file mode 100644 index 000000000..3f2da3baa --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java @@ -0,0 +1,131 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class User { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String username; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String password_salt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private byte[] password_hash; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.user_id + * + * @return the value of guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.user_id + * + * @param user_id the value for guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.username + * + * @return the value of guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getUsername() { + return username; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.username + * + * @param username the value for guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_salt + * + * @return the value of guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPassword_salt() { + return password_salt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_salt + * + * @param password_salt the value for guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPassword_salt(String password_salt) { + this.password_salt = password_salt == null ? null : password_salt.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_hash + * + * @return the value of guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public byte[] getPassword_hash() { + return password_hash; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_hash + * + * @param password_hash the value for guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPassword_hash(byte[] password_hash) { + this.password_hash = password_hash; + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java new file mode 100644 index 000000000..3b8d8f09c --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class UserExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public UserExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andPassword_saltIsNull() { + addCriterion("password_salt is null"); + return (Criteria) this; + } + + public Criteria andPassword_saltIsNotNull() { + addCriterion("password_salt is not null"); + return (Criteria) this; + } + + public Criteria andPassword_saltEqualTo(String value) { + addCriterion("password_salt =", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotEqualTo(String value) { + addCriterion("password_salt <>", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltGreaterThan(String value) { + addCriterion("password_salt >", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltGreaterThanOrEqualTo(String value) { + addCriterion("password_salt >=", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLessThan(String value) { + addCriterion("password_salt <", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLessThanOrEqualTo(String value) { + addCriterion("password_salt <=", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLike(String value) { + addCriterion("password_salt like", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotLike(String value) { + addCriterion("password_salt not like", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltIn(List values) { + addCriterion("password_salt in", values, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotIn(List values) { + addCriterion("password_salt not in", values, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltBetween(String value1, String value2) { + addCriterion("password_salt between", value1, value2, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotBetween(String value1, String value2) { + addCriterion("password_salt not between", value1, value2, "password_salt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java new file mode 100644 index 000000000..6902d9515 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java @@ -0,0 +1,492 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class UserPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public UserPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIsNull() { + addCriterion("affected_user_id is null"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIsNotNull() { + addCriterion("affected_user_id is not null"); + return (Criteria) this; + } + + public Criteria andAffected_user_idEqualTo(Integer value) { + addCriterion("affected_user_id =", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotEqualTo(Integer value) { + addCriterion("affected_user_id <>", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idGreaterThan(Integer value) { + addCriterion("affected_user_id >", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idGreaterThanOrEqualTo(Integer value) { + addCriterion("affected_user_id >=", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idLessThan(Integer value) { + addCriterion("affected_user_id <", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idLessThanOrEqualTo(Integer value) { + addCriterion("affected_user_id <=", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIn(List values) { + addCriterion("affected_user_id in", values, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotIn(List values) { + addCriterion("affected_user_id not in", values, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idBetween(Integer value1, Integer value2) { + addCriterion("affected_user_id between", value1, value2, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotBetween(Integer value1, Integer value2) { + addCriterion("affected_user_id not between", value1, value2, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java new file mode 100644 index 000000000..f9e966bb7 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class UserPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer affected_user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.user_id + * + * @return the value of guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.user_id + * + * @param user_id the value for guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.affected_user_id + * + * @return the value of guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getAffected_user_id() { + return affected_user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.affected_user_id + * + * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setAffected_user_id(Integer affected_user_id) { + this.affected_user_id = affected_user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.permission + * + * @return the value of guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.permission + * + * @param permission the value for guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml new file mode 100644 index 000000000..376ac3269 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + connection_id, connection_name, protocol + + + + + + delete from guacamole..guacamole_connection + where connection_id = #{connection_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_connection + + + + + + + insert into guacamole..guacamole_connection (connection_id, connection_name, protocol + ) + values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} + ) + + + + insert into guacamole..guacamole_connection + + + connection_id, + + + connection_name, + + + protocol, + + + + + #{connection_id,jdbcType=INTEGER}, + + + #{connection_name,jdbcType=VARCHAR}, + + + #{protocol,jdbcType=VARCHAR}, + + + + + + + update guacamole..guacamole_connection + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + connection_name = #{record.connection_name,jdbcType=VARCHAR}, + + + protocol = #{record.protocol,jdbcType=VARCHAR}, + + + + + + + + + update guacamole..guacamole_connection + set connection_id = #{record.connection_id,jdbcType=INTEGER}, + connection_name = #{record.connection_name,jdbcType=VARCHAR}, + protocol = #{record.protocol,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_connection + + + connection_name = #{connection_name,jdbcType=VARCHAR}, + + + protocol = #{protocol,jdbcType=VARCHAR}, + + + where connection_id = #{connection_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_connection + set connection_name = #{connection_name,jdbcType=VARCHAR}, + protocol = #{protocol,jdbcType=VARCHAR} + where connection_id = #{connection_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml new file mode 100644 index 000000000..44b175d1f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + connection_id, parameter_name, parameter_value + + + + + + delete from guacamole..guacamole_connection_parameter + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + + + delete from guacamole..guacamole_connection_parameter + + + + + + + insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value + ) + values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} + ) + + + + insert into guacamole..guacamole_connection_parameter + + + connection_id, + + + parameter_name, + + + parameter_value, + + + + + #{connection_id,jdbcType=INTEGER}, + + + #{parameter_name,jdbcType=VARCHAR}, + + + #{parameter_value,jdbcType=VARCHAR}, + + + + + + + update guacamole..guacamole_connection_parameter + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, + + + parameter_value = #{record.parameter_value,jdbcType=VARCHAR}, + + + + + + + + + update guacamole..guacamole_connection_parameter + set connection_id = #{record.connection_id,jdbcType=INTEGER}, + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, + parameter_value = #{record.parameter_value,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_connection_parameter + + + parameter_value = #{parameter_value,jdbcType=VARCHAR}, + + + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + + + update guacamole..guacamole_connection_parameter + set parameter_value = #{parameter_value,jdbcType=VARCHAR} + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml new file mode 100644 index 000000000..8f522958b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, connection_id, permission + + + + + delete from guacamole..guacamole_connection_permission + where user_id = #{user_id,jdbcType=INTEGER} + and connection_id = #{connection_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_connection_permission + + + + + + + insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission + ) + values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} + ) + + + + insert into guacamole..guacamole_connection_permission + + + user_id, + + + connection_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{connection_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_connection_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_connection_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + connection_id = #{record.connection_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml new file mode 100644 index 000000000..40f3da6bc --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, permission + + + + + delete from guacamole..guacamole_system_permission + where user_id = #{user_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_system_permission + + + + + + + insert into guacamole..guacamole_system_permission (user_id, permission) + values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) + + + + insert into guacamole..guacamole_system_permission + + + user_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_system_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_system_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml new file mode 100644 index 000000000..d1abca0f6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, username, password_salt + + + + password_hash + + + + + + + delete from guacamole..guacamole_user + where user_id = #{user_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_user + + + + + + + insert into guacamole..guacamole_user (user_id, username, password_salt, + password_hash) + values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_salt,jdbcType=VARCHAR}, + #{password_hash,jdbcType=BINARY}) + + + + insert into guacamole..guacamole_user + + + user_id, + + + username, + + + password_salt, + + + password_hash, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{username,jdbcType=VARCHAR}, + + + #{password_salt,jdbcType=VARCHAR}, + + + #{password_hash,jdbcType=BINARY}, + + + + + + + update guacamole..guacamole_user + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + password_salt = #{record.password_salt,jdbcType=VARCHAR}, + + + password_hash = #{record.password_hash,jdbcType=BINARY}, + + + + + + + + + update guacamole..guacamole_user + set user_id = #{record.user_id,jdbcType=INTEGER}, + username = #{record.username,jdbcType=VARCHAR}, + password_salt = #{record.password_salt,jdbcType=VARCHAR}, + password_hash = #{record.password_hash,jdbcType=BINARY} + + + + + + + update guacamole..guacamole_user + set user_id = #{record.user_id,jdbcType=INTEGER}, + username = #{record.username,jdbcType=VARCHAR}, + password_salt = #{record.password_salt,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_user + + + username = #{username,jdbcType=VARCHAR}, + + + password_salt = #{password_salt,jdbcType=VARCHAR}, + + + password_hash = #{password_hash,jdbcType=BINARY}, + + + where user_id = #{user_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_user + set username = #{username,jdbcType=VARCHAR}, + password_salt = #{password_salt,jdbcType=VARCHAR}, + password_hash = #{password_hash,jdbcType=BINARY} + where user_id = #{user_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_user + set username = #{username,jdbcType=VARCHAR}, + password_salt = #{password_salt,jdbcType=VARCHAR} + where user_id = #{user_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml new file mode 100644 index 000000000..5d27de207 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, affected_user_id, permission + + + + + delete from guacamole..guacamole_user_permission + where user_id = #{user_id,jdbcType=INTEGER} + and affected_user_id = #{affected_user_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_user_permission + + + + + + + insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission + ) + values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} + ) + + + + insert into guacamole..guacamole_user_permission + + + user_id, + + + affected_user_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{affected_user_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_user_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_user_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file From f46397739afb8142ab5dacba7a59875420610605 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 5 Feb 2013 21:27:29 -0800 Subject: [PATCH 009/109] Ticket #269: Fixed documentation formatting problems --- extensions/guacamole-auth-mysql/README | 4 ++-- extensions/guacamole-auth-mysql/README.mybatis | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/guacamole-auth-mysql/README b/extensions/guacamole-auth-mysql/README index af229b944..ffe70495e 100644 --- a/extensions/guacamole-auth-mysql/README +++ b/extensions/guacamole-auth-mysql/README @@ -21,10 +21,10 @@ Distribution-specific documentation is provided on the Guacamole wiki: ------------------------------------------------------------ guacamole-auth-ldap is a Java library for use with the Guacamole web -application to provide mysql based authentication. +application to provide MySQL based authentication. guacamole-auth-mysql provides an authentication provider which can be -set in guacamole.properties to allow mysql authentication of Guacamole +set in guacamole.properties to allow MySQL authentication of Guacamole users. Additional properties are required to configure the mysql connection parameters. diff --git a/extensions/guacamole-auth-mysql/README.mybatis b/extensions/guacamole-auth-mysql/README.mybatis index 559b88ef0..21920cf48 100644 --- a/extensions/guacamole-auth-mysql/README.mybatis +++ b/extensions/guacamole-auth-mysql/README.mybatis @@ -26,12 +26,12 @@ http://code.google.com/p/mybatis/ 2) Set up the MyBatis mapping generator configuration xml - A commented sample file is provided in docs/examples. - For more information, see the documentation provided in the download from step 1. + A commented sample file is provided in docs/examples. For more information + see the documentation provided in the download from step 1. 3) Generate the source files - java -jar mybatis-generator-core-1.3.2.jar -configfile mybatisconfig.xml [-overwrite] + java -jar mybatis-generator-core-1.3.2.jar -configfile mybatisconfig.xml - This command will create the generated java and xml source in the location specified - in the configuration xml. + This command will create the generated java and xml source in the location + specified in the configuration xml. From 2a8893213a97566cbca4a7ab4d24523cf679a81a Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 5 Feb 2013 22:07:46 -0800 Subject: [PATCH 010/109] Ticket #269: Created maven project. --- .../src/main/assembly/dist.xml | 54 ++ .../mysql/dao/guacamole/ConnectionMapper.java | 96 ---- .../guacamole/ConnectionParameterMapper.java | 97 ---- .../guacamole/ConnectionPermissionMapper.java | 72 --- .../dao/guacamole/SystemPermissionMapper.java | 72 --- .../auth/mysql/dao/guacamole/UserMapper.java | 120 ----- .../dao/guacamole/UserPermissionMapper.java | 72 --- .../mysql/model/guacamole/Connection.java | 99 ---- .../model/guacamole/ConnectionExample.java | 502 ------------------ .../model/guacamole/ConnectionParameter.java | 35 -- .../guacamole/ConnectionParameterExample.java | 502 ------------------ .../guacamole/ConnectionParameterKey.java | 67 --- .../ConnectionPermissionExample.java | 492 ----------------- .../guacamole/ConnectionPermissionKey.java | 99 ---- .../guacamole/SystemPermissionExample.java | 432 --------------- .../model/guacamole/SystemPermissionKey.java | 67 --- .../net/auth/mysql/model/guacamole/User.java | 131 ----- .../mysql/model/guacamole/UserExample.java | 502 ------------------ .../guacamole/UserPermissionExample.java | 492 ----------------- .../model/guacamole/UserPermissionKey.java | 99 ---- .../mysql/xml/guacamole/ConnectionMapper.xml | 256 --------- .../guacamole/ConnectionParameterMapper.xml | 256 --------- .../guacamole/ConnectionPermissionMapper.xml | 219 -------- .../xml/guacamole/SystemPermissionMapper.xml | 205 ------- .../auth/mysql/xml/guacamole/UserMapper.xml | 334 ------------ .../xml/guacamole/UserPermissionMapper.xml | 219 -------- 26 files changed, 54 insertions(+), 5537 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/src/main/assembly/dist.xml delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml diff --git a/extensions/guacamole-auth-mysql/src/main/assembly/dist.xml b/extensions/guacamole-auth-mysql/src/main/assembly/dist.xml new file mode 100644 index 000000000..a13bce3e2 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/assembly/dist.xml @@ -0,0 +1,54 @@ + + + dist + ${project.artifactId}-${project.version} + + + + tar.gz + + + + + + + + / + doc + + + + + /schema + schema + + + + + + + + + /lib + runtime + false + true + true + + + + + net.sourceforge.guacamole:guacamole-common + + + net.sourceforge.guacamole:guacamole-ext + + + + + + diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java deleted file mode 100644 index 5366034c6..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java +++ /dev/null @@ -1,96 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.Connection; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionExample; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int countByExample(ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByExample(ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByPrimaryKey(Integer connection_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insert(Connection record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insertSelective(Connection record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExample(ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - Connection selectByPrimaryKey(Integer connection_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKeySelective(Connection record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKey(Connection record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java deleted file mode 100644 index f17368249..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java +++ /dev/null @@ -1,97 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameter; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterKey; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionParameterMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int countByExample(ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByExample(ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByPrimaryKey(ConnectionParameterKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insert(ConnectionParameter record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insertSelective(ConnectionParameter record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExample(ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKeySelective(ConnectionParameter record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKey(ConnectionParameter record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java deleted file mode 100644 index 4c2d60456..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionKey; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionPermissionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int countByExample(ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByExample(ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByPrimaryKey(ConnectionPermissionKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insert(ConnectionPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insertSelective(ConnectionPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExample(ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java deleted file mode 100644 index 1669809b4..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionKey; -import org.apache.ibatis.annotations.Param; - -public interface SystemPermissionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int countByExample(SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByExample(SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByPrimaryKey(SystemPermissionKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insert(SystemPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insertSelective(SystemPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExample(SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java deleted file mode 100644 index 27a5b3d2b..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java +++ /dev/null @@ -1,120 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; -import org.apache.ibatis.annotations.Param; - -public interface UserMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int countByExample(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByExample(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByPrimaryKey(Integer user_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insert(User record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insertSelective(User record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExampleWithBLOBs(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExample(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - User selectByPrimaryKey(Integer user_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExample(@Param("record") User record, @Param("example") UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKeySelective(User record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKeyWithBLOBs(User record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByPrimaryKey(User record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java deleted file mode 100644 index 1f4356e90..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionKey; -import org.apache.ibatis.annotations.Param; - -public interface UserPermissionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int countByExample(UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByExample(UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int deleteByPrimaryKey(UserPermissionKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insert(UserPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int insertSelective(UserPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - List selectByExample(UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java deleted file mode 100644 index 25ae414f3..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class Connection { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection.connection_name - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String connection_name; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection.protocol - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String protocol; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection.connection_id - * - * @return the value of guacamole..guacamole_connection.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection.connection_name - * - * @return the value of guacamole..guacamole_connection.connection_name - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getConnection_name() { - return connection_name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection.connection_name - * - * @param connection_name the value for guacamole..guacamole_connection.connection_name - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setConnection_name(String connection_name) { - this.connection_name = connection_name == null ? null : connection_name.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection.protocol - * - * @return the value of guacamole..guacamole_connection.protocol - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getProtocol() { - return protocol; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection.protocol - * - * @param protocol the value for guacamole..guacamole_connection.protocol - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setProtocol(String protocol) { - this.protocol = protocol == null ? null : protocol.trim(); - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java deleted file mode 100644 index 374a1cd78..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java +++ /dev/null @@ -1,502 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -import java.util.ArrayList; -import java.util.List; - -public class ConnectionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public ConnectionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_nameIsNull() { - addCriterion("connection_name is null"); - return (Criteria) this; - } - - public Criteria andConnection_nameIsNotNull() { - addCriterion("connection_name is not null"); - return (Criteria) this; - } - - public Criteria andConnection_nameEqualTo(String value) { - addCriterion("connection_name =", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotEqualTo(String value) { - addCriterion("connection_name <>", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameGreaterThan(String value) { - addCriterion("connection_name >", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameGreaterThanOrEqualTo(String value) { - addCriterion("connection_name >=", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameLessThan(String value) { - addCriterion("connection_name <", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameLessThanOrEqualTo(String value) { - addCriterion("connection_name <=", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameLike(String value) { - addCriterion("connection_name like", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotLike(String value) { - addCriterion("connection_name not like", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameIn(List values) { - addCriterion("connection_name in", values, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotIn(List values) { - addCriterion("connection_name not in", values, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameBetween(String value1, String value2) { - addCriterion("connection_name between", value1, value2, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotBetween(String value1, String value2) { - addCriterion("connection_name not between", value1, value2, "connection_name"); - return (Criteria) this; - } - - public Criteria andProtocolIsNull() { - addCriterion("protocol is null"); - return (Criteria) this; - } - - public Criteria andProtocolIsNotNull() { - addCriterion("protocol is not null"); - return (Criteria) this; - } - - public Criteria andProtocolEqualTo(String value) { - addCriterion("protocol =", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotEqualTo(String value) { - addCriterion("protocol <>", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolGreaterThan(String value) { - addCriterion("protocol >", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolGreaterThanOrEqualTo(String value) { - addCriterion("protocol >=", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLessThan(String value) { - addCriterion("protocol <", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLessThanOrEqualTo(String value) { - addCriterion("protocol <=", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLike(String value) { - addCriterion("protocol like", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotLike(String value) { - addCriterion("protocol not like", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolIn(List values) { - addCriterion("protocol in", values, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotIn(List values) { - addCriterion("protocol not in", values, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolBetween(String value1, String value2) { - addCriterion("protocol between", value1, value2, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotBetween(String value1, String value2) { - addCriterion("protocol not between", value1, value2, "protocol"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java deleted file mode 100644 index 2a2d73bc1..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class ConnectionParameter extends ConnectionParameterKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String parameter_value; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_value - * - * @return the value of guacamole..guacamole_connection_parameter.parameter_value - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getParameter_value() { - return parameter_value; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_value - * - * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setParameter_value(String parameter_value) { - this.parameter_value = parameter_value == null ? null : parameter_value.trim(); - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java deleted file mode 100644 index be25c918b..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java +++ /dev/null @@ -1,502 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -import java.util.ArrayList; -import java.util.List; - -public class ConnectionParameterExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public ConnectionParameterExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andParameter_nameIsNull() { - addCriterion("parameter_name is null"); - return (Criteria) this; - } - - public Criteria andParameter_nameIsNotNull() { - addCriterion("parameter_name is not null"); - return (Criteria) this; - } - - public Criteria andParameter_nameEqualTo(String value) { - addCriterion("parameter_name =", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotEqualTo(String value) { - addCriterion("parameter_name <>", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameGreaterThan(String value) { - addCriterion("parameter_name >", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameGreaterThanOrEqualTo(String value) { - addCriterion("parameter_name >=", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameLessThan(String value) { - addCriterion("parameter_name <", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameLessThanOrEqualTo(String value) { - addCriterion("parameter_name <=", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameLike(String value) { - addCriterion("parameter_name like", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotLike(String value) { - addCriterion("parameter_name not like", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameIn(List values) { - addCriterion("parameter_name in", values, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotIn(List values) { - addCriterion("parameter_name not in", values, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameBetween(String value1, String value2) { - addCriterion("parameter_name between", value1, value2, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotBetween(String value1, String value2) { - addCriterion("parameter_name not between", value1, value2, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_valueIsNull() { - addCriterion("parameter_value is null"); - return (Criteria) this; - } - - public Criteria andParameter_valueIsNotNull() { - addCriterion("parameter_value is not null"); - return (Criteria) this; - } - - public Criteria andParameter_valueEqualTo(String value) { - addCriterion("parameter_value =", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotEqualTo(String value) { - addCriterion("parameter_value <>", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueGreaterThan(String value) { - addCriterion("parameter_value >", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueGreaterThanOrEqualTo(String value) { - addCriterion("parameter_value >=", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueLessThan(String value) { - addCriterion("parameter_value <", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueLessThanOrEqualTo(String value) { - addCriterion("parameter_value <=", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueLike(String value) { - addCriterion("parameter_value like", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotLike(String value) { - addCriterion("parameter_value not like", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueIn(List values) { - addCriterion("parameter_value in", values, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotIn(List values) { - addCriterion("parameter_value not in", values, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueBetween(String value1, String value2) { - addCriterion("parameter_value between", value1, value2, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotBetween(String value1, String value2) { - addCriterion("parameter_value not between", value1, value2, "parameter_value"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java deleted file mode 100644 index 986dbb4e4..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class ConnectionParameterKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String parameter_name; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_parameter.connection_id - * - * @return the value of guacamole..guacamole_connection_parameter.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_parameter.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_name - * - * @return the value of guacamole..guacamole_connection_parameter.parameter_name - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getParameter_name() { - return parameter_name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_name - * - * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setParameter_name(String parameter_name) { - this.parameter_name = parameter_name == null ? null : parameter_name.trim(); - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java deleted file mode 100644 index a65cde408..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java +++ /dev/null @@ -1,492 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -import java.util.ArrayList; -import java.util.List; - -public class ConnectionPermissionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public ConnectionPermissionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); - return (Criteria) this; - } - - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); - return (Criteria) this; - } - - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java deleted file mode 100644 index 7e496190e..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class ConnectionPermissionKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String permission; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_permission.user_id - * - * @return the value of guacamole..guacamole_connection_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_permission.user_id - * - * @param user_id the value for guacamole..guacamole_connection_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_permission.connection_id - * - * @return the value of guacamole..guacamole_connection_permission.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_permission.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_permission.permission - * - * @return the value of guacamole..guacamole_connection_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getPermission() { - return permission; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_permission.permission - * - * @param permission the value for guacamole..guacamole_connection_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPermission(String permission) { - this.permission = permission == null ? null : permission.trim(); - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java deleted file mode 100644 index 7c972fd93..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java +++ /dev/null @@ -1,432 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -import java.util.ArrayList; -import java.util.List; - -public class SystemPermissionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public SystemPermissionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); - return (Criteria) this; - } - - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); - return (Criteria) this; - } - - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java deleted file mode 100644 index 920341d47..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class SystemPermissionKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_system_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_system_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String permission; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_system_permission.user_id - * - * @return the value of guacamole..guacamole_system_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_system_permission.user_id - * - * @param user_id the value for guacamole..guacamole_system_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_system_permission.permission - * - * @return the value of guacamole..guacamole_system_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getPermission() { - return permission; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_system_permission.permission - * - * @param permission the value for guacamole..guacamole_system_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPermission(String permission) { - this.permission = permission == null ? null : permission.trim(); - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java deleted file mode 100644 index 3f2da3baa..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java +++ /dev/null @@ -1,131 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class User { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String username; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String password_salt; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private byte[] password_hash; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.user_id - * - * @return the value of guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.user_id - * - * @param user_id the value for guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.username - * - * @return the value of guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getUsername() { - return username; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.username - * - * @param username the value for guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUsername(String username) { - this.username = username == null ? null : username.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.password_salt - * - * @return the value of guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getPassword_salt() { - return password_salt; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.password_salt - * - * @param password_salt the value for guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPassword_salt(String password_salt) { - this.password_salt = password_salt == null ? null : password_salt.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.password_hash - * - * @return the value of guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public byte[] getPassword_hash() { - return password_hash; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.password_hash - * - * @param password_hash the value for guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPassword_hash(byte[] password_hash) { - this.password_hash = password_hash; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java deleted file mode 100644 index 3b8d8f09c..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java +++ /dev/null @@ -1,502 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -import java.util.ArrayList; -import java.util.List; - -public class UserExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public UserExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUsernameIsNull() { - addCriterion("username is null"); - return (Criteria) this; - } - - public Criteria andUsernameIsNotNull() { - addCriterion("username is not null"); - return (Criteria) this; - } - - public Criteria andUsernameEqualTo(String value) { - addCriterion("username =", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotEqualTo(String value) { - addCriterion("username <>", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThan(String value) { - addCriterion("username >", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThanOrEqualTo(String value) { - addCriterion("username >=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThan(String value) { - addCriterion("username <", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThanOrEqualTo(String value) { - addCriterion("username <=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLike(String value) { - addCriterion("username like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotLike(String value) { - addCriterion("username not like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameIn(List values) { - addCriterion("username in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotIn(List values) { - addCriterion("username not in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameBetween(String value1, String value2) { - addCriterion("username between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotBetween(String value1, String value2) { - addCriterion("username not between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andPassword_saltIsNull() { - addCriterion("password_salt is null"); - return (Criteria) this; - } - - public Criteria andPassword_saltIsNotNull() { - addCriterion("password_salt is not null"); - return (Criteria) this; - } - - public Criteria andPassword_saltEqualTo(String value) { - addCriterion("password_salt =", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotEqualTo(String value) { - addCriterion("password_salt <>", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltGreaterThan(String value) { - addCriterion("password_salt >", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltGreaterThanOrEqualTo(String value) { - addCriterion("password_salt >=", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltLessThan(String value) { - addCriterion("password_salt <", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltLessThanOrEqualTo(String value) { - addCriterion("password_salt <=", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltLike(String value) { - addCriterion("password_salt like", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotLike(String value) { - addCriterion("password_salt not like", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltIn(List values) { - addCriterion("password_salt in", values, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotIn(List values) { - addCriterion("password_salt not in", values, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltBetween(String value1, String value2) { - addCriterion("password_salt between", value1, value2, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotBetween(String value1, String value2) { - addCriterion("password_salt not between", value1, value2, "password_salt"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java deleted file mode 100644 index 6902d9515..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java +++ /dev/null @@ -1,492 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -import java.util.ArrayList; -import java.util.List; - -public class UserPermissionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public UserPermissionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idIsNull() { - addCriterion("affected_user_id is null"); - return (Criteria) this; - } - - public Criteria andAffected_user_idIsNotNull() { - addCriterion("affected_user_id is not null"); - return (Criteria) this; - } - - public Criteria andAffected_user_idEqualTo(Integer value) { - addCriterion("affected_user_id =", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idNotEqualTo(Integer value) { - addCriterion("affected_user_id <>", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idGreaterThan(Integer value) { - addCriterion("affected_user_id >", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idGreaterThanOrEqualTo(Integer value) { - addCriterion("affected_user_id >=", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idLessThan(Integer value) { - addCriterion("affected_user_id <", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idLessThanOrEqualTo(Integer value) { - addCriterion("affected_user_id <=", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idIn(List values) { - addCriterion("affected_user_id in", values, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idNotIn(List values) { - addCriterion("affected_user_id not in", values, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idBetween(Integer value1, Integer value2) { - addCriterion("affected_user_id between", value1, value2, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idNotBetween(Integer value1, Integer value2) { - addCriterion("affected_user_id not between", value1, value2, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); - return (Criteria) this; - } - - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); - return (Criteria) this; - } - - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java deleted file mode 100644 index f9e966bb7..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class UserPermissionKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer affected_user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String permission; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user_permission.user_id - * - * @return the value of guacamole..guacamole_user_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user_permission.user_id - * - * @param user_id the value for guacamole..guacamole_user_permission.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user_permission.affected_user_id - * - * @return the value of guacamole..guacamole_user_permission.affected_user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getAffected_user_id() { - return affected_user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user_permission.affected_user_id - * - * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setAffected_user_id(Integer affected_user_id) { - this.affected_user_id = affected_user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user_permission.permission - * - * @return the value of guacamole..guacamole_user_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getPermission() { - return permission; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user_permission.permission - * - * @param permission the value for guacamole..guacamole_user_permission.permission - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPermission(String permission) { - this.permission = permission == null ? null : permission.trim(); - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml deleted file mode 100644 index 376ac3269..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - connection_id, connection_name, protocol - - - - - - delete from guacamole..guacamole_connection - where connection_id = #{connection_id,jdbcType=INTEGER} - - - - delete from guacamole..guacamole_connection - - - - - - - insert into guacamole..guacamole_connection (connection_id, connection_name, protocol - ) - values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} - ) - - - - insert into guacamole..guacamole_connection - - - connection_id, - - - connection_name, - - - protocol, - - - - - #{connection_id,jdbcType=INTEGER}, - - - #{connection_name,jdbcType=VARCHAR}, - - - #{protocol,jdbcType=VARCHAR}, - - - - - - - update guacamole..guacamole_connection - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - connection_name = #{record.connection_name,jdbcType=VARCHAR}, - - - protocol = #{record.protocol,jdbcType=VARCHAR}, - - - - - - - - - update guacamole..guacamole_connection - set connection_id = #{record.connection_id,jdbcType=INTEGER}, - connection_name = #{record.connection_name,jdbcType=VARCHAR}, - protocol = #{record.protocol,jdbcType=VARCHAR} - - - - - - - update guacamole..guacamole_connection - - - connection_name = #{connection_name,jdbcType=VARCHAR}, - - - protocol = #{protocol,jdbcType=VARCHAR}, - - - where connection_id = #{connection_id,jdbcType=INTEGER} - - - - update guacamole..guacamole_connection - set connection_name = #{connection_name,jdbcType=VARCHAR}, - protocol = #{protocol,jdbcType=VARCHAR} - where connection_id = #{connection_id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml deleted file mode 100644 index 44b175d1f..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - connection_id, parameter_name, parameter_value - - - - - - delete from guacamole..guacamole_connection_parameter - where connection_id = #{connection_id,jdbcType=INTEGER} - and parameter_name = #{parameter_name,jdbcType=VARCHAR} - - - - delete from guacamole..guacamole_connection_parameter - - - - - - - insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value - ) - values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} - ) - - - - insert into guacamole..guacamole_connection_parameter - - - connection_id, - - - parameter_name, - - - parameter_value, - - - - - #{connection_id,jdbcType=INTEGER}, - - - #{parameter_name,jdbcType=VARCHAR}, - - - #{parameter_value,jdbcType=VARCHAR}, - - - - - - - update guacamole..guacamole_connection_parameter - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, - - - parameter_value = #{record.parameter_value,jdbcType=VARCHAR}, - - - - - - - - - update guacamole..guacamole_connection_parameter - set connection_id = #{record.connection_id,jdbcType=INTEGER}, - parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, - parameter_value = #{record.parameter_value,jdbcType=VARCHAR} - - - - - - - update guacamole..guacamole_connection_parameter - - - parameter_value = #{parameter_value,jdbcType=VARCHAR}, - - - where connection_id = #{connection_id,jdbcType=INTEGER} - and parameter_name = #{parameter_name,jdbcType=VARCHAR} - - - - update guacamole..guacamole_connection_parameter - set parameter_value = #{parameter_value,jdbcType=VARCHAR} - where connection_id = #{connection_id,jdbcType=INTEGER} - and parameter_name = #{parameter_name,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml deleted file mode 100644 index 8f522958b..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, connection_id, permission - - - - - delete from guacamole..guacamole_connection_permission - where user_id = #{user_id,jdbcType=INTEGER} - and connection_id = #{connection_id,jdbcType=INTEGER} - and permission = #{permission,jdbcType=CHAR} - - - - delete from guacamole..guacamole_connection_permission - - - - - - - insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission - ) - values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} - ) - - - - insert into guacamole..guacamole_connection_permission - - - user_id, - - - connection_id, - - - permission, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{connection_id,jdbcType=INTEGER}, - - - #{permission,jdbcType=CHAR}, - - - - - - - update guacamole..guacamole_connection_permission - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - permission = #{record.permission,jdbcType=CHAR}, - - - - - - - - - update guacamole..guacamole_connection_permission - set user_id = #{record.user_id,jdbcType=INTEGER}, - connection_id = #{record.connection_id,jdbcType=INTEGER}, - permission = #{record.permission,jdbcType=CHAR} - - - - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml deleted file mode 100644 index 40f3da6bc..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, permission - - - - - delete from guacamole..guacamole_system_permission - where user_id = #{user_id,jdbcType=INTEGER} - and permission = #{permission,jdbcType=CHAR} - - - - delete from guacamole..guacamole_system_permission - - - - - - - insert into guacamole..guacamole_system_permission (user_id, permission) - values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) - - - - insert into guacamole..guacamole_system_permission - - - user_id, - - - permission, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{permission,jdbcType=CHAR}, - - - - - - - update guacamole..guacamole_system_permission - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - permission = #{record.permission,jdbcType=CHAR}, - - - - - - - - - update guacamole..guacamole_system_permission - set user_id = #{record.user_id,jdbcType=INTEGER}, - permission = #{record.permission,jdbcType=CHAR} - - - - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml deleted file mode 100644 index d1abca0f6..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, username, password_salt - - - - password_hash - - - - - - - delete from guacamole..guacamole_user - where user_id = #{user_id,jdbcType=INTEGER} - - - - delete from guacamole..guacamole_user - - - - - - - insert into guacamole..guacamole_user (user_id, username, password_salt, - password_hash) - values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_salt,jdbcType=VARCHAR}, - #{password_hash,jdbcType=BINARY}) - - - - insert into guacamole..guacamole_user - - - user_id, - - - username, - - - password_salt, - - - password_hash, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{username,jdbcType=VARCHAR}, - - - #{password_salt,jdbcType=VARCHAR}, - - - #{password_hash,jdbcType=BINARY}, - - - - - - - update guacamole..guacamole_user - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - username = #{record.username,jdbcType=VARCHAR}, - - - password_salt = #{record.password_salt,jdbcType=VARCHAR}, - - - password_hash = #{record.password_hash,jdbcType=BINARY}, - - - - - - - - - update guacamole..guacamole_user - set user_id = #{record.user_id,jdbcType=INTEGER}, - username = #{record.username,jdbcType=VARCHAR}, - password_salt = #{record.password_salt,jdbcType=VARCHAR}, - password_hash = #{record.password_hash,jdbcType=BINARY} - - - - - - - update guacamole..guacamole_user - set user_id = #{record.user_id,jdbcType=INTEGER}, - username = #{record.username,jdbcType=VARCHAR}, - password_salt = #{record.password_salt,jdbcType=VARCHAR} - - - - - - - update guacamole..guacamole_user - - - username = #{username,jdbcType=VARCHAR}, - - - password_salt = #{password_salt,jdbcType=VARCHAR}, - - - password_hash = #{password_hash,jdbcType=BINARY}, - - - where user_id = #{user_id,jdbcType=INTEGER} - - - - update guacamole..guacamole_user - set username = #{username,jdbcType=VARCHAR}, - password_salt = #{password_salt,jdbcType=VARCHAR}, - password_hash = #{password_hash,jdbcType=BINARY} - where user_id = #{user_id,jdbcType=INTEGER} - - - - update guacamole..guacamole_user - set username = #{username,jdbcType=VARCHAR}, - password_salt = #{password_salt,jdbcType=VARCHAR} - where user_id = #{user_id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml deleted file mode 100644 index 5d27de207..000000000 --- a/extensions/guacamole-auth-mysql/src/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, affected_user_id, permission - - - - - delete from guacamole..guacamole_user_permission - where user_id = #{user_id,jdbcType=INTEGER} - and affected_user_id = #{affected_user_id,jdbcType=INTEGER} - and permission = #{permission,jdbcType=CHAR} - - - - delete from guacamole..guacamole_user_permission - - - - - - - insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission - ) - values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} - ) - - - - insert into guacamole..guacamole_user_permission - - - user_id, - - - affected_user_id, - - - permission, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{affected_user_id,jdbcType=INTEGER}, - - - #{permission,jdbcType=CHAR}, - - - - - - - update guacamole..guacamole_user_permission - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, - - - permission = #{record.permission,jdbcType=CHAR}, - - - - - - - - - update guacamole..guacamole_user_permission - set user_id = #{record.user_id,jdbcType=INTEGER}, - affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, - permission = #{record.permission,jdbcType=CHAR} - - - - - \ No newline at end of file From 0a1740c886984908f22105f339054ee1339a3f6c Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 5 Feb 2013 22:08:06 -0800 Subject: [PATCH 011/109] Ticket #269: Created maven project. --- .../mysql/dao/guacamole/ConnectionMapper.java | 96 ++++ .../guacamole/ConnectionParameterMapper.java | 97 ++++ .../guacamole/ConnectionPermissionMapper.java | 72 +++ .../dao/guacamole/SystemPermissionMapper.java | 72 +++ .../auth/mysql/dao/guacamole/UserMapper.java | 120 +++++ .../dao/guacamole/UserPermissionMapper.java | 72 +++ .../mysql/model/guacamole/Connection.java | 99 ++++ .../model/guacamole/ConnectionExample.java | 502 ++++++++++++++++++ .../model/guacamole/ConnectionParameter.java | 35 ++ .../guacamole/ConnectionParameterExample.java | 502 ++++++++++++++++++ .../guacamole/ConnectionParameterKey.java | 67 +++ .../ConnectionPermissionExample.java | 492 +++++++++++++++++ .../guacamole/ConnectionPermissionKey.java | 99 ++++ .../guacamole/SystemPermissionExample.java | 432 +++++++++++++++ .../model/guacamole/SystemPermissionKey.java | 67 +++ .../net/auth/mysql/model/guacamole/User.java | 131 +++++ .../mysql/model/guacamole/UserExample.java | 502 ++++++++++++++++++ .../guacamole/UserPermissionExample.java | 492 +++++++++++++++++ .../model/guacamole/UserPermissionKey.java | 99 ++++ .../mysql/xml/guacamole/ConnectionMapper.xml | 256 +++++++++ .../guacamole/ConnectionParameterMapper.xml | 256 +++++++++ .../guacamole/ConnectionPermissionMapper.xml | 219 ++++++++ .../xml/guacamole/SystemPermissionMapper.xml | 205 +++++++ .../auth/mysql/xml/guacamole/UserMapper.xml | 334 ++++++++++++ .../xml/guacamole/UserPermissionMapper.xml | 219 ++++++++ 25 files changed, 5537 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java new file mode 100644 index 000000000..5366034c6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java @@ -0,0 +1,96 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.Connection; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionExample; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(Integer connection_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + Connection selectByPrimaryKey(Integer connection_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(Connection record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(Connection record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java new file mode 100644 index 000000000..f17368249 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java @@ -0,0 +1,97 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameter; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterKey; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionParameterMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(ConnectionParameterKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(ConnectionParameter record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(ConnectionParameter record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java new file mode 100644 index 000000000..4c2d60456 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(ConnectionPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(ConnectionPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(ConnectionPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java new file mode 100644 index 000000000..1669809b4 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface SystemPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(SystemPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(SystemPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(SystemPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java new file mode 100644 index 000000000..27a5b3d2b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java @@ -0,0 +1,120 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; +import org.apache.ibatis.annotations.Param; + +public interface UserMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(Integer user_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExampleWithBLOBs(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + User selectByPrimaryKey(Integer user_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") User record, @Param("example") UserExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeySelective(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKeyWithBLOBs(User record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByPrimaryKey(User record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java new file mode 100644 index 000000000..1f4356e90 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java @@ -0,0 +1,72 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionKey; +import org.apache.ibatis.annotations.Param; + +public interface UserPermissionMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int countByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int deleteByPrimaryKey(UserPermissionKey key); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insert(UserPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int insertSelective(UserPermissionKey record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + List selectByExample(UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java new file mode 100644 index 000000000..25ae414f3 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class Connection { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String connection_name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String protocol; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.connection_id + * + * @return the value of guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.connection_name + * + * @return the value of guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getConnection_name() { + return connection_name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.connection_name + * + * @param connection_name the value for guacamole..guacamole_connection.connection_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_name(String connection_name) { + this.connection_name = connection_name == null ? null : connection_name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection.protocol + * + * @return the value of guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getProtocol() { + return protocol; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection.protocol + * + * @param protocol the value for guacamole..guacamole_connection.protocol + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setProtocol(String protocol) { + this.protocol = protocol == null ? null : protocol.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java new file mode 100644 index 000000000..374a1cd78 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_nameIsNull() { + addCriterion("connection_name is null"); + return (Criteria) this; + } + + public Criteria andConnection_nameIsNotNull() { + addCriterion("connection_name is not null"); + return (Criteria) this; + } + + public Criteria andConnection_nameEqualTo(String value) { + addCriterion("connection_name =", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotEqualTo(String value) { + addCriterion("connection_name <>", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameGreaterThan(String value) { + addCriterion("connection_name >", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameGreaterThanOrEqualTo(String value) { + addCriterion("connection_name >=", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLessThan(String value) { + addCriterion("connection_name <", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLessThanOrEqualTo(String value) { + addCriterion("connection_name <=", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameLike(String value) { + addCriterion("connection_name like", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotLike(String value) { + addCriterion("connection_name not like", value, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameIn(List values) { + addCriterion("connection_name in", values, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotIn(List values) { + addCriterion("connection_name not in", values, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameBetween(String value1, String value2) { + addCriterion("connection_name between", value1, value2, "connection_name"); + return (Criteria) this; + } + + public Criteria andConnection_nameNotBetween(String value1, String value2) { + addCriterion("connection_name not between", value1, value2, "connection_name"); + return (Criteria) this; + } + + public Criteria andProtocolIsNull() { + addCriterion("protocol is null"); + return (Criteria) this; + } + + public Criteria andProtocolIsNotNull() { + addCriterion("protocol is not null"); + return (Criteria) this; + } + + public Criteria andProtocolEqualTo(String value) { + addCriterion("protocol =", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotEqualTo(String value) { + addCriterion("protocol <>", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolGreaterThan(String value) { + addCriterion("protocol >", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolGreaterThanOrEqualTo(String value) { + addCriterion("protocol >=", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLessThan(String value) { + addCriterion("protocol <", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLessThanOrEqualTo(String value) { + addCriterion("protocol <=", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolLike(String value) { + addCriterion("protocol like", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotLike(String value) { + addCriterion("protocol not like", value, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolIn(List values) { + addCriterion("protocol in", values, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotIn(List values) { + addCriterion("protocol not in", values, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolBetween(String value1, String value2) { + addCriterion("protocol between", value1, value2, "protocol"); + return (Criteria) this; + } + + public Criteria andProtocolNotBetween(String value1, String value2) { + addCriterion("protocol not between", value1, value2, "protocol"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java new file mode 100644 index 000000000..2a2d73bc1 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java @@ -0,0 +1,35 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionParameter extends ConnectionParameterKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String parameter_value; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @return the value of guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getParameter_value() { + return parameter_value; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_value + * + * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setParameter_value(String parameter_value) { + this.parameter_value = parameter_value == null ? null : parameter_value.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java new file mode 100644 index 000000000..be25c918b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionParameterExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionParameterExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andParameter_nameIsNull() { + addCriterion("parameter_name is null"); + return (Criteria) this; + } + + public Criteria andParameter_nameIsNotNull() { + addCriterion("parameter_name is not null"); + return (Criteria) this; + } + + public Criteria andParameter_nameEqualTo(String value) { + addCriterion("parameter_name =", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotEqualTo(String value) { + addCriterion("parameter_name <>", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameGreaterThan(String value) { + addCriterion("parameter_name >", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameGreaterThanOrEqualTo(String value) { + addCriterion("parameter_name >=", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLessThan(String value) { + addCriterion("parameter_name <", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLessThanOrEqualTo(String value) { + addCriterion("parameter_name <=", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameLike(String value) { + addCriterion("parameter_name like", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotLike(String value) { + addCriterion("parameter_name not like", value, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameIn(List values) { + addCriterion("parameter_name in", values, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotIn(List values) { + addCriterion("parameter_name not in", values, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameBetween(String value1, String value2) { + addCriterion("parameter_name between", value1, value2, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_nameNotBetween(String value1, String value2) { + addCriterion("parameter_name not between", value1, value2, "parameter_name"); + return (Criteria) this; + } + + public Criteria andParameter_valueIsNull() { + addCriterion("parameter_value is null"); + return (Criteria) this; + } + + public Criteria andParameter_valueIsNotNull() { + addCriterion("parameter_value is not null"); + return (Criteria) this; + } + + public Criteria andParameter_valueEqualTo(String value) { + addCriterion("parameter_value =", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotEqualTo(String value) { + addCriterion("parameter_value <>", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueGreaterThan(String value) { + addCriterion("parameter_value >", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueGreaterThanOrEqualTo(String value) { + addCriterion("parameter_value >=", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLessThan(String value) { + addCriterion("parameter_value <", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLessThanOrEqualTo(String value) { + addCriterion("parameter_value <=", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueLike(String value) { + addCriterion("parameter_value like", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotLike(String value) { + addCriterion("parameter_value not like", value, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueIn(List values) { + addCriterion("parameter_value in", values, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotIn(List values) { + addCriterion("parameter_value not in", values, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueBetween(String value1, String value2) { + addCriterion("parameter_value between", value1, value2, "parameter_value"); + return (Criteria) this; + } + + public Criteria andParameter_valueNotBetween(String value1, String value2) { + addCriterion("parameter_value not between", value1, value2, "parameter_value"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_parameter + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java new file mode 100644 index 000000000..986dbb4e4 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionParameterKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String parameter_name; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.connection_id + * + * @return the value of guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @return the value of guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getParameter_name() { + return parameter_name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_name + * + * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setParameter_name(String parameter_name) { + this.parameter_name = parameter_name == null ? null : parameter_name.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java new file mode 100644 index 000000000..a65cde408 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java @@ -0,0 +1,492 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class ConnectionPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public ConnectionPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java new file mode 100644 index 000000000..7e496190e --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class ConnectionPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.user_id + * + * @return the value of guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.user_id + * + * @param user_id the value for guacamole..guacamole_connection_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.connection_id + * + * @return the value of guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_permission.permission + * + * @return the value of guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_permission.permission + * + * @param permission the value for guacamole..guacamole_connection_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java new file mode 100644 index 000000000..7c972fd93 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java @@ -0,0 +1,432 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class SystemPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public SystemPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_system_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java new file mode 100644 index 000000000..920341d47 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class SystemPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_system_permission.user_id + * + * @return the value of guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_system_permission.user_id + * + * @param user_id the value for guacamole..guacamole_system_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_system_permission.permission + * + * @return the value of guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_system_permission.permission + * + * @param permission the value for guacamole..guacamole_system_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java new file mode 100644 index 000000000..3f2da3baa --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java @@ -0,0 +1,131 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class User { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String username; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String password_salt; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private byte[] password_hash; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.user_id + * + * @return the value of guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.user_id + * + * @param user_id the value for guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.username + * + * @return the value of guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getUsername() { + return username; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.username + * + * @param username the value for guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_salt + * + * @return the value of guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPassword_salt() { + return password_salt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_salt + * + * @param password_salt the value for guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPassword_salt(String password_salt) { + this.password_salt = password_salt == null ? null : password_salt.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_hash + * + * @return the value of guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public byte[] getPassword_hash() { + return password_hash; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_hash + * + * @param password_hash the value for guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPassword_hash(byte[] password_hash) { + this.password_hash = password_hash; + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java new file mode 100644 index 000000000..3b8d8f09c --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java @@ -0,0 +1,502 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class UserExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public UserExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andPassword_saltIsNull() { + addCriterion("password_salt is null"); + return (Criteria) this; + } + + public Criteria andPassword_saltIsNotNull() { + addCriterion("password_salt is not null"); + return (Criteria) this; + } + + public Criteria andPassword_saltEqualTo(String value) { + addCriterion("password_salt =", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotEqualTo(String value) { + addCriterion("password_salt <>", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltGreaterThan(String value) { + addCriterion("password_salt >", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltGreaterThanOrEqualTo(String value) { + addCriterion("password_salt >=", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLessThan(String value) { + addCriterion("password_salt <", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLessThanOrEqualTo(String value) { + addCriterion("password_salt <=", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltLike(String value) { + addCriterion("password_salt like", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotLike(String value) { + addCriterion("password_salt not like", value, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltIn(List values) { + addCriterion("password_salt in", values, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotIn(List values) { + addCriterion("password_salt not in", values, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltBetween(String value1, String value2) { + addCriterion("password_salt between", value1, value2, "password_salt"); + return (Criteria) this; + } + + public Criteria andPassword_saltNotBetween(String value1, String value2) { + addCriterion("password_salt not between", value1, value2, "password_salt"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java new file mode 100644 index 000000000..6902d9515 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java @@ -0,0 +1,492 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +import java.util.ArrayList; +import java.util.List; + +public class UserPermissionExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public UserPermissionExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIsNull() { + addCriterion("affected_user_id is null"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIsNotNull() { + addCriterion("affected_user_id is not null"); + return (Criteria) this; + } + + public Criteria andAffected_user_idEqualTo(Integer value) { + addCriterion("affected_user_id =", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotEqualTo(Integer value) { + addCriterion("affected_user_id <>", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idGreaterThan(Integer value) { + addCriterion("affected_user_id >", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idGreaterThanOrEqualTo(Integer value) { + addCriterion("affected_user_id >=", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idLessThan(Integer value) { + addCriterion("affected_user_id <", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idLessThanOrEqualTo(Integer value) { + addCriterion("affected_user_id <=", value, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idIn(List values) { + addCriterion("affected_user_id in", values, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotIn(List values) { + addCriterion("affected_user_id not in", values, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idBetween(Integer value1, Integer value2) { + addCriterion("affected_user_id between", value1, value2, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andAffected_user_idNotBetween(Integer value1, Integer value2) { + addCriterion("affected_user_id not between", value1, value2, "affected_user_id"); + return (Criteria) this; + } + + public Criteria andPermissionIsNull() { + addCriterion("permission is null"); + return (Criteria) this; + } + + public Criteria andPermissionIsNotNull() { + addCriterion("permission is not null"); + return (Criteria) this; + } + + public Criteria andPermissionEqualTo(String value) { + addCriterion("permission =", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotEqualTo(String value) { + addCriterion("permission <>", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThan(String value) { + addCriterion("permission >", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionGreaterThanOrEqualTo(String value) { + addCriterion("permission >=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThan(String value) { + addCriterion("permission <", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLessThanOrEqualTo(String value) { + addCriterion("permission <=", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionLike(String value) { + addCriterion("permission like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotLike(String value) { + addCriterion("permission not like", value, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionIn(List values) { + addCriterion("permission in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotIn(List values) { + addCriterion("permission not in", values, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionBetween(String value1, String value2) { + addCriterion("permission between", value1, value2, "permission"); + return (Criteria) this; + } + + public Criteria andPermissionNotBetween(String value1, String value2) { + addCriterion("permission not between", value1, value2, "permission"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_user_permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java new file mode 100644 index 000000000..f9e966bb7 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java @@ -0,0 +1,99 @@ +package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; + +public class UserPermissionKey { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private Integer affected_user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + private String permission; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.user_id + * + * @return the value of guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.user_id + * + * @param user_id the value for guacamole..guacamole_user_permission.user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.affected_user_id + * + * @return the value of guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public Integer getAffected_user_id() { + return affected_user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.affected_user_id + * + * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setAffected_user_id(Integer affected_user_id) { + this.affected_user_id = affected_user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user_permission.permission + * + * @return the value of guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public String getPermission() { + return permission; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user_permission.permission + * + * @param permission the value for guacamole..guacamole_user_permission.permission + * + * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + */ + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml new file mode 100644 index 000000000..376ac3269 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + connection_id, connection_name, protocol + + + + + + delete from guacamole..guacamole_connection + where connection_id = #{connection_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_connection + + + + + + + insert into guacamole..guacamole_connection (connection_id, connection_name, protocol + ) + values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} + ) + + + + insert into guacamole..guacamole_connection + + + connection_id, + + + connection_name, + + + protocol, + + + + + #{connection_id,jdbcType=INTEGER}, + + + #{connection_name,jdbcType=VARCHAR}, + + + #{protocol,jdbcType=VARCHAR}, + + + + + + + update guacamole..guacamole_connection + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + connection_name = #{record.connection_name,jdbcType=VARCHAR}, + + + protocol = #{record.protocol,jdbcType=VARCHAR}, + + + + + + + + + update guacamole..guacamole_connection + set connection_id = #{record.connection_id,jdbcType=INTEGER}, + connection_name = #{record.connection_name,jdbcType=VARCHAR}, + protocol = #{record.protocol,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_connection + + + connection_name = #{connection_name,jdbcType=VARCHAR}, + + + protocol = #{protocol,jdbcType=VARCHAR}, + + + where connection_id = #{connection_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_connection + set connection_name = #{connection_name,jdbcType=VARCHAR}, + protocol = #{protocol,jdbcType=VARCHAR} + where connection_id = #{connection_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml new file mode 100644 index 000000000..44b175d1f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + connection_id, parameter_name, parameter_value + + + + + + delete from guacamole..guacamole_connection_parameter + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + + + delete from guacamole..guacamole_connection_parameter + + + + + + + insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value + ) + values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} + ) + + + + insert into guacamole..guacamole_connection_parameter + + + connection_id, + + + parameter_name, + + + parameter_value, + + + + + #{connection_id,jdbcType=INTEGER}, + + + #{parameter_name,jdbcType=VARCHAR}, + + + #{parameter_value,jdbcType=VARCHAR}, + + + + + + + update guacamole..guacamole_connection_parameter + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, + + + parameter_value = #{record.parameter_value,jdbcType=VARCHAR}, + + + + + + + + + update guacamole..guacamole_connection_parameter + set connection_id = #{record.connection_id,jdbcType=INTEGER}, + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, + parameter_value = #{record.parameter_value,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_connection_parameter + + + parameter_value = #{parameter_value,jdbcType=VARCHAR}, + + + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + + + update guacamole..guacamole_connection_parameter + set parameter_value = #{parameter_value,jdbcType=VARCHAR} + where connection_id = #{connection_id,jdbcType=INTEGER} + and parameter_name = #{parameter_name,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml new file mode 100644 index 000000000..8f522958b --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, connection_id, permission + + + + + delete from guacamole..guacamole_connection_permission + where user_id = #{user_id,jdbcType=INTEGER} + and connection_id = #{connection_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_connection_permission + + + + + + + insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission + ) + values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} + ) + + + + insert into guacamole..guacamole_connection_permission + + + user_id, + + + connection_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{connection_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_connection_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_connection_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + connection_id = #{record.connection_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml new file mode 100644 index 000000000..40f3da6bc --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, permission + + + + + delete from guacamole..guacamole_system_permission + where user_id = #{user_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_system_permission + + + + + + + insert into guacamole..guacamole_system_permission (user_id, permission) + values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) + + + + insert into guacamole..guacamole_system_permission + + + user_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_system_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_system_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml new file mode 100644 index 000000000..d1abca0f6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, username, password_salt + + + + password_hash + + + + + + + delete from guacamole..guacamole_user + where user_id = #{user_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_user + + + + + + + insert into guacamole..guacamole_user (user_id, username, password_salt, + password_hash) + values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_salt,jdbcType=VARCHAR}, + #{password_hash,jdbcType=BINARY}) + + + + insert into guacamole..guacamole_user + + + user_id, + + + username, + + + password_salt, + + + password_hash, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{username,jdbcType=VARCHAR}, + + + #{password_salt,jdbcType=VARCHAR}, + + + #{password_hash,jdbcType=BINARY}, + + + + + + + update guacamole..guacamole_user + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + password_salt = #{record.password_salt,jdbcType=VARCHAR}, + + + password_hash = #{record.password_hash,jdbcType=BINARY}, + + + + + + + + + update guacamole..guacamole_user + set user_id = #{record.user_id,jdbcType=INTEGER}, + username = #{record.username,jdbcType=VARCHAR}, + password_salt = #{record.password_salt,jdbcType=VARCHAR}, + password_hash = #{record.password_hash,jdbcType=BINARY} + + + + + + + update guacamole..guacamole_user + set user_id = #{record.user_id,jdbcType=INTEGER}, + username = #{record.username,jdbcType=VARCHAR}, + password_salt = #{record.password_salt,jdbcType=VARCHAR} + + + + + + + update guacamole..guacamole_user + + + username = #{username,jdbcType=VARCHAR}, + + + password_salt = #{password_salt,jdbcType=VARCHAR}, + + + password_hash = #{password_hash,jdbcType=BINARY}, + + + where user_id = #{user_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_user + set username = #{username,jdbcType=VARCHAR}, + password_salt = #{password_salt,jdbcType=VARCHAR}, + password_hash = #{password_hash,jdbcType=BINARY} + where user_id = #{user_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_user + set username = #{username,jdbcType=VARCHAR}, + password_salt = #{password_salt,jdbcType=VARCHAR} + where user_id = #{user_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml new file mode 100644 index 000000000..5d27de207 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + user_id, affected_user_id, permission + + + + + delete from guacamole..guacamole_user_permission + where user_id = #{user_id,jdbcType=INTEGER} + and affected_user_id = #{affected_user_id,jdbcType=INTEGER} + and permission = #{permission,jdbcType=CHAR} + + + + delete from guacamole..guacamole_user_permission + + + + + + + insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission + ) + values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} + ) + + + + insert into guacamole..guacamole_user_permission + + + user_id, + + + affected_user_id, + + + permission, + + + + + #{user_id,jdbcType=INTEGER}, + + + #{affected_user_id,jdbcType=INTEGER}, + + + #{permission,jdbcType=CHAR}, + + + + + + + update guacamole..guacamole_user_permission + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, + + + permission = #{record.permission,jdbcType=CHAR}, + + + + + + + + + update guacamole..guacamole_user_permission + set user_id = #{record.user_id,jdbcType=INTEGER}, + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, + permission = #{record.permission,jdbcType=CHAR} + + + + + \ No newline at end of file From 64a4063cf496b9ea842673b3d0977a4ad544bea9 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 5 Feb 2013 22:08:40 -0800 Subject: [PATCH 012/109] Ticket #269: Created maven project. --- extensions/guacamole-auth-mysql/pom.xml | 89 +++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/pom.xml diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml new file mode 100644 index 000000000..4b7f1daba --- /dev/null +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + net.sourceforge.guacamole + guacamole-auth-mysql + jar + 0.8.0 + guacamole-auth-mysql + http://guac-dev.org/ + + + UTF-8 + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + maven-assembly-plugin + 2.2-beta-5 + + ${project.artifactId}-${project.version} + false + + src/main/assembly/dist.xml + + + + + make-dist-archive + package + + single + + + + + + + + + + + + + net.sourceforge.guacamole + guacamole-common + 0.7.0 + + + + + net.sourceforge.guacamole + guacamole-ext + 0.7.0 + + + + + org.mybatis + mybatis + 3.1.1 + + + + + + + + + guac-dev + http://guac-dev.org/repo + + + + + From 773b12b3ed2258820ba1aa638b6b27c6609a576e Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 6 Feb 2013 08:56:54 -0800 Subject: [PATCH 013/109] Ticket #269: guacamole-auth-mysql should depend on version 0.8.0 of guacamole-common and guacamole-ext. --- extensions/guacamole-auth-mysql/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index 4b7f1daba..e7032bd3a 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -57,14 +57,14 @@ net.sourceforge.guacamole guacamole-common - 0.7.0 + 0.8.0 net.sourceforge.guacamole guacamole-ext - 0.7.0 + 0.8.0 From af9fccd7880346903b503cba6fe79d35ad142dfe Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 11 Feb 2013 00:26:30 -0800 Subject: [PATCH 014/109] Ticket #269: Added guice injection framework for ease of transaction management. --- extensions/guacamole-auth-mysql/.README.swp | Bin 0 -> 12288 bytes extensions/guacamole-auth-mysql/pom.xml | 7 ++ .../mysql/MySQLAuthenticationProvider.java | 116 ++++++++++++++++++ .../guacamole/net/auth/mysql/MySQLUser.java | 99 +++++++++++++++ .../net/auth/mysql/MySQLUserContext.java | 72 +++++++++++ .../properties/MySQLGuacamoleProperties.java | 70 +++++++++++ 6 files changed, 364 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/.README.swp create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java diff --git a/extensions/guacamole-auth-mysql/.README.swp b/extensions/guacamole-auth-mysql/.README.swp new file mode 100644 index 0000000000000000000000000000000000000000..fbf9aa7350eedd006425a5d1259fbdf16eefe753 GIT binary patch literal 12288 zcmeHNNpBoQ6s{x?LP%Hz0!}Xu9D*`Ec8ox>kic0m2^c3%!jb?|b$5BDL1`-nF!uAK?d)3Q~Cnh4AQ&6|`Y3%8$_g;PPd#}oJ zxzkS_T%-q`S%K$fAs)GS%aMnUZxLsggz#mjqq3RlRepDw$5*}9e;NByJ*eGJvQ?c* zPqjO_^kkHTswH#NZAAlpI&3c=nBTv6;4&_oR}BLV16Rzzb}_qWW}2t%oZ3OR-Fp0r zEi@Av1{ww$1{ww$1{ww$1{ww$1{wygUIt9ML7YMO8_Oj;Uw&>F`z(KLJ{krZ1{ww$ z1{ww$1{ww$1{ww$1{ww$1{ww$2ChN|q%Xwh_+$U%CIpZF|5tzi|9z7Xp8y{M8E_i7 z7x?K$A$|nj1YQAN1|A0v0h@r0z{TxC{0jU6ybrt%JP9lUTY&Gj3Gpp(4p;y-1Ha!O z#Baa{z&pU(z+1ozKpXgLs}O$z7l0GMoxoSu3-KlJG4K&^0eBBM3EU2Rvqgxnfj59Y z&;t$vj{#eO&#uEe;2dxmSOT^IUu*^^zN0XdHz2P5T33v>0I01a%th7jFV)Y zw#lT|7W`Ip6K#}F(#(m&p^{orrqU!cB;x_Oc}J6qy(Eu~$}r3wP?D-Rh&v=HR(&#o zx2iDMkm)Kq2D_vOuowx^n&1(%Y@=XDX_mO5iu7a##ZjefjK$3!CmOiY1e#WYP&tzZ zyP#r~!5pGp9PG7rmzEbPl4*+XCXL)C%3e!qrBZ9$T=M5Qcjd$13I4ell53U4GE$>M z_`8uIzBJNBsz-;^x1gNrt;1GEX0a+pXRyoJ+35#HhOn5%ecPxUels+_Rgpa;^#{k!T|)w-UB!50y; zojM}oD`hH1l@tpF@1fFl?5Psq%uA0A6#=vS!CqVc@oEw^J37 z1INZ)uh|(Ayqja7eh`Le7O(~Hg<-UjSUGeIR%?US%E1*o#ZM?s40UA>sU!H!Bo{%qwg3|3V*sJ+6T>0((@Qw*$j zshIqvABTyAGIozeYYBIY+Fb;Nagl;*f^F@b4}`bIHkYBB2cchOye6O^jP9YR7ZYwx zuF8%QVrCaD=keO_){_BNjUqPPa+esZiBjJgYhCta5OR$;qV`RmjJf!OSR2qW9 ztdWKAk|;%YhgFd1g=mxfbL>|O&`etdyId6L1%9AS7Pz@BQmXy4Oam?Ig^gSj<&c>$ zl$)&*OSVIMD-PG2GwEKl&#sCy#7ikj;a}HvHo+d;!a2w`ZyGkJwatkeYu%kdVxf5} z#=5hv?RWx7sTw@ekYR_x!9qL2b{~i4*KO16XJ`<9s_M6{Y>Yyq=b->=5=Ls;HoY)R z`elC~(;upEq3VL`XSrM>i)XZZ^3GL@x7er(sS1IOKdgIxQjIG8^VW+K*P5Nd8TTCe zGPM;!hfoxC-{BGkS14%16*bzx`^ueETTgR|Len*iBU*oW!tj9f*pPE9a*$0TH3-N>&Ib8E@701e3Hdx0NOsHpU_d SnN%b5Zj$q9zYb_ZUHk(l|4Zut literal 0 HcmV?d00001 diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index e7032bd3a..435100ddf 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -73,6 +73,13 @@ mybatis 3.1.1 + + + + org.mybatis + mybatis-guice + 3.2 + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java new file mode 100644 index 000000000..0d992aa5f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -0,0 +1,116 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-ext. + * + * The Initial Developer of the Original Code is + * Michael Jumper. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.inject.Binder; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Module; +import com.google.inject.Provider; +import com.google.inject.name.Names; +import java.util.Properties; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.AuthenticationProvider; +import net.sourceforge.guacamole.net.auth.Credentials; +import net.sourceforge.guacamole.net.auth.UserContext; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.ConnectionParameterMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.ConnectionPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.SystemPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.properties.GuacamoleProperties; +import org.mybatis.guice.MyBatisModule; +import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider; +import org.mybatis.guice.datasource.helper.JdbcHelper; + +/** + * Provides a MySQL based implementation of the AuthenticationProvider + * functionality. + * @author dagger10k + */ +public class MySQLAuthenticationProvider implements AuthenticationProvider { + + private Injector injector; + private Credentials credentials; + + @Override + public UserContext getUserContext(Credentials credentials) throws GuacamoleException { + this.credentials = credentials; + UserContext context = injector.getInstance(UserContext.class); + return context; + } + + public MySQLAuthenticationProvider() throws GuacamoleException { + final Properties myBatisProperties = new Properties(); + myBatisProperties.setProperty("mybatis.environment.id", "guacamole"); + myBatisProperties.setProperty("JDBC.host", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_HOSTNAME)); + myBatisProperties.setProperty("JDBC.port", String.valueOf(GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PORT))); + myBatisProperties.setProperty("JDBC.schema", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_DATABASE)); + myBatisProperties.setProperty("JDBC.username", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_USERNAME)); + myBatisProperties.setProperty("JDBC.password", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD)); + myBatisProperties.setProperty("JDBC.autoCommit", "false"); + + injector = Guice.createInjector( + JdbcHelper.MySQL, + new Module() { + @Override + public void configure(Binder binder) { + Names.bindProperties(binder, myBatisProperties); + } + },new MyBatisModule() { + @Override + protected void initialize() { + bindDataSourceProviderType(PooledDataSourceProvider.class); + addMapperClass(ConnectionMapper.class); + addMapperClass(ConnectionParameterMapper.class); + addMapperClass(ConnectionPermissionMapper.class); + addMapperClass(SystemPermissionMapper.class); + addMapperClass(UserMapper.class); + addMapperClass(UserPermissionMapper.class); + bind(UserContext.class).to(MySQLUserContext.class); + bind(Credentials.class).toProvider(new Provider() { + @Override + public Credentials get() { + return credentials; + } + }); + } + } + ); + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java new file mode 100644 index 000000000..839115b22 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -0,0 +1,99 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-ext. + * + * The Initial Developer of the Original Code is + * Michael Jumper. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import java.util.Set; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.Credentials; +import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.permission.Permission; + +/** + * + * @author dagger10k + */ +public class MySQLUser implements User { + + private String username; + private String userID; + private String salt; + + MySQLUser(Credentials credentials) { + //TODO: load the user from the DB if the credentials are correct, + // otherwise, throw some kind of exception + } + + @Override + public String getUsername() { + return username; + } + + @Override + public void setUsername(String username) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public String getPassword() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setPassword(String password) { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Set getPermissions() throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean hasPermission(Permission permission) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void addPermission(Permission permission) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void removePermission(Permission permission) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java new file mode 100644 index 000000000..233e6f341 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-ext. + * + * The Initial Developer of the Original Code is + * Michael Jumper. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.inject.Inject; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.auth.Credentials; +import net.sourceforge.guacamole.net.auth.Directory; +import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.UserContext; + +/** + * + * @author dagger10k + */ +public class MySQLUserContext implements UserContext { + + @Inject + MySQLUserContext(Credentials credentials) { + + } + + @Override + public User self() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Directory getUserDirectory() throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public Directory getConnectionDirectory() throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java new file mode 100644 index 000000000..2d8a8a065 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java @@ -0,0 +1,70 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.sourceforge.guacamole.net.auth.mysql.properties; + +import net.sourceforge.guacamole.properties.IntegerGuacamoleProperty; +import net.sourceforge.guacamole.properties.StringGuacamoleProperty; + +/** + * Properties used by the MySQL Authentication plugin. + * @author dagger10k + */ +public class MySQLGuacamoleProperties { + + /** + * This class should not be instantiated. + */ + private MySQLGuacamoleProperties() {} + + /** + * The URL of the MySQL server hosting the guacamole authentication tables. + */ + public static final StringGuacamoleProperty MYSQL_HOSTNAME = new StringGuacamoleProperty() { + + @Override + public String getName() { return "mysql-hostname"; } + + }; + + /** + * The port of the MySQL server hosting the guacamole authentication tables. + */ + public static final IntegerGuacamoleProperty MYSQL_PORT = new IntegerGuacamoleProperty() { + + @Override + public String getName() { return "mysql-port"; } + + }; + + /** + * The name of the MySQL database containing the guacamole authentication tables. + */ + public static final StringGuacamoleProperty MYSQL_DATABASE = new StringGuacamoleProperty() { + + @Override + public String getName() { return "mysql-database"; } + + }; + + /** + * The username used to authenticate to the MySQL database containing the guacamole authentication tables. + */ + public static final StringGuacamoleProperty MYSQL_USERNAME = new StringGuacamoleProperty() { + + @Override + public String getName() { return "mysql-username"; } + + }; + + /** + * The password used to authenticate to the MySQL database containing the guacamole authentication tables. + */ + public static final StringGuacamoleProperty MYSQL_PASSWORD = new StringGuacamoleProperty() { + + @Override + public String getName() { return "mysql-password"; } + + }; +} From be739f6b3502540b03ed6f102df7d9ab5ff6a815 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 11 Feb 2013 00:26:42 -0800 Subject: [PATCH 015/109] Ticket #269: Added guice injection framework for ease of transaction management. --- extensions/guacamole-auth-mysql/.README.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 extensions/guacamole-auth-mysql/.README.swp diff --git a/extensions/guacamole-auth-mysql/.README.swp b/extensions/guacamole-auth-mysql/.README.swp deleted file mode 100644 index fbf9aa7350eedd006425a5d1259fbdf16eefe753..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeHNNpBoQ6s{x?LP%Hz0!}Xu9D*`Ec8ox>kic0m2^c3%!jb?|b$5BDL1`-nF!uAK?d)3Q~Cnh4AQ&6|`Y3%8$_g;PPd#}oJ zxzkS_T%-q`S%K$fAs)GS%aMnUZxLsggz#mjqq3RlRepDw$5*}9e;NByJ*eGJvQ?c* zPqjO_^kkHTswH#NZAAlpI&3c=nBTv6;4&_oR}BLV16Rzzb}_qWW}2t%oZ3OR-Fp0r zEi@Av1{ww$1{ww$1{ww$1{ww$1{wygUIt9ML7YMO8_Oj;Uw&>F`z(KLJ{krZ1{ww$ z1{ww$1{ww$1{ww$1{ww$1{ww$2ChN|q%Xwh_+$U%CIpZF|5tzi|9z7Xp8y{M8E_i7 z7x?K$A$|nj1YQAN1|A0v0h@r0z{TxC{0jU6ybrt%JP9lUTY&Gj3Gpp(4p;y-1Ha!O z#Baa{z&pU(z+1ozKpXgLs}O$z7l0GMoxoSu3-KlJG4K&^0eBBM3EU2Rvqgxnfj59Y z&;t$vj{#eO&#uEe;2dxmSOT^IUu*^^zN0XdHz2P5T33v>0I01a%th7jFV)Y zw#lT|7W`Ip6K#}F(#(m&p^{orrqU!cB;x_Oc}J6qy(Eu~$}r3wP?D-Rh&v=HR(&#o zx2iDMkm)Kq2D_vOuowx^n&1(%Y@=XDX_mO5iu7a##ZjefjK$3!CmOiY1e#WYP&tzZ zyP#r~!5pGp9PG7rmzEbPl4*+XCXL)C%3e!qrBZ9$T=M5Qcjd$13I4ell53U4GE$>M z_`8uIzBJNBsz-;^x1gNrt;1GEX0a+pXRyoJ+35#HhOn5%ecPxUels+_Rgpa;^#{k!T|)w-UB!50y; zojM}oD`hH1l@tpF@1fFl?5Psq%uA0A6#=vS!CqVc@oEw^J37 z1INZ)uh|(Ayqja7eh`Le7O(~Hg<-UjSUGeIR%?US%E1*o#ZM?s40UA>sU!H!Bo{%qwg3|3V*sJ+6T>0((@Qw*$j zshIqvABTyAGIozeYYBIY+Fb;Nagl;*f^F@b4}`bIHkYBB2cchOye6O^jP9YR7ZYwx zuF8%QVrCaD=keO_){_BNjUqPPa+esZiBjJgYhCta5OR$;qV`RmjJf!OSR2qW9 ztdWKAk|;%YhgFd1g=mxfbL>|O&`etdyId6L1%9AS7Pz@BQmXy4Oam?Ig^gSj<&c>$ zl$)&*OSVIMD-PG2GwEKl&#sCy#7ikj;a}HvHo+d;!a2w`ZyGkJwatkeYu%kdVxf5} z#=5hv?RWx7sTw@ekYR_x!9qL2b{~i4*KO16XJ`<9s_M6{Y>Yyq=b->=5=Ls;HoY)R z`elC~(;upEq3VL`XSrM>i)XZZ^3GL@x7er(sS1IOKdgIxQjIG8^VW+K*P5Nd8TTCe zGPM;!hfoxC-{BGkS14%16*bzx`^ueETTgR|Len*iBU*oW!tj9f*pPE9a*$0TH3-N>&Ib8E@701e3Hdx0NOsHpU_d SnN%b5Zj$q9zYb_ZUHk(l|4Zut From e66f5bc03b4cdc9aa53dc309e86a3bf4859ec18e Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 11 Feb 2013 00:53:04 -0800 Subject: [PATCH 016/109] Ticket #269: Fixed synchronization issues by not trying to inject Credentials. Also included logger. --- extensions/guacamole-auth-mysql/pom.xml | 13 +++++++++++++ .../mysql/MySQLAuthenticationProvider.java | 18 +++++++----------- .../net/auth/mysql/MySQLUserContext.java | 9 ++++++--- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index 435100ddf..952db2420 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -67,6 +67,19 @@ 0.8.0 + + + org.slf4j + slf4j-api + 1.6.1 + + + org.slf4j + slf4j-jcl + 1.6.1 + runtime + + org.mybatis diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 0d992aa5f..d2830056e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -39,7 +39,6 @@ import com.google.inject.Binder; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Module; -import com.google.inject.Provider; import com.google.inject.name.Names; import java.util.Properties; import net.sourceforge.guacamole.GuacamoleException; @@ -57,6 +56,8 @@ import net.sourceforge.guacamole.properties.GuacamoleProperties; import org.mybatis.guice.MyBatisModule; import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider; import org.mybatis.guice.datasource.helper.JdbcHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Provides a MySQL based implementation of the AuthenticationProvider @@ -65,13 +66,14 @@ import org.mybatis.guice.datasource.helper.JdbcHelper; */ public class MySQLAuthenticationProvider implements AuthenticationProvider { + private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); + private Injector injector; - private Credentials credentials; @Override public UserContext getUserContext(Credentials credentials) throws GuacamoleException { - this.credentials = credentials; - UserContext context = injector.getInstance(UserContext.class); + MySQLUserContext context = injector.getInstance(MySQLUserContext.class); + context.init(credentials); return context; } @@ -102,13 +104,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { addMapperClass(SystemPermissionMapper.class); addMapperClass(UserMapper.class); addMapperClass(UserPermissionMapper.class); - bind(UserContext.class).to(MySQLUserContext.class); - bind(Credentials.class).toProvider(new Provider() { - @Override - public Credentials get() { - return credentials; - } - }); + bind(MySQLUserContext.class); } } ); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 233e6f341..b658d28fd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -42,6 +42,8 @@ import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.UserContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -49,9 +51,10 @@ import net.sourceforge.guacamole.net.auth.UserContext; */ public class MySQLUserContext implements UserContext { - @Inject - MySQLUserContext(Credentials credentials) { - + private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); + + void init(Credentials credentials) { + // load the required data with the provided credentials } @Override From 9cea60d8e619cb7ab7c57ce952e1589729d1ab22 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 11 Feb 2013 12:00:16 -0800 Subject: [PATCH 017/109] Ticket #269: Fixed license blocks and author comments. --- .../mysql/MySQLAuthenticationProvider.java | 6 +-- .../guacamole/net/auth/mysql/MySQLUser.java | 6 +-- .../net/auth/mysql/MySQLUserContext.java | 6 +-- .../properties/MySQLGuacamoleProperties.java | 41 ++++++++++++++++--- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index d2830056e..6505dbea8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -11,10 +11,10 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is guacamole-ext. + * The Original Code is guacamole-auth-mysql. * * The Initial Developer of the Original Code is - * Michael Jumper. + * James Muehlner. * Portions created by the Initial Developer are Copyright (C) 2010 * the Initial Developer. All Rights Reserved. * @@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory; /** * Provides a MySQL based implementation of the AuthenticationProvider * functionality. - * @author dagger10k + * @author James Muehlner */ public class MySQLAuthenticationProvider implements AuthenticationProvider { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index 839115b22..c0a351576 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -11,10 +11,10 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is guacamole-ext. + * The Original Code is guacamole-auth-mysql. * * The Initial Developer of the Original Code is - * Michael Jumper. + * James Muehlner. * Portions created by the Initial Developer are Copyright (C) 2010 * the Initial Developer. All Rights Reserved. * @@ -43,7 +43,7 @@ import net.sourceforge.guacamole.net.auth.permission.Permission; /** * - * @author dagger10k + * @author James Muehlner */ public class MySQLUser implements User { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index b658d28fd..6de80c19e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -11,10 +11,10 @@ * for the specific language governing rights and limitations under the * License. * - * The Original Code is guacamole-ext. + * The Original Code is guacamole-auth-mysql. * * The Initial Developer of the Original Code is - * Michael Jumper. + * James Muehlner. * Portions created by the Initial Developer are Copyright (C) 2010 * the Initial Developer. All Rights Reserved. * @@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory; /** * - * @author dagger10k + * @author James Muehlner */ public class MySQLUserContext implements UserContext { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java index 2d8a8a065..b37856a6c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java @@ -1,7 +1,38 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.properties; import net.sourceforge.guacamole.properties.IntegerGuacamoleProperty; @@ -9,7 +40,7 @@ import net.sourceforge.guacamole.properties.StringGuacamoleProperty; /** * Properties used by the MySQL Authentication plugin. - * @author dagger10k + * @author James Muehlner */ public class MySQLGuacamoleProperties { From 6213cf490b2475a78c1d6f9bfc4b3daa44b4484d Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 11 Feb 2013 23:59:53 -0800 Subject: [PATCH 018/109] Ticket #269: Continuing work, more work on UserMapping and UserDirectory --- extensions/guacamole-auth-mysql/pom.xml | 13 ++- .../mysql/MySQLAuthenticationProvider.java | 7 ++ .../guacamole/net/auth/mysql/MySQLUser.java | 83 +++++++++++++++---- .../net/auth/mysql/MySQLUserContext.java | 9 +- .../net/auth/mysql/UserDirectory.java | 72 ++++++++++++++++ .../utility/PasswordEncryptionUtility.java | 64 ++++++++++++++ .../net/auth/mysql/utility/SaltUtility.java | 50 +++++++++++ .../utility/SecureRandomSaltUtility.java | 28 +++++++ .../Sha256PasswordEncryptionUtility.java | 79 ++++++++++++++++++ 9 files changed, 385 insertions(+), 20 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index 952db2420..c193336ad 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -93,7 +93,18 @@ mybatis-guice 3.2 - + + + com.google.collections + google-collections + 1.0 + + + net.sourceforge.guacamole + guacamole-auth-mysql + 0.8.0 + jar + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 6505dbea8..db95428a7 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -52,6 +52,10 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.SystemPermissionMa import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.Sha256PasswordEncryptionUtility; import net.sourceforge.guacamole.properties.GuacamoleProperties; import org.mybatis.guice.MyBatisModule; import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider; @@ -105,6 +109,9 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { addMapperClass(UserMapper.class); addMapperClass(UserPermissionMapper.class); bind(MySQLUserContext.class); + bind(MySQLUser.class); + bind(SaltUtility.class).to(SecureRandomSaltUtility.class); + bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); } } ); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index c0a351576..f29ec948a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -35,65 +35,116 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql; +import com.google.inject.Inject; +import java.io.UnsupportedEncodingException; +import java.util.HashSet; +import java.util.List; import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.permission.Permission; /** - * + * A MySQL based implementation of the User object. * @author James Muehlner */ public class MySQLUser implements User { - private String username; - private String userID; - private String salt; + private net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User user; - MySQLUser(Credentials credentials) { - //TODO: load the user from the DB if the credentials are correct, - // otherwise, throw some kind of exception + @Inject + UserMapper userDao; + + @Inject + PasswordEncryptionUtility passwordUtility; + + @Inject + SaltUtility saltUtility; + + Set permissions; + + MySQLUser() { + user = new net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User(); + permissions = new HashSet(); + } + + /** + * Create the user, throwing an exception if the credentials do not match what's in the database. + * @param credentials + * @throws GuacamoleException + */ + void init (Credentials credentials) throws GuacamoleException { + UserExample userExample = new UserExample(); + userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); + List users = userDao.selectByExample(userExample); + if(users.size() > 1) // the unique constraint on the table should prevent this + throw new GuacamoleException("Multiple users found with the same username: " + credentials.getUsername()); + if(users.isEmpty()) + throw new GuacamoleException("No user found with the supplied credentials"); + user = users.get(0); + // check password + if(!passwordUtility.checkCredentials(credentials, user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) + throw new GuacamoleException("No user found with the supplied credentials"); + } + + void init (User user) { + this.setPassword(user.getPassword()); + this.setUsername(user.getUsername()); + } + + public net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User getUser() { + return user; } @Override public String getUsername() { - return username; + return user.getUsername(); } @Override public void setUsername(String username) { - throw new UnsupportedOperationException("Not supported yet."); + user.setUsername(username); } @Override public String getPassword() { - throw new UnsupportedOperationException("Not supported yet."); + try { + return new String(user.getPassword_hash(), "UTF-8"); + } catch (UnsupportedEncodingException ex) { + throw new RuntimeException(ex); // should not happen + } } @Override public void setPassword(String password) { - throw new UnsupportedOperationException("Not supported yet."); + String salt = saltUtility.generateSalt(); + user.setPassword_salt(salt); + byte[] hash = passwordUtility.createPasswordHash(password, salt); + user.setPassword_hash(hash); } @Override public Set getPermissions() throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + return permissions; } @Override public boolean hasPermission(Permission permission) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + return permissions.contains(permission); } @Override public void addPermission(Permission permission) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + permissions.add(permission); } @Override public void removePermission(Permission permission) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + permissions.remove(permission); } - } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 6de80c19e..026533aea 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -53,13 +53,16 @@ public class MySQLUserContext implements UserContext { private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); - void init(Credentials credentials) { - // load the required data with the provided credentials + @Inject + private MySQLUser user; + + void init(Credentials credentials) throws GuacamoleException { + user.init(credentials); } @Override public User self() { - throw new UnsupportedOperationException("Not supported yet."); + return user; } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java new file mode 100644 index 000000000..09419b969 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -0,0 +1,72 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.inject.Inject; +import com.google.inject.Provider; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.Directory; +import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; + +/** + * A MySQL based implementation of the User Directory. + * @author James Muehlner + */ +public class UserDirectory implements Directory { + + private Map userMap = new HashMap(); + + @Inject + UserMapper userDAO; + + @Inject + Provider mySQLUserProvider; + + private MySQLUser getMySQLUser(User user) { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.init(user); + return mySQLUser; + } + + @Override + public User get(String identifier) throws GuacamoleException { + return userMap.get(identifier); + } + + @Override + public Set getIdentifiers() throws GuacamoleException { + return userMap.keySet(); + } + + @Override + public void add(User object) throws GuacamoleException { + MySQLUser mySQLUser = getMySQLUser(object); + userDAO.insert(mySQLUser.getUser()); + userMap.put(mySQLUser.getUsername(), mySQLUser); + } + + @Override + public void update(User object) throws GuacamoleException { + if(!userMap.containsKey(object.getUsername())) + throw new GuacamoleException("User not found in Directory."); + MySQLUser mySQLUser = getMySQLUser(object); + userDAO.updateByPrimaryKey(mySQLUser.getUser()); + userMap.put(object.getUsername(), mySQLUser); + } + + @Override + public void remove(String identifier) throws GuacamoleException { + User user = userMap.get(identifier); + if(user == null) + throw new GuacamoleException("User not found in Directory."); + MySQLUser mySQLUser = getMySQLUser(user); + userDAO.deleteByPrimaryKey(mySQLUser.getUser().getUser_id()); + userMap.remove(user.getUsername()); + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java new file mode 100644 index 000000000..f9d7a4963 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java @@ -0,0 +1,64 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import net.sourceforge.guacamole.net.auth.Credentials; + +/** + * + * @author James Muehlner + */ +public interface PasswordEncryptionUtility { + + /** + * Checks if the provided Credentials are correct, compared with what the values from the database. + * @param credentials + * @param dbPasswordHash + * @param dbUsername + * @param dbSalt + * @return true if the provided credentials match what's in the database for that user. + */ + public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, String dbSalt); + + /** + * Creates a password hash based on the provided username, password, and salt. + * @param username + * @param password + * @param salt + * @return the generated password hash. + */ + public byte[] createPasswordHash(String password, String salt); +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java new file mode 100644 index 000000000..fd4661769 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java @@ -0,0 +1,50 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import net.sourceforge.guacamole.GuacamoleException; + +/** + * + * @author James Muehlner + */ +public interface SaltUtility { + /** + * Generates a new String that can be used as a password salt. + * @return a new salt for password encryption. + */ + public String generateSalt(); +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java new file mode 100644 index 000000000..63d37d3a5 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -0,0 +1,28 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import java.io.UnsupportedEncodingException; +import java.security.SecureRandom; + +/** + * Generates password salts via the SecureRandom utility. + * @author dagger10k + */ +public class SecureRandomSaltUtility implements SaltUtility { + + SecureRandom secureRandom = new SecureRandom(); + + @Override + public String generateSalt() { + byte[] salt = new byte[32]; + secureRandom.nextBytes(salt); + try { + return new String(salt, "UTF-8"); + } catch (UnsupportedEncodingException ex) { // should not happen + throw new RuntimeException(ex); + } + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java new file mode 100644 index 000000000..ff233d7f6 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java @@ -0,0 +1,79 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import com.google.common.base.Preconditions; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import net.sourceforge.guacamole.net.auth.Credentials; + +/** + * Provides a SHA-256 based implementation of the password encryption functionality. + * @author James Muehlner + */ +public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtility { + + @Override + public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, String dbSalt) { + Preconditions.checkNotNull(credentials); + Preconditions.checkNotNull(dbPasswordHash); + Preconditions.checkNotNull(dbUsername); + Preconditions.checkNotNull(dbSalt); + byte[] passwordBytes = createPasswordHash(credentials.getPassword(), dbSalt); + return Arrays.equals(passwordBytes, dbPasswordHash); + } + + @Override + public byte[] createPasswordHash(String password, String salt) { + Preconditions.checkNotNull(password); + Preconditions.checkNotNull(salt); + try { + MessageDigest md = MessageDigest.getInstance("SHA-256"); + + StringBuilder builder = new StringBuilder(); + builder.append(password); + builder.append(salt); + md.update(builder.toString().getBytes("UTF-8")); + return md.digest(); + } catch (UnsupportedEncodingException ex) { // should not happen + throw new RuntimeException(ex); + } catch (NoSuchAlgorithmException ex) { // should not happen + throw new RuntimeException(ex); + } + } +} From e9396999a413aa3a9afb7968278aff1d5372841d Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 12 Feb 2013 00:01:33 -0800 Subject: [PATCH 019/109] Ticket #269: Continuing work, more work on UserMapping and UserDirectory --- .../utility/SecureRandomSaltUtility.java | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java index 63d37d3a5..a22120338 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -1,7 +1,38 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.utility; import java.io.UnsupportedEncodingException; From f831287747299b3d87f3b5970d09c26c94768ed8 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 12 Feb 2013 11:41:36 -0800 Subject: [PATCH 020/109] Ticket #269: Changed password hash column to binary(32) and added a database script to create a default admin user --- extensions/guacamole-auth-mysql/README | 4 + extensions/guacamole-auth-mysql/pom.xml | 3 + ...acamole-auth-mysql-create-default-user.sql | 4 + .../schema/guacamole-auth-mysql-schema.sql | 2 +- .../mysql/MySQLAuthenticationProvider.java | 12 +- .../guacamole/net/auth/mysql/MySQLUser.java | 15 +- .../net/auth/mysql/UserDirectory.java | 2 +- .../dao/{guacamole => }/ConnectionMapper.java | 28 ++-- .../ConnectionParameterMapper.java | 30 ++-- .../ConnectionPermissionMapper.java | 22 +-- .../SystemPermissionMapper.java | 22 +-- .../mysql/dao/{guacamole => }/UserMapper.java | 51 +++---- .../{guacamole => }/UserPermissionMapper.java | 22 +-- .../model/{guacamole => }/Connection.java | 24 ++-- .../{guacamole => }/ConnectionExample.java | 36 ++--- .../{guacamole => }/ConnectionParameter.java | 10 +- .../ConnectionParameterExample.java | 36 ++--- .../ConnectionParameterKey.java | 16 +-- .../ConnectionPermissionExample.java | 36 ++--- .../ConnectionPermissionKey.java | 22 +-- .../SystemPermissionExample.java | 36 ++--- .../{guacamole => }/SystemPermissionKey.java | 16 +-- .../guacamole/net/auth/mysql/model/User.java | 67 +++++++++ .../model/{guacamole => }/UserExample.java | 106 +++----------- .../UserPermissionExample.java | 36 ++--- .../{guacamole => }/UserPermissionKey.java | 22 +-- .../net/auth/mysql/model/UserWithBLOBs.java | 67 +++++++++ .../net/auth/mysql/model/guacamole/User.java | 131 ------------------ .../utility/PasswordEncryptionUtility.java | 4 +- .../net/auth/mysql/utility/SaltUtility.java | 4 +- .../utility/SecureRandomSaltUtility.java | 9 +- .../Sha256PasswordEncryptionUtility.java | 7 +- .../xml/{guacamole => }/ConnectionMapper.xml | 48 +++---- .../ConnectionParameterMapper.xml | 52 +++---- .../ConnectionPermissionMapper.xml | 40 +++--- .../SystemPermissionMapper.xml | 40 +++--- .../mysql/xml/{guacamole => }/UserMapper.xml | 116 ++++++++-------- .../{guacamole => }/UserPermissionMapper.xml | 40 +++--- 38 files changed, 588 insertions(+), 650 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/{guacamole => }/ConnectionMapper.java (77%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/{guacamole => }/ConnectionParameterMapper.java (76%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/{guacamole => }/ConnectionPermissionMapper.java (76%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/{guacamole => }/SystemPermissionMapper.java (76%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/{guacamole => }/UserMapper.java (63%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/{guacamole => }/UserPermissionMapper.java (76%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/Connection.java (80%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/ConnectionExample.java (94%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/ConnectionParameter.java (77%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/ConnectionParameterExample.java (94%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/ConnectionParameterKey.java (81%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/ConnectionPermissionExample.java (93%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/ConnectionPermissionKey.java (82%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/SystemPermissionExample.java (92%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/SystemPermissionKey.java (80%) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/UserExample.java (77%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/UserPermissionExample.java (93%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/{guacamole => }/UserPermissionKey.java (82%) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/{guacamole => }/ConnectionMapper.xml (85%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/{guacamole => }/ConnectionParameterMapper.xml (84%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/{guacamole => }/ConnectionPermissionMapper.xml (85%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/{guacamole => }/SystemPermissionMapper.xml (84%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/{guacamole => }/UserMapper.xml (79%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/{guacamole => }/UserPermissionMapper.xml (85%) diff --git a/extensions/guacamole-auth-mysql/README b/extensions/guacamole-auth-mysql/README index ffe70495e..f99deb6ee 100644 --- a/extensions/guacamole-auth-mysql/README +++ b/extensions/guacamole-auth-mysql/README @@ -63,6 +63,10 @@ guacamole.properties such that the authentication provider is available. A schema file is provided in the schema directory for creating the guacamole authentication tables in your MySQL database. + Additionally, a script is provided to create a default admin user + with username 'guacadmin' and password 'guacadmin'. This user can + be used to set up any other connections and users. + 4) Configure guacamole.properties for MySQL There are additional properties required by the MySQL JDBC driver diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index c193336ad..e0b8a7dee 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -94,11 +94,14 @@ 3.2 + com.google.collections google-collections 1.0 + + net.sourceforge.guacamole guacamole-auth-mysql diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql new file mode 100644 index 000000000..a9a553084 --- /dev/null +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql @@ -0,0 +1,4 @@ +insert into guacamole_user values(1, 'guacadmin', x'AE97B20D5B24B2F18BE7921E3C0CF6109696391D7D5A6BE24BD267E49F0D7E42', x'FE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264'); + +insert into guacamole_system_permission values(1, 'CREATE_CONFIGURATION'); +insert into guacamole_system_permission values(1, 'CREATE_USER'); diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index ffb94771f..ee0a0205e 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -18,7 +18,7 @@ CREATE TABLE `guacamole_user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(128) NOT NULL, `password_hash` binary(32) NOT NULL, - `password_salt` varchar(100) NOT NULL, + `password_salt` binary(32) NOT NULL, PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index db95428a7..831239300 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -45,12 +45,12 @@ import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.AuthenticationProvider; import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.UserContext; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.ConnectionMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.ConnectionParameterMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.ConnectionPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.SystemPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index f29ec948a..ab943d4ac 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -43,8 +43,9 @@ import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.User; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.permission.Permission; @@ -55,7 +56,7 @@ import net.sourceforge.guacamole.net.auth.permission.Permission; */ public class MySQLUser implements User { - private net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User user; + private UserWithBLOBs user; @Inject UserMapper userDao; @@ -69,7 +70,7 @@ public class MySQLUser implements User { Set permissions; MySQLUser() { - user = new net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User(); + user = new UserWithBLOBs(); permissions = new HashSet(); } @@ -81,7 +82,7 @@ public class MySQLUser implements User { void init (Credentials credentials) throws GuacamoleException { UserExample userExample = new UserExample(); userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); - List users = userDao.selectByExample(userExample); + List users = userDao.selectByExampleWithBLOBs(userExample); if(users.size() > 1) // the unique constraint on the table should prevent this throw new GuacamoleException("Multiple users found with the same username: " + credentials.getUsername()); if(users.isEmpty()) @@ -97,7 +98,7 @@ public class MySQLUser implements User { this.setUsername(user.getUsername()); } - public net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User getUser() { + public UserWithBLOBs getUser() { return user; } @@ -122,7 +123,7 @@ public class MySQLUser implements User { @Override public void setPassword(String password) { - String salt = saltUtility.generateSalt(); + byte[] salt = saltUtility.generateSalt(); user.setPassword_salt(salt); byte[] hash = passwordUtility.createPasswordHash(password, salt); user.setPassword_hash(hash); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 09419b969..ef298dc09 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -12,7 +12,7 @@ import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.User; -import net.sourceforge.guacamole.net.auth.mysql.dao.guacamole.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; /** * A MySQL based implementation of the User Directory. diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java similarity index 77% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java index 5366034c6..5039aaa99 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java @@ -1,8 +1,8 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.dao; import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.Connection; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.Connection; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import org.apache.ibatis.annotations.Param; public interface ConnectionMapper { @@ -10,7 +10,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int countByExample(ConnectionExample example); @@ -18,7 +18,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByExample(ConnectionExample example); @@ -26,7 +26,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByPrimaryKey(Integer connection_id); @@ -34,7 +34,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insert(Connection record); @@ -42,7 +42,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insertSelective(Connection record); @@ -50,7 +50,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ List selectByExample(ConnectionExample example); @@ -58,7 +58,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ Connection selectByPrimaryKey(Integer connection_id); @@ -66,7 +66,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); @@ -74,7 +74,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); @@ -82,7 +82,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByPrimaryKeySelective(Connection record); @@ -90,7 +90,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByPrimaryKey(Connection record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java similarity index 76% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java index f17368249..f1053dfbb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionParameterMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java @@ -1,9 +1,9 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.dao; import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameter; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionParameterKey; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterKey; import org.apache.ibatis.annotations.Param; public interface ConnectionParameterMapper { @@ -11,7 +11,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int countByExample(ConnectionParameterExample example); @@ -19,7 +19,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByExample(ConnectionParameterExample example); @@ -27,7 +27,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByPrimaryKey(ConnectionParameterKey key); @@ -35,7 +35,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insert(ConnectionParameter record); @@ -43,7 +43,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insertSelective(ConnectionParameter record); @@ -51,7 +51,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ List selectByExample(ConnectionParameterExample example); @@ -59,7 +59,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); @@ -67,7 +67,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); @@ -75,7 +75,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); @@ -83,7 +83,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByPrimaryKeySelective(ConnectionParameter record); @@ -91,7 +91,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByPrimaryKey(ConnectionParameter record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java similarity index 76% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java index 4c2d60456..ec024edd5 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/ConnectionPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java @@ -1,8 +1,8 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.dao; import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.ConnectionPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import org.apache.ibatis.annotations.Param; public interface ConnectionPermissionMapper { @@ -10,7 +10,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int countByExample(ConnectionPermissionExample example); @@ -18,7 +18,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByExample(ConnectionPermissionExample example); @@ -26,7 +26,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByPrimaryKey(ConnectionPermissionKey key); @@ -34,7 +34,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insert(ConnectionPermissionKey record); @@ -42,7 +42,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insertSelective(ConnectionPermissionKey record); @@ -50,7 +50,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ List selectByExample(ConnectionPermissionExample example); @@ -58,7 +58,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); @@ -66,7 +66,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java similarity index 76% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java index 1669809b4..bfd34f02f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/SystemPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java @@ -1,8 +1,8 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.dao; import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.SystemPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; import org.apache.ibatis.annotations.Param; public interface SystemPermissionMapper { @@ -10,7 +10,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int countByExample(SystemPermissionExample example); @@ -18,7 +18,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByExample(SystemPermissionExample example); @@ -26,7 +26,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByPrimaryKey(SystemPermissionKey key); @@ -34,7 +34,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insert(SystemPermissionKey record); @@ -42,7 +42,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insertSelective(SystemPermissionKey record); @@ -50,7 +50,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ List selectByExample(SystemPermissionExample example); @@ -58,7 +58,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); @@ -66,7 +66,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java similarity index 63% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java index 27a5b3d2b..e5172c3a6 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java @@ -1,8 +1,9 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.dao; import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.User; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.User; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import org.apache.ibatis.annotations.Param; public interface UserMapper { @@ -10,7 +11,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int countByExample(UserExample example); @@ -18,7 +19,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByExample(UserExample example); @@ -26,7 +27,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByPrimaryKey(Integer user_id); @@ -34,31 +35,31 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - int insert(User record); + int insert(UserWithBLOBs record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - int insertSelective(User record); + int insertSelective(UserWithBLOBs record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - List selectByExampleWithBLOBs(UserExample example); + List selectByExampleWithBLOBs(UserExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ List selectByExample(UserExample example); @@ -66,31 +67,31 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - User selectByPrimaryKey(Integer user_id); + UserWithBLOBs selectByPrimaryKey(Integer user_id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); + int updateByExampleSelective(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - int updateByExampleWithBLOBs(@Param("record") User record, @Param("example") UserExample example); + int updateByExampleWithBLOBs(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExample(@Param("record") User record, @Param("example") UserExample example); @@ -98,23 +99,23 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - int updateByPrimaryKeySelective(User record); + int updateByPrimaryKeySelective(UserWithBLOBs record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ - int updateByPrimaryKeyWithBLOBs(User record); + int updateByPrimaryKeyWithBLOBs(UserWithBLOBs record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByPrimaryKey(User record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java similarity index 76% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java index 1f4356e90..304bca62b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/guacamole/UserPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java @@ -1,8 +1,8 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.dao; import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.guacamole.UserPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; import org.apache.ibatis.annotations.Param; public interface UserPermissionMapper { @@ -10,7 +10,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int countByExample(UserPermissionExample example); @@ -18,7 +18,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByExample(UserPermissionExample example); @@ -26,7 +26,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int deleteByPrimaryKey(UserPermissionKey key); @@ -34,7 +34,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insert(UserPermissionKey record); @@ -42,7 +42,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int insertSelective(UserPermissionKey record); @@ -50,7 +50,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ List selectByExample(UserPermissionExample example); @@ -58,7 +58,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); @@ -66,7 +66,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java similarity index 80% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java index 25ae414f3..b644193ee 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/Connection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java @@ -1,11 +1,11 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; public class Connection { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer connection_id; @@ -13,7 +13,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String connection_name; @@ -21,7 +21,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String protocol; @@ -31,7 +31,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -43,7 +43,7 @@ public class Connection { * * @param connection_id the value for guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -55,7 +55,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getConnection_name() { return connection_name; @@ -67,10 +67,10 @@ public class Connection { * * @param connection_name the value for guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setConnection_name(String connection_name) { - this.connection_name = connection_name == null ? null : connection_name.trim(); + this.connection_name = connection_name; } /** @@ -79,7 +79,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getProtocol() { return protocol; @@ -91,9 +91,9 @@ public class Connection { * * @param protocol the value for guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setProtocol(String protocol) { - this.protocol = protocol == null ? null : protocol.trim(); + this.protocol = protocol; } } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java index 374a1cd78..ad8a48e19 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java @@ -1,4 +1,4 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public ConnectionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -399,7 +399,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +412,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java similarity index 77% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java index 2a2d73bc1..5f750f2d6 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameter.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java @@ -1,11 +1,11 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; public class ConnectionParameter extends ConnectionParameterKey { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String parameter_value; @@ -15,7 +15,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getParameter_value() { return parameter_value; @@ -27,9 +27,9 @@ public class ConnectionParameter extends ConnectionParameterKey { * * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setParameter_value(String parameter_value) { - this.parameter_value = parameter_value == null ? null : parameter_value.trim(); + this.parameter_value = parameter_value; } } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java index be25c918b..d57f3918f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java @@ -1,4 +1,4 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public ConnectionParameterExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -399,7 +399,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +412,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java similarity index 81% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java index 986dbb4e4..2b7062448 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionParameterKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java @@ -1,11 +1,11 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; public class ConnectionParameterKey { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer connection_id; @@ -13,7 +13,7 @@ public class ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String parameter_name; @@ -23,7 +23,7 @@ public class ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -35,7 +35,7 @@ public class ConnectionParameterKey { * * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -47,7 +47,7 @@ public class ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getParameter_name() { return parameter_name; @@ -59,9 +59,9 @@ public class ConnectionParameterKey { * * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setParameter_name(String parameter_name) { - this.parameter_name = parameter_name == null ? null : parameter_name.trim(); + this.parameter_name = parameter_name; } } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java similarity index 93% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java index a65cde408..6ffbebb64 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java @@ -1,4 +1,4 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public ConnectionPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -389,7 +389,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -402,7 +402,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java similarity index 82% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java index 7e496190e..bb9c4bee8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/ConnectionPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java @@ -1,11 +1,11 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; public class ConnectionPermissionKey { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer connection_id; @@ -21,7 +21,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String permission; @@ -31,7 +31,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getUser_id() { return user_id; @@ -43,7 +43,7 @@ public class ConnectionPermissionKey { * * @param user_id the value for guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -55,7 +55,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -67,7 +67,7 @@ public class ConnectionPermissionKey { * * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -79,7 +79,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getPermission() { return permission; @@ -91,9 +91,9 @@ public class ConnectionPermissionKey { * * @param permission the value for guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setPermission(String permission) { - this.permission = permission == null ? null : permission.trim(); + this.permission = permission; } } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java similarity index 92% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java index 7c972fd93..fddbafd6d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java @@ -1,4 +1,4 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public SystemPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -329,7 +329,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -342,7 +342,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java similarity index 80% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java index 920341d47..fa59ec47b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/SystemPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java @@ -1,11 +1,11 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; public class SystemPermissionKey { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class SystemPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String permission; @@ -23,7 +23,7 @@ public class SystemPermissionKey { * * @return the value of guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getUser_id() { return user_id; @@ -35,7 +35,7 @@ public class SystemPermissionKey { * * @param user_id the value for guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -47,7 +47,7 @@ public class SystemPermissionKey { * * @return the value of guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getPermission() { return permission; @@ -59,9 +59,9 @@ public class SystemPermissionKey { * * @param permission the value for guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setPermission(String permission) { - this.permission = permission == null ? null : permission.trim(); + this.permission = permission; } } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java new file mode 100644 index 000000000..d9ea8c87f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model; + +public class User { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + private String username; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.user_id + * + * @return the value of guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.user_id + * + * @param user_id the value for guacamole..guacamole_user.user_id + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.username + * + * @return the value of guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public String getUsername() { + return username; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.username + * + * @param username the value for guacamole..guacamole_user.username + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public void setUsername(String username) { + this.username = username; + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java similarity index 77% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java index 3b8d8f09c..15c8bda7a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java @@ -1,4 +1,4 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public UserExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -323,83 +323,13 @@ public class UserExample { addCriterion("username not between", value1, value2, "username"); return (Criteria) this; } - - public Criteria andPassword_saltIsNull() { - addCriterion("password_salt is null"); - return (Criteria) this; - } - - public Criteria andPassword_saltIsNotNull() { - addCriterion("password_salt is not null"); - return (Criteria) this; - } - - public Criteria andPassword_saltEqualTo(String value) { - addCriterion("password_salt =", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotEqualTo(String value) { - addCriterion("password_salt <>", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltGreaterThan(String value) { - addCriterion("password_salt >", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltGreaterThanOrEqualTo(String value) { - addCriterion("password_salt >=", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltLessThan(String value) { - addCriterion("password_salt <", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltLessThanOrEqualTo(String value) { - addCriterion("password_salt <=", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltLike(String value) { - addCriterion("password_salt like", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotLike(String value) { - addCriterion("password_salt not like", value, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltIn(List values) { - addCriterion("password_salt in", values, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotIn(List values) { - addCriterion("password_salt not in", values, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltBetween(String value1, String value2) { - addCriterion("password_salt between", value1, value2, "password_salt"); - return (Criteria) this; - } - - public Criteria andPassword_saltNotBetween(String value1, String value2) { - addCriterion("password_salt not between", value1, value2, "password_salt"); - return (Criteria) this; - } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +342,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java similarity index 93% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java index 6902d9515..a3803a93c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java @@ -1,4 +1,4 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; import java.util.ArrayList; import java.util.List; @@ -8,7 +8,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public UserPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -389,7 +389,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -402,7 +402,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java similarity index 82% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java index f9e966bb7..43a3abb4e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/UserPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java @@ -1,11 +1,11 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; +package net.sourceforge.guacamole.net.auth.mysql.model; public class UserPermissionKey { /** * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private Integer affected_user_id; @@ -21,7 +21,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ private String permission; @@ -31,7 +31,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getUser_id() { return user_id; @@ -43,7 +43,7 @@ public class UserPermissionKey { * * @param user_id the value for guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -55,7 +55,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public Integer getAffected_user_id() { return affected_user_id; @@ -67,7 +67,7 @@ public class UserPermissionKey { * * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setAffected_user_id(Integer affected_user_id) { this.affected_user_id = affected_user_id; @@ -79,7 +79,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public String getPermission() { return permission; @@ -91,9 +91,9 @@ public class UserPermissionKey { * * @param permission the value for guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 */ public void setPermission(String permission) { - this.permission = permission == null ? null : permission.trim(); + this.permission = permission; } } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java new file mode 100644 index 000000000..4ff86ca41 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java @@ -0,0 +1,67 @@ +package net.sourceforge.guacamole.net.auth.mysql.model; + +public class UserWithBLOBs extends User { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + private byte[] password_hash; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + private byte[] password_salt; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_hash + * + * @return the value of guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public byte[] getPassword_hash() { + return password_hash; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_hash + * + * @param password_hash the value for guacamole..guacamole_user.password_hash + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public void setPassword_hash(byte[] password_hash) { + this.password_hash = password_hash; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_user.password_salt + * + * @return the value of guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public byte[] getPassword_salt() { + return password_salt; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_user.password_salt + * + * @param password_salt the value for guacamole..guacamole_user.password_salt + * + * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + */ + public void setPassword_salt(byte[] password_salt) { + this.password_salt = password_salt; + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java deleted file mode 100644 index 3f2da3baa..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/guacamole/User.java +++ /dev/null @@ -1,131 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model.guacamole; - -public class User { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String username; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private String password_salt; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - private byte[] password_hash; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.user_id - * - * @return the value of guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.user_id - * - * @param user_id the value for guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.username - * - * @return the value of guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getUsername() { - return username; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.username - * - * @param username the value for guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setUsername(String username) { - this.username = username == null ? null : username.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.password_salt - * - * @return the value of guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public String getPassword_salt() { - return password_salt; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.password_salt - * - * @param password_salt the value for guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPassword_salt(String password_salt) { - this.password_salt = password_salt == null ? null : password_salt.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.password_hash - * - * @return the value of guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public byte[] getPassword_hash() { - return password_hash; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.password_hash - * - * @param password_hash the value for guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 05 15:45:11 PST 2013 - */ - public void setPassword_hash(byte[] password_hash) { - this.password_hash = password_hash; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java index f9d7a4963..0ebe3d819 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java @@ -51,7 +51,7 @@ public interface PasswordEncryptionUtility { * @param dbSalt * @return true if the provided credentials match what's in the database for that user. */ - public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, String dbSalt); + public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt); /** * Creates a password hash based on the provided username, password, and salt. @@ -60,5 +60,5 @@ public interface PasswordEncryptionUtility { * @param salt * @return the generated password hash. */ - public byte[] createPasswordHash(String password, String salt); + public byte[] createPasswordHash(String password, byte[] salt); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java index fd4661769..ce5a389c4 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SaltUtility.java @@ -35,8 +35,6 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.utility; -import net.sourceforge.guacamole.GuacamoleException; - /** * * @author James Muehlner @@ -46,5 +44,5 @@ public interface SaltUtility { * Generates a new String that can be used as a password salt. * @return a new salt for password encryption. */ - public String generateSalt(); + public byte[] generateSalt(); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java index a22120338..71833fd94 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -35,7 +35,6 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.utility; -import java.io.UnsupportedEncodingException; import java.security.SecureRandom; /** @@ -47,13 +46,9 @@ public class SecureRandomSaltUtility implements SaltUtility { SecureRandom secureRandom = new SecureRandom(); @Override - public String generateSalt() { + public byte[] generateSalt() { byte[] salt = new byte[32]; secureRandom.nextBytes(salt); - try { - return new String(salt, "UTF-8"); - } catch (UnsupportedEncodingException ex) { // should not happen - throw new RuntimeException(ex); - } + return salt; } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java index ff233d7f6..a46485695 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java @@ -40,6 +40,7 @@ import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; +import javax.xml.bind.DatatypeConverter; import net.sourceforge.guacamole.net.auth.Credentials; /** @@ -49,7 +50,7 @@ import net.sourceforge.guacamole.net.auth.Credentials; public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtility { @Override - public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, String dbSalt) { + public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt) { Preconditions.checkNotNull(credentials); Preconditions.checkNotNull(dbPasswordHash); Preconditions.checkNotNull(dbUsername); @@ -59,7 +60,7 @@ public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtilit } @Override - public byte[] createPasswordHash(String password, String salt) { + public byte[] createPasswordHash(String password, byte[] salt) { Preconditions.checkNotNull(password); Preconditions.checkNotNull(salt); try { @@ -67,7 +68,7 @@ public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtilit StringBuilder builder = new StringBuilder(); builder.append(password); - builder.append(salt); + builder.append(DatatypeConverter.printHexBinary(salt)); md.update(builder.toString().getBytes("UTF-8")); return md.digest(); } catch (UnsupportedEncodingException ex) { // should not happen diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml similarity index 85% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml index 376ac3269..0735194c5 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml @@ -1,11 +1,11 @@ - - + + @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,15 +83,15 @@ connection_id, connection_name, protocol - select @@ -110,7 +110,7 @@ select @@ -121,38 +121,38 @@ delete from guacamole..guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} - + delete from guacamole..guacamole_connection - + insert into guacamole..guacamole_connection (connection_id, connection_name, protocol ) values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} ) - + insert into guacamole..guacamole_connection @@ -178,11 +178,11 @@ - select count(*) from guacamole..guacamole_connection @@ -193,7 +193,7 @@ update guacamole..guacamole_connection @@ -215,7 +215,7 @@ update guacamole..guacamole_connection set connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -225,11 +225,11 @@ - + update guacamole..guacamole_connection @@ -242,11 +242,11 @@ where connection_id = #{connection_id,jdbcType=INTEGER} - + update guacamole..guacamole_connection set connection_name = #{connection_name,jdbcType=VARCHAR}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml similarity index 84% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml index 44b175d1f..9dce08532 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionParameterMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml @@ -1,11 +1,11 @@ - - + + @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,15 +83,15 @@ connection_id, parameter_name, parameter_value - select @@ -106,11 +106,11 @@ order by ${orderByClause} - select @@ -118,43 +118,43 @@ where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} - + delete from guacamole..guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} - + delete from guacamole..guacamole_connection_parameter - + insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value ) values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} ) - + insert into guacamole..guacamole_connection_parameter @@ -180,11 +180,11 @@ - select count(*) from guacamole..guacamole_connection_parameter @@ -195,7 +195,7 @@ update guacamole..guacamole_connection_parameter @@ -217,7 +217,7 @@ update guacamole..guacamole_connection_parameter set connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -227,11 +227,11 @@ - + update guacamole..guacamole_connection_parameter @@ -242,11 +242,11 @@ where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} - + update guacamole..guacamole_connection_parameter set parameter_value = #{parameter_value,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml similarity index 85% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml index 8f522958b..0ae3fc3a9 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml @@ -1,11 +1,11 @@ - - + + @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,15 +83,15 @@ user_id, connection_id, permission - select @@ -106,44 +106,44 @@ order by ${orderByClause} - + delete from guacamole..guacamole_connection_permission where user_id = #{user_id,jdbcType=INTEGER} and connection_id = #{connection_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} - + delete from guacamole..guacamole_connection_permission - + insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) - + insert into guacamole..guacamole_connection_permission @@ -169,11 +169,11 @@ - select count(*) from guacamole..guacamole_connection_permission @@ -184,7 +184,7 @@ update guacamole..guacamole_connection_permission @@ -206,7 +206,7 @@ update guacamole..guacamole_connection_permission set user_id = #{record.user_id,jdbcType=INTEGER}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml similarity index 84% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml index 40f3da6bc..dde3c6690 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/SystemPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml @@ -1,11 +1,11 @@ - - + + @@ -14,7 +14,7 @@ @@ -48,7 +48,7 @@ @@ -82,15 +82,15 @@ user_id, permission - select @@ -105,41 +105,41 @@ order by ${orderByClause} - + delete from guacamole..guacamole_system_permission where user_id = #{user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} - + delete from guacamole..guacamole_system_permission - + insert into guacamole..guacamole_system_permission (user_id, permission) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) - + insert into guacamole..guacamole_system_permission @@ -159,11 +159,11 @@ - select count(*) from guacamole..guacamole_system_permission @@ -174,7 +174,7 @@ update guacamole..guacamole_system_permission @@ -193,7 +193,7 @@ update guacamole..guacamole_system_permission set user_id = #{record.user_id,jdbcType=INTEGER}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml similarity index 79% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml index d1abca0f6..4a0e1f21e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml @@ -1,29 +1,29 @@ - - + + - - + + @@ -57,7 +57,7 @@ @@ -91,23 +91,23 @@ - user_id, username, password_salt + user_id, username - password_hash + password_hash, password_salt - select @@ -124,11 +124,11 @@ order by ${orderByClause} - select @@ -147,7 +147,7 @@ select @@ -160,38 +160,38 @@ delete from guacamole..guacamole_user where user_id = #{user_id,jdbcType=INTEGER} - + delete from guacamole..guacamole_user - + - insert into guacamole..guacamole_user (user_id, username, password_salt, - password_hash) - values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_salt,jdbcType=VARCHAR}, - #{password_hash,jdbcType=BINARY}) + insert into guacamole..guacamole_user (user_id, username, password_hash, + password_salt) + values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, + #{password_salt,jdbcType=BINARY}) - + insert into guacamole..guacamole_user @@ -201,12 +201,12 @@ username, - - password_salt, - password_hash, + + password_salt, + @@ -215,19 +215,19 @@ #{username,jdbcType=VARCHAR}, - - #{password_salt,jdbcType=VARCHAR}, - #{password_hash,jdbcType=BINARY}, + + #{password_salt,jdbcType=BINARY}, + - select count(*) from guacamole..guacamole_user @@ -238,7 +238,7 @@ update guacamole..guacamole_user @@ -248,12 +248,12 @@ username = #{record.username,jdbcType=VARCHAR}, - - password_salt = #{record.password_salt,jdbcType=VARCHAR}, - password_hash = #{record.password_hash,jdbcType=BINARY}, + + password_salt = #{record.password_salt,jdbcType=BINARY}, + @@ -263,13 +263,13 @@ update guacamole..guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR}, - password_salt = #{record.password_salt,jdbcType=VARCHAR}, - password_hash = #{record.password_hash,jdbcType=BINARY} + password_hash = #{record.password_hash,jdbcType=BINARY}, + password_salt = #{record.password_salt,jdbcType=BINARY} @@ -278,57 +278,55 @@ update guacamole..guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, - username = #{record.username,jdbcType=VARCHAR}, - password_salt = #{record.password_salt,jdbcType=VARCHAR} + username = #{record.username,jdbcType=VARCHAR} - + update guacamole..guacamole_user username = #{username,jdbcType=VARCHAR}, - - password_salt = #{password_salt,jdbcType=VARCHAR}, - password_hash = #{password_hash,jdbcType=BINARY}, + + password_salt = #{password_salt,jdbcType=BINARY}, + where user_id = #{user_id,jdbcType=INTEGER} - + update guacamole..guacamole_user set username = #{username,jdbcType=VARCHAR}, - password_salt = #{password_salt,jdbcType=VARCHAR}, - password_hash = #{password_hash,jdbcType=BINARY} + password_hash = #{password_hash,jdbcType=BINARY}, + password_salt = #{password_salt,jdbcType=BINARY} where user_id = #{user_id,jdbcType=INTEGER} - + update guacamole..guacamole_user - set username = #{username,jdbcType=VARCHAR}, - password_salt = #{password_salt,jdbcType=VARCHAR} + set username = #{username,jdbcType=VARCHAR} where user_id = #{user_id,jdbcType=INTEGER} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml similarity index 85% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml index 5d27de207..98c49f7c1 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/guacamole/UserPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml @@ -1,11 +1,11 @@ - - + + @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,15 +83,15 @@ user_id, affected_user_id, permission - select @@ -106,44 +106,44 @@ order by ${orderByClause} - + delete from guacamole..guacamole_user_permission where user_id = #{user_id,jdbcType=INTEGER} and affected_user_id = #{affected_user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} - + delete from guacamole..guacamole_user_permission - + insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) - + insert into guacamole..guacamole_user_permission @@ -169,11 +169,11 @@ - select count(*) from guacamole..guacamole_user_permission @@ -184,7 +184,7 @@ update guacamole..guacamole_user_permission @@ -206,7 +206,7 @@ update guacamole..guacamole_user_permission set user_id = #{record.user_id,jdbcType=INTEGER}, From 70b34ecf304092bef92def0562b9a31311463fa1 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Tue, 12 Feb 2013 23:35:13 -0800 Subject: [PATCH 021/109] Ticket #269: More things implemented. Still to do: ConnectionDirectory, and enforcing permissions on things in general. --- ...acamole-auth-mysql-create-default-user.sql | 2 +- .../schema/guacamole-auth-mysql-schema.sql | 2 +- .../mysql/MySQLAuthenticationProvider.java | 2 + .../net/auth/mysql/MySQLConnection.java | 85 +++ .../net/auth/mysql/MySQLConstants.java | 71 +++ .../guacamole/net/auth/mysql/MySQLUser.java | 60 +- .../net/auth/mysql/MySQLUserContext.java | 7 +- .../net/auth/mysql/UserDirectory.java | 372 ++++++++++++- .../net/auth/mysql/dao/ConnectionMapper.java | 22 +- .../mysql/dao/ConnectionParameterMapper.java | 22 +- .../mysql/dao/ConnectionPermissionMapper.java | 16 +- .../mysql/dao/SystemPermissionMapper.java | 16 +- .../net/auth/mysql/dao/UserMapper.java | 28 +- .../auth/mysql/dao/UserPermissionMapper.java | 16 +- .../net/auth/mysql/model/Connection.java | 18 +- .../auth/mysql/model/ConnectionExample.java | 34 +- .../auth/mysql/model/ConnectionParameter.java | 6 +- .../model/ConnectionParameterExample.java | 34 +- .../mysql/model/ConnectionParameterKey.java | 12 +- .../model/ConnectionPermissionExample.java | 34 +- .../mysql/model/ConnectionPermissionKey.java | 18 +- .../mysql/model/SystemPermissionExample.java | 34 +- .../auth/mysql/model/SystemPermissionKey.java | 12 +- .../guacamole/net/auth/mysql/model/User.java | 12 +- .../net/auth/mysql/model/UserExample.java | 34 +- .../mysql/model/UserPermissionExample.java | 34 +- .../auth/mysql/model/UserPermissionKey.java | 18 +- .../net/auth/mysql/model/UserWithBLOBs.java | 12 +- .../mysql/utility/PermissionCheckUtility.java | 511 ++++++++++++++++++ .../utility/SecureRandomSaltUtility.java | 2 +- .../net/auth/mysql/xml/ConnectionMapper.xml | 30 +- .../mysql/xml/ConnectionParameterMapper.xml | 30 +- .../mysql/xml/ConnectionPermissionMapper.xml | 24 +- .../auth/mysql/xml/SystemPermissionMapper.xml | 24 +- .../net/auth/mysql/xml/UserMapper.xml | 40 +- .../auth/mysql/xml/UserPermissionMapper.xml | 24 +- 36 files changed, 1386 insertions(+), 332 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql index a9a553084..a50584d9f 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql @@ -1,4 +1,4 @@ insert into guacamole_user values(1, 'guacadmin', x'AE97B20D5B24B2F18BE7921E3C0CF6109696391D7D5A6BE24BD267E49F0D7E42', x'FE24ADC5E11E2B25288D1704ABE67A79E342ECC26064CE69C5B3177795A82264'); -insert into guacamole_system_permission values(1, 'CREATE_CONFIGURATION'); +insert into guacamole_system_permission values(1, 'CREATE_CONNECTION'); insert into guacamole_system_permission values(1, 'CREATE_USER'); diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index ee0a0205e..4d74f1e4c 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -54,7 +54,7 @@ CREATE TABLE `guacamole_connection_permission` ( CREATE TABLE `guacamole_system_permission` ( `user_id` int(11) NOT NULL, - `permission` enum('CREATE_CONFIGURATION','CREATE_USER') NOT NULL, + `permission` enum('CREATE_CONNECTION','CREATE_USER') NOT NULL, PRIMARY KEY (`user_id`,`permission`), CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 831239300..09497a943 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -52,6 +52,7 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; @@ -112,6 +113,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(MySQLUser.class); bind(SaltUtility.class).to(SecureRandomSaltUtility.class); bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); + bind(PermissionCheckUtility.class); } } ); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java new file mode 100644 index 000000000..1ca51a0ad --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -0,0 +1,85 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.inject.Inject; +import java.util.List; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.GuacamoleSocket; +import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; +import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; +import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; + +/** + * A MySQL based implementation of the Connection object. + * @author James Muehlner + */ +public class MySQLConnection implements Connection { + + @Inject + ConnectionMapper connectionDAO; + + private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection; + + /** + * Create a default, empty connection. + */ + MySQLConnection() { + connection = new net.sourceforge.guacamole.net.auth.mysql.model.Connection(); + } + + /** + * Load an existing connection by name. + * @param connectionName + */ + public void init(String connectionName) throws GuacamoleException { + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_nameEqualTo(connectionName); + List connections; + connections = connectionDAO.selectByExample(example); + if(connections.size() > 1) // the unique constraint should prevent this from happening + throw new GuacamoleException("Multiple connections found named '" + connectionName + "'."); + else if(connections.isEmpty()) + throw new GuacamoleException("No connection found named '" + connectionName + "'."); + + connection = connections.get(0); + } + + /** + * Initialize from a database record. + * @param connection + */ + public void init(net.sourceforge.guacamole.net.auth.mysql.model.Connection connection) { + this.connection = connection; + } + + @Override + public String getIdentifier() { + return connection.getConnection_name(); + } + + @Override + public void setIdentifier(String identifier) { + connection.setConnection_name(identifier); + } + + @Override + public GuacamoleConfiguration getConfiguration() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setConfiguration(GuacamoleConfiguration config) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public GuacamoleSocket connect(GuacamoleClientInformation info) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java new file mode 100644 index 000000000..e34b76ee7 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -0,0 +1,71 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +/** + * Constants relevant to the guacamole-auth-mysql project. + * @author James Muehlner + */ +public interface MySQLConstants { + + //*********** Permission Strings *********** + // operations + public static final String CREATE = "CREATE"; + public static final String READ = "READ"; + public static final String WRITE = "WRITE"; + public static final String DELETE = "DELETE"; + public static final String ADMINISTER = "ADMINISTER"; + + // used to separate operations from objects + public static final String SEPARATOR = "_"; + + //object types + public static final String USER = "USER"; + public static final String CONNECTION = "CONNECTION"; + + //combinations + public static final String CREATE_USER = CREATE + SEPARATOR + USER; + public static final String READ_USER = READ + SEPARATOR + USER; + public static final String WRITE_USER = WRITE + SEPARATOR + USER; + public static final String DELETE_USER = DELETE + SEPARATOR + USER; + public static final String ADMINISTER_USER = ADMINISTER + SEPARATOR + USER; + + public static final String CREATE_CONNECTION = CREATE + SEPARATOR + CONNECTION; + public static final String READ_CONNECTION = READ + SEPARATOR + CONNECTION; + public static final String WRITE_CONNECTION = WRITE + SEPARATOR + CONNECTION; + public static final String DELETE_CONNECTION = DELETE + SEPARATOR + CONNECTION; + public static final String ADMINISTER_CONNECTION = ADMINISTER + SEPARATOR + CONNECTION; +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index ab943d4ac..7fe4bd554 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -47,6 +47,7 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.permission.Permission; @@ -59,7 +60,7 @@ public class MySQLUser implements User { private UserWithBLOBs user; @Inject - UserMapper userDao; + UserMapper userDAO; @Inject PasswordEncryptionUtility passwordUtility; @@ -67,8 +68,14 @@ public class MySQLUser implements User { @Inject SaltUtility saltUtility; + @Inject + PermissionCheckUtility permissionCheckUtility; + Set permissions; + /** + * Create a default, empty user. + */ MySQLUser() { user = new UserWithBLOBs(); permissions = new HashSet(); @@ -82,7 +89,7 @@ public class MySQLUser implements User { void init (Credentials credentials) throws GuacamoleException { UserExample userExample = new UserExample(); userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); - List users = userDao.selectByExampleWithBLOBs(userExample); + List users = userDAO.selectByExampleWithBLOBs(userExample); if(users.size() > 1) // the unique constraint on the table should prevent this throw new GuacamoleException("Multiple users found with the same username: " + credentials.getUsername()); if(users.isEmpty()) @@ -91,13 +98,60 @@ public class MySQLUser implements User { // check password if(!passwordUtility.checkCredentials(credentials, user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) throw new GuacamoleException("No user found with the supplied credentials"); + + this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); } - void init (User user) { + /** + * Create a new user from the provided information. This represents a user that has not yet been inserted. + * @param user + * @throws GuacamoleException + */ + public void initNew (User user) throws GuacamoleException { this.setPassword(user.getPassword()); this.setUsername(user.getUsername()); + this.permissions = user.getPermissions(); } + /** + * Loads a user by username. + * @param userName + * @throws GuacamoleException + */ + public void initExisting (String username) throws GuacamoleException { + UserExample example = new UserExample(); + example.createCriteria().andUsernameEqualTo(username); + List userList = userDAO.selectByExampleWithBLOBs(example); + if(userList.size() > 1) // this should never happen; the unique constraint should prevent it + throw new GuacamoleException("Multiple users found with username '" + username + "'."); + if(userList.size() == 0) + throw new GuacamoleException("No user found with username '" + username + "'."); + + this.user = userList.get(0); + this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); + } + + /** + * Initialize from a database record. + * @param user + */ + public void init(UserWithBLOBs user) { + this.user = user; + this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); + } + + /** + * Get the user id. + * @return + */ + public int getUserID() { + return user.getUser_id(); + } + + /** + * Return the database record held by this object. + * @return + */ public UserWithBLOBs getUser() { return user; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 026533aea..5d33b169a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -46,7 +46,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * + * * @author James Muehlner */ public class MySQLUserContext implements UserContext { @@ -56,8 +56,11 @@ public class MySQLUserContext implements UserContext { @Inject private MySQLUser user; + @Inject UserDirectory userDirectory; + void init(Credentials credentials) throws GuacamoleException { user.init(credentials); + userDirectory.init(user); } @Override @@ -67,7 +70,7 @@ public class MySQLUserContext implements UserContext { @Override public Directory getUserDirectory() throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + return userDirectory; } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index ef298dc09..dd25e9b46 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -1,72 +1,400 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql; +import com.google.common.base.Preconditions; import com.google.inject.Inject; import com.google.inject.Provider; +import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; +import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; +import net.sourceforge.guacamole.net.auth.permission.Permission; +import net.sourceforge.guacamole.net.auth.permission.SystemPermission; +import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.UserPermission; +import org.mybatis.guice.transactional.Transactional; /** * A MySQL based implementation of the User Directory. * @author James Muehlner */ public class UserDirectory implements Directory { - - private Map userMap = new HashMap(); + + /** + * The user who this user directory belongs to. + * Access is based on his/her permission settings. + */ + private MySQLUser user; @Inject UserMapper userDAO; + @Inject + ConnectionMapper connectionDAO; + + @Inject + UserPermissionMapper userPermissionDAO; + + @Inject + ConnectionPermissionMapper connectionPermissionDAO; + + @Inject + SystemPermissionMapper systemPermissionDAO; + + @Inject + PermissionCheckUtility permissionCheckUtility; + @Inject Provider mySQLUserProvider; - private MySQLUser getMySQLUser(User user) { + /** + * Set the user for this directory. + * @param user + */ + void init(MySQLUser user) { + this.user = user; + } + + /** + * Create a new user based on the provided object. + * @param user + * @return + * @throws GuacamoleException + */ + private MySQLUser getNewMySQLUser(User user) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.init(user); + mySQLUser.initNew(user); return mySQLUser; } + /** + * Get the user based on the username of the provided object. + * @param user + * @return + * @throws GuacamoleException + */ + private MySQLUser getExistingMySQLUser(User user) throws GuacamoleException { + return getExistingMySQLUser(user.getUsername()); + } + + /** + * Get the user based on the username of the provided object. + * @param user + * @return + * @throws GuacamoleException + */ + private MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.initExisting(name); + return mySQLUser; + } + + @Transactional @Override public User get(String identifier) throws GuacamoleException { - return userMap.get(identifier); + return getExistingMySQLUser(identifier); } + @Transactional @Override public Set getIdentifiers() throws GuacamoleException { - return userMap.keySet(); + Set userNameSet = new HashSet(); + List users = permissionCheckUtility.getReadableUsers(user.getUserID()); + for(MySQLUser mySQLUser : users) { + userNameSet.add(mySQLUser.getUsername()); + } + return userNameSet; } @Override + @Transactional public void add(User object) throws GuacamoleException { - MySQLUser mySQLUser = getMySQLUser(object); + Preconditions.checkNotNull(object); + //create user in database + MySQLUser mySQLUser = getNewMySQLUser(object); userDAO.insert(mySQLUser.getUser()); - userMap.put(mySQLUser.getUsername(), mySQLUser); + + //create permissions in database + updatePermissions(mySQLUser); + } + + /** + * Update all the permissions for a given user to be only those specified in the user object. + * Delete any permissions not in the list, and create any in the list that do not exist + * in the database. + * @param user + * @throws GuacamoleException + */ + private void updatePermissions(MySQLUser user) throws GuacamoleException { + List userPermissions = new ArrayList(); + List connectionPermissions = new ArrayList(); + List systemPermissions = new ArrayList(); + + for(Permission permission : user.getPermissions()) { + if(permission instanceof UserPermission) + userPermissions.add((UserPermission)permission); + else if(permission instanceof ConnectionPermission) + connectionPermissions.add((ConnectionPermission)permission); + else if(permission instanceof SystemPermission) + systemPermissions.add((SystemPermission)permission); + } + + updateUserPermissions(userPermissions, user); + updateConnectionPermissions(connectionPermissions, user); + updateSystemPermissions(systemPermissions, user); + } + + /** + * Update all the permissions having to do with users for a given user. + * @param permissions + * @param user + */ + private void updateUserPermissions(Iterable permissions, MySQLUser user) throws GuacamoleException { + + List usernames = new ArrayList(); + for(UserPermission permission : permissions) { + usernames.add(permission.getObjectIdentifier()); + } + + // find all the users by username + UserExample userExample = new UserExample(); + userExample.createCriteria().andUsernameIn(usernames); + List dbUsers = userDAO.selectByExample(userExample); + List userIDs = new ArrayList(); + + Map dbUserMap = new HashMap(); + for(net.sourceforge.guacamole.net.auth.mysql.model.User dbUser : dbUsers) { + dbUserMap.put(dbUser.getUsername(), dbUser); + userIDs.add(dbUser.getUser_id()); + } + + // find any user permissions that may already exist + UserPermissionExample userPermissionExample = new UserPermissionExample(); + userPermissionExample.createCriteria().andAffected_user_idIn(userIDs); + List existingPermissions = userPermissionDAO.selectByExample(userPermissionExample); + Set existingUserIDs = new HashSet(); + for(UserPermissionKey userPermission : existingPermissions) { + existingUserIDs.add(userPermission.getAffected_user_id()); + } + + // delete any permissions that are not in the provided list + userPermissionExample.clear(); + userPermissionExample.createCriteria().andAffected_user_idNotIn(userIDs); + userPermissionDAO.deleteByExample(userPermissionExample); + + // finally, insert the new permissions + for(UserPermission permission : permissions) { + net.sourceforge.guacamole.net.auth.mysql.model.User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); + if(dbAffectedUser == null) + throw new GuacamoleException("User '" + permission.getObjectIdentifier() + "' not found."); + + // the permission for this user already exists, we don't need to create it again + if(existingUserIDs.contains(dbAffectedUser.getUser_id())) + continue; + + UserPermissionKey newPermission = new UserPermissionKey(); + newPermission.setAffected_user_id(dbAffectedUser.getUser_id()); + newPermission.setPermission(permission.getType().name()); + newPermission.setUser_id(user.getUserID()); + userPermissionDAO.insert(newPermission); + } + } + + /** + * Update all the permissions having to do with connections for a given user. + * @param permissions + * @param user + */ + private void updateConnectionPermissions(Iterable permissions, MySQLUser user) throws GuacamoleException { + + List connectionnames = new ArrayList(); + for(ConnectionPermission permission : permissions) { + connectionnames.add(permission.getObjectIdentifier()); + } + + // find all the connections by connectionname + ConnectionExample connectionExample = new ConnectionExample(); + connectionExample.createCriteria().andConnection_nameIn(connectionnames); + List dbConnections = connectionDAO.selectByExample(connectionExample); + List connectionIDs = new ArrayList(); + + Map dbConnectionMap = new HashMap(); + for(net.sourceforge.guacamole.net.auth.mysql.model.Connection dbConnection : dbConnections) { + dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); + connectionIDs.add(dbConnection.getConnection_id()); + } + + // find any connection permissions that may already exist + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria().andConnection_idIn(connectionIDs); + List existingPermissions = connectionPermissionDAO.selectByExample(connectionPermissionExample); + Set existingConnectionIDs = new HashSet(); + for(ConnectionPermissionKey connectionPermission : existingPermissions) { + existingConnectionIDs.add(connectionPermission.getConnection_id()); + } + + // delete any permissions that are not in the provided list + connectionPermissionExample.clear(); + connectionPermissionExample.createCriteria().andConnection_idNotIn(connectionIDs); + connectionPermissionDAO.deleteByExample(connectionPermissionExample); + + // finally, insert the new permissions + for(ConnectionPermission permission : permissions) { + net.sourceforge.guacamole.net.auth.mysql.model.Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); + if(dbConnection == null) + throw new GuacamoleException("Connection '" + permission.getObjectIdentifier() + "' not found."); + + // the permission for this connection already exists, we don't need to create it again + if(existingConnectionIDs.contains(dbConnection.getConnection_id())) + continue; + + ConnectionPermissionKey newPermission = new ConnectionPermissionKey(); + newPermission.setConnection_id(dbConnection.getConnection_id()); + newPermission.setPermission(permission.getType().name()); + newPermission.setConnection_id(user.getUserID()); + connectionPermissionDAO.insert(newPermission); + } + } + + /** + * Update all system permissions for a given user. + * @param permissions + * @param user + */ + private void updateSystemPermissions(Iterable permissions, MySQLUser user) { + List systemPermissionTypes = new ArrayList(); + for(SystemPermission permission : permissions) { + String operation = permission.getType().name(); + if(permission instanceof ConnectionDirectoryPermission) + systemPermissionTypes.add(operation + "_CONNECTION"); + else if(permission instanceof UserDirectoryPermission) + systemPermissionTypes.add(operation + "_USER"); + } + + //delete all system permissions not in the list + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()).andPermissionNotIn(systemPermissionTypes); + systemPermissionDAO.deleteByExample(systemPermissionExample); + + // find all existing system permissions + systemPermissionExample.clear(); + systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()).andPermissionIn(systemPermissionTypes); + List existingPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); + Set existingPermissionTypes = new HashSet(); + for(SystemPermissionKey existingPermission : existingPermissions) { + existingPermissionTypes.add(existingPermission.getPermission()); + } + + // finally, insert any new system permissions for this user + for(String systemPermissionType : systemPermissionTypes) { + //do not insert the permission if it already exists + if(existingPermissionTypes.contains(systemPermissionType)) + continue; + + SystemPermissionKey newSystemPermission = new SystemPermissionKey(); + newSystemPermission.setUser_id(user.getUserID()); + newSystemPermission.setPermission(systemPermissionType); + systemPermissionDAO.insert(newSystemPermission); + } } @Override + @Transactional public void update(User object) throws GuacamoleException { - if(!userMap.containsKey(object.getUsername())) - throw new GuacamoleException("User not found in Directory."); - MySQLUser mySQLUser = getMySQLUser(object); + //update the user in the database + MySQLUser mySQLUser = getExistingMySQLUser(object); userDAO.updateByPrimaryKey(mySQLUser.getUser()); - userMap.put(object.getUsername(), mySQLUser); + + //update permissions in database + updatePermissions(mySQLUser); } @Override + @Transactional public void remove(String identifier) throws GuacamoleException { - User user = userMap.get(identifier); - if(user == null) - throw new GuacamoleException("User not found in Directory."); - MySQLUser mySQLUser = getMySQLUser(user); - userDAO.deleteByPrimaryKey(mySQLUser.getUser().getUser_id()); - userMap.remove(user.getUsername()); + + MySQLUser mySQLUser = getExistingMySQLUser(identifier); + + //delete all the user permissions in the database + deleteAllPermissions(mySQLUser); + + //delete the user in the database + userDAO.deleteByPrimaryKey(mySQLUser.getUserID()); + } + + /** + * Delete all permissions associated with the provided user. + * @param user + */ + private void deleteAllPermissions(MySQLUser user) { + //delete all user permissions + UserPermissionExample userPermissionExample = new UserPermissionExample(); + userPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); + userPermissionDAO.deleteByExample(userPermissionExample); + + //delete all connection permissions + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); + connectionPermissionDAO.deleteByExample(connectionPermissionExample); + + //delete all system permissions + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); + systemPermissionDAO.deleteByExample(systemPermissionExample); } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java index 5039aaa99..c94ce35fb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java @@ -10,7 +10,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int countByExample(ConnectionExample example); @@ -18,7 +18,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByExample(ConnectionExample example); @@ -26,7 +26,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByPrimaryKey(Integer connection_id); @@ -34,7 +34,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insert(Connection record); @@ -42,7 +42,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insertSelective(Connection record); @@ -50,7 +50,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExample(ConnectionExample example); @@ -58,7 +58,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ Connection selectByPrimaryKey(Integer connection_id); @@ -66,7 +66,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); @@ -74,7 +74,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); @@ -82,7 +82,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKeySelective(Connection record); @@ -90,7 +90,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKey(Connection record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java index f1053dfbb..d8375bc71 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java @@ -11,7 +11,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int countByExample(ConnectionParameterExample example); @@ -19,7 +19,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByExample(ConnectionParameterExample example); @@ -27,7 +27,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByPrimaryKey(ConnectionParameterKey key); @@ -35,7 +35,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insert(ConnectionParameter record); @@ -43,7 +43,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insertSelective(ConnectionParameter record); @@ -51,7 +51,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExample(ConnectionParameterExample example); @@ -59,7 +59,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); @@ -67,7 +67,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); @@ -75,7 +75,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); @@ -83,7 +83,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKeySelective(ConnectionParameter record); @@ -91,7 +91,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKey(ConnectionParameter record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java index ec024edd5..b764d3238 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java @@ -10,7 +10,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int countByExample(ConnectionPermissionExample example); @@ -18,7 +18,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByExample(ConnectionPermissionExample example); @@ -26,7 +26,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByPrimaryKey(ConnectionPermissionKey key); @@ -34,7 +34,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insert(ConnectionPermissionKey record); @@ -42,7 +42,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insertSelective(ConnectionPermissionKey record); @@ -50,7 +50,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExample(ConnectionPermissionExample example); @@ -58,7 +58,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); @@ -66,7 +66,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java index bfd34f02f..2aa690b53 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java @@ -10,7 +10,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int countByExample(SystemPermissionExample example); @@ -18,7 +18,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByExample(SystemPermissionExample example); @@ -26,7 +26,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByPrimaryKey(SystemPermissionKey key); @@ -34,7 +34,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insert(SystemPermissionKey record); @@ -42,7 +42,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insertSelective(SystemPermissionKey record); @@ -50,7 +50,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExample(SystemPermissionExample example); @@ -58,7 +58,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); @@ -66,7 +66,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java index e5172c3a6..d74677309 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java @@ -11,7 +11,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int countByExample(UserExample example); @@ -19,7 +19,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByExample(UserExample example); @@ -27,7 +27,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByPrimaryKey(Integer user_id); @@ -35,7 +35,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insert(UserWithBLOBs record); @@ -43,7 +43,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insertSelective(UserWithBLOBs record); @@ -51,7 +51,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExampleWithBLOBs(UserExample example); @@ -59,7 +59,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExample(UserExample example); @@ -67,7 +67,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ UserWithBLOBs selectByPrimaryKey(Integer user_id); @@ -75,7 +75,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleSelective(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); @@ -83,7 +83,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleWithBLOBs(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); @@ -91,7 +91,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExample(@Param("record") User record, @Param("example") UserExample example); @@ -99,7 +99,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKeySelective(UserWithBLOBs record); @@ -107,7 +107,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKeyWithBLOBs(UserWithBLOBs record); @@ -115,7 +115,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByPrimaryKey(User record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java index 304bca62b..3cba6639d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java @@ -10,7 +10,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int countByExample(UserPermissionExample example); @@ -18,7 +18,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByExample(UserPermissionExample example); @@ -26,7 +26,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int deleteByPrimaryKey(UserPermissionKey key); @@ -34,7 +34,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insert(UserPermissionKey record); @@ -42,7 +42,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int insertSelective(UserPermissionKey record); @@ -50,7 +50,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ List selectByExample(UserPermissionExample example); @@ -58,7 +58,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); @@ -66,7 +66,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java index b644193ee..fa5b3b7d8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java @@ -5,7 +5,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer connection_id; @@ -13,7 +13,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String connection_name; @@ -21,7 +21,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String protocol; @@ -31,7 +31,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -43,7 +43,7 @@ public class Connection { * * @param connection_id the value for guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -55,7 +55,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getConnection_name() { return connection_name; @@ -67,7 +67,7 @@ public class Connection { * * @param connection_name the value for guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setConnection_name(String connection_name) { this.connection_name = connection_name; @@ -79,7 +79,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getProtocol() { return protocol; @@ -91,7 +91,7 @@ public class Connection { * * @param protocol the value for guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setProtocol(String protocol) { this.protocol = protocol; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java index ad8a48e19..c3490071b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java @@ -8,7 +8,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public ConnectionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -399,7 +399,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +412,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java index 5f750f2d6..e15c4fb0f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java @@ -5,7 +5,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String parameter_value; @@ -15,7 +15,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getParameter_value() { return parameter_value; @@ -27,7 +27,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setParameter_value(String parameter_value) { this.parameter_value = parameter_value; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java index d57f3918f..ae1cd3519 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java @@ -8,7 +8,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public ConnectionParameterExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -399,7 +399,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +412,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java index 2b7062448..494c9c162 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java @@ -5,7 +5,7 @@ public class ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer connection_id; @@ -13,7 +13,7 @@ public class ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String parameter_name; @@ -23,7 +23,7 @@ public class ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -35,7 +35,7 @@ public class ConnectionParameterKey { * * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -47,7 +47,7 @@ public class ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getParameter_name() { return parameter_name; @@ -59,7 +59,7 @@ public class ConnectionParameterKey { * * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setParameter_name(String parameter_name) { this.parameter_name = parameter_name; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java index 6ffbebb64..4f898bbfb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java @@ -8,7 +8,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public ConnectionPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -389,7 +389,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -402,7 +402,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java index bb9c4bee8..31b7e5b3a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java @@ -5,7 +5,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer connection_id; @@ -21,7 +21,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String permission; @@ -31,7 +31,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getUser_id() { return user_id; @@ -43,7 +43,7 @@ public class ConnectionPermissionKey { * * @param user_id the value for guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -55,7 +55,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -67,7 +67,7 @@ public class ConnectionPermissionKey { * * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -79,7 +79,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getPermission() { return permission; @@ -91,7 +91,7 @@ public class ConnectionPermissionKey { * * @param permission the value for guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setPermission(String permission) { this.permission = permission; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java index fddbafd6d..36f76ff33 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java @@ -8,7 +8,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public SystemPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -329,7 +329,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -342,7 +342,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java index fa59ec47b..e7d8523dc 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java @@ -5,7 +5,7 @@ public class SystemPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class SystemPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String permission; @@ -23,7 +23,7 @@ public class SystemPermissionKey { * * @return the value of guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getUser_id() { return user_id; @@ -35,7 +35,7 @@ public class SystemPermissionKey { * * @param user_id the value for guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -47,7 +47,7 @@ public class SystemPermissionKey { * * @return the value of guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getPermission() { return permission; @@ -59,7 +59,7 @@ public class SystemPermissionKey { * * @param permission the value for guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setPermission(String permission) { this.permission = permission; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java index d9ea8c87f..c8ddd1ba1 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java @@ -5,7 +5,7 @@ public class User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.username * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String username; @@ -23,7 +23,7 @@ public class User { * * @return the value of guacamole..guacamole_user.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getUser_id() { return user_id; @@ -35,7 +35,7 @@ public class User { * * @param user_id the value for guacamole..guacamole_user.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -47,7 +47,7 @@ public class User { * * @return the value of guacamole..guacamole_user.username * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getUsername() { return username; @@ -59,7 +59,7 @@ public class User { * * @param username the value for guacamole..guacamole_user.username * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setUsername(String username) { this.username = username; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java index 15c8bda7a..19baccadb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java @@ -8,7 +8,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public UserExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -329,7 +329,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -342,7 +342,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java index a3803a93c..1d65e896d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java @@ -8,7 +8,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public UserPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -389,7 +389,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -402,7 +402,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java index 43a3abb4e..711785577 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java @@ -5,7 +5,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private Integer affected_user_id; @@ -21,7 +21,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private String permission; @@ -31,7 +31,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getUser_id() { return user_id; @@ -43,7 +43,7 @@ public class UserPermissionKey { * * @param user_id the value for guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -55,7 +55,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public Integer getAffected_user_id() { return affected_user_id; @@ -67,7 +67,7 @@ public class UserPermissionKey { * * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setAffected_user_id(Integer affected_user_id) { this.affected_user_id = affected_user_id; @@ -79,7 +79,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public String getPermission() { return permission; @@ -91,7 +91,7 @@ public class UserPermissionKey { * * @param permission the value for guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setPermission(String permission) { this.permission = permission; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java index 4ff86ca41..36838bdfa 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java @@ -5,7 +5,7 @@ public class UserWithBLOBs extends User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.password_hash * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private byte[] password_hash; @@ -13,7 +13,7 @@ public class UserWithBLOBs extends User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.password_salt * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ private byte[] password_salt; @@ -23,7 +23,7 @@ public class UserWithBLOBs extends User { * * @return the value of guacamole..guacamole_user.password_hash * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public byte[] getPassword_hash() { return password_hash; @@ -35,7 +35,7 @@ public class UserWithBLOBs extends User { * * @param password_hash the value for guacamole..guacamole_user.password_hash * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setPassword_hash(byte[] password_hash) { this.password_hash = password_hash; @@ -47,7 +47,7 @@ public class UserWithBLOBs extends User { * * @return the value of guacamole..guacamole_user.password_salt * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public byte[] getPassword_salt() { return password_salt; @@ -59,7 +59,7 @@ public class UserWithBLOBs extends User { * * @param password_salt the value for guacamole..guacamole_user.password_salt * - * @mbggenerated Tue Feb 12 10:51:12 PST 2013 + * @mbggenerated Tue Feb 12 20:35:54 PST 2013 */ public void setPassword_salt(byte[] password_salt) { this.password_salt = password_salt; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java new file mode 100644 index 000000000..096b2af35 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -0,0 +1,511 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import com.google.inject.Inject; +import com.google.inject.Provider; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; +import net.sourceforge.guacamole.net.auth.mysql.MySQLConstants; +import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.Connection; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.User; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; +import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; +import net.sourceforge.guacamole.net.auth.permission.Permission; +import net.sourceforge.guacamole.net.auth.permission.SystemPermission; +import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.UserPermission; + +/** + * A utility to retrieve information about what objects a user has permission to. + * @author James Muehlner + */ +public class PermissionCheckUtility { + + @Inject + UserMapper userDAO; + + @Inject + ConnectionMapper connectionDAO; + + @Inject + UserPermissionMapper userPermissionDAO; + + @Inject + ConnectionPermissionMapper connectionPermissionDAO; + + @Inject + SystemPermissionMapper systemPermissionDAO; + + @Inject + Provider mySQLUserProvider; + + @Inject + Provider mySQLConnectionProvider; + + public boolean checkUserReadAccess(int userID, int affectedUserID) { + return checkUserAccess(userID, affectedUserID, MySQLConstants.READ_USER); + } + + public boolean checkUserWriteAccess(int userID, int affectedUserID) { + return checkUserAccess(userID, affectedUserID, MySQLConstants.WRITE_USER); + } + + public boolean checkUserDeleteAccess(int userID, int affectedUserID) { + return checkUserAccess(userID, affectedUserID, MySQLConstants.DELETE_USER); + } + + public boolean checkUserAdministerAccess(int userID, int affectedUserID) { + return checkUserAccess(userID, affectedUserID, MySQLConstants.ADMINISTER_USER); + } + + public boolean checkUserReadAccess(int userID, String affectedUsername) { + return checkUserAccess(userID, affectedUsername, MySQLConstants.READ_USER); + } + + public boolean checkUserWriteAccess(int userID, String affectedUsername) { + return checkUserAccess(userID, affectedUsername, MySQLConstants.WRITE_USER); + } + + public boolean checkUserDeleteAccess(int userID, String affectedUsername) { + return checkUserAccess(userID, affectedUsername, MySQLConstants.DELETE_USER); + } + + public boolean checkUserAdministerAccess(int userID, String affectedUsername) { + return checkUserAccess(userID, affectedUsername, MySQLConstants.ADMINISTER_USER); + } + + /** + * Check if the user has the selected type of access to the affected user. + * @param userID + * @param affectedUsername + * @param permissionType + * @return + */ + private boolean checkUserAccess(int userID, String affectedUsername, String permissionType) { + User affectedUser = getUser(affectedUsername); + if(affectedUser != null) + return checkUserAccess(userID, affectedUser.getUser_id(), permissionType); + + return false; + } + + /** + * Check if the user has the selected type of access to the affected user. + * @param userID + * @param affectedUserID + * @param permissionType + * @return + */ + private boolean checkUserAccess(int userID, Integer affectedUserID, String permissionType) { + UserPermissionExample example = new UserPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andAffected_user_idEqualTo(affectedUserID).andPermissionEqualTo(permissionType); + int count = userPermissionDAO.countByExample(example); + return count > 0; + } + + /** + * Find the list of all users a user has permission to administer. + * @param userID + * @return the list of all users this user has administer access to + */ + public List getAdministerableUsers(int userID) { + return getUsers(userID, MySQLConstants.ADMINISTER_USER); + } + + /** + * Find the list of all users a user has permission to delete. + * @param userID + * @return the list of all users this user has delete access to + */ + public List getDeletableUsers(int userID) { + return getUsers(userID, MySQLConstants.DELETE_USER); + } + + /** + * Find the list of all users a user has permission to write. + * @param userID + * @return the list of all users this user has write access to + */ + public List getWriteableleUsers(int userID) { + return getUsers(userID, MySQLConstants.WRITE_USER); + } + + /** + * Find the list of all users a user has permission to read. + * @param userID + * @return the list of all users this user read has access to + */ + public List getReadableUsers(int userID) { + return getUsers(userID, MySQLConstants.READ_USER); + } + + /** + * Find the list of all users a user has permission to. + * The access type is defined by permissionType. + * @param userID + * @param permissionType + * @return the list of all users this user has access to + */ + private List getUsers(int userID, String permissionType) { + List affectedUserIDs = getUserIDs(userID, permissionType); + UserExample example = new UserExample(); + example.createCriteria().andUser_idIn(affectedUserIDs); + List userDBOjects = userDAO.selectByExampleWithBLOBs(example); + List affectedUsers = new ArrayList(); + for(UserWithBLOBs affectedUser : userDBOjects) { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.init(affectedUser); + affectedUsers.add(mySQLUser); + } + + return affectedUsers; + } + + /** + * Find the list of the IDs of all users a user has permission to. + * The access type is defined by permissionType. + * @param userID + * @param permissionType + * @return the list of all user IDs this user has access to + */ + private List getUserIDs(int userID, String permissionType) { + List userIDs = new ArrayList(); + UserPermissionExample example = new UserPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); + List userPermissions = userPermissionDAO.selectByExample(example); + for(UserPermissionKey permission : userPermissions) + userIDs.add(permission.getAffected_user_id()); + + return userIDs; + } + + public boolean checkConnectionReadAccess(int userID, int affectedConnectionID) { + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.READ_CONNECTION); + } + + public boolean checkConnectionWriteAccess(int userID, int affectedConnectionID) { + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.WRITE_CONNECTION); + } + + public boolean checkConnectionDeleteAccess(int userID, int affectedConnectionID) { + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.DELETE_CONNECTION); + } + + public boolean checkConnectionAdministerAccess(int userID, int affectedConnectionID) { + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.ADMINISTER_CONNECTION); + } + + public boolean checkConnectionReadAccess(int userID, String affectedConnectionname) { + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.READ_CONNECTION); + } + + public boolean checkConnectionWriteAccess(int userID, String affectedConnectionname) { + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.WRITE_CONNECTION); + } + + public boolean checkConnectionDeleteAccess(int userID, String affectedConnectionname) { + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.DELETE_CONNECTION); + } + + public boolean checkConnectionAdministerAccess(int userID, String affectedConnectionname) { + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.ADMINISTER_CONNECTION); + } + + /** + * Check if the user has the selected type of access to the affected connection. + * @param connectionID + * @param affectedConnectionname + * @param permissionType + * @return + */ + private boolean checkConnectionAccess(int userID, String affectedConnectionName, String permissionType) { + Connection connection = getConnection(affectedConnectionName); + if(connection != null) + return checkConnectionAccess(userID, connection.getConnection_id(), permissionType); + + return false; + } + + /** + * Check if the user has the selected type of access to the affected connection. + * @param connectionID + * @param affectedConnectionID + * @param permissionType + * @return + */ + private boolean checkConnectionAccess(int userID, Integer affectedConnectionID, String permissionType) { + ConnectionPermissionExample example = new ConnectionPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andConnection_idEqualTo(affectedConnectionID).andPermissionEqualTo(permissionType); + int count = connectionPermissionDAO.countByExample(example); + return count > 0; + } + + /** + * Find the list of all connections a user has permission to administer. + * @param connectionID + * @return the list of all connections this connection has administer access to + */ + public List getAdministerableConnections(int userID) { + return getConnections(userID, MySQLConstants.ADMINISTER_CONNECTION); + } + + /** + * Find the list of all connections a user has permission to delete. + * @param connectionID + * @return the list of all connections this connection has delete access to + */ + public List getDeletableConnections(int userID) { + return getConnections(userID, MySQLConstants.DELETE_CONNECTION); + } + + /** + * Find the list of all connections a user has permission to write. + * @param connectionID + * @return the list of all connections this connection has write access to + */ + public List getWriteableleConnections(int userID) { + return getConnections(userID, MySQLConstants.WRITE_CONNECTION); + } + + /** + * Find the list of all connections a user has permission to read. + * @param connectionID + * @return the list of all connections this connection read has access to + */ + public List getReadableConnections(int userID) { + return getConnections(userID, MySQLConstants.READ_CONNECTION); + } + + /** + * Find the list of all connections a user has permission to. + * The access type is defined by permissionType. + * @param connectionID + * @param permissionType + * @return the list of all connections this user has access to + */ + private List getConnections(int userID, String permissionType) { + List affectedConnectionIDs = getConnectionIDs(userID, permissionType); + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_idIn(affectedConnectionIDs); + List connectionDBOjects = connectionDAO.selectByExample(example); + List affectedConnections = new ArrayList(); + for(Connection affectedConnection : connectionDBOjects) { + MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); + mySQLConnection.init(affectedConnection); + affectedConnections.add(mySQLConnection); + } + + return affectedConnections; + } + + /** + * Find the list of the IDs of all connections a user has permission to. + * The access type is defined by permissionType. + * @param connectionID + * @param permissionType + * @return the list of all connection IDs this user has access to + */ + private List getConnectionIDs(int userID, String permissionType) { + List connectionIDs = new ArrayList(); + ConnectionPermissionExample example = new ConnectionPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); + List connectionPermissions = connectionPermissionDAO.selectByExample(example); + for(ConnectionPermissionKey permission : connectionPermissions) + connectionIDs.add(permission.getConnection_id()); + + return connectionIDs; + } + + /** + * Check if the user has the permission to create users. + * @param userID + * @return + */ + public boolean checkCreateUserPermission(int userID) { + return checkSystemPermission(userID, MySQLConstants.CREATE_USER); + } + + /** + * Check if the user has the permission to create connections. + * @param userID + * @return + */ + public boolean checkCreateConnectionPermission(int userID) { + return checkSystemPermission(userID, MySQLConstants.CREATE_CONNECTION); + } + + /** + * Check if the user has the selected system permission. + * @param userID + * @param systemPermissionType + * @return + */ + private boolean checkSystemPermission(int userID, String systemPermissionType) { + SystemPermissionExample example = new SystemPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(systemPermissionType); + int count = systemPermissionDAO.countByExample(example); + return count > 0; + } + + /** + * Get a connection object by name. + * @param name + * @return + */ + private Connection getConnection(String name) { + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_nameEqualTo(name); + List connections = connectionDAO.selectByExample(example); + if(connections.isEmpty()) + return null; + + return connections.get(0); + } + + /** + * Get a user object by username. + * @param userName + * @return + */ + private User getUser(String username) { + UserExample example = new UserExample(); + example.createCriteria().andUsernameEqualTo(username); + List users = userDAO.selectByExample(example); + if(users.isEmpty()) + return null; + + return users.get(0); + } + + /** + * Get all permissions a given user has. + * @param userID + * @return + */ + public Set getAllPermissions(int userID) { + Set allPermissions = new HashSet(); + + // first, user permissions + UserPermissionExample userPermissionExample = new UserPermissionExample(); + userPermissionExample.createCriteria().andUser_idEqualTo(userID); + List userPermissions = userPermissionDAO.selectByExample(userPermissionExample); + List affectedUserIDs = new ArrayList(); + for(UserPermissionKey userPermission : userPermissions) { + affectedUserIDs.add(userPermission.getAffected_user_id()); + } + + UserExample userExample = new UserExample(); + userExample.createCriteria().andUser_idIn(affectedUserIDs); + List users = userDAO.selectByExample(userExample); + Map userMap = new HashMap(); + for(User user : users) { + userMap.put(user.getUser_id(), user); + } + + for(UserPermissionKey userPermission : userPermissions) { + User affectedUser = userMap.get(userPermission.getAffected_user_id()); + UserPermission newPermission = new UserPermission( + UserPermission.Type.valueOf(userPermission.getPermission()), + affectedUser.getUsername() + ); + allPermissions.add(newPermission); + } + + //secondly, connection permissions + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria().andUser_idEqualTo(userID); + List connectionPermissions = connectionPermissionDAO.selectByExample(connectionPermissionExample); + List affectedConnectionIDs = new ArrayList(); + for(ConnectionPermissionKey connectionPermission : connectionPermissions) { + affectedConnectionIDs.add(connectionPermission.getConnection_id()); + } + + ConnectionExample connectionExample = new ConnectionExample(); + connectionExample.createCriteria().andConnection_idIn(affectedConnectionIDs); + List connections = connectionDAO.selectByExample(connectionExample); + Map connectionMap = new HashMap(); + for(Connection connection : connections) { + connectionMap.put(connection.getConnection_id(), connection); + } + + for(ConnectionPermissionKey connectionPermission : connectionPermissions) { + Connection affectedConnection = connectionMap.get(connectionPermission.getConnection_id()); + ConnectionPermission newPermission = new ConnectionPermission( + ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), + affectedConnection.getConnection_name() + ); + allPermissions.add(newPermission); + } + + //and finally, system permissions + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(userID); + List systemPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); + for(SystemPermissionKey systemPermission : systemPermissions) { + SystemPermission newPermission = null; + if(systemPermission.getPermission().equals(MySQLConstants.CREATE_USER)) + newPermission = new UserDirectoryPermission(UserDirectoryPermission.Type.CREATE); + else if(systemPermission.getPermission().equals(MySQLConstants.CREATE_CONNECTION)) + newPermission = new ConnectionDirectoryPermission(ConnectionDirectoryPermission.Type.CREATE); + + if(newPermission != null) + allPermissions.add(newPermission); + } + + return allPermissions; + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java index 71833fd94..3b31322d5 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -39,7 +39,7 @@ import java.security.SecureRandom; /** * Generates password salts via the SecureRandom utility. - * @author dagger10k + * @author James Muehlner */ public class SecureRandomSaltUtility implements SaltUtility { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml index 0735194c5..db0a8aad7 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml @@ -5,7 +5,7 @@ @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,7 +83,7 @@ connection_id, connection_name, protocol @@ -91,7 +91,7 @@ select @@ -110,7 +110,7 @@ select @@ -121,7 +121,7 @@ delete from guacamole..guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -130,7 +130,7 @@ delete from guacamole..guacamole_connection @@ -141,7 +141,7 @@ insert into guacamole..guacamole_connection (connection_id, connection_name, protocol ) @@ -152,7 +152,7 @@ insert into guacamole..guacamole_connection @@ -182,7 +182,7 @@ select count(*) from guacamole..guacamole_connection @@ -193,7 +193,7 @@ update guacamole..guacamole_connection @@ -215,7 +215,7 @@ update guacamole..guacamole_connection set connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -229,7 +229,7 @@ update guacamole..guacamole_connection @@ -246,7 +246,7 @@ update guacamole..guacamole_connection set connection_name = #{connection_name,jdbcType=VARCHAR}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml index 9dce08532..dab04a451 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml @@ -5,7 +5,7 @@ @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,7 +83,7 @@ connection_id, parameter_name, parameter_value @@ -91,7 +91,7 @@ select @@ -110,7 +110,7 @@ select @@ -122,7 +122,7 @@ delete from guacamole..guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} @@ -132,7 +132,7 @@ delete from guacamole..guacamole_connection_parameter @@ -143,7 +143,7 @@ insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value ) @@ -154,7 +154,7 @@ insert into guacamole..guacamole_connection_parameter @@ -184,7 +184,7 @@ select count(*) from guacamole..guacamole_connection_parameter @@ -195,7 +195,7 @@ update guacamole..guacamole_connection_parameter @@ -217,7 +217,7 @@ update guacamole..guacamole_connection_parameter set connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -231,7 +231,7 @@ update guacamole..guacamole_connection_parameter @@ -246,7 +246,7 @@ update guacamole..guacamole_connection_parameter set parameter_value = #{parameter_value,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml index 0ae3fc3a9..748522557 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml @@ -5,7 +5,7 @@ @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,7 +83,7 @@ user_id, connection_id, permission @@ -91,7 +91,7 @@ select @@ -110,7 +110,7 @@ delete from guacamole..guacamole_connection_permission where user_id = #{user_id,jdbcType=INTEGER} @@ -121,7 +121,7 @@ delete from guacamole..guacamole_connection_permission @@ -132,7 +132,7 @@ insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission ) @@ -143,7 +143,7 @@ insert into guacamole..guacamole_connection_permission @@ -173,7 +173,7 @@ select count(*) from guacamole..guacamole_connection_permission @@ -184,7 +184,7 @@ update guacamole..guacamole_connection_permission @@ -206,7 +206,7 @@ update guacamole..guacamole_connection_permission set user_id = #{record.user_id,jdbcType=INTEGER}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml index dde3c6690..790c15e8e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml @@ -5,7 +5,7 @@ @@ -14,7 +14,7 @@ @@ -48,7 +48,7 @@ @@ -82,7 +82,7 @@ user_id, permission @@ -90,7 +90,7 @@ select @@ -109,7 +109,7 @@ delete from guacamole..guacamole_system_permission where user_id = #{user_id,jdbcType=INTEGER} @@ -119,7 +119,7 @@ delete from guacamole..guacamole_system_permission @@ -130,7 +130,7 @@ insert into guacamole..guacamole_system_permission (user_id, permission) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) @@ -139,7 +139,7 @@ insert into guacamole..guacamole_system_permission @@ -163,7 +163,7 @@ select count(*) from guacamole..guacamole_system_permission @@ -174,7 +174,7 @@ update guacamole..guacamole_system_permission @@ -193,7 +193,7 @@ update guacamole..guacamole_system_permission set user_id = #{record.user_id,jdbcType=INTEGER}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml index 4a0e1f21e..7af380321 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml @@ -5,7 +5,7 @@ @@ -14,7 +14,7 @@ @@ -23,7 +23,7 @@ @@ -57,7 +57,7 @@ @@ -91,7 +91,7 @@ user_id, username @@ -99,7 +99,7 @@ password_hash, password_salt @@ -107,7 +107,7 @@ select @@ -128,7 +128,7 @@ select @@ -147,7 +147,7 @@ select @@ -160,7 +160,7 @@ delete from guacamole..guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -169,7 +169,7 @@ delete from guacamole..guacamole_user @@ -180,7 +180,7 @@ insert into guacamole..guacamole_user (user_id, username, password_hash, password_salt) @@ -191,7 +191,7 @@ insert into guacamole..guacamole_user @@ -227,7 +227,7 @@ select count(*) from guacamole..guacamole_user @@ -238,7 +238,7 @@ update guacamole..guacamole_user @@ -263,7 +263,7 @@ update guacamole..guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, @@ -278,7 +278,7 @@ update guacamole..guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, @@ -291,7 +291,7 @@ update guacamole..guacamole_user @@ -311,7 +311,7 @@ update guacamole..guacamole_user set username = #{username,jdbcType=VARCHAR}, @@ -323,7 +323,7 @@ update guacamole..guacamole_user set username = #{username,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml index 98c49f7c1..363ebea71 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml @@ -5,7 +5,7 @@ @@ -15,7 +15,7 @@ @@ -49,7 +49,7 @@ @@ -83,7 +83,7 @@ user_id, affected_user_id, permission @@ -91,7 +91,7 @@ select @@ -110,7 +110,7 @@ delete from guacamole..guacamole_user_permission where user_id = #{user_id,jdbcType=INTEGER} @@ -121,7 +121,7 @@ delete from guacamole..guacamole_user_permission @@ -132,7 +132,7 @@ insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission ) @@ -143,7 +143,7 @@ insert into guacamole..guacamole_user_permission @@ -173,7 +173,7 @@ select count(*) from guacamole..guacamole_user_permission @@ -184,7 +184,7 @@ update guacamole..guacamole_user_permission @@ -206,7 +206,7 @@ update guacamole..guacamole_user_permission set user_id = #{record.user_id,jdbcType=INTEGER}, From 6aaf271914640688bc0f6327a270bed06a2c1f00 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 13 Feb 2013 08:50:11 -0800 Subject: [PATCH 022/109] Ticket #269: guacamole-auth-mysql should not depend on itself. --- extensions/guacamole-auth-mysql/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index e0b8a7dee..a1924b376 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -100,14 +100,6 @@ google-collections 1.0 - - - - net.sourceforge.guacamole - guacamole-auth-mysql - 0.8.0 - jar - From 3209f11d1f43257b4140cf9fbe753ad20701eb65 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 13 Feb 2013 12:13:30 -0800 Subject: [PATCH 023/109] Ticket #269: Changed database permission enums from WRITE to UPDATE. --- .../schema/guacamole-auth-mysql-schema.sql | 4 +- .../net/auth/mysql/MySQLConstants.java | 50 +++++++------ .../mysql/utility/PermissionCheckUtility.java | 70 +++++++++---------- 3 files changed, 61 insertions(+), 63 deletions(-) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index 4d74f1e4c..1bfbf6815 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -42,7 +42,7 @@ CREATE TABLE `guacamole_connection_parameter` ( CREATE TABLE `guacamole_connection_permission` ( `user_id` int(11) NOT NULL, `connection_id` int(11) NOT NULL, - `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, + `permission` enum('READ','UPDATE','DELETE','ADMINISTER') NOT NULL, PRIMARY KEY (`user_id`,`connection_id`,`permission`), CONSTRAINT `guacamole_connection_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_connection` (`connection_id`), CONSTRAINT `guacamole_connection_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) @@ -66,7 +66,7 @@ CREATE TABLE `guacamole_system_permission` ( CREATE TABLE `guacamole_user_permission` ( `user_id` int(11) NOT NULL, `affected_user_id` int(11) NOT NULL, - `permission` enum('READ','WRITE','DELETE','ADMINISTER') NOT NULL, + `permission` enum('READ','UPDATE','DELETE','ADMINISTER') NOT NULL, PRIMARY KEY (`user_id`,`affected_user_id`,`permission`), CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`affected_user_id`) REFERENCES `guacamole_user` (`user_id`), CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index e34b76ee7..becec0ed2 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -35,37 +35,35 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql; +import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; +import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.UserPermission; + /** - * Constants relevant to the guacamole-auth-mysql project. + * A set of constants that useful for the MySQL-based authentication provider. * @author James Muehlner */ -public interface MySQLConstants { +public final class MySQLConstants { - //*********** Permission Strings *********** - // operations - public static final String CREATE = "CREATE"; - public static final String READ = "READ"; - public static final String WRITE = "WRITE"; - public static final String DELETE = "DELETE"; - public static final String ADMINISTER = "ADMINISTER"; + /** + * This class should not be instantiated. + */ + private MySQLConstants() {} - // used to separate operations from objects - public static final String SEPARATOR = "_"; + // Permission constants + public static final String USER_READ = UserPermission.Type.READ.name(); + public static final String USER_UPDATE = UserPermission.Type.UPDATE.name(); + public static final String USER_DELETE = UserPermission.Type.DELETE.name(); + public static final String USER_ADMINISTER = UserPermission.Type.ADMINISTER.name(); + public static final String USER_CREATE = UserDirectoryPermission.Type.CREATE.name(); - //object types - public static final String USER = "USER"; - public static final String CONNECTION = "CONNECTION"; + public static final String CONNECTION_READ = ConnectionPermission.Type.READ.name(); + public static final String CONNECTION_UPDATE = ConnectionPermission.Type.UPDATE.name(); + public static final String CONNECTION_DELETE = ConnectionPermission.Type.DELETE.name(); + public static final String CONNECTION_ADMINISTER = ConnectionPermission.Type.ADMINISTER.name(); + public static final String CONNECTION_CREATE = ConnectionDirectoryPermission.Type.CREATE.name(); - //combinations - public static final String CREATE_USER = CREATE + SEPARATOR + USER; - public static final String READ_USER = READ + SEPARATOR + USER; - public static final String WRITE_USER = WRITE + SEPARATOR + USER; - public static final String DELETE_USER = DELETE + SEPARATOR + USER; - public static final String ADMINISTER_USER = ADMINISTER + SEPARATOR + USER; - - public static final String CREATE_CONNECTION = CREATE + SEPARATOR + CONNECTION; - public static final String READ_CONNECTION = READ + SEPARATOR + CONNECTION; - public static final String WRITE_CONNECTION = WRITE + SEPARATOR + CONNECTION; - public static final String DELETE_CONNECTION = DELETE + SEPARATOR + CONNECTION; - public static final String ADMINISTER_CONNECTION = ADMINISTER + SEPARATOR + CONNECTION; + public static final String SYSTEM_USER_CREATE = "USER_CREATE"; + public static final String SYSTEM_CONNECTION_CREATE = "CONNECTION_CREATE"; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java index 096b2af35..876297fdd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -97,35 +97,35 @@ public class PermissionCheckUtility { Provider mySQLConnectionProvider; public boolean checkUserReadAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.READ_USER); + return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_READ); } - public boolean checkUserWriteAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.WRITE_USER); + public boolean checkUserUpdateAccess(int userID, int affectedUserID) { + return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_UPDATE); } public boolean checkUserDeleteAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.DELETE_USER); + return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_DELETE); } public boolean checkUserAdministerAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.ADMINISTER_USER); + return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_ADMINISTER); } public boolean checkUserReadAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.READ_USER); + return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_READ); } - public boolean checkUserWriteAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.WRITE_USER); + public boolean checkUserUpdateAccess(int userID, String affectedUsername) { + return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_UPDATE); } public boolean checkUserDeleteAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.DELETE_USER); + return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_DELETE); } public boolean checkUserAdministerAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.ADMINISTER_USER); + return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_ADMINISTER); } /** @@ -163,7 +163,7 @@ public class PermissionCheckUtility { * @return the list of all users this user has administer access to */ public List getAdministerableUsers(int userID) { - return getUsers(userID, MySQLConstants.ADMINISTER_USER); + return getUsers(userID, MySQLConstants.USER_ADMINISTER); } /** @@ -172,7 +172,7 @@ public class PermissionCheckUtility { * @return the list of all users this user has delete access to */ public List getDeletableUsers(int userID) { - return getUsers(userID, MySQLConstants.DELETE_USER); + return getUsers(userID, MySQLConstants.USER_DELETE); } /** @@ -180,8 +180,8 @@ public class PermissionCheckUtility { * @param userID * @return the list of all users this user has write access to */ - public List getWriteableleUsers(int userID) { - return getUsers(userID, MySQLConstants.WRITE_USER); + public List getUpdateableUsers(int userID) { + return getUsers(userID, MySQLConstants.USER_UPDATE); } /** @@ -190,7 +190,7 @@ public class PermissionCheckUtility { * @return the list of all users this user read has access to */ public List getReadableUsers(int userID) { - return getUsers(userID, MySQLConstants.READ_USER); + return getUsers(userID, MySQLConstants.USER_READ); } /** @@ -234,35 +234,35 @@ public class PermissionCheckUtility { } public boolean checkConnectionReadAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.READ_CONNECTION); + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_READ); } - public boolean checkConnectionWriteAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.WRITE_CONNECTION); + public boolean checkConnectionUpdateAccess(int userID, int affectedConnectionID) { + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_UPDATE); } public boolean checkConnectionDeleteAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.DELETE_CONNECTION); + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_DELETE); } public boolean checkConnectionAdministerAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.ADMINISTER_CONNECTION); + return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_ADMINISTER); } public boolean checkConnectionReadAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.READ_CONNECTION); + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_READ); } - public boolean checkConnectionWriteAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.WRITE_CONNECTION); + public boolean checkConnectionUpdateAccess(int userID, String affectedConnectionname) { + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_UPDATE); } public boolean checkConnectionDeleteAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.DELETE_CONNECTION); + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_DELETE); } public boolean checkConnectionAdministerAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.ADMINISTER_CONNECTION); + return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_ADMINISTER); } /** @@ -300,7 +300,7 @@ public class PermissionCheckUtility { * @return the list of all connections this connection has administer access to */ public List getAdministerableConnections(int userID) { - return getConnections(userID, MySQLConstants.ADMINISTER_CONNECTION); + return getConnections(userID, MySQLConstants.CONNECTION_ADMINISTER); } /** @@ -309,7 +309,7 @@ public class PermissionCheckUtility { * @return the list of all connections this connection has delete access to */ public List getDeletableConnections(int userID) { - return getConnections(userID, MySQLConstants.DELETE_CONNECTION); + return getConnections(userID, MySQLConstants.CONNECTION_DELETE); } /** @@ -317,8 +317,8 @@ public class PermissionCheckUtility { * @param connectionID * @return the list of all connections this connection has write access to */ - public List getWriteableleConnections(int userID) { - return getConnections(userID, MySQLConstants.WRITE_CONNECTION); + public List getUpdateableConnections(int userID) { + return getConnections(userID, MySQLConstants.CONNECTION_UPDATE); } /** @@ -327,7 +327,7 @@ public class PermissionCheckUtility { * @return the list of all connections this connection read has access to */ public List getReadableConnections(int userID) { - return getConnections(userID, MySQLConstants.READ_CONNECTION); + return getConnections(userID, MySQLConstants.CONNECTION_READ); } /** @@ -376,7 +376,7 @@ public class PermissionCheckUtility { * @return */ public boolean checkCreateUserPermission(int userID) { - return checkSystemPermission(userID, MySQLConstants.CREATE_USER); + return checkSystemPermission(userID, MySQLConstants.SYSTEM_USER_CREATE); } /** @@ -385,7 +385,7 @@ public class PermissionCheckUtility { * @return */ public boolean checkCreateConnectionPermission(int userID) { - return checkSystemPermission(userID, MySQLConstants.CREATE_CONNECTION); + return checkSystemPermission(userID, MySQLConstants.SYSTEM_CONNECTION_CREATE); } /** @@ -434,7 +434,7 @@ public class PermissionCheckUtility { /** * Get all permissions a given user has. * @param userID - * @return + * @return all permissions a user has. */ public Set getAllPermissions(int userID) { Set allPermissions = new HashSet(); @@ -497,9 +497,9 @@ public class PermissionCheckUtility { List systemPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); for(SystemPermissionKey systemPermission : systemPermissions) { SystemPermission newPermission = null; - if(systemPermission.getPermission().equals(MySQLConstants.CREATE_USER)) + if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) newPermission = new UserDirectoryPermission(UserDirectoryPermission.Type.CREATE); - else if(systemPermission.getPermission().equals(MySQLConstants.CREATE_CONNECTION)) + else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) newPermission = new ConnectionDirectoryPermission(ConnectionDirectoryPermission.Type.CREATE); if(newPermission != null) From 3e484ab8f8e8c297ed817354823e389095d26fd4 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 13 Feb 2013 12:18:22 -0800 Subject: [PATCH 024/109] Ticket #269: Fixed comment --- .../sourceforge/guacamole/net/auth/mysql/MySQLConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index becec0ed2..99de9fdc8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -41,7 +41,7 @@ import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.UserPermission; /** - * A set of constants that useful for the MySQL-based authentication provider. + * A set of constants that are useful for the MySQL-based authentication provider. * @author James Muehlner */ public final class MySQLConstants { From 66fdcbe0b1a1d863b76c3c15d82e8e460a6d879e Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 13 Feb 2013 19:02:41 -0800 Subject: [PATCH 025/109] Ticket #269: Added permissions checks to UserDirectory actions, and improved PermissionCheckUtility --- .../mysql/GuacamolePermissionException.java | 78 +++++ .../net/auth/mysql/UserDirectory.java | 6 + .../mysql/utility/PermissionCheckUtility.java | 295 +++++++++++++++++- 3 files changed, 373 insertions(+), 6 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java new file mode 100644 index 000000000..44502bf0a --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java @@ -0,0 +1,78 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import net.sourceforge.guacamole.GuacamoleException; + +/** + * Represents an error condition when a user tries to perform an action + * that he/she does not have permission to do. + * @author James Muehlner + */ +public class GuacamolePermissionException extends GuacamoleException { + + /** + * Creates a new GuacamoleException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamolePermissionException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamolePermissionException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamolePermissionException(Throwable cause) { + super(cause); + } + + +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index dd25e9b46..6690d82eb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -147,6 +147,7 @@ public class UserDirectory implements Directory { @Transactional @Override public User get(String identifier) throws GuacamoleException { + permissionCheckUtility.verifyUserReadAccess(this.user.getUserID(), identifier); return getExistingMySQLUser(identifier); } @@ -164,7 +165,10 @@ public class UserDirectory implements Directory { @Override @Transactional public void add(User object) throws GuacamoleException { + permissionCheckUtility.verifyCreateUserPermission(this.user.getUserID()); Preconditions.checkNotNull(object); + permissionCheckUtility.verifyUserUpdateAccess(user.getUserID(), object.getUsername()); + //create user in database MySQLUser mySQLUser = getNewMySQLUser(object); userDAO.insert(mySQLUser.getUser()); @@ -356,6 +360,7 @@ public class UserDirectory implements Directory { @Override @Transactional public void update(User object) throws GuacamoleException { + permissionCheckUtility.verifyUserUpdateAccess(this.user.getUserID(), object.getUsername()); //update the user in the database MySQLUser mySQLUser = getExistingMySQLUser(object); userDAO.updateByPrimaryKey(mySQLUser.getUser()); @@ -367,6 +372,7 @@ public class UserDirectory implements Directory { @Override @Transactional public void remove(String identifier) throws GuacamoleException { + permissionCheckUtility.verifyUserDeleteAccess(this.user.getUserID(), identifier); MySQLUser mySQLUser = getExistingMySQLUser(identifier); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java index 876297fdd..0c126fc09 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -43,6 +43,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import net.sourceforge.guacamole.net.auth.mysql.GuacamolePermissionException; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; import net.sourceforge.guacamole.net.auth.mysql.MySQLConstants; import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; @@ -96,34 +97,170 @@ public class PermissionCheckUtility { @Inject Provider mySQLConnectionProvider; + /** + * Verifies that the user has read access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUserID + * @throws GuacamolePermissionException + */ + public void verifyUserReadAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + if(!checkUserReadAccess(userID, affectedUserID)) + throw new GuacamolePermissionException("User " + userID + " does not have read access to user " + affectedUserID); + } + + /** + * Verifies that the user has update access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUserID + * @throws GuacamolePermissionException + */ + public void verifyUserUpdateAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + if(!checkUserUpdateAccess(userID, affectedUserID)) + throw new GuacamolePermissionException("User " + userID + " does not have update access to user " + affectedUserID); + } + + /** + * Verifies that the user has delete access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUserID + * @throws GuacamolePermissionException + */ + public void verifyUserDeleteAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + if(!checkUserDeleteAccess(userID, affectedUserID)) + throw new GuacamolePermissionException("User " + userID + " does not have delete access to user " + affectedUserID); + } + + /** + * Verifies that the user has administer access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUserID + * @throws GuacamolePermissionException + */ + public void verifyUserAdministerAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + if(!checkUserAdministerAccess(userID, affectedUserID)) + throw new GuacamolePermissionException("User " + userID + " does not have administer access to user " + affectedUserID); + } + + /** + * Verifies that the user has read access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUsername + * @throws GuacamolePermissionException + */ + public void verifyUserReadAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + if(!checkUserReadAccess(userID, affectedUsername)) + throw new GuacamolePermissionException("User " + userID + " does not have read access to user '" + affectedUsername + "'"); + } + + /** + * Verifies that the user has update access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUsername + * @throws GuacamolePermissionException + */ + public void verifyUserUpdateAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + if(!checkUserUpdateAccess(userID, affectedUsername)) + throw new GuacamolePermissionException("User " + userID + " does not have update access to user '" + affectedUsername + "'"); + } + + /** + * Verifies that the user has delete access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUsername + * @throws GuacamolePermissionException + */ + public void verifyUserDeleteAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + if(!checkUserDeleteAccess(userID, affectedUsername)) + throw new GuacamolePermissionException("User " + userID + " does not have delete access to user '" + affectedUsername + "'"); + } + + /** + * Verifies that the user has administer access to the given user. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedUsername + * @throws GuacamolePermissionException + */ + public void verifyUserAdministerAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + if(!checkUserAdministerAccess(userID, affectedUsername)) + throw new GuacamolePermissionException("User " + userID + " does not have administer access to user '" + affectedUsername + "'"); + } + + /** + * Checks if the user has read access to the given user. + * @param userID + * @param affectedUserID + * @return true if the user has access to this user. + */ public boolean checkUserReadAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_READ); } + /** + * Checks if the user has update access to the given user. + * @param userID + * @param affectedUserID + * @return true if the user has access to this user. + */ public boolean checkUserUpdateAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_UPDATE); } + /** + * Checks if the user has delete access to the given user. + * @param userID + * @param affectedUserID + * @return true if the user has access to this user. + */ public boolean checkUserDeleteAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_DELETE); } + /** + * Checks if the user has administer access to the given user. + * @param userID + * @param affectedUserID + * @return true if the user has access to this user. + */ public boolean checkUserAdministerAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_ADMINISTER); } + /** + * Checks if the user has read access to the given user. + * @param userID + * @param affectedUsername + * @return true if the user has access to this user. + */ public boolean checkUserReadAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_READ); } + /** + * Checks if the user has update access to the given user. + * @param userID + * @param affectedUsername + * @return true if the user has access to this user. + */ public boolean checkUserUpdateAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_UPDATE); } + /** + * Checks if the user has delete access to the given user. + * @param userID + * @param affectedUsername + * @return true if the user has access to this user. + */ public boolean checkUserDeleteAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_DELETE); } + /** + * Checks if the user has administer access to the given user. + * @param userID + * @param affectedUsername + * @return true if the user has access to this user. + */ public boolean checkUserAdministerAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_ADMINISTER); } @@ -233,36 +370,172 @@ public class PermissionCheckUtility { return userIDs; } + /** + * Verifies that the user has read access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionID + * @throws GuacamolePermissionException + */ + public void verifyConnectionReadAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + if(!checkConnectionReadAccess(userID, affectedConnectionID)) + throw new GuacamolePermissionException("User " + userID + " does not have read access to connection " + affectedConnectionID); + } + + /** + * Verifies that the user has update access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionID + * @throws GuacamolePermissionException + */ + public void verifyConnectionUpdateAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + if(!checkConnectionUpdateAccess(userID, affectedConnectionID)) + throw new GuacamolePermissionException("User " + userID + " does not have update access to connection " + affectedConnectionID); + } + + /** + * Verifies that the user has delete access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionID + * @throws GuacamolePermissionException + */ + public void verifyConnectionDeleteAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + if(!checkConnectionDeleteAccess(userID, affectedConnectionID)) + throw new GuacamolePermissionException("User " + userID + " does not have delete access to connection " + affectedConnectionID); + } + + /** + * Verifies that the user has administer access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionID + * @throws GuacamolePermissionException + */ + public void verifyConnectionAdministerAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + if(!checkConnectionAdministerAccess(userID, affectedConnectionID)) + throw new GuacamolePermissionException("User " + userID + " does not have administer access to connection " + affectedConnectionID); + } + + /** + * Verifies that the user has read access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionName + * @throws GuacamolePermissionException + */ + public void verifyConnectionReadAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + if(!checkConnectionReadAccess(userID, affectedConnectionName)) + throw new GuacamolePermissionException("User " + userID + " does not have read access to connection '" + affectedConnectionName + "'"); + } + + /** + * Verifies that the user has update access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionName + * @throws GuacamolePermissionException + */ + public void verifyConnectionUpdateAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + if(!checkConnectionUpdateAccess(userID, affectedConnectionName)) + throw new GuacamolePermissionException("User " + userID + " does not have update access to connection '" + affectedConnectionName + "'"); + } + + /** + * Verifies that the user has delete access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionName + * @throws GuacamolePermissionException + */ + public void verifyConnectionDeleteAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + if(!checkConnectionDeleteAccess(userID, affectedConnectionName)) + throw new GuacamolePermissionException("User " + userID + " does not have delete access to connection '" + affectedConnectionName + "'"); + } + + /** + * Verifies that the user has administer access to the given connection. If not, throws a GuacamolePermissionException. + * @param userID + * @param affectedConnectionName + * @throws GuacamolePermissionException + */ + public void verifyConnectionAdministerAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + if(!checkConnectionAdministerAccess(userID, affectedConnectionName)) + throw new GuacamolePermissionException("User " + userID + " does not have administer access to connection '" + affectedConnectionName + "'"); + } + + /** + * Checks if the user has read access to the given connection. + * @param userID + * @param affectedConnectionID + * @return true if the user has access to this connection. + */ public boolean checkConnectionReadAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_READ); } + /** + * Checks if the user has update access to the given connection. + * @param userID + * @param affectedConnectionID + * @return true if the user has access to this connection. + */ public boolean checkConnectionUpdateAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_UPDATE); } + /** + * Checks if the user has delete access to the given connection. + * @param userID + * @param affectedConnectionID + * @return true if the user has access to this connection. + */ public boolean checkConnectionDeleteAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_DELETE); } + /** + * Checks if the user has administer access to the given connection. + * @param userID + * @param affectedConnectionID + * @return true if the user has access to this connection. + */ public boolean checkConnectionAdministerAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_ADMINISTER); } - public boolean checkConnectionReadAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_READ); + /** + * Checks if the user has read access to the given connection. + * @param userID + * @param affectedConnectionName + * @return true if the user has access to this connection. + */ + public boolean checkConnectionReadAccess(int userID, String affectedConnectionName) { + return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_READ); } - public boolean checkConnectionUpdateAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_UPDATE); + /** + * Checks if the user has update access to the given connection. + * @param userID + * @param affectedConnectionName + * @return true if the user has access to this connection. + */ + public boolean checkConnectionUpdateAccess(int userID, String affectedConnectionName) { + return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_UPDATE); } + /** + * Checks if the user has delete access to the given connection. + * @param userID + * @param affectedConnectionID + * @return true if the user has access to this connection. + */ public boolean checkConnectionDeleteAccess(int userID, String affectedConnectionname) { return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_DELETE); } - public boolean checkConnectionAdministerAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_ADMINISTER); + /** + * Checks if the user has administer access to the given connection. + * @param userID + * @param affectedConnectionName + * @return true if the user has access to this connection. + */ + public boolean checkConnectionAdministerAccess(int userID, String affectedConnectionName) { + return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_ADMINISTER); } /** @@ -370,6 +643,16 @@ public class PermissionCheckUtility { return connectionIDs; } + public void verifyCreateUserPermission(int userID) throws GuacamolePermissionException { + if(!checkCreateUserPermission(userID)) + throw new GuacamolePermissionException("User " + userID + " does not have permission to create users."); + } + + public void verifyCreateConnectionPermission(int userID) throws GuacamolePermissionException { + if(!checkCreateConnectionPermission(userID)) + throw new GuacamolePermissionException("User " + userID + " does not have permission to create connections."); + } + /** * Check if the user has the permission to create users. * @param userID From e6e9200f98fda6438fce87ddeb0b89120955cc6a Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 15 Feb 2013 01:11:50 -0800 Subject: [PATCH 026/109] Ticket #269: Added administrate permission checking. --- .../net/auth/mysql/MySQLConnection.java | 24 +++- .../guacamole/net/auth/mysql/MySQLUser.java | 7 + .../net/auth/mysql/UserDirectory.java | 41 +++++- .../mysql/utility/PermissionCheckUtility.java | 131 ++++++++++++++---- 4 files changed, 168 insertions(+), 35 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 1ca51a0ad..b01563f0a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -30,7 +30,23 @@ public class MySQLConnection implements Connection { */ MySQLConnection() { connection = new net.sourceforge.guacamole.net.auth.mysql.model.Connection(); - } + } + + /** + * Get the ID of the underlying connection record. + * @return the ID of the underlying connection + */ + public int getConnectionID() { + return connection.getConnection_id(); + } + + /** + * Get the underlying connection database record. + * @return the underlying connection record. + */ + public net.sourceforge.guacamole.net.auth.mysql.model.Connection getConnection() { + return connection; + } /** * Load an existing connection by name. @@ -82,4 +98,10 @@ public class MySQLConnection implements Connection { throw new UnsupportedOperationException("Not supported yet."); } + @Override + public boolean equals(Object other) { + if(!(other instanceof MySQLConnection)) + return false; + return ((MySQLConnection)other).getConnectionID() == this.getConnectionID(); + } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index 7fe4bd554..ad4e36ca7 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -202,4 +202,11 @@ public class MySQLUser implements User { public void removePermission(Permission permission) throws GuacamoleException { permissions.remove(permission); } + + @Override + public boolean equals(Object other) { + if(!(other instanceof MySQLUser)) + return false; + return ((MySQLUser)other).getUserID() == this.getUserID(); + } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 6690d82eb..6adfa2d96 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -155,7 +155,7 @@ public class UserDirectory implements Directory { @Override public Set getIdentifiers() throws GuacamoleException { Set userNameSet = new HashSet(); - List users = permissionCheckUtility.getReadableUsers(user.getUserID()); + Set users = permissionCheckUtility.getReadableUsers(user.getUserID()); for(MySQLUser mySQLUser : users) { userNameSet.add(mySQLUser.getUsername()); } @@ -189,6 +189,11 @@ public class UserDirectory implements Directory { List connectionPermissions = new ArrayList(); List systemPermissions = new ArrayList(); + // Get the list of all the users and connections that the user performing the user save action has. + // Need to make sure the user saving this user has permission to administrate all the objects in the permission list. + Set administerableUsers = permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); + Set administerableConnections = permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); + for(Permission permission : user.getPermissions()) { if(permission instanceof UserPermission) userPermissions.add((UserPermission)permission); @@ -198,8 +203,8 @@ public class UserDirectory implements Directory { systemPermissions.add((SystemPermission)permission); } - updateUserPermissions(userPermissions, user); - updateConnectionPermissions(connectionPermissions, user); + updateUserPermissions(userPermissions, user, administerableUsers); + updateConnectionPermissions(connectionPermissions, user, administerableConnections); updateSystemPermissions(systemPermissions, user); } @@ -208,7 +213,7 @@ public class UserDirectory implements Directory { * @param permissions * @param user */ - private void updateUserPermissions(Iterable permissions, MySQLUser user) throws GuacamoleException { + private void updateUserPermissions(Iterable permissions, MySQLUser user, Set administerableUsers) throws GuacamoleException { List usernames = new ArrayList(); for(UserPermission permission : permissions) { @@ -239,6 +244,14 @@ public class UserDirectory implements Directory { // delete any permissions that are not in the provided list userPermissionExample.clear(); userPermissionExample.createCriteria().andAffected_user_idNotIn(userIDs); + List permissionsToDelete = userPermissionDAO.selectByExample(userPermissionExample); + + // verify that the user actually has permission to administrate every one of these users + for(UserPermissionKey permissionToDelete : permissionsToDelete) { + if(!administerableUsers.contains(permissionToDelete.getAffected_user_id())) + throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + permissionToDelete.getAffected_user_id()); + } + userPermissionDAO.deleteByExample(userPermissionExample); // finally, insert the new permissions @@ -251,6 +264,11 @@ public class UserDirectory implements Directory { if(existingUserIDs.contains(dbAffectedUser.getUser_id())) continue; + + // verify that the user actually has permission to administrate every one of these users + if(!administerableUsers.contains(dbAffectedUser.getUser_id())) + throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + dbAffectedUser.getUser_id()); + UserPermissionKey newPermission = new UserPermissionKey(); newPermission.setAffected_user_id(dbAffectedUser.getUser_id()); newPermission.setPermission(permission.getType().name()); @@ -264,7 +282,7 @@ public class UserDirectory implements Directory { * @param permissions * @param user */ - private void updateConnectionPermissions(Iterable permissions, MySQLUser user) throws GuacamoleException { + private void updateConnectionPermissions(Iterable permissions, MySQLUser user, Set administerableConnections) throws GuacamoleException { List connectionnames = new ArrayList(); for(ConnectionPermission permission : permissions) { @@ -295,6 +313,15 @@ public class UserDirectory implements Directory { // delete any permissions that are not in the provided list connectionPermissionExample.clear(); connectionPermissionExample.createCriteria().andConnection_idNotIn(connectionIDs); + + //make sure the user has permission to administrate each of these connections + List connectionPermissionsToDelete = connectionPermissionDAO.selectByExample(connectionPermissionExample); + + for(ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { + if(!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) + throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + connectionPermissionToDelete.getConnection_id()); + } + connectionPermissionDAO.deleteByExample(connectionPermissionExample); // finally, insert the new permissions @@ -307,6 +334,10 @@ public class UserDirectory implements Directory { if(existingConnectionIDs.contains(dbConnection.getConnection_id())) continue; + if(!administerableConnections.contains(dbConnection.getConnection_id())) + throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + dbConnection.getConnection_id()); + + ConnectionPermissionKey newPermission = new ConnectionPermissionKey(); newPermission.setConnection_id(dbConnection.getConnection_id()); newPermission.setPermission(permission.getType().name()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java index 0c126fc09..07745c098 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -35,6 +35,7 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.utility; +import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Provider; import java.util.ArrayList; @@ -294,12 +295,48 @@ public class PermissionCheckUtility { return count > 0; } + /** + * Find the list of all user IDs a user has permission to administer. + * @param userID + * @return the list of all user IDs this user has administer access to + */ + public Set getAdministerableUserIDs(int userID) { + return getUserIDs(userID, MySQLConstants.USER_ADMINISTER); + } + + /** + * Find the list of all user IDs a user has permission to delete. + * @param userID + * @return the list of all user IDs this user has delete access to + */ + public Set getDeletableUserIDs(int userID) { + return getUserIDs(userID, MySQLConstants.USER_DELETE); + } + + /** + * Find the list of all user IDs a user has permission to write. + * @param userID + * @return the list of all user IDs this user has write access to + */ + public Set getUpdateableUserIDs(int userID) { + return getUserIDs(userID, MySQLConstants.USER_UPDATE); + } + + /** + * Find the list of all user IDs a user has permission to read. + * @param userID + * @return the list of all user IDs this user has read access to + */ + public Set getReadableUserIDs(int userID) { + return getUserIDs(userID, MySQLConstants.USER_READ); + } + /** * Find the list of all users a user has permission to administer. * @param userID * @return the list of all users this user has administer access to */ - public List getAdministerableUsers(int userID) { + public Set getAdministerableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_ADMINISTER); } @@ -308,7 +345,7 @@ public class PermissionCheckUtility { * @param userID * @return the list of all users this user has delete access to */ - public List getDeletableUsers(int userID) { + public Set getDeletableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_DELETE); } @@ -317,7 +354,7 @@ public class PermissionCheckUtility { * @param userID * @return the list of all users this user has write access to */ - public List getUpdateableUsers(int userID) { + public Set getUpdateableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_UPDATE); } @@ -326,7 +363,7 @@ public class PermissionCheckUtility { * @param userID * @return the list of all users this user read has access to */ - public List getReadableUsers(int userID) { + public Set getReadableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_READ); } @@ -337,12 +374,12 @@ public class PermissionCheckUtility { * @param permissionType * @return the list of all users this user has access to */ - private List getUsers(int userID, String permissionType) { - List affectedUserIDs = getUserIDs(userID, permissionType); + private Set getUsers(int userID, String permissionType) { + Set affectedUserIDs = getUserIDs(userID, permissionType); UserExample example = new UserExample(); - example.createCriteria().andUser_idIn(affectedUserIDs); + example.createCriteria().andUser_idIn(Lists.newArrayList(affectedUserIDs)); List userDBOjects = userDAO.selectByExampleWithBLOBs(example); - List affectedUsers = new ArrayList(); + Set affectedUsers = new HashSet(); for(UserWithBLOBs affectedUser : userDBOjects) { MySQLUser mySQLUser = mySQLUserProvider.get(); mySQLUser.init(affectedUser); @@ -359,8 +396,8 @@ public class PermissionCheckUtility { * @param permissionType * @return the list of all user IDs this user has access to */ - private List getUserIDs(int userID, String permissionType) { - List userIDs = new ArrayList(); + private Set getUserIDs(int userID, String permissionType) { + Set userIDs = new HashSet(); UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); List userPermissions = userPermissionDAO.selectByExample(example); @@ -568,38 +605,74 @@ public class PermissionCheckUtility { } /** - * Find the list of all connections a user has permission to administer. - * @param connectionID - * @return the list of all connections this connection has administer access to + * Find the list of all connection IDs a user has permission to administer. + * @param userID + * @return the list of all connection IDs this user has administer access to */ - public List getAdministerableConnections(int userID) { + public Set getAdministerableConnectionIDs(int userID) { + return getConnectionIDs(userID, MySQLConstants.CONNECTION_ADMINISTER); + } + + /** + * Find the list of all connection IDs a user has permission to delete. + * @param userID + * @return the list of all connection IDs this user has delete access to + */ + public Set getDeletableConnectionIDs(int userID) { + return getConnectionIDs(userID, MySQLConstants.CONNECTION_DELETE); + } + + /** + * Find the list of all connection IDs a user has permission to write. + * @param userID + * @return the list of all connection IDs this user has write access to + */ + public Set getUpdateableConnectionIDs(int userID) { + return getConnectionIDs(userID, MySQLConstants.CONNECTION_UPDATE); + } + + /** + * Find the list of all connection IDs a user has permission to read. + * @param userID + * @return the list of all connection IDs this user has ready access to + */ + public Set getReadableConnectionIDs(int userID) { + return getConnectionIDs(userID, MySQLConstants.CONNECTION_READ); + } + + /** + * Find the list of all connections a user has permission to administer. + * @param userID + * @return the list of all connections this user has administer access to + */ + public Set getAdministerableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_ADMINISTER); } /** * Find the list of all connections a user has permission to delete. - * @param connectionID - * @return the list of all connections this connection has delete access to + * @param userID + * @return the list of all connections this user has delete access to */ - public List getDeletableConnections(int userID) { + public Set getDeletableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_DELETE); } /** * Find the list of all connections a user has permission to write. - * @param connectionID - * @return the list of all connections this connection has write access to + * @param userID + * @return the list of all connections this user has write access to */ - public List getUpdateableConnections(int userID) { + public Set getUpdateableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_UPDATE); } /** * Find the list of all connections a user has permission to read. - * @param connectionID - * @return the list of all connections this connection read has access to + * @param userID + * @return the list of all connections this user has read access to */ - public List getReadableConnections(int userID) { + public Set getReadableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_READ); } @@ -610,12 +683,12 @@ public class PermissionCheckUtility { * @param permissionType * @return the list of all connections this user has access to */ - private List getConnections(int userID, String permissionType) { - List affectedConnectionIDs = getConnectionIDs(userID, permissionType); + private Set getConnections(int userID, String permissionType) { + Set affectedConnectionIDs = getConnectionIDs(userID, permissionType); ConnectionExample example = new ConnectionExample(); - example.createCriteria().andConnection_idIn(affectedConnectionIDs); + example.createCriteria().andConnection_idIn(Lists.newArrayList(affectedConnectionIDs)); List connectionDBOjects = connectionDAO.selectByExample(example); - List affectedConnections = new ArrayList(); + Set affectedConnections = new HashSet(); for(Connection affectedConnection : connectionDBOjects) { MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); mySQLConnection.init(affectedConnection); @@ -632,8 +705,8 @@ public class PermissionCheckUtility { * @param permissionType * @return the list of all connection IDs this user has access to */ - private List getConnectionIDs(int userID, String permissionType) { - List connectionIDs = new ArrayList(); + private Set getConnectionIDs(int userID, String permissionType) { + Set connectionIDs = new HashSet(); ConnectionPermissionExample example = new ConnectionPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); List connectionPermissions = connectionPermissionDAO.selectByExample(example); From b5aa49aa69fdeb3c263adfe360b59653650cbaf3 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 15 Feb 2013 01:20:00 -0800 Subject: [PATCH 027/109] Ticket #269: Added administrate permission on delete user, and initially give full access to newly created user. --- .../net/auth/mysql/UserDirectory.java | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 6adfa2d96..dcb512560 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -175,6 +175,19 @@ public class UserDirectory implements Directory { //create permissions in database updatePermissions(mySQLUser); + + //finally, give the current user full access to the newly created user. + UserPermissionKey newUserPermission = new UserPermissionKey(); + newUserPermission.setUser_id(this.user.getUserID()); + newUserPermission.setAffected_user_id(mySQLUser.getUserID()); + newUserPermission.setPermission(MySQLConstants.USER_READ); + userPermissionDAO.insert(newUserPermission); + newUserPermission.setPermission(MySQLConstants.USER_UPDATE); + userPermissionDAO.insert(newUserPermission); + newUserPermission.setPermission(MySQLConstants.USER_DELETE); + userPermissionDAO.insert(newUserPermission); + newUserPermission.setPermission(MySQLConstants.USER_ADMINISTER); + userPermissionDAO.insert(newUserPermission); } /** @@ -418,15 +431,37 @@ public class UserDirectory implements Directory { * Delete all permissions associated with the provided user. * @param user */ - private void deleteAllPermissions(MySQLUser user) { + private void deleteAllPermissions(MySQLUser user) throws GuacamolePermissionException { + // Get the list of all the users and connections that the user performing the user save action has. + // Need to make sure the user saving this user has permission to administrate all the objects in the permission list. + Set administerableUsers = permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); + Set administerableConnections = permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); + //delete all user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); + List permissionsToDelete = userPermissionDAO.selectByExample(userPermissionExample); + + // verify that the user actually has permission to administrate every one of these users + for(UserPermissionKey permissionToDelete : permissionsToDelete) { + if(!administerableUsers.contains(permissionToDelete.getAffected_user_id())) + throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + permissionToDelete.getAffected_user_id()); + } + userPermissionDAO.deleteByExample(userPermissionExample); //delete all connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); + + //make sure the user has permission to administrate each of these connections + List connectionPermissionsToDelete = connectionPermissionDAO.selectByExample(connectionPermissionExample); + + for(ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { + if(!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) + throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + connectionPermissionToDelete.getConnection_id()); + } + connectionPermissionDAO.deleteByExample(connectionPermissionExample); //delete all system permissions From 1beb031a05bd85a1d905f7edd05217370c97beac Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 15 Feb 2013 10:38:15 -0800 Subject: [PATCH 028/109] Ticket #269: The only permission needed to delete a user is DELETE_USER. --- .../net/auth/mysql/UserDirectory.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index dcb512560..667720db4 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -428,40 +428,18 @@ public class UserDirectory implements Directory { } /** - * Delete all permissions associated with the provided user. + * Delete all permissions associated with the provided user. This is only used when deleting a user. * @param user */ private void deleteAllPermissions(MySQLUser user) throws GuacamolePermissionException { - // Get the list of all the users and connections that the user performing the user save action has. - // Need to make sure the user saving this user has permission to administrate all the objects in the permission list. - Set administerableUsers = permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); - Set administerableConnections = permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); - //delete all user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); - List permissionsToDelete = userPermissionDAO.selectByExample(userPermissionExample); - - // verify that the user actually has permission to administrate every one of these users - for(UserPermissionKey permissionToDelete : permissionsToDelete) { - if(!administerableUsers.contains(permissionToDelete.getAffected_user_id())) - throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + permissionToDelete.getAffected_user_id()); - } - userPermissionDAO.deleteByExample(userPermissionExample); //delete all connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); - - //make sure the user has permission to administrate each of these connections - List connectionPermissionsToDelete = connectionPermissionDAO.selectByExample(connectionPermissionExample); - - for(ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { - if(!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) - throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + connectionPermissionToDelete.getConnection_id()); - } - connectionPermissionDAO.deleteByExample(connectionPermissionExample); //delete all system permissions From 39665ad0f640656be4c932252720f41d6aace06f Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 20 Feb 2013 00:07:59 -0800 Subject: [PATCH 029/109] Ticket #269: Added a new utility class, and support for reading ConnectionRecord objects. --- .../doc/examples/mybatisGeneratorConfig.xml | 5 + .../schema/guacamole-auth-mysql-schema.sql | 17 + .../net/auth/mysql/ConnectionDirectory.java | 172 +++++ .../mysql/MySQLAuthenticationProvider.java | 5 +- .../net/auth/mysql/MySQLConnection.java | 67 +- .../net/auth/mysql/MySQLConnectionRecord.java | 102 +++ .../guacamole/net/auth/mysql/MySQLUser.java | 2 +- .../net/auth/mysql/MySQLUserContext.java | 11 +- .../net/auth/mysql/UserDirectory.java | 47 +- .../mysql/dao/ConnectionHistoryMapper.java | 96 +++ .../net/auth/mysql/dao/ConnectionMapper.java | 22 +- .../mysql/dao/ConnectionParameterMapper.java | 22 +- .../mysql/dao/ConnectionPermissionMapper.java | 16 +- .../mysql/dao/SystemPermissionMapper.java | 16 +- .../net/auth/mysql/dao/UserMapper.java | 28 +- .../auth/mysql/dao/UserPermissionMapper.java | 16 +- .../net/auth/mysql/model/Connection.java | 18 +- .../auth/mysql/model/ConnectionExample.java | 34 +- .../auth/mysql/model/ConnectionHistory.java | 165 +++++ .../mysql/model/ConnectionHistoryExample.java | 603 ++++++++++++++++++ .../auth/mysql/model/ConnectionParameter.java | 6 +- .../model/ConnectionParameterExample.java | 34 +- .../mysql/model/ConnectionParameterKey.java | 12 +- .../model/ConnectionPermissionExample.java | 34 +- .../mysql/model/ConnectionPermissionKey.java | 18 +- .../mysql/model/SystemPermissionExample.java | 34 +- .../auth/mysql/model/SystemPermissionKey.java | 12 +- .../guacamole/net/auth/mysql/model/User.java | 12 +- .../net/auth/mysql/model/UserExample.java | 34 +- .../mysql/model/UserPermissionExample.java | 34 +- .../auth/mysql/model/UserPermissionKey.java | 18 +- .../net/auth/mysql/model/UserWithBLOBs.java | 12 +- .../auth/mysql/utility/ProviderUtility.java | 226 +++++++ .../mysql/xml/ConnectionHistoryMapper.xml | 286 +++++++++ .../net/auth/mysql/xml/ConnectionMapper.xml | 160 ++--- .../mysql/xml/ConnectionParameterMapper.xml | 158 ++--- .../mysql/xml/ConnectionPermissionMapper.xml | 142 ++--- .../auth/mysql/xml/SystemPermissionMapper.xml | 134 ++-- .../net/auth/mysql/xml/UserMapper.xml | 198 +++--- .../auth/mysql/xml/UserPermissionMapper.xml | 142 ++--- 40 files changed, 2434 insertions(+), 736 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml diff --git a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml index b2110b992..aae06dd98 100644 --- a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml +++ b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml @@ -63,6 +63,11 @@ + + + +
+ diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index 1bfbf6815..591936243 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -72,3 +72,20 @@ CREATE TABLE `guacamole_user_permission` ( CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- Table structure for table `guacamole_connection_history` +-- + +CREATE TABLE `guacamole_connection_history` ( + `history_id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `connection_id` int(11) NOT NULL, + `start_date` datetime NOT NULL, + `end_date` datetime DEFAULT NULL, + PRIMARY KEY (`history_id`), + KEY `user_id` (`user_id`), + KEY `connection_id` (`connection_id`), + CONSTRAINT `guacamole_connection_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`), + CONSTRAINT `guacamole_connection_history_ibfk_2` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java new file mode 100644 index 000000000..f99e14e99 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -0,0 +1,172 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.common.base.Preconditions; +import com.google.inject.Inject; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.auth.Directory; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; +import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; +import org.mybatis.guice.transactional.Transactional; + +/** + * + * @author James Muehlner + */ +public class ConnectionDirectory implements Directory{ + + /** + * The user who this connection directory belongs to. + * Access is based on his/her permission settings. + */ + private MySQLUser user; + + @Inject + PermissionCheckUtility permissionCheckUtility; + + @Inject + ProviderUtility providerUtility; + + @Inject + ConnectionMapper connectionDAO; + + @Inject + ConnectionPermissionMapper connectionPermissionDAO; + + @Inject + ConnectionParameterMapper connectionParameterDAO; + + /** + * Set the user for this directory. + * @param user + */ + void init(MySQLUser user) { + this.user = user; + } + + @Transactional + @Override + public Connection get(String identifier) throws GuacamoleException { + permissionCheckUtility.verifyConnectionReadAccess(this.user.getUserID(), identifier); + return providerUtility.getExistingMySQLConnection(identifier); + } + + @Transactional + @Override + public Set getIdentifiers() throws GuacamoleException { + Set connectionNameSet = new HashSet(); + Set connections = permissionCheckUtility.getReadableConnections(this.user.getUserID()); + for(MySQLConnection mySQLConnection : connections) { + connectionNameSet.add(mySQLConnection.getIdentifier()); + } + return connectionNameSet; + } + + @Transactional + @Override + public void add(Connection object) throws GuacamoleException { + Preconditions.checkNotNull(object); + permissionCheckUtility.verifyCreateConnectionPermission(this.user.getUserID()); + + MySQLConnection mySQLConnection = providerUtility.getNewMySQLConnection(object); + connectionDAO.insert(mySQLConnection.getConnection()); + + updateConfigurationValues(mySQLConnection); + + //finally, give the current user full access to the newly created connection. + ConnectionPermissionKey newConnectionPermission = new ConnectionPermissionKey(); + newConnectionPermission.setUser_id(this.user.getUserID()); + newConnectionPermission.setConnection_id(mySQLConnection.getConnectionID()); + newConnectionPermission.setPermission(MySQLConstants.USER_READ); + connectionPermissionDAO.insert(newConnectionPermission); + newConnectionPermission.setPermission(MySQLConstants.USER_UPDATE); + connectionPermissionDAO.insert(newConnectionPermission); + newConnectionPermission.setPermission(MySQLConstants.USER_DELETE); + connectionPermissionDAO.insert(newConnectionPermission); + newConnectionPermission.setPermission(MySQLConstants.USER_ADMINISTER); + connectionPermissionDAO.insert(newConnectionPermission); + } + + /** + * Saves the values of the configuration to the database + * @param connection + */ + private void updateConfigurationValues(MySQLConnection mySQLConnection) { + GuacamoleConfiguration configuration = mySQLConnection.getConfiguration(); + Map existingConfiguration = new HashMap(); + ConnectionParameterExample example = new ConnectionParameterExample(); + List connectionParameters = connectionParameterDAO.selectByExample(example); + for(ConnectionParameter parameter : connectionParameters) + existingConfiguration.put(parameter.getParameter_name(), parameter.getParameter_value()); + + List parametersToInsert = new ArrayList(); + List parametersToUpdate = new ArrayList(); + + Set parameterNames = configuration.getParameterNames(); + + for(String parameterName : parameterNames) { + + } + } + + @Transactional + @Override + public void update(Connection object) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Transactional + @Override + public void remove(String identifier) throws GuacamoleException { + throw new UnsupportedOperationException("Not supported yet."); + } + +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 09497a943..5cd9ca423 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -52,8 +52,9 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; -import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.Sha256PasswordEncryptionUtility; @@ -110,10 +111,12 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { addMapperClass(UserMapper.class); addMapperClass(UserPermissionMapper.class); bind(MySQLUserContext.class); + bind(UserDirectory.class); bind(MySQLUser.class); bind(SaltUtility.class).to(SecureRandomSaltUtility.class); bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); bind(PermissionCheckUtility.class); + bind(ProviderUtility.class); } } ); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index b01563f0a..968e7288b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -1,7 +1,38 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; @@ -9,8 +40,10 @@ import java.util.List; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.GuacamoleSocket; import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.auth.ConnectionRecord; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; +import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; @@ -23,8 +56,13 @@ public class MySQLConnection implements Connection { @Inject ConnectionMapper connectionDAO; + @Inject + ProviderUtility providerUtility; + private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection; + private GuacamoleConfiguration configuration; + /** * Create a default, empty connection. */ @@ -48,11 +86,21 @@ public class MySQLConnection implements Connection { return connection; } + /** + * Create a new MySQLConnection from this new connection. This is a connection that has not yet been inserted. + * @param connection + */ + public void initNew(Connection connection) { + configuration = connection.getConfiguration(); + this.connection.setConnection_name(connection.getIdentifier()); + this.configuration = connection.getConfiguration(); + } + /** * Load an existing connection by name. * @param connectionName */ - public void init(String connectionName) throws GuacamoleException { + public void initExisting(String connectionName) throws GuacamoleException { ConnectionExample example = new ConnectionExample(); example.createCriteria().andConnection_nameEqualTo(connectionName); List connections; @@ -85,12 +133,12 @@ public class MySQLConnection implements Connection { @Override public GuacamoleConfiguration getConfiguration() { - throw new UnsupportedOperationException("Not supported yet."); + return configuration; } @Override public void setConfiguration(GuacamoleConfiguration config) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + this.configuration = config; } @Override @@ -104,4 +152,9 @@ public class MySQLConnection implements Connection { return false; return ((MySQLConnection)other).getConnectionID() == this.getConnectionID(); } + + @Override + public List getHistory() throws GuacamoleException { + return providerUtility.getExistingMySQLConnectionRecords(connection.getConnection_id()); + } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java new file mode 100644 index 000000000..099f5a482 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -0,0 +1,102 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.inject.Inject; +import java.util.Date; +import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.auth.ConnectionRecord; +import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; +import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; + +/** + * + * @author James Muehlner + */ +public class MySQLConnectionRecord implements ConnectionRecord { + + /** + * The database record that this ConnectionRecord represents. + */ + private ConnectionHistory connectionHistory; + + @Inject + UserMapper userDAO; + + @Inject + ConnectionMapper connectionDAO; + + @Inject + ProviderUtility providerUtility; + + /** + * Initialize this MySQLConnectionRecord with the database record it represents. + * @param connectionHistory + */ + public void init(ConnectionHistory connectionHistory) { + this.connectionHistory = connectionHistory; + } + + @Override + public Date getStartDate() { + return connectionHistory.getStart_date(); + } + + @Override + public Date getEndDate() { + return connectionHistory.getEnd_date(); + } + + @Override + public User getUser() { + return providerUtility.getExistingMySQLUser(connectionHistory.getUser_id()); + } + + @Override + public Connection getConnection() { + return providerUtility.getExistingMySQLConnection(connectionHistory.getConnection_id()); + } + + @Override + public boolean isActive() { + // if the end date hasn't been stored yet, the connection is still open. + return connectionHistory.getEnd_date() == null; + } + +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index ad4e36ca7..491d3d9e1 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -124,7 +124,7 @@ public class MySQLUser implements User { List userList = userDAO.selectByExampleWithBLOBs(example); if(userList.size() > 1) // this should never happen; the unique constraint should prevent it throw new GuacamoleException("Multiple users found with username '" + username + "'."); - if(userList.size() == 0) + if(userList.isEmpty()) throw new GuacamoleException("No user found with username '" + username + "'."); this.user = userList.get(0); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 5d33b169a..fc55da470 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -46,7 +46,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * + * The MySQL representation of a UserContext. * @author James Muehlner */ public class MySQLUserContext implements UserContext { @@ -56,11 +56,16 @@ public class MySQLUserContext implements UserContext { @Inject private MySQLUser user; - @Inject UserDirectory userDirectory; + @Inject + private UserDirectory userDirectory; + + @Inject + private ConnectionDirectory connectionDirectory; void init(Credentials credentials) throws GuacamoleException { user.init(credentials); userDirectory.init(user); + connectionDirectory.init(user); } @Override @@ -75,7 +80,7 @@ public class MySQLUserContext implements UserContext { @Override public Directory getConnectionDirectory() throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + return connectionDirectory; } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 667720db4..92dd7d22f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -37,7 +37,6 @@ package net.sourceforge.guacamole.net.auth.mysql; import com.google.common.base.Preconditions; import com.google.inject.Inject; -import com.google.inject.Provider; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -61,6 +60,7 @@ import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; +import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; @@ -100,7 +100,7 @@ public class UserDirectory implements Directory { PermissionCheckUtility permissionCheckUtility; @Inject - Provider mySQLUserProvider; + ProviderUtility providerUtility; /** * Set the user for this directory. @@ -110,45 +110,11 @@ public class UserDirectory implements Directory { this.user = user; } - /** - * Create a new user based on the provided object. - * @param user - * @return - * @throws GuacamoleException - */ - private MySQLUser getNewMySQLUser(User user) throws GuacamoleException { - MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.initNew(user); - return mySQLUser; - } - - /** - * Get the user based on the username of the provided object. - * @param user - * @return - * @throws GuacamoleException - */ - private MySQLUser getExistingMySQLUser(User user) throws GuacamoleException { - return getExistingMySQLUser(user.getUsername()); - } - - /** - * Get the user based on the username of the provided object. - * @param user - * @return - * @throws GuacamoleException - */ - private MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { - MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.initExisting(name); - return mySQLUser; - } - @Transactional @Override public User get(String identifier) throws GuacamoleException { permissionCheckUtility.verifyUserReadAccess(this.user.getUserID(), identifier); - return getExistingMySQLUser(identifier); + return providerUtility.getExistingMySQLUser(identifier); } @Transactional @@ -167,10 +133,9 @@ public class UserDirectory implements Directory { public void add(User object) throws GuacamoleException { permissionCheckUtility.verifyCreateUserPermission(this.user.getUserID()); Preconditions.checkNotNull(object); - permissionCheckUtility.verifyUserUpdateAccess(user.getUserID(), object.getUsername()); //create user in database - MySQLUser mySQLUser = getNewMySQLUser(object); + MySQLUser mySQLUser = providerUtility.getNewMySQLUser(object); userDAO.insert(mySQLUser.getUser()); //create permissions in database @@ -406,7 +371,7 @@ public class UserDirectory implements Directory { public void update(User object) throws GuacamoleException { permissionCheckUtility.verifyUserUpdateAccess(this.user.getUserID(), object.getUsername()); //update the user in the database - MySQLUser mySQLUser = getExistingMySQLUser(object); + MySQLUser mySQLUser = providerUtility.getExistingMySQLUser(object); userDAO.updateByPrimaryKey(mySQLUser.getUser()); //update permissions in database @@ -418,7 +383,7 @@ public class UserDirectory implements Directory { public void remove(String identifier) throws GuacamoleException { permissionCheckUtility.verifyUserDeleteAccess(this.user.getUserID(), identifier); - MySQLUser mySQLUser = getExistingMySQLUser(identifier); + MySQLUser mySQLUser = providerUtility.getExistingMySQLUser(identifier); //delete all the user permissions in the database deleteAllPermissions(mySQLUser); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java new file mode 100644 index 000000000..8a28bdc8c --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java @@ -0,0 +1,96 @@ +package net.sourceforge.guacamole.net.auth.mysql.dao; + +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample; +import org.apache.ibatis.annotations.Param; + +public interface ConnectionHistoryMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int countByExample(ConnectionHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int deleteByExample(ConnectionHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int deleteByPrimaryKey(Integer history_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int insert(ConnectionHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int insertSelective(ConnectionHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + List selectByExample(ConnectionHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + ConnectionHistory selectByPrimaryKey(Integer history_id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int updateByExampleSelective(@Param("record") ConnectionHistory record, @Param("example") ConnectionHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int updateByExample(@Param("record") ConnectionHistory record, @Param("example") ConnectionHistoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int updateByPrimaryKeySelective(ConnectionHistory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + int updateByPrimaryKey(ConnectionHistory record); +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java index c94ce35fb..659e11ef6 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java @@ -10,7 +10,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int countByExample(ConnectionExample example); @@ -18,7 +18,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByExample(ConnectionExample example); @@ -26,7 +26,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByPrimaryKey(Integer connection_id); @@ -34,7 +34,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insert(Connection record); @@ -42,7 +42,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insertSelective(Connection record); @@ -50,7 +50,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExample(ConnectionExample example); @@ -58,7 +58,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ Connection selectByPrimaryKey(Integer connection_id); @@ -66,7 +66,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); @@ -74,7 +74,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); @@ -82,7 +82,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKeySelective(Connection record); @@ -90,7 +90,7 @@ public interface ConnectionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKey(Connection record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java index d8375bc71..cd4b1df63 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java @@ -11,7 +11,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int countByExample(ConnectionParameterExample example); @@ -19,7 +19,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByExample(ConnectionParameterExample example); @@ -27,7 +27,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByPrimaryKey(ConnectionParameterKey key); @@ -35,7 +35,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insert(ConnectionParameter record); @@ -43,7 +43,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insertSelective(ConnectionParameter record); @@ -51,7 +51,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExample(ConnectionParameterExample example); @@ -59,7 +59,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); @@ -67,7 +67,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); @@ -75,7 +75,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); @@ -83,7 +83,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKeySelective(ConnectionParameter record); @@ -91,7 +91,7 @@ public interface ConnectionParameterMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKey(ConnectionParameter record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java index b764d3238..5ba73ce6d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java @@ -10,7 +10,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int countByExample(ConnectionPermissionExample example); @@ -18,7 +18,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByExample(ConnectionPermissionExample example); @@ -26,7 +26,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByPrimaryKey(ConnectionPermissionKey key); @@ -34,7 +34,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insert(ConnectionPermissionKey record); @@ -42,7 +42,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insertSelective(ConnectionPermissionKey record); @@ -50,7 +50,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExample(ConnectionPermissionExample example); @@ -58,7 +58,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); @@ -66,7 +66,7 @@ public interface ConnectionPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java index 2aa690b53..1d12f9e07 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java @@ -10,7 +10,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int countByExample(SystemPermissionExample example); @@ -18,7 +18,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByExample(SystemPermissionExample example); @@ -26,7 +26,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByPrimaryKey(SystemPermissionKey key); @@ -34,7 +34,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insert(SystemPermissionKey record); @@ -42,7 +42,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insertSelective(SystemPermissionKey record); @@ -50,7 +50,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExample(SystemPermissionExample example); @@ -58,7 +58,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); @@ -66,7 +66,7 @@ public interface SystemPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java index d74677309..acbcfd299 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java @@ -11,7 +11,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int countByExample(UserExample example); @@ -19,7 +19,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByExample(UserExample example); @@ -27,7 +27,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByPrimaryKey(Integer user_id); @@ -35,7 +35,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insert(UserWithBLOBs record); @@ -43,7 +43,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insertSelective(UserWithBLOBs record); @@ -51,7 +51,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExampleWithBLOBs(UserExample example); @@ -59,7 +59,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExample(UserExample example); @@ -67,7 +67,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ UserWithBLOBs selectByPrimaryKey(Integer user_id); @@ -75,7 +75,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleSelective(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); @@ -83,7 +83,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleWithBLOBs(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); @@ -91,7 +91,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExample(@Param("record") User record, @Param("example") UserExample example); @@ -99,7 +99,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKeySelective(UserWithBLOBs record); @@ -107,7 +107,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKeyWithBLOBs(UserWithBLOBs record); @@ -115,7 +115,7 @@ public interface UserMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByPrimaryKey(User record); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java index 3cba6639d..132d00eca 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java @@ -10,7 +10,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int countByExample(UserPermissionExample example); @@ -18,7 +18,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByExample(UserPermissionExample example); @@ -26,7 +26,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int deleteByPrimaryKey(UserPermissionKey key); @@ -34,7 +34,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insert(UserPermissionKey record); @@ -42,7 +42,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int insertSelective(UserPermissionKey record); @@ -50,7 +50,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ List selectByExample(UserPermissionExample example); @@ -58,7 +58,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); @@ -66,7 +66,7 @@ public interface UserPermissionMapper { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); } \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java index fa5b3b7d8..3be686d99 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java @@ -5,7 +5,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer connection_id; @@ -13,7 +13,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String connection_name; @@ -21,7 +21,7 @@ public class Connection { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String protocol; @@ -31,7 +31,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -43,7 +43,7 @@ public class Connection { * * @param connection_id the value for guacamole..guacamole_connection.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -55,7 +55,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getConnection_name() { return connection_name; @@ -67,7 +67,7 @@ public class Connection { * * @param connection_name the value for guacamole..guacamole_connection.connection_name * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setConnection_name(String connection_name) { this.connection_name = connection_name; @@ -79,7 +79,7 @@ public class Connection { * * @return the value of guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getProtocol() { return protocol; @@ -91,7 +91,7 @@ public class Connection { * * @param protocol the value for guacamole..guacamole_connection.protocol * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setProtocol(String protocol) { this.protocol = protocol; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java index c3490071b..4e5d37c61 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java @@ -8,7 +8,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public ConnectionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -399,7 +399,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +412,7 @@ public class ConnectionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java new file mode 100644 index 000000000..937a7b989 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java @@ -0,0 +1,165 @@ +package net.sourceforge.guacamole.net.auth.mysql.model; + +import java.util.Date; + +public class ConnectionHistory { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_history.history_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + private Integer history_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_history.user_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + private Integer user_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_history.connection_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + private Integer connection_id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_history.start_date + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + private Date start_date; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column guacamole..guacamole_connection_history.end_date + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + private Date end_date; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_history.history_id + * + * @return the value of guacamole..guacamole_connection_history.history_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Integer getHistory_id() { + return history_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_history.history_id + * + * @param history_id the value for guacamole..guacamole_connection_history.history_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setHistory_id(Integer history_id) { + this.history_id = history_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_history.user_id + * + * @return the value of guacamole..guacamole_connection_history.user_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Integer getUser_id() { + return user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_history.user_id + * + * @param user_id the value for guacamole..guacamole_connection_history.user_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setUser_id(Integer user_id) { + this.user_id = user_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_history.connection_id + * + * @return the value of guacamole..guacamole_connection_history.connection_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Integer getConnection_id() { + return connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_history.connection_id + * + * @param connection_id the value for guacamole..guacamole_connection_history.connection_id + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setConnection_id(Integer connection_id) { + this.connection_id = connection_id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_history.start_date + * + * @return the value of guacamole..guacamole_connection_history.start_date + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Date getStart_date() { + return start_date; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_history.start_date + * + * @param start_date the value for guacamole..guacamole_connection_history.start_date + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setStart_date(Date start_date) { + this.start_date = start_date; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column guacamole..guacamole_connection_history.end_date + * + * @return the value of guacamole..guacamole_connection_history.end_date + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Date getEnd_date() { + return end_date; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column guacamole..guacamole_connection_history.end_date + * + * @param end_date the value for guacamole..guacamole_connection_history.end_date + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setEnd_date(Date end_date) { + this.end_date = end_date; + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java new file mode 100644 index 000000000..2d3db94e8 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java @@ -0,0 +1,603 @@ +package net.sourceforge.guacamole.net.auth.mysql.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class ConnectionHistoryExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public ConnectionHistoryExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andHistory_idIsNull() { + addCriterion("history_id is null"); + return (Criteria) this; + } + + public Criteria andHistory_idIsNotNull() { + addCriterion("history_id is not null"); + return (Criteria) this; + } + + public Criteria andHistory_idEqualTo(Integer value) { + addCriterion("history_id =", value, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idNotEqualTo(Integer value) { + addCriterion("history_id <>", value, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idGreaterThan(Integer value) { + addCriterion("history_id >", value, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idGreaterThanOrEqualTo(Integer value) { + addCriterion("history_id >=", value, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idLessThan(Integer value) { + addCriterion("history_id <", value, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idLessThanOrEqualTo(Integer value) { + addCriterion("history_id <=", value, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idIn(List values) { + addCriterion("history_id in", values, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idNotIn(List values) { + addCriterion("history_id not in", values, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idBetween(Integer value1, Integer value2) { + addCriterion("history_id between", value1, value2, "history_id"); + return (Criteria) this; + } + + public Criteria andHistory_idNotBetween(Integer value1, Integer value2) { + addCriterion("history_id not between", value1, value2, "history_id"); + return (Criteria) this; + } + + public Criteria andUser_idIsNull() { + addCriterion("user_id is null"); + return (Criteria) this; + } + + public Criteria andUser_idIsNotNull() { + addCriterion("user_id is not null"); + return (Criteria) this; + } + + public Criteria andUser_idEqualTo(Integer value) { + addCriterion("user_id =", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotEqualTo(Integer value) { + addCriterion("user_id <>", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThan(Integer value) { + addCriterion("user_id >", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { + addCriterion("user_id >=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThan(Integer value) { + addCriterion("user_id <", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idLessThanOrEqualTo(Integer value) { + addCriterion("user_id <=", value, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idIn(List values) { + addCriterion("user_id in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotIn(List values) { + addCriterion("user_id not in", values, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idBetween(Integer value1, Integer value2) { + addCriterion("user_id between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andUser_idNotBetween(Integer value1, Integer value2) { + addCriterion("user_id not between", value1, value2, "user_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNull() { + addCriterion("connection_id is null"); + return (Criteria) this; + } + + public Criteria andConnection_idIsNotNull() { + addCriterion("connection_id is not null"); + return (Criteria) this; + } + + public Criteria andConnection_idEqualTo(Integer value) { + addCriterion("connection_id =", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotEqualTo(Integer value) { + addCriterion("connection_id <>", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThan(Integer value) { + addCriterion("connection_id >", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { + addCriterion("connection_id >=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThan(Integer value) { + addCriterion("connection_id <", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idLessThanOrEqualTo(Integer value) { + addCriterion("connection_id <=", value, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idIn(List values) { + addCriterion("connection_id in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotIn(List values) { + addCriterion("connection_id not in", values, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idBetween(Integer value1, Integer value2) { + addCriterion("connection_id between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { + addCriterion("connection_id not between", value1, value2, "connection_id"); + return (Criteria) this; + } + + public Criteria andStart_dateIsNull() { + addCriterion("start_date is null"); + return (Criteria) this; + } + + public Criteria andStart_dateIsNotNull() { + addCriterion("start_date is not null"); + return (Criteria) this; + } + + public Criteria andStart_dateEqualTo(Date value) { + addCriterion("start_date =", value, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateNotEqualTo(Date value) { + addCriterion("start_date <>", value, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateGreaterThan(Date value) { + addCriterion("start_date >", value, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateGreaterThanOrEqualTo(Date value) { + addCriterion("start_date >=", value, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateLessThan(Date value) { + addCriterion("start_date <", value, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateLessThanOrEqualTo(Date value) { + addCriterion("start_date <=", value, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateIn(List values) { + addCriterion("start_date in", values, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateNotIn(List values) { + addCriterion("start_date not in", values, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateBetween(Date value1, Date value2) { + addCriterion("start_date between", value1, value2, "start_date"); + return (Criteria) this; + } + + public Criteria andStart_dateNotBetween(Date value1, Date value2) { + addCriterion("start_date not between", value1, value2, "start_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateIsNull() { + addCriterion("end_date is null"); + return (Criteria) this; + } + + public Criteria andEnd_dateIsNotNull() { + addCriterion("end_date is not null"); + return (Criteria) this; + } + + public Criteria andEnd_dateEqualTo(Date value) { + addCriterion("end_date =", value, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateNotEqualTo(Date value) { + addCriterion("end_date <>", value, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateGreaterThan(Date value) { + addCriterion("end_date >", value, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateGreaterThanOrEqualTo(Date value) { + addCriterion("end_date >=", value, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateLessThan(Date value) { + addCriterion("end_date <", value, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateLessThanOrEqualTo(Date value) { + addCriterion("end_date <=", value, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateIn(List values) { + addCriterion("end_date in", values, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateNotIn(List values) { + addCriterion("end_date not in", values, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateBetween(Date value1, Date value2) { + addCriterion("end_date between", value1, value2, "end_date"); + return (Criteria) this; + } + + public Criteria andEnd_dateNotBetween(Date value1, Date value2) { + addCriterion("end_date not between", value1, value2, "end_date"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table guacamole..guacamole_connection_history + * + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java index e15c4fb0f..95deac7df 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java @@ -5,7 +5,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String parameter_value; @@ -15,7 +15,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getParameter_value() { return parameter_value; @@ -27,7 +27,7 @@ public class ConnectionParameter extends ConnectionParameterKey { * * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setParameter_value(String parameter_value) { this.parameter_value = parameter_value; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java index ae1cd3519..bdc44b136 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java @@ -8,7 +8,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionParameterExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public ConnectionParameterExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionParameterExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -399,7 +399,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -412,7 +412,7 @@ public class ConnectionParameterExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_parameter * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java index 494c9c162..2bc72662d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java @@ -5,7 +5,7 @@ public class ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer connection_id; @@ -13,7 +13,7 @@ public class ConnectionParameterKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String parameter_name; @@ -23,7 +23,7 @@ public class ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -35,7 +35,7 @@ public class ConnectionParameterKey { * * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -47,7 +47,7 @@ public class ConnectionParameterKey { * * @return the value of guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getParameter_name() { return parameter_name; @@ -59,7 +59,7 @@ public class ConnectionParameterKey { * * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setParameter_name(String parameter_name) { this.parameter_name = parameter_name; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java index 4f898bbfb..5e4264f6f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java @@ -8,7 +8,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class ConnectionPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public ConnectionPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class ConnectionPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -389,7 +389,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -402,7 +402,7 @@ public class ConnectionPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_connection_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java index 31b7e5b3a..f93afff7f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java @@ -5,7 +5,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer connection_id; @@ -21,7 +21,7 @@ public class ConnectionPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String permission; @@ -31,7 +31,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getUser_id() { return user_id; @@ -43,7 +43,7 @@ public class ConnectionPermissionKey { * * @param user_id the value for guacamole..guacamole_connection_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -55,7 +55,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getConnection_id() { return connection_id; @@ -67,7 +67,7 @@ public class ConnectionPermissionKey { * * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setConnection_id(Integer connection_id) { this.connection_id = connection_id; @@ -79,7 +79,7 @@ public class ConnectionPermissionKey { * * @return the value of guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getPermission() { return permission; @@ -91,7 +91,7 @@ public class ConnectionPermissionKey { * * @param permission the value for guacamole..guacamole_connection_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setPermission(String permission) { this.permission = permission; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java index 36f76ff33..3a042a6a3 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java @@ -8,7 +8,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class SystemPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public SystemPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class SystemPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -329,7 +329,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -342,7 +342,7 @@ public class SystemPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_system_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java index e7d8523dc..707614471 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java @@ -5,7 +5,7 @@ public class SystemPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class SystemPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String permission; @@ -23,7 +23,7 @@ public class SystemPermissionKey { * * @return the value of guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getUser_id() { return user_id; @@ -35,7 +35,7 @@ public class SystemPermissionKey { * * @param user_id the value for guacamole..guacamole_system_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -47,7 +47,7 @@ public class SystemPermissionKey { * * @return the value of guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getPermission() { return permission; @@ -59,7 +59,7 @@ public class SystemPermissionKey { * * @param permission the value for guacamole..guacamole_system_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setPermission(String permission) { this.permission = permission; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java index c8ddd1ba1..516249839 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java @@ -5,7 +5,7 @@ public class User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.username * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String username; @@ -23,7 +23,7 @@ public class User { * * @return the value of guacamole..guacamole_user.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getUser_id() { return user_id; @@ -35,7 +35,7 @@ public class User { * * @param user_id the value for guacamole..guacamole_user.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -47,7 +47,7 @@ public class User { * * @return the value of guacamole..guacamole_user.username * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getUsername() { return username; @@ -59,7 +59,7 @@ public class User { * * @param username the value for guacamole..guacamole_user.username * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setUsername(String username) { this.username = username; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java index 19baccadb..a766bc074 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java @@ -8,7 +8,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class UserExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public UserExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class UserExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -329,7 +329,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -342,7 +342,7 @@ public class UserExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java index 1d65e896d..bdb1c89dc 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java @@ -8,7 +8,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected String orderByClause; @@ -16,7 +16,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected boolean distinct; @@ -24,7 +24,7 @@ public class UserPermissionExample { * This field was generated by MyBatis Generator. * This field corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected List oredCriteria; @@ -32,7 +32,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public UserPermissionExample() { oredCriteria = new ArrayList(); @@ -42,7 +42,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; @@ -52,7 +52,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getOrderByClause() { return orderByClause; @@ -62,7 +62,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setDistinct(boolean distinct) { this.distinct = distinct; @@ -72,7 +72,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public boolean isDistinct() { return distinct; @@ -82,7 +82,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public List getOredCriteria() { return oredCriteria; @@ -92,7 +92,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void or(Criteria criteria) { oredCriteria.add(criteria); @@ -102,7 +102,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); @@ -114,7 +114,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); @@ -128,7 +128,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); @@ -139,7 +139,7 @@ public class UserPermissionExample { * This method was generated by MyBatis Generator. * This method corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void clear() { oredCriteria.clear(); @@ -151,7 +151,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ protected abstract static class GeneratedCriteria { protected List criteria; @@ -389,7 +389,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated do_not_delete_during_merge Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 */ public static class Criteria extends GeneratedCriteria { @@ -402,7 +402,7 @@ public class UserPermissionExample { * This class was generated by MyBatis Generator. * This class corresponds to the database table guacamole..guacamole_user_permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public static class Criterion { private String condition; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java index 711785577..35e4b95e0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java @@ -5,7 +5,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer user_id; @@ -13,7 +13,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private Integer affected_user_id; @@ -21,7 +21,7 @@ public class UserPermissionKey { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private String permission; @@ -31,7 +31,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getUser_id() { return user_id; @@ -43,7 +43,7 @@ public class UserPermissionKey { * * @param user_id the value for guacamole..guacamole_user_permission.user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setUser_id(Integer user_id) { this.user_id = user_id; @@ -55,7 +55,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public Integer getAffected_user_id() { return affected_user_id; @@ -67,7 +67,7 @@ public class UserPermissionKey { * * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setAffected_user_id(Integer affected_user_id) { this.affected_user_id = affected_user_id; @@ -79,7 +79,7 @@ public class UserPermissionKey { * * @return the value of guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public String getPermission() { return permission; @@ -91,7 +91,7 @@ public class UserPermissionKey { * * @param permission the value for guacamole..guacamole_user_permission.permission * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setPermission(String permission) { this.permission = permission; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java index 36838bdfa..27d44d714 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java @@ -5,7 +5,7 @@ public class UserWithBLOBs extends User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.password_hash * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private byte[] password_hash; @@ -13,7 +13,7 @@ public class UserWithBLOBs extends User { * This field was generated by MyBatis Generator. * This field corresponds to the database column guacamole..guacamole_user.password_salt * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ private byte[] password_salt; @@ -23,7 +23,7 @@ public class UserWithBLOBs extends User { * * @return the value of guacamole..guacamole_user.password_hash * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public byte[] getPassword_hash() { return password_hash; @@ -35,7 +35,7 @@ public class UserWithBLOBs extends User { * * @param password_hash the value for guacamole..guacamole_user.password_hash * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setPassword_hash(byte[] password_hash) { this.password_hash = password_hash; @@ -47,7 +47,7 @@ public class UserWithBLOBs extends User { * * @return the value of guacamole..guacamole_user.password_salt * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public byte[] getPassword_salt() { return password_salt; @@ -59,7 +59,7 @@ public class UserWithBLOBs extends User { * * @param password_salt the value for guacamole..guacamole_user.password_salt * - * @mbggenerated Tue Feb 12 20:35:54 PST 2013 + * @mbggenerated Tue Feb 19 23:09:22 PST 2013 */ public void setPassword_salt(byte[] password_salt) { this.password_salt = password_salt; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java new file mode 100644 index 000000000..f2b91428f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java @@ -0,0 +1,226 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import com.google.inject.Inject; +import com.google.inject.Provider; +import java.util.ArrayList; +import java.util.List; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; +import net.sourceforge.guacamole.net.auth.mysql.MySQLConnectionRecord; +import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; + +/** + * Provides convenient provider methods for MySQLUser, MySQLConnection, and MySQLConnctionRecord objects. + * @author James Muehlner + */ +public class ProviderUtility { + @Inject + UserMapper userDAO; + + @Inject + ConnectionMapper connectionDAO; + + @Inject + ConnectionHistoryMapper connectionHistoryDAO; + + @Inject + Provider mySQLUserProvider; + + @Inject + Provider mySQLConnectionProvider; + + @Inject + Provider mySQLConnectionRecordProvider; + + /** + * Create a new user based on the provided object. + * @param user + * @return the new MySQLUser object. + * @throws GuacamoleException + */ + public MySQLUser getNewMySQLUser(User user) throws GuacamoleException { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.initNew(user); + return mySQLUser; + } + + /** + * Get the user based on the username of the provided object. + * @param user + * @return the new MySQLUser object. + * @throws GuacamoleException + */ + public MySQLUser getExistingMySQLUser(User user) throws GuacamoleException { + return getExistingMySQLUser(user.getUsername()); + } + + /** + * Get the user based on the username of the provided object. + * @param name + * @return the new MySQLUser object. + * @throws GuacamoleException + */ + public MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.initExisting(name); + return mySQLUser; + } + + /** + * Get an existing MySQLUser from a user database record. + * @param user + * @return the existing MySQLUser object. + */ + public MySQLUser getExistingMySQLUser(UserWithBLOBs user) { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.init(user); + return mySQLUser; + } + + /** + * Get an existing MySQLUser from a user ID. + * @param id + * @return the existing MySQLUser object if found, null if not. + */ + public MySQLUser getExistingMySQLUser(Integer id) { + UserExample example = new UserExample(); + example.createCriteria().andUser_idEqualTo(id); + List users = userDAO.selectByExampleWithBLOBs(example); + if(users.isEmpty()) + return null; + return getExistingMySQLUser(users.get(0)); + } + + + /** + * Create a new connection based on the provided object. + * @param connection + * @return the new Connection object. + * @throws GuacamoleException + */ + public MySQLConnection getNewMySQLConnection(Connection connection) throws GuacamoleException { + MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); + mySQLConnection.initNew(connection); + return mySQLConnection; + } + + /** + * Get the connection based on the connection name of the provided object. + * @param connection + * @return the new Connection object. + * @throws GuacamoleException + */ + public MySQLConnection getExistingMySQLConnection(Connection connection) throws GuacamoleException { + return getExistingMySQLConnection(connection.getIdentifier()); + } + + /** + * Get the connection based on the connection name of the provided object. + * @param name + * @return the new Connection object. + * @throws GuacamoleException + */ + public MySQLConnection getExistingMySQLConnection(String name) throws GuacamoleException { + MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); + mySQLConnection.initExisting(name); + return mySQLConnection; + } + + /** + * Get an existing MySQLConnection from a connection database record. + * @param connection + * @return the existing MySQLConnection object. + */ + public MySQLConnection getExistingMySQLConnection(net.sourceforge.guacamole.net.auth.mysql.model.Connection connection) { + MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); + mySQLConnection.init(connection); + return mySQLConnection; + } + + /** + * Get an existing MySQLConnection from a connection ID. + * @param id + * @return the existing MySQLConnection object if found, null if not. + */ + public MySQLConnection getExistingMySQLConnection(Integer id) { + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_idEqualTo(id); + List connections = connectionDAO.selectByExample(example); + if(connections.isEmpty()) + return null; + return getExistingMySQLConnection(connections.get(0)); + } + + /** + * Gets a list of existing MySQLConnectionRecord from the database. These represent + * the history records of the connection. + * @param connectionID + * @return the list of MySQLConnectionRecord related to this connectionID. + */ + public List getExistingMySQLConnectionRecords(Integer connectionID) { + ConnectionHistoryExample example = new ConnectionHistoryExample(); + example.createCriteria().andConnection_idEqualTo(connectionID); + List connectionHistories = connectionHistoryDAO.selectByExample(example); + List connectionRecords = new ArrayList(); + for(ConnectionHistory history : connectionHistories) { + connectionRecords.add(getExistingMySQLConnectionRecord(history)); + } + return connectionRecords; + } + + /** + * Create a MySQLConnectionRecord object around a single ConnectionHistory database record. + * @param history + * @return the new MySQLConnectionRecord object. + */ + public MySQLConnectionRecord getExistingMySQLConnectionRecord(ConnectionHistory history) { + MySQLConnectionRecord record = mySQLConnectionRecordProvider.get(); + record.init(history); + return record; + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml new file mode 100644 index 000000000..784d896fd --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + history_id, user_id, connection_id, start_date, end_date + + + + + + delete from guacamole..guacamole_connection_history + where history_id = #{history_id,jdbcType=INTEGER} + + + + delete from guacamole..guacamole_connection_history + + + + + + + insert into guacamole..guacamole_connection_history (history_id, user_id, connection_id, + start_date, end_date) + values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, + #{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP}) + + + + insert into guacamole..guacamole_connection_history + + + history_id, + + + user_id, + + + connection_id, + + + start_date, + + + end_date, + + + + + #{history_id,jdbcType=INTEGER}, + + + #{user_id,jdbcType=INTEGER}, + + + #{connection_id,jdbcType=INTEGER}, + + + #{start_date,jdbcType=TIMESTAMP}, + + + #{end_date,jdbcType=TIMESTAMP}, + + + + + + + update guacamole..guacamole_connection_history + + + history_id = #{record.history_id,jdbcType=INTEGER}, + + + user_id = #{record.user_id,jdbcType=INTEGER}, + + + connection_id = #{record.connection_id,jdbcType=INTEGER}, + + + start_date = #{record.start_date,jdbcType=TIMESTAMP}, + + + end_date = #{record.end_date,jdbcType=TIMESTAMP}, + + + + + + + + + update guacamole..guacamole_connection_history + set history_id = #{record.history_id,jdbcType=INTEGER}, + user_id = #{record.user_id,jdbcType=INTEGER}, + connection_id = #{record.connection_id,jdbcType=INTEGER}, + start_date = #{record.start_date,jdbcType=TIMESTAMP}, + end_date = #{record.end_date,jdbcType=TIMESTAMP} + + + + + + + update guacamole..guacamole_connection_history + + + user_id = #{user_id,jdbcType=INTEGER}, + + + connection_id = #{connection_id,jdbcType=INTEGER}, + + + start_date = #{start_date,jdbcType=TIMESTAMP}, + + + end_date = #{end_date,jdbcType=TIMESTAMP}, + + + where history_id = #{history_id,jdbcType=INTEGER} + + + + update guacamole..guacamole_connection_history + set user_id = #{user_id,jdbcType=INTEGER}, + connection_id = #{connection_id,jdbcType=INTEGER}, + start_date = #{start_date,jdbcType=TIMESTAMP}, + end_date = #{end_date,jdbcType=TIMESTAMP} + where history_id = #{history_id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml index db0a8aad7..80646bd9d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml @@ -1,40 +1,40 @@ - - - - + + + + - - - + + + - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -45,30 +45,30 @@ - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -79,174 +79,174 @@ - + connection_id, connection_name, protocol - select - + distinct from guacamole..guacamole_connection - + - + order by ${orderByClause} - select from guacamole..guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} - + delete from guacamole..guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} - + delete from guacamole..guacamole_connection - + - + insert into guacamole..guacamole_connection (connection_id, connection_name, protocol ) values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} ) - + insert into guacamole..guacamole_connection - - + + connection_id, - + connection_name, - + protocol, - - + + #{connection_id,jdbcType=INTEGER}, - + #{connection_name,jdbcType=VARCHAR}, - + #{protocol,jdbcType=VARCHAR}, - select count(*) from guacamole..guacamole_connection - + - + update guacamole..guacamole_connection - - + + connection_id = #{record.connection_id,jdbcType=INTEGER}, - + connection_name = #{record.connection_name,jdbcType=VARCHAR}, - + protocol = #{record.protocol,jdbcType=VARCHAR}, - + - + update guacamole..guacamole_connection set connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_name = #{record.connection_name,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR} - + - + update guacamole..guacamole_connection - - + + connection_name = #{connection_name,jdbcType=VARCHAR}, - + protocol = #{protocol,jdbcType=VARCHAR}, where connection_id = #{connection_id,jdbcType=INTEGER} - + update guacamole..guacamole_connection set connection_name = #{connection_name,jdbcType=VARCHAR}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml index dab04a451..146622a62 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml @@ -1,40 +1,40 @@ - - - - + + + + - - - + + + - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -45,30 +45,30 @@ - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -79,38 +79,38 @@ - + connection_id, parameter_name, parameter_value - select - + distinct from guacamole..guacamole_connection_parameter - + - + order by ${orderByClause} - select @@ -118,135 +118,135 @@ where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} - + delete from guacamole..guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} - + delete from guacamole..guacamole_connection_parameter - + - + insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value ) values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} ) - + insert into guacamole..guacamole_connection_parameter - - + + connection_id, - + parameter_name, - + parameter_value, - - + + #{connection_id,jdbcType=INTEGER}, - + #{parameter_name,jdbcType=VARCHAR}, - + #{parameter_value,jdbcType=VARCHAR}, - select count(*) from guacamole..guacamole_connection_parameter - + - + update guacamole..guacamole_connection_parameter - - + + connection_id = #{record.connection_id,jdbcType=INTEGER}, - + parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, - + parameter_value = #{record.parameter_value,jdbcType=VARCHAR}, - + - + update guacamole..guacamole_connection_parameter set connection_id = #{record.connection_id,jdbcType=INTEGER}, parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, parameter_value = #{record.parameter_value,jdbcType=VARCHAR} - + - + update guacamole..guacamole_connection_parameter - - + + parameter_value = #{parameter_value,jdbcType=VARCHAR}, where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} - + update guacamole..guacamole_connection_parameter set parameter_value = #{parameter_value,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml index 748522557..240d868bb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml @@ -1,40 +1,40 @@ - - - - + + + + - - - + + + - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -45,30 +45,30 @@ - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -79,140 +79,140 @@ - + user_id, connection_id, permission - select - + distinct from guacamole..guacamole_connection_permission - + - + order by ${orderByClause} - + delete from guacamole..guacamole_connection_permission where user_id = #{user_id,jdbcType=INTEGER} and connection_id = #{connection_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} - + delete from guacamole..guacamole_connection_permission - + - + insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) - + insert into guacamole..guacamole_connection_permission - - + + user_id, - + connection_id, - + permission, - - + + #{user_id,jdbcType=INTEGER}, - + #{connection_id,jdbcType=INTEGER}, - + #{permission,jdbcType=CHAR}, - select count(*) from guacamole..guacamole_connection_permission - + - + update guacamole..guacamole_connection_permission - - + + user_id = #{record.user_id,jdbcType=INTEGER}, - + connection_id = #{record.connection_id,jdbcType=INTEGER}, - + permission = #{record.permission,jdbcType=CHAR}, - + - + update guacamole..guacamole_connection_permission set user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} - + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml index 790c15e8e..2ca6297ac 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml @@ -1,39 +1,39 @@ - - - - + + + + - - + + - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -44,30 +44,30 @@ - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -78,127 +78,127 @@ - + user_id, permission - select - + distinct from guacamole..guacamole_system_permission - + - + order by ${orderByClause} - + delete from guacamole..guacamole_system_permission where user_id = #{user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} - + delete from guacamole..guacamole_system_permission - + - + insert into guacamole..guacamole_system_permission (user_id, permission) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) - + insert into guacamole..guacamole_system_permission - - + + user_id, - + permission, - - + + #{user_id,jdbcType=INTEGER}, - + #{permission,jdbcType=CHAR}, - select count(*) from guacamole..guacamole_system_permission - + - + update guacamole..guacamole_system_permission - - + + user_id = #{record.user_id,jdbcType=INTEGER}, - + permission = #{record.permission,jdbcType=CHAR}, - + - + update guacamole..guacamole_system_permission set user_id = #{record.user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} - + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml index 7af380321..5fe55f665 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml @@ -1,48 +1,48 @@ - - - - + + + + - - + + - + - - + + - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -53,30 +53,30 @@ - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -87,67 +87,67 @@ - + user_id, username - + password_hash, password_salt - select - + distinct , from guacamole..guacamole_user - + - + order by ${orderByClause} - select - + distinct from guacamole..guacamole_user - + - + order by ${orderByClause} - select @@ -156,162 +156,162 @@ from guacamole..guacamole_user where user_id = #{user_id,jdbcType=INTEGER} - + delete from guacamole..guacamole_user where user_id = #{user_id,jdbcType=INTEGER} - + delete from guacamole..guacamole_user - + - + insert into guacamole..guacamole_user (user_id, username, password_hash, password_salt) values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, #{password_salt,jdbcType=BINARY}) - + insert into guacamole..guacamole_user - - + + user_id, - + username, - + password_hash, - + password_salt, - - + + #{user_id,jdbcType=INTEGER}, - + #{username,jdbcType=VARCHAR}, - + #{password_hash,jdbcType=BINARY}, - + #{password_salt,jdbcType=BINARY}, - select count(*) from guacamole..guacamole_user - + - + update guacamole..guacamole_user - - + + user_id = #{record.user_id,jdbcType=INTEGER}, - + username = #{record.username,jdbcType=VARCHAR}, - + password_hash = #{record.password_hash,jdbcType=BINARY}, - + password_salt = #{record.password_salt,jdbcType=BINARY}, - + - + update guacamole..guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR}, password_hash = #{record.password_hash,jdbcType=BINARY}, password_salt = #{record.password_salt,jdbcType=BINARY} - + - + update guacamole..guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR} - + - + update guacamole..guacamole_user - - + + username = #{username,jdbcType=VARCHAR}, - + password_hash = #{password_hash,jdbcType=BINARY}, - + password_salt = #{password_salt,jdbcType=BINARY}, where user_id = #{user_id,jdbcType=INTEGER} - + update guacamole..guacamole_user set username = #{username,jdbcType=VARCHAR}, @@ -319,11 +319,11 @@ password_salt = #{password_salt,jdbcType=BINARY} where user_id = #{user_id,jdbcType=INTEGER} - + update guacamole..guacamole_user set username = #{username,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml index 363ebea71..97f86bbe5 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml @@ -1,40 +1,40 @@ - - - - + + + + - - - + + + - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -45,30 +45,30 @@ - + - - - - - - - + + + + + + + and ${criterion.condition} - + and ${criterion.condition} #{criterion.value} - + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - + and ${criterion.condition} - + #{listItem} @@ -79,140 +79,140 @@ - + user_id, affected_user_id, permission - select - + distinct from guacamole..guacamole_user_permission - + - + order by ${orderByClause} - + delete from guacamole..guacamole_user_permission where user_id = #{user_id,jdbcType=INTEGER} and affected_user_id = #{affected_user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} - + delete from guacamole..guacamole_user_permission - + - + insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) - + insert into guacamole..guacamole_user_permission - - + + user_id, - + affected_user_id, - + permission, - - + + #{user_id,jdbcType=INTEGER}, - + #{affected_user_id,jdbcType=INTEGER}, - + #{permission,jdbcType=CHAR}, - select count(*) from guacamole..guacamole_user_permission - + - + update guacamole..guacamole_user_permission - - + + user_id = #{record.user_id,jdbcType=INTEGER}, - + affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, - + permission = #{record.permission,jdbcType=CHAR}, - + - + update guacamole..guacamole_user_permission set user_id = #{record.user_id,jdbcType=INTEGER}, affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} - + From df50454f152733302edc0da10e0e816690199e47 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 20 Feb 2013 12:49:45 -0800 Subject: [PATCH 030/109] Ticket #269: Added hashcode functions for MySQLUSer and MySQLConnection. --- .../guacamole/net/auth/mysql/MySQLConnection.java | 15 +++++++++++++-- .../guacamole/net/auth/mysql/MySQLUser.java | 14 +++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 968e7288b..70cff48fd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -91,7 +91,6 @@ public class MySQLConnection implements Connection { * @param connection */ public void initNew(Connection connection) { - configuration = connection.getConfiguration(); this.connection.setConnection_name(connection.getIdentifier()); this.configuration = connection.getConfiguration(); } @@ -150,7 +149,19 @@ public class MySQLConnection implements Connection { public boolean equals(Object other) { if(!(other instanceof MySQLConnection)) return false; - return ((MySQLConnection)other).getConnectionID() == this.getConnectionID(); + boolean idsAreEqual = ((MySQLConnection)other).getConnectionID() == this.getConnectionID(); + // they are both new, check if they have the same name + if(idsAreEqual && this.getConnectionID() == 0) + return this.getIdentifier().equals(((MySQLConnection)other).getIdentifier()); + return idsAreEqual; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 73 * hash + getConnectionID(); + hash = 73 * hash + getIdentifier().hashCode(); + return hash; } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index 491d3d9e1..92975ee87 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -207,6 +207,18 @@ public class MySQLUser implements User { public boolean equals(Object other) { if(!(other instanceof MySQLUser)) return false; - return ((MySQLUser)other).getUserID() == this.getUserID(); + boolean idsAreEqual = ((MySQLUser)other).getUserID() == this.getUserID(); + // they are both new, check if they have the same name + if(idsAreEqual && this.getUserID() == 0) + return this.getUsername().equals(((MySQLUser)other).getUsername()); + return idsAreEqual; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 73 * hash + getUserID(); + hash = 73 * hash + getUsername().hashCode(); + return hash; } } From 253636bb4f610b7b91302e3e1f3a732ed8fa69df Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 20 Feb 2013 22:20:19 -0800 Subject: [PATCH 031/109] Ticket #269: Connection.setConfiguration should not throw exceptions. --- .../sourceforge/guacamole/net/auth/mysql/MySQLConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 70cff48fd..d34bce987 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -136,7 +136,7 @@ public class MySQLConnection implements Connection { } @Override - public void setConfiguration(GuacamoleConfiguration config) throws GuacamoleException { + public void setConfiguration(GuacamoleConfiguration config) { this.configuration = config; } From 4bbe2c986368b5b1dcd98f122485d0f25808fccc Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Thu, 21 Feb 2013 22:56:43 -0800 Subject: [PATCH 032/109] Ticket #269: Connection implementation completed. Testing and styling remain. --- .../net/auth/mysql/ConnectionDirectory.java | 109 ++++++++-- .../mysql/GuacamolePermissionException.java | 2 +- .../mysql/MySQLAuthenticationProvider.java | 13 +- .../net/auth/mysql/MySQLConnection.java | 86 ++++++-- .../net/auth/mysql/MySQLConnectionRecord.java | 14 +- .../guacamole/net/auth/mysql/MySQLUser.java | 44 ++-- .../net/auth/mysql/MySQLUserContext.java | 12 +- .../net/auth/mysql/UserDirectory.java | 131 ++++++------ .../properties/MySQLGuacamoleProperties.java | 23 +- .../mysql/utility/PermissionCheckUtility.java | 198 +++++++++--------- .../auth/mysql/utility/ProviderUtility.java | 21 +- .../Sha256PasswordEncryptionUtility.java | 7 - 12 files changed, 405 insertions(+), 255 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index f99e14e99..b98e00653 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -35,7 +35,7 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql; -import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import com.google.inject.Inject; import java.util.ArrayList; import java.util.HashMap; @@ -51,6 +51,7 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; @@ -68,30 +69,30 @@ public class ConnectionDirectory implements Directory{ * Access is based on his/her permission settings. */ private MySQLUser user; - + @Inject PermissionCheckUtility permissionCheckUtility; - + @Inject ProviderUtility providerUtility; - + @Inject ConnectionMapper connectionDAO; - + @Inject ConnectionPermissionMapper connectionPermissionDAO; - + @Inject ConnectionParameterMapper connectionParameterDAO; - + /** * Set the user for this directory. - * @param user + * @param user */ void init(MySQLUser user) { this.user = user; } - + @Transactional @Override public Connection get(String identifier) throws GuacamoleException { @@ -113,14 +114,13 @@ public class ConnectionDirectory implements Directory{ @Transactional @Override public void add(Connection object) throws GuacamoleException { - Preconditions.checkNotNull(object); permissionCheckUtility.verifyCreateConnectionPermission(this.user.getUserID()); - + MySQLConnection mySQLConnection = providerUtility.getNewMySQLConnection(object); connectionDAO.insert(mySQLConnection.getConnection()); - + updateConfigurationValues(mySQLConnection); - + //finally, give the current user full access to the newly created connection. ConnectionPermissionKey newConnectionPermission = new ConnectionPermissionKey(); newConnectionPermission.setUser_id(this.user.getUserID()); @@ -134,39 +134,104 @@ public class ConnectionDirectory implements Directory{ newConnectionPermission.setPermission(MySQLConstants.USER_ADMINISTER); connectionPermissionDAO.insert(newConnectionPermission); } - + /** * Saves the values of the configuration to the database - * @param connection + * @param connection */ private void updateConfigurationValues(MySQLConnection mySQLConnection) { GuacamoleConfiguration configuration = mySQLConnection.getConfiguration(); Map existingConfiguration = new HashMap(); ConnectionParameterExample example = new ConnectionParameterExample(); + example.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); List connectionParameters = connectionParameterDAO.selectByExample(example); for(ConnectionParameter parameter : connectionParameters) existingConfiguration.put(parameter.getParameter_name(), parameter.getParameter_value()); - + List parametersToInsert = new ArrayList(); List parametersToUpdate = new ArrayList(); - + Set parameterNames = configuration.getParameterNames(); - + for(String parameterName : parameterNames) { - + String parameterValue = configuration.getParameter(parameterName); + if(existingConfiguration.containsKey(parameterName)) { + String existingValue = existingConfiguration.get(parameterName); + // the value is different; we'll have to update this one in the database + if(!parameterValue.equals(existingValue)) { + ConnectionParameter parameterToUpdate = new ConnectionParameter(); + parameterToUpdate.setConnection_id(mySQLConnection.getConnectionID()); + parameterToUpdate.setParameter_name(parameterName); + parameterToUpdate.setParameter_value(parameterValue); + parametersToUpdate.add(parameterToUpdate); + } + } else { + // the value is new, we need to insert it + ConnectionParameter parameterToInsert = new ConnectionParameter(); + parameterToInsert.setConnection_id(mySQLConnection.getConnectionID()); + parameterToInsert.setParameter_name(parameterName); + parameterToInsert.setParameter_value(parameterValue); + parametersToInsert.add(parameterToInsert); + } + } + + // First, delete all parameters that are not in the new configuration. + example.clear(); + example.createCriteria(). + andConnection_idEqualTo(mySQLConnection.getConnectionID()). + andParameter_nameNotIn(Lists.newArrayList(existingConfiguration.keySet())); + + //Second, update all the parameters that need to be modified. + for(ConnectionParameter parameter : parametersToUpdate) { + example.clear(); + example.createCriteria(). + andConnection_idEqualTo(mySQLConnection.getConnectionID()). + andParameter_nameEqualTo(parameter.getParameter_name()); + + connectionParameterDAO.updateByExample(parameter, example); + } + + //Finally, insert any new parameters. + for(ConnectionParameter parameter : parametersToInsert) { + example.clear(); + example.createCriteria(). + andConnection_idEqualTo(mySQLConnection.getConnectionID()). + andParameter_nameEqualTo(parameter.getParameter_name()); + + connectionParameterDAO.insert(parameter); } } @Transactional @Override public void update(Connection object) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + permissionCheckUtility.verifyConnectionUpdateAccess(this.user.getUserID(), object.getIdentifier()); + + MySQLConnection mySQLConnection = providerUtility.getExistingMySQLConnection(object); + connectionDAO.updateByPrimaryKey(mySQLConnection.getConnection()); + + updateConfigurationValues(mySQLConnection); } @Transactional @Override public void remove(String identifier) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + permissionCheckUtility.verifyConnectionDeleteAccess(this.user.getUserID(), identifier); + + MySQLConnection mySQLConnection = providerUtility.getExistingMySQLConnection(identifier); + + // delete all configuration values + ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample(); + connectionParameterExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); + connectionParameterDAO.deleteByExample(connectionParameterExample); + + // delete all permissions that refer to this connection + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); + connectionPermissionDAO.deleteByExample(connectionPermissionExample); + + // delete the connection itself + connectionDAO.deleteByPrimaryKey(mySQLConnection.getConnectionID()); } - + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java index 44502bf0a..98df8f749 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java @@ -74,5 +74,5 @@ public class GuacamolePermissionException extends GuacamoleException { super(cause); } - + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 5cd9ca423..22a00e7e4 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -52,6 +52,7 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; @@ -73,18 +74,21 @@ import org.slf4j.LoggerFactory; public class MySQLAuthenticationProvider implements AuthenticationProvider { private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); - + + private ActiveConnectionSet activeConnectionSet = new ActiveConnectionSet(); + private Injector injector; - + @Override public UserContext getUserContext(Credentials credentials) throws GuacamoleException { MySQLUserContext context = injector.getInstance(MySQLUserContext.class); context.init(credentials); return context; } - + public MySQLAuthenticationProvider() throws GuacamoleException { final Properties myBatisProperties = new Properties(); + //set the mysql properties for MyBatis. myBatisProperties.setProperty("mybatis.environment.id", "guacamole"); myBatisProperties.setProperty("JDBC.host", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_HOSTNAME)); myBatisProperties.setProperty("JDBC.port", String.valueOf(GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PORT))); @@ -93,6 +97,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { myBatisProperties.setProperty("JDBC.password", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PASSWORD)); myBatisProperties.setProperty("JDBC.autoCommit", "false"); + // Set up Guice injector. injector = Guice.createInjector( JdbcHelper.MySQL, new Module() { @@ -117,6 +122,8 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); bind(PermissionCheckUtility.class); bind(ProviderUtility.class); + bind(ConfigurationTranslationUtility.class); + bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); } } ); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index d34bce987..6dabae6cb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -39,11 +39,19 @@ import com.google.inject.Inject; import java.util.List; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.GuacamoleSocket; +import net.sourceforge.guacamole.net.InetGuacamoleSocket; import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.ConnectionRecord; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; +import net.sourceforge.guacamole.properties.GuacamoleProperties; +import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; @@ -52,24 +60,34 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; * @author James Muehlner */ public class MySQLConnection implements Connection { - + @Inject ConnectionMapper connectionDAO; - + + @Inject + ConnectionParameterMapper connectionParameterDAO; + @Inject ProviderUtility providerUtility; - + + @Inject + ActiveConnectionSet activeConnectionSet; + + @Inject + ConfigurationTranslationUtility configurationTranslationUtility; + private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection; - + private GuacamoleConfiguration configuration; - + /** * Create a default, empty connection. */ MySQLConnection() { connection = new net.sourceforge.guacamole.net.auth.mysql.model.Connection(); + configuration = new GuacamoleConfiguration(); } - + /** * Get the ID of the underlying connection record. * @return the ID of the underlying connection @@ -77,7 +95,7 @@ public class MySQLConnection implements Connection { public int getConnectionID() { return connection.getConnection_id(); } - + /** * Get the underlying connection database record. * @return the underlying connection record. @@ -85,19 +103,31 @@ public class MySQLConnection implements Connection { public net.sourceforge.guacamole.net.auth.mysql.model.Connection getConnection() { return connection; } - + /** * Create a new MySQLConnection from this new connection. This is a connection that has not yet been inserted. - * @param connection + * @param connection */ public void initNew(Connection connection) { this.connection.setConnection_name(connection.getIdentifier()); this.configuration = connection.getConfiguration(); } - + + /** + * Initializes the GuacamoleConfiguration based on the ConnectionParameter values in the database. + */ + private void initConfiguration() { + ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample(); + connectionParameterExample.createCriteria().andConnection_idEqualTo(connection.getConnection_id()); + + List connectionParameters = connectionParameterDAO.selectByExample(connectionParameterExample); + + configuration = configurationTranslationUtility.getConfiguration(connection.getProtocol(), connectionParameters); + } + /** * Load an existing connection by name. - * @param connectionName + * @param connectionName */ public void initExisting(String connectionName) throws GuacamoleException { ConnectionExample example = new ConnectionExample(); @@ -108,16 +138,19 @@ public class MySQLConnection implements Connection { throw new GuacamoleException("Multiple connections found named '" + connectionName + "'."); else if(connections.isEmpty()) throw new GuacamoleException("No connection found named '" + connectionName + "'."); - + connection = connections.get(0); + + initConfiguration(); } - + /** - * Initialize from a database record. - * @param connection + * Initialize from a database record. This also initializes the configuration values. + * @param connection */ public void init(net.sourceforge.guacamole.net.auth.mysql.model.Connection connection) { this.connection = connection; + initConfiguration(); } @Override @@ -138,13 +171,30 @@ public class MySQLConnection implements Connection { @Override public void setConfiguration(GuacamoleConfiguration config) { this.configuration = config; + } @Override public GuacamoleSocket connect(GuacamoleClientInformation info) throws GuacamoleException { - throw new UnsupportedOperationException("Not supported yet."); + // If the current connection is active, and multiple simultaneous connections are not allowed. + if(GuacamoleProperties.getProperty(MySQLGuacamoleProperties.MYSQL_DISALLOW_SIMULTANEOUS_CONNECTIONS, false) + && activeConnectionSet.contains(getConnectionID())) + throw new GuacamoleException("Cannot connect. This connection is in use."); + + String host = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME); + int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT); + + InetGuacamoleSocket inetSocket = new InetGuacamoleSocket(host, port); + ConfiguredGuacamoleSocket configuredSocket = new ConfiguredGuacamoleSocket(inetSocket, configuration); + + MySQLGuacamoleSocket mySQLSocket = providerUtility.getMySQLGuacamoleSocket(configuredSocket, getConnectionID()); + + // mark this connection as active + activeConnectionSet.add(getConnectionID()); + + return mySQLSocket; } - + @Override public boolean equals(Object other) { if(!(other instanceof MySQLConnection)) @@ -163,7 +213,7 @@ public class MySQLConnection implements Connection { hash = 73 * hash + getIdentifier().hashCode(); return hash; } - + @Override public List getHistory() throws GuacamoleException { return providerUtility.getExistingMySQLConnectionRecords(connection.getConnection_id()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 099f5a482..ec47b4556 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -55,24 +55,24 @@ public class MySQLConnectionRecord implements ConnectionRecord { * The database record that this ConnectionRecord represents. */ private ConnectionHistory connectionHistory; - + @Inject UserMapper userDAO; - + @Inject ConnectionMapper connectionDAO; - + @Inject ProviderUtility providerUtility; - + /** * Initialize this MySQLConnectionRecord with the database record it represents. - * @param connectionHistory + * @param connectionHistory */ public void init(ConnectionHistory connectionHistory) { this.connectionHistory = connectionHistory; } - + @Override public Date getStartDate() { return connectionHistory.getStart_date(); @@ -98,5 +98,5 @@ public class MySQLConnectionRecord implements ConnectionRecord { // if the end date hasn't been stored yet, the connection is still open. return connectionHistory.getEnd_date() == null; } - + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index 92975ee87..be69486b3 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -58,21 +58,21 @@ import net.sourceforge.guacamole.net.auth.permission.Permission; public class MySQLUser implements User { private UserWithBLOBs user; - + @Inject UserMapper userDAO; - + @Inject PasswordEncryptionUtility passwordUtility; - + @Inject SaltUtility saltUtility; - + @Inject PermissionCheckUtility permissionCheckUtility; - + Set permissions; - + /** * Create a default, empty user. */ @@ -80,11 +80,11 @@ public class MySQLUser implements User { user = new UserWithBLOBs(); permissions = new HashSet(); } - + /** * Create the user, throwing an exception if the credentials do not match what's in the database. * @param credentials - * @throws GuacamoleException + * @throws GuacamoleException */ void init (Credentials credentials) throws GuacamoleException { UserExample userExample = new UserExample(); @@ -98,25 +98,25 @@ public class MySQLUser implements User { // check password if(!passwordUtility.checkCredentials(credentials, user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) throw new GuacamoleException("No user found with the supplied credentials"); - + this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); } - + /** * Create a new user from the provided information. This represents a user that has not yet been inserted. * @param user - * @throws GuacamoleException + * @throws GuacamoleException */ public void initNew (User user) throws GuacamoleException { this.setPassword(user.getPassword()); this.setUsername(user.getUsername()); this.permissions = user.getPermissions(); } - + /** * Loads a user by username. * @param userName - * @throws GuacamoleException + * @throws GuacamoleException */ public void initExisting (String username) throws GuacamoleException { UserExample example = new UserExample(); @@ -126,36 +126,36 @@ public class MySQLUser implements User { throw new GuacamoleException("Multiple users found with username '" + username + "'."); if(userList.isEmpty()) throw new GuacamoleException("No user found with username '" + username + "'."); - + this.user = userList.get(0); this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); } - + /** * Initialize from a database record. - * @param user + * @param user */ public void init(UserWithBLOBs user) { this.user = user; this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); } - + /** * Get the user id. - * @return + * @return */ public int getUserID() { return user.getUser_id(); } - + /** * Return the database record held by this object. - * @return + * @return */ public UserWithBLOBs getUser() { return user; } - + @Override public String getUsername() { return user.getUsername(); @@ -202,7 +202,7 @@ public class MySQLUser implements User { public void removePermission(Permission permission) throws GuacamoleException { permissions.remove(permission); } - + @Override public boolean equals(Object other) { if(!(other instanceof MySQLUser)) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index fc55da470..2ca81af11 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -50,18 +50,18 @@ import org.slf4j.LoggerFactory; * @author James Muehlner */ public class MySQLUserContext implements UserContext { - + private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); - + @Inject private MySQLUser user; - + @Inject private UserDirectory userDirectory; - + @Inject private ConnectionDirectory connectionDirectory; - + void init(Credentials credentials) throws GuacamoleException { user.init(credentials); userDirectory.init(user); @@ -82,5 +82,5 @@ public class MySQLUserContext implements UserContext { public Directory getConnectionDirectory() throws GuacamoleException { return connectionDirectory; } - + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 92dd7d22f..1cc339d42 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -74,42 +74,42 @@ import org.mybatis.guice.transactional.Transactional; * @author James Muehlner */ public class UserDirectory implements Directory { - + /** * The user who this user directory belongs to. * Access is based on his/her permission settings. */ private MySQLUser user; - + @Inject UserMapper userDAO; - + @Inject ConnectionMapper connectionDAO; - + @Inject UserPermissionMapper userPermissionDAO; - + @Inject ConnectionPermissionMapper connectionPermissionDAO; - + @Inject SystemPermissionMapper systemPermissionDAO; - + @Inject PermissionCheckUtility permissionCheckUtility; - + @Inject ProviderUtility providerUtility; - + /** * Set the user for this directory. - * @param user + * @param user */ void init(MySQLUser user) { this.user = user; } - + @Transactional @Override public User get(String identifier) throws GuacamoleException { @@ -133,14 +133,14 @@ public class UserDirectory implements Directory { public void add(User object) throws GuacamoleException { permissionCheckUtility.verifyCreateUserPermission(this.user.getUserID()); Preconditions.checkNotNull(object); - + //create user in database MySQLUser mySQLUser = providerUtility.getNewMySQLUser(object); userDAO.insert(mySQLUser.getUser()); - + //create permissions in database updatePermissions(mySQLUser); - + //finally, give the current user full access to the newly created user. UserPermissionKey newUserPermission = new UserPermissionKey(); newUserPermission.setUser_id(this.user.getUserID()); @@ -154,24 +154,24 @@ public class UserDirectory implements Directory { newUserPermission.setPermission(MySQLConstants.USER_ADMINISTER); userPermissionDAO.insert(newUserPermission); } - + /** * Update all the permissions for a given user to be only those specified in the user object. * Delete any permissions not in the list, and create any in the list that do not exist * in the database. * @param user - * @throws GuacamoleException + * @throws GuacamoleException */ private void updatePermissions(MySQLUser user) throws GuacamoleException { List userPermissions = new ArrayList(); List connectionPermissions = new ArrayList(); List systemPermissions = new ArrayList(); - + // Get the list of all the users and connections that the user performing the user save action has. // Need to make sure the user saving this user has permission to administrate all the objects in the permission list. Set administerableUsers = permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); Set administerableConnections = permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); - + for(Permission permission : user.getPermissions()) { if(permission instanceof UserPermission) userPermissions.add((UserPermission)permission); @@ -180,36 +180,36 @@ public class UserDirectory implements Directory { else if(permission instanceof SystemPermission) systemPermissions.add((SystemPermission)permission); } - + updateUserPermissions(userPermissions, user, administerableUsers); updateConnectionPermissions(connectionPermissions, user, administerableConnections); updateSystemPermissions(systemPermissions, user); } - + /** * Update all the permissions having to do with users for a given user. * @param permissions - * @param user + * @param user */ private void updateUserPermissions(Iterable permissions, MySQLUser user, Set administerableUsers) throws GuacamoleException { - + List usernames = new ArrayList(); for(UserPermission permission : permissions) { usernames.add(permission.getObjectIdentifier()); } - + // find all the users by username UserExample userExample = new UserExample(); userExample.createCriteria().andUsernameIn(usernames); List dbUsers = userDAO.selectByExample(userExample); List userIDs = new ArrayList(); - + Map dbUserMap = new HashMap(); for(net.sourceforge.guacamole.net.auth.mysql.model.User dbUser : dbUsers) { dbUserMap.put(dbUser.getUsername(), dbUser); userIDs.add(dbUser.getUser_id()); } - + // find any user permissions that may already exist UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andAffected_user_idIn(userIDs); @@ -218,35 +218,35 @@ public class UserDirectory implements Directory { for(UserPermissionKey userPermission : existingPermissions) { existingUserIDs.add(userPermission.getAffected_user_id()); } - + // delete any permissions that are not in the provided list userPermissionExample.clear(); userPermissionExample.createCriteria().andAffected_user_idNotIn(userIDs); List permissionsToDelete = userPermissionDAO.selectByExample(userPermissionExample); - + // verify that the user actually has permission to administrate every one of these users for(UserPermissionKey permissionToDelete : permissionsToDelete) { if(!administerableUsers.contains(permissionToDelete.getAffected_user_id())) throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + permissionToDelete.getAffected_user_id()); } - + userPermissionDAO.deleteByExample(userPermissionExample); - + // finally, insert the new permissions for(UserPermission permission : permissions) { net.sourceforge.guacamole.net.auth.mysql.model.User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); if(dbAffectedUser == null) throw new GuacamoleException("User '" + permission.getObjectIdentifier() + "' not found."); - + // the permission for this user already exists, we don't need to create it again if(existingUserIDs.contains(dbAffectedUser.getUser_id())) continue; - - + + // verify that the user actually has permission to administrate every one of these users if(!administerableUsers.contains(dbAffectedUser.getUser_id())) throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + dbAffectedUser.getUser_id()); - + UserPermissionKey newPermission = new UserPermissionKey(); newPermission.setAffected_user_id(dbAffectedUser.getUser_id()); newPermission.setPermission(permission.getType().name()); @@ -254,31 +254,31 @@ public class UserDirectory implements Directory { userPermissionDAO.insert(newPermission); } } - + /** * Update all the permissions having to do with connections for a given user. * @param permissions - * @param user + * @param user */ private void updateConnectionPermissions(Iterable permissions, MySQLUser user, Set administerableConnections) throws GuacamoleException { - + List connectionnames = new ArrayList(); for(ConnectionPermission permission : permissions) { connectionnames.add(permission.getObjectIdentifier()); } - + // find all the connections by connectionname ConnectionExample connectionExample = new ConnectionExample(); connectionExample.createCriteria().andConnection_nameIn(connectionnames); List dbConnections = connectionDAO.selectByExample(connectionExample); List connectionIDs = new ArrayList(); - + Map dbConnectionMap = new HashMap(); for(net.sourceforge.guacamole.net.auth.mysql.model.Connection dbConnection : dbConnections) { dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); connectionIDs.add(dbConnection.getConnection_id()); } - + // find any connection permissions that may already exist ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andConnection_idIn(connectionIDs); @@ -287,35 +287,35 @@ public class UserDirectory implements Directory { for(ConnectionPermissionKey connectionPermission : existingPermissions) { existingConnectionIDs.add(connectionPermission.getConnection_id()); } - + // delete any permissions that are not in the provided list connectionPermissionExample.clear(); connectionPermissionExample.createCriteria().andConnection_idNotIn(connectionIDs); - + //make sure the user has permission to administrate each of these connections List connectionPermissionsToDelete = connectionPermissionDAO.selectByExample(connectionPermissionExample); - + for(ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { if(!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + connectionPermissionToDelete.getConnection_id()); } - + connectionPermissionDAO.deleteByExample(connectionPermissionExample); - + // finally, insert the new permissions for(ConnectionPermission permission : permissions) { net.sourceforge.guacamole.net.auth.mysql.model.Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); if(dbConnection == null) throw new GuacamoleException("Connection '" + permission.getObjectIdentifier() + "' not found."); - + // the permission for this connection already exists, we don't need to create it again if(existingConnectionIDs.contains(dbConnection.getConnection_id())) continue; - + if(!administerableConnections.contains(dbConnection.getConnection_id())) throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + dbConnection.getConnection_id()); - - + + ConnectionPermissionKey newPermission = new ConnectionPermissionKey(); newPermission.setConnection_id(dbConnection.getConnection_id()); newPermission.setPermission(permission.getType().name()); @@ -323,11 +323,11 @@ public class UserDirectory implements Directory { connectionPermissionDAO.insert(newPermission); } } - + /** * Update all system permissions for a given user. * @param permissions - * @param user + * @param user */ private void updateSystemPermissions(Iterable permissions, MySQLUser user) { List systemPermissionTypes = new ArrayList(); @@ -338,12 +338,12 @@ public class UserDirectory implements Directory { else if(permission instanceof UserDirectoryPermission) systemPermissionTypes.add(operation + "_USER"); } - + //delete all system permissions not in the list SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()).andPermissionNotIn(systemPermissionTypes); systemPermissionDAO.deleteByExample(systemPermissionExample); - + // find all existing system permissions systemPermissionExample.clear(); systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()).andPermissionIn(systemPermissionTypes); @@ -352,13 +352,13 @@ public class UserDirectory implements Directory { for(SystemPermissionKey existingPermission : existingPermissions) { existingPermissionTypes.add(existingPermission.getPermission()); } - + // finally, insert any new system permissions for this user for(String systemPermissionType : systemPermissionTypes) { - //do not insert the permission if it already exists + //do not insert the permission if it already exists if(existingPermissionTypes.contains(systemPermissionType)) continue; - + SystemPermissionKey newSystemPermission = new SystemPermissionKey(); newSystemPermission.setUser_id(user.getUserID()); newSystemPermission.setPermission(systemPermissionType); @@ -373,7 +373,7 @@ public class UserDirectory implements Directory { //update the user in the database MySQLUser mySQLUser = providerUtility.getExistingMySQLUser(object); userDAO.updateByPrimaryKey(mySQLUser.getUser()); - + //update permissions in database updatePermissions(mySQLUser); } @@ -382,34 +382,39 @@ public class UserDirectory implements Directory { @Transactional public void remove(String identifier) throws GuacamoleException { permissionCheckUtility.verifyUserDeleteAccess(this.user.getUserID(), identifier); - + MySQLUser mySQLUser = providerUtility.getExistingMySQLUser(identifier); - + //delete all the user permissions in the database deleteAllPermissions(mySQLUser); - + //delete the user in the database userDAO.deleteByPrimaryKey(mySQLUser.getUserID()); } - + /** * Delete all permissions associated with the provided user. This is only used when deleting a user. - * @param user + * @param user */ private void deleteAllPermissions(MySQLUser user) throws GuacamolePermissionException { //delete all user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); userPermissionDAO.deleteByExample(userPermissionExample); - + //delete all connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); connectionPermissionDAO.deleteByExample(connectionPermissionExample); - + //delete all system permissions SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); systemPermissionDAO.deleteByExample(systemPermissionExample); + + //delete all permissions that refer to this user + userPermissionExample.createCriteria(); + userPermissionExample.createCriteria().andAffected_user_idEqualTo(user.getUserID()); + userPermissionDAO.deleteByExample(userPermissionExample); } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java index b37856a6c..10ca5525f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/MySQLGuacamoleProperties.java @@ -35,6 +35,7 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.properties; +import net.sourceforge.guacamole.properties.BooleanGuacamoleProperty; import net.sourceforge.guacamole.properties.IntegerGuacamoleProperty; import net.sourceforge.guacamole.properties.StringGuacamoleProperty; @@ -43,12 +44,12 @@ import net.sourceforge.guacamole.properties.StringGuacamoleProperty; * @author James Muehlner */ public class MySQLGuacamoleProperties { - + /** * This class should not be instantiated. */ private MySQLGuacamoleProperties() {} - + /** * The URL of the MySQL server hosting the guacamole authentication tables. */ @@ -58,7 +59,7 @@ public class MySQLGuacamoleProperties { public String getName() { return "mysql-hostname"; } }; - + /** * The port of the MySQL server hosting the guacamole authentication tables. */ @@ -68,7 +69,7 @@ public class MySQLGuacamoleProperties { public String getName() { return "mysql-port"; } }; - + /** * The name of the MySQL database containing the guacamole authentication tables. */ @@ -78,7 +79,7 @@ public class MySQLGuacamoleProperties { public String getName() { return "mysql-database"; } }; - + /** * The username used to authenticate to the MySQL database containing the guacamole authentication tables. */ @@ -88,7 +89,7 @@ public class MySQLGuacamoleProperties { public String getName() { return "mysql-username"; } }; - + /** * The password used to authenticate to the MySQL database containing the guacamole authentication tables. */ @@ -98,4 +99,14 @@ public class MySQLGuacamoleProperties { public String getName() { return "mysql-password"; } }; + + /** + * Whether or not multiple users accessing the same connection at the same time should be disallowed. + */ + public static final BooleanGuacamoleProperty MYSQL_DISALLOW_SIMULTANEOUS_CONNECTIONS = new BooleanGuacamoleProperty() { + + @Override + public String getName() { return "mysql-disallow-simultaneous-connections"; } + + }; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java index 07745c098..8d43206e1 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -76,28 +76,28 @@ import net.sourceforge.guacamole.net.auth.permission.UserPermission; * @author James Muehlner */ public class PermissionCheckUtility { - + @Inject UserMapper userDAO; - + @Inject ConnectionMapper connectionDAO; - + @Inject UserPermissionMapper userPermissionDAO; - + @Inject ConnectionPermissionMapper connectionPermissionDAO; - + @Inject SystemPermissionMapper systemPermissionDAO; - + @Inject Provider mySQLUserProvider; - + @Inject Provider mySQLConnectionProvider; - + /** * Verifies that the user has read access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -108,7 +108,7 @@ public class PermissionCheckUtility { if(!checkUserReadAccess(userID, affectedUserID)) throw new GuacamolePermissionException("User " + userID + " does not have read access to user " + affectedUserID); } - + /** * Verifies that the user has update access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -119,7 +119,7 @@ public class PermissionCheckUtility { if(!checkUserUpdateAccess(userID, affectedUserID)) throw new GuacamolePermissionException("User " + userID + " does not have update access to user " + affectedUserID); } - + /** * Verifies that the user has delete access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -130,7 +130,7 @@ public class PermissionCheckUtility { if(!checkUserDeleteAccess(userID, affectedUserID)) throw new GuacamolePermissionException("User " + userID + " does not have delete access to user " + affectedUserID); } - + /** * Verifies that the user has administer access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -141,7 +141,7 @@ public class PermissionCheckUtility { if(!checkUserAdministerAccess(userID, affectedUserID)) throw new GuacamolePermissionException("User " + userID + " does not have administer access to user " + affectedUserID); } - + /** * Verifies that the user has read access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -152,7 +152,7 @@ public class PermissionCheckUtility { if(!checkUserReadAccess(userID, affectedUsername)) throw new GuacamolePermissionException("User " + userID + " does not have read access to user '" + affectedUsername + "'"); } - + /** * Verifies that the user has update access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -163,7 +163,7 @@ public class PermissionCheckUtility { if(!checkUserUpdateAccess(userID, affectedUsername)) throw new GuacamolePermissionException("User " + userID + " does not have update access to user '" + affectedUsername + "'"); } - + /** * Verifies that the user has delete access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -174,7 +174,7 @@ public class PermissionCheckUtility { if(!checkUserDeleteAccess(userID, affectedUsername)) throw new GuacamolePermissionException("User " + userID + " does not have delete access to user '" + affectedUsername + "'"); } - + /** * Verifies that the user has administer access to the given user. If not, throws a GuacamolePermissionException. * @param userID @@ -185,7 +185,7 @@ public class PermissionCheckUtility { if(!checkUserAdministerAccess(userID, affectedUsername)) throw new GuacamolePermissionException("User " + userID + " does not have administer access to user '" + affectedUsername + "'"); } - + /** * Checks if the user has read access to the given user. * @param userID @@ -195,7 +195,7 @@ public class PermissionCheckUtility { public boolean checkUserReadAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_READ); } - + /** * Checks if the user has update access to the given user. * @param userID @@ -205,7 +205,7 @@ public class PermissionCheckUtility { public boolean checkUserUpdateAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_UPDATE); } - + /** * Checks if the user has delete access to the given user. * @param userID @@ -215,7 +215,7 @@ public class PermissionCheckUtility { public boolean checkUserDeleteAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_DELETE); } - + /** * Checks if the user has administer access to the given user. * @param userID @@ -225,7 +225,7 @@ public class PermissionCheckUtility { public boolean checkUserAdministerAccess(int userID, int affectedUserID) { return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_ADMINISTER); } - + /** * Checks if the user has read access to the given user. * @param userID @@ -235,7 +235,7 @@ public class PermissionCheckUtility { public boolean checkUserReadAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_READ); } - + /** * Checks if the user has update access to the given user. * @param userID @@ -245,7 +245,7 @@ public class PermissionCheckUtility { public boolean checkUserUpdateAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_UPDATE); } - + /** * Checks if the user has delete access to the given user. * @param userID @@ -255,7 +255,7 @@ public class PermissionCheckUtility { public boolean checkUserDeleteAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_DELETE); } - + /** * Checks if the user has administer access to the given user. * @param userID @@ -265,28 +265,28 @@ public class PermissionCheckUtility { public boolean checkUserAdministerAccess(int userID, String affectedUsername) { return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_ADMINISTER); } - + /** * Check if the user has the selected type of access to the affected user. * @param userID * @param affectedUsername * @param permissionType - * @return + * @return */ private boolean checkUserAccess(int userID, String affectedUsername, String permissionType) { User affectedUser = getUser(affectedUsername); if(affectedUser != null) return checkUserAccess(userID, affectedUser.getUser_id(), permissionType); - + return false; } - + /** * Check if the user has the selected type of access to the affected user. * @param userID * @param affectedUserID * @param permissionType - * @return + * @return */ private boolean checkUserAccess(int userID, Integer affectedUserID, String permissionType) { UserPermissionExample example = new UserPermissionExample(); @@ -294,7 +294,7 @@ public class PermissionCheckUtility { int count = userPermissionDAO.countByExample(example); return count > 0; } - + /** * Find the list of all user IDs a user has permission to administer. * @param userID @@ -303,7 +303,7 @@ public class PermissionCheckUtility { public Set getAdministerableUserIDs(int userID) { return getUserIDs(userID, MySQLConstants.USER_ADMINISTER); } - + /** * Find the list of all user IDs a user has permission to delete. * @param userID @@ -312,7 +312,7 @@ public class PermissionCheckUtility { public Set getDeletableUserIDs(int userID) { return getUserIDs(userID, MySQLConstants.USER_DELETE); } - + /** * Find the list of all user IDs a user has permission to write. * @param userID @@ -321,7 +321,7 @@ public class PermissionCheckUtility { public Set getUpdateableUserIDs(int userID) { return getUserIDs(userID, MySQLConstants.USER_UPDATE); } - + /** * Find the list of all user IDs a user has permission to read. * @param userID @@ -330,7 +330,7 @@ public class PermissionCheckUtility { public Set getReadableUserIDs(int userID) { return getUserIDs(userID, MySQLConstants.USER_READ); } - + /** * Find the list of all users a user has permission to administer. * @param userID @@ -339,7 +339,7 @@ public class PermissionCheckUtility { public Set getAdministerableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_ADMINISTER); } - + /** * Find the list of all users a user has permission to delete. * @param userID @@ -348,7 +348,7 @@ public class PermissionCheckUtility { public Set getDeletableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_DELETE); } - + /** * Find the list of all users a user has permission to write. * @param userID @@ -357,7 +357,7 @@ public class PermissionCheckUtility { public Set getUpdateableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_UPDATE); } - + /** * Find the list of all users a user has permission to read. * @param userID @@ -366,7 +366,7 @@ public class PermissionCheckUtility { public Set getReadableUsers(int userID) { return getUsers(userID, MySQLConstants.USER_READ); } - + /** * Find the list of all users a user has permission to. * The access type is defined by permissionType. @@ -385,10 +385,10 @@ public class PermissionCheckUtility { mySQLUser.init(affectedUser); affectedUsers.add(mySQLUser); } - + return affectedUsers; } - + /** * Find the list of the IDs of all users a user has permission to. * The access type is defined by permissionType. @@ -403,10 +403,10 @@ public class PermissionCheckUtility { List userPermissions = userPermissionDAO.selectByExample(example); for(UserPermissionKey permission : userPermissions) userIDs.add(permission.getAffected_user_id()); - + return userIDs; } - + /** * Verifies that the user has read access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -417,7 +417,7 @@ public class PermissionCheckUtility { if(!checkConnectionReadAccess(userID, affectedConnectionID)) throw new GuacamolePermissionException("User " + userID + " does not have read access to connection " + affectedConnectionID); } - + /** * Verifies that the user has update access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -428,7 +428,7 @@ public class PermissionCheckUtility { if(!checkConnectionUpdateAccess(userID, affectedConnectionID)) throw new GuacamolePermissionException("User " + userID + " does not have update access to connection " + affectedConnectionID); } - + /** * Verifies that the user has delete access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -439,7 +439,7 @@ public class PermissionCheckUtility { if(!checkConnectionDeleteAccess(userID, affectedConnectionID)) throw new GuacamolePermissionException("User " + userID + " does not have delete access to connection " + affectedConnectionID); } - + /** * Verifies that the user has administer access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -450,7 +450,7 @@ public class PermissionCheckUtility { if(!checkConnectionAdministerAccess(userID, affectedConnectionID)) throw new GuacamolePermissionException("User " + userID + " does not have administer access to connection " + affectedConnectionID); } - + /** * Verifies that the user has read access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -461,7 +461,7 @@ public class PermissionCheckUtility { if(!checkConnectionReadAccess(userID, affectedConnectionName)) throw new GuacamolePermissionException("User " + userID + " does not have read access to connection '" + affectedConnectionName + "'"); } - + /** * Verifies that the user has update access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -472,7 +472,7 @@ public class PermissionCheckUtility { if(!checkConnectionUpdateAccess(userID, affectedConnectionName)) throw new GuacamolePermissionException("User " + userID + " does not have update access to connection '" + affectedConnectionName + "'"); } - + /** * Verifies that the user has delete access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -483,7 +483,7 @@ public class PermissionCheckUtility { if(!checkConnectionDeleteAccess(userID, affectedConnectionName)) throw new GuacamolePermissionException("User " + userID + " does not have delete access to connection '" + affectedConnectionName + "'"); } - + /** * Verifies that the user has administer access to the given connection. If not, throws a GuacamolePermissionException. * @param userID @@ -494,7 +494,7 @@ public class PermissionCheckUtility { if(!checkConnectionAdministerAccess(userID, affectedConnectionName)) throw new GuacamolePermissionException("User " + userID + " does not have administer access to connection '" + affectedConnectionName + "'"); } - + /** * Checks if the user has read access to the given connection. * @param userID @@ -504,7 +504,7 @@ public class PermissionCheckUtility { public boolean checkConnectionReadAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_READ); } - + /** * Checks if the user has update access to the given connection. * @param userID @@ -514,7 +514,7 @@ public class PermissionCheckUtility { public boolean checkConnectionUpdateAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_UPDATE); } - + /** * Checks if the user has delete access to the given connection. * @param userID @@ -524,7 +524,7 @@ public class PermissionCheckUtility { public boolean checkConnectionDeleteAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_DELETE); } - + /** * Checks if the user has administer access to the given connection. * @param userID @@ -534,7 +534,7 @@ public class PermissionCheckUtility { public boolean checkConnectionAdministerAccess(int userID, int affectedConnectionID) { return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_ADMINISTER); } - + /** * Checks if the user has read access to the given connection. * @param userID @@ -544,7 +544,7 @@ public class PermissionCheckUtility { public boolean checkConnectionReadAccess(int userID, String affectedConnectionName) { return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_READ); } - + /** * Checks if the user has update access to the given connection. * @param userID @@ -554,7 +554,7 @@ public class PermissionCheckUtility { public boolean checkConnectionUpdateAccess(int userID, String affectedConnectionName) { return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_UPDATE); } - + /** * Checks if the user has delete access to the given connection. * @param userID @@ -564,7 +564,7 @@ public class PermissionCheckUtility { public boolean checkConnectionDeleteAccess(int userID, String affectedConnectionname) { return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_DELETE); } - + /** * Checks if the user has administer access to the given connection. * @param userID @@ -574,28 +574,28 @@ public class PermissionCheckUtility { public boolean checkConnectionAdministerAccess(int userID, String affectedConnectionName) { return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_ADMINISTER); } - + /** * Check if the user has the selected type of access to the affected connection. * @param connectionID * @param affectedConnectionname * @param permissionType - * @return + * @return */ private boolean checkConnectionAccess(int userID, String affectedConnectionName, String permissionType) { Connection connection = getConnection(affectedConnectionName); if(connection != null) return checkConnectionAccess(userID, connection.getConnection_id(), permissionType); - + return false; } - + /** * Check if the user has the selected type of access to the affected connection. * @param connectionID * @param affectedConnectionID * @param permissionType - * @return + * @return */ private boolean checkConnectionAccess(int userID, Integer affectedConnectionID, String permissionType) { ConnectionPermissionExample example = new ConnectionPermissionExample(); @@ -603,7 +603,7 @@ public class PermissionCheckUtility { int count = connectionPermissionDAO.countByExample(example); return count > 0; } - + /** * Find the list of all connection IDs a user has permission to administer. * @param userID @@ -612,7 +612,7 @@ public class PermissionCheckUtility { public Set getAdministerableConnectionIDs(int userID) { return getConnectionIDs(userID, MySQLConstants.CONNECTION_ADMINISTER); } - + /** * Find the list of all connection IDs a user has permission to delete. * @param userID @@ -621,7 +621,7 @@ public class PermissionCheckUtility { public Set getDeletableConnectionIDs(int userID) { return getConnectionIDs(userID, MySQLConstants.CONNECTION_DELETE); } - + /** * Find the list of all connection IDs a user has permission to write. * @param userID @@ -630,7 +630,7 @@ public class PermissionCheckUtility { public Set getUpdateableConnectionIDs(int userID) { return getConnectionIDs(userID, MySQLConstants.CONNECTION_UPDATE); } - + /** * Find the list of all connection IDs a user has permission to read. * @param userID @@ -639,7 +639,7 @@ public class PermissionCheckUtility { public Set getReadableConnectionIDs(int userID) { return getConnectionIDs(userID, MySQLConstants.CONNECTION_READ); } - + /** * Find the list of all connections a user has permission to administer. * @param userID @@ -648,7 +648,7 @@ public class PermissionCheckUtility { public Set getAdministerableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_ADMINISTER); } - + /** * Find the list of all connections a user has permission to delete. * @param userID @@ -657,7 +657,7 @@ public class PermissionCheckUtility { public Set getDeletableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_DELETE); } - + /** * Find the list of all connections a user has permission to write. * @param userID @@ -666,7 +666,7 @@ public class PermissionCheckUtility { public Set getUpdateableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_UPDATE); } - + /** * Find the list of all connections a user has permission to read. * @param userID @@ -675,7 +675,7 @@ public class PermissionCheckUtility { public Set getReadableConnections(int userID) { return getConnections(userID, MySQLConstants.CONNECTION_READ); } - + /** * Find the list of all connections a user has permission to. * The access type is defined by permissionType. @@ -694,10 +694,10 @@ public class PermissionCheckUtility { mySQLConnection.init(affectedConnection); affectedConnections.add(mySQLConnection); } - + return affectedConnections; } - + /** * Find the list of the IDs of all connections a user has permission to. * The access type is defined by permissionType. @@ -712,43 +712,43 @@ public class PermissionCheckUtility { List connectionPermissions = connectionPermissionDAO.selectByExample(example); for(ConnectionPermissionKey permission : connectionPermissions) connectionIDs.add(permission.getConnection_id()); - + return connectionIDs; } - + public void verifyCreateUserPermission(int userID) throws GuacamolePermissionException { if(!checkCreateUserPermission(userID)) throw new GuacamolePermissionException("User " + userID + " does not have permission to create users."); } - + public void verifyCreateConnectionPermission(int userID) throws GuacamolePermissionException { if(!checkCreateConnectionPermission(userID)) throw new GuacamolePermissionException("User " + userID + " does not have permission to create connections."); } - + /** * Check if the user has the permission to create users. * @param userID - * @return + * @return */ public boolean checkCreateUserPermission(int userID) { return checkSystemPermission(userID, MySQLConstants.SYSTEM_USER_CREATE); } - + /** * Check if the user has the permission to create connections. * @param userID - * @return + * @return */ public boolean checkCreateConnectionPermission(int userID) { return checkSystemPermission(userID, MySQLConstants.SYSTEM_CONNECTION_CREATE); } - + /** * Check if the user has the selected system permission. * @param userID - * @param systemPermissionType - * @return + * @param systemPermissionType + * @return */ private boolean checkSystemPermission(int userID, String systemPermissionType) { SystemPermissionExample example = new SystemPermissionExample(); @@ -756,11 +756,11 @@ public class PermissionCheckUtility { int count = systemPermissionDAO.countByExample(example); return count > 0; } - + /** * Get a connection object by name. * @param name - * @return + * @return */ private Connection getConnection(String name) { ConnectionExample example = new ConnectionExample(); @@ -768,14 +768,14 @@ public class PermissionCheckUtility { List connections = connectionDAO.selectByExample(example); if(connections.isEmpty()) return null; - + return connections.get(0); } - + /** * Get a user object by username. * @param userName - * @return + * @return */ private User getUser(String username) { UserExample example = new UserExample(); @@ -783,18 +783,18 @@ public class PermissionCheckUtility { List users = userDAO.selectByExample(example); if(users.isEmpty()) return null; - + return users.get(0); } - + /** * Get all permissions a given user has. * @param userID - * @return all permissions a user has. + * @return all permissions a user has. */ public Set getAllPermissions(int userID) { Set allPermissions = new HashSet(); - + // first, user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(userID); @@ -803,7 +803,7 @@ public class PermissionCheckUtility { for(UserPermissionKey userPermission : userPermissions) { affectedUserIDs.add(userPermission.getAffected_user_id()); } - + UserExample userExample = new UserExample(); userExample.createCriteria().andUser_idIn(affectedUserIDs); List users = userDAO.selectByExample(userExample); @@ -811,7 +811,7 @@ public class PermissionCheckUtility { for(User user : users) { userMap.put(user.getUser_id(), user); } - + for(UserPermissionKey userPermission : userPermissions) { User affectedUser = userMap.get(userPermission.getAffected_user_id()); UserPermission newPermission = new UserPermission( @@ -820,7 +820,7 @@ public class PermissionCheckUtility { ); allPermissions.add(newPermission); } - + //secondly, connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(userID); @@ -829,7 +829,7 @@ public class PermissionCheckUtility { for(ConnectionPermissionKey connectionPermission : connectionPermissions) { affectedConnectionIDs.add(connectionPermission.getConnection_id()); } - + ConnectionExample connectionExample = new ConnectionExample(); connectionExample.createCriteria().andConnection_idIn(affectedConnectionIDs); List connections = connectionDAO.selectByExample(connectionExample); @@ -837,7 +837,7 @@ public class PermissionCheckUtility { for(Connection connection : connections) { connectionMap.put(connection.getConnection_id(), connection); } - + for(ConnectionPermissionKey connectionPermission : connectionPermissions) { Connection affectedConnection = connectionMap.get(connectionPermission.getConnection_id()); ConnectionPermission newPermission = new ConnectionPermission( @@ -846,7 +846,7 @@ public class PermissionCheckUtility { ); allPermissions.add(newPermission); } - + //and finally, system permissions SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(userID); @@ -857,11 +857,11 @@ public class PermissionCheckUtility { newPermission = new UserDirectoryPermission(UserDirectoryPermission.Type.CREATE); else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) newPermission = new ConnectionDirectoryPermission(ConnectionDirectoryPermission.Type.CREATE); - + if(newPermission != null) allPermissions.add(newPermission); } - + return allPermissions; } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java index f2b91428f..a449e7154 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java @@ -44,6 +44,7 @@ import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnectionRecord; +import net.sourceforge.guacamole.net.auth.mysql.MySQLGuacamoleSocket; import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; @@ -53,9 +54,10 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; +import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; /** - * Provides convenient provider methods for MySQLUser, MySQLConnection, and MySQLConnctionRecord objects. + * Provides convenient provider methods for MySQL specific implementations. * @author James Muehlner */ public class ProviderUtility { @@ -77,6 +79,9 @@ public class ProviderUtility { @Inject Provider mySQLConnectionRecordProvider; + @Inject + Provider mySQLGuacamoleSocketProvider; + /** * Create a new user based on the provided object. * @param user @@ -205,6 +210,8 @@ public class ProviderUtility { public List getExistingMySQLConnectionRecords(Integer connectionID) { ConnectionHistoryExample example = new ConnectionHistoryExample(); example.createCriteria().andConnection_idEqualTo(connectionID); + // we want to return the newest records first + example.setOrderByClause("start_date DESC"); List connectionHistories = connectionHistoryDAO.selectByExample(example); List connectionRecords = new ArrayList(); for(ConnectionHistory history : connectionHistories) { @@ -223,4 +230,16 @@ public class ProviderUtility { record.init(history); return record; } + + /** + * Create a MySQLGuacamoleSocket using the provided ConfiguredGuacamoleSocket and connection ID. + * @param socket + * @param connectionID + * @return + */ + public MySQLGuacamoleSocket getMySQLGuacamoleSocket(ConfiguredGuacamoleSocket socket, int connectionID) { + MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); + mySQLGuacamoleSocket.init(socket, connectionID); + return mySQLGuacamoleSocket; + } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java index a46485695..c191f60ca 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java @@ -35,7 +35,6 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.utility; -import com.google.common.base.Preconditions; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -51,18 +50,12 @@ public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtilit @Override public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt) { - Preconditions.checkNotNull(credentials); - Preconditions.checkNotNull(dbPasswordHash); - Preconditions.checkNotNull(dbUsername); - Preconditions.checkNotNull(dbSalt); byte[] passwordBytes = createPasswordHash(credentials.getPassword(), dbSalt); return Arrays.equals(passwordBytes, dbPasswordHash); } @Override public byte[] createPasswordHash(String password, byte[] salt) { - Preconditions.checkNotNull(password); - Preconditions.checkNotNull(salt); try { MessageDigest md = MessageDigest.getInstance("SHA-256"); From 41322b72deb9403b3725e41c17ed321484842fd9 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Thu, 21 Feb 2013 22:57:15 -0800 Subject: [PATCH 033/109] Ticket #269: Connection implementation completed. Testing and styling remain. --- .../net/auth/mysql/ActiveConnectionSet.java | 47 ++++++++++ .../net/auth/mysql/MySQLGuacamoleSocket.java | 87 ++++++++++++++++++ .../ConfigurationTranslationUtility.java | 88 +++++++++++++++++++ .../net/auth/mysql/utility/sedPPrchI | 0 4 files changed, 222 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java new file mode 100644 index 000000000..769b7f02f --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java @@ -0,0 +1,47 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import java.util.HashSet; +import java.util.Set; + +/** + * Represents the set of currently active Connections. Whenever a socket is opened, + * the connection ID should be added to this set, and whenever a socket is closed, + * the connection ID should be removed from this set. + * @author dagger10k + */ +public class ActiveConnectionSet extends HashSet implements Set {} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java new file mode 100644 index 000000000..f35d76ae5 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -0,0 +1,87 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql; + +import com.google.inject.Inject; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.io.GuacamoleReader; +import net.sourceforge.guacamole.io.GuacamoleWriter; +import net.sourceforge.guacamole.net.GuacamoleSocket; +import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; + +/** + * A MySQL specific wrapper around a ConfiguredGuacamoleSocket. + * @author James Muehlner + */ +public class MySQLGuacamoleSocket implements GuacamoleSocket { + + @Inject + ActiveConnectionSet activeConnectionSet; + + private ConfiguredGuacamoleSocket socket; + private int connectionID; + + /** + * Initialize this MySQLGuacamoleSocket with the provided ConfiguredGuacamoleSocket. + * @param socket the ConfiguredGuacamoleSocket to wrap. + */ + public void init(ConfiguredGuacamoleSocket socket, int connectionID) { + this.socket = socket; + this.connectionID = connectionID; + } + + @Override + public GuacamoleReader getReader() { + return socket.getReader(); + } + + @Override + public GuacamoleWriter getWriter() { + return socket.getWriter(); + } + + @Override + public void close() throws GuacamoleException { + socket.close(); + //mark this connection as inactive + activeConnectionSet.remove(connectionID); + } + + @Override + public boolean isOpen() { + return socket.isOpen(); + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java new file mode 100644 index 000000000..98f3c2b28 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java @@ -0,0 +1,88 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + +import java.util.ArrayList; +import java.util.List; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; +import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; + +/** + * Provides functions for translating between GuacamoleConfiguration objects + * and a collection of ConnectionParameter database records. + * @author James Muehlner + */ +public class ConfigurationTranslationUtility { + + /** + * Get a GuacamoleConfiguration based on the provided protocol and parameters. + * @param protocol the protocol used (VNC, RDP, etc) + * @param parameters the parameter database records to translate + * @return + */ + public GuacamoleConfiguration getConfiguration(String protocol, Iterable parameters) { + GuacamoleConfiguration configuration = new GuacamoleConfiguration(); + configuration.setProtocol(protocol); + + for(ConnectionParameter parameter : parameters) { + configuration.setParameter(parameter.getParameter_name(), parameter.getParameter_value()); + } + + return configuration; + } + + /** + * Creates a list of ConnectionParameter database records based on the provided connectionID and GuacamoleConfiguration. + * @param connectionID the ID of the connection that these parameters are for + * @param configuration the configuration to pull the parameter values from + * @return + */ + public List getConnectionParameters(int connectionID, GuacamoleConfiguration configuration) { + List connectionParameters = new ArrayList(); + + for(String parameterName : configuration.getParameterNames()) { + ConnectionParameter connectionParameter = new ConnectionParameter(); + String parameterValue = configuration.getParameter(parameterName); + connectionParameter.setConnection_id(connectionID); + connectionParameter.setParameter_name(parameterName); + connectionParameter.setParameter_value(parameterValue); + + connectionParameters.add(connectionParameter); + } + + return connectionParameters; + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI new file mode 100644 index 000000000..e69de29bb From b88088f226c79baabca85faa648a7796579db120 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Thu, 21 Feb 2013 22:58:08 -0800 Subject: [PATCH 034/109] Ticket #269: Connection implementation completed. Testing and styling remain. --- .../net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/sedPPrchI deleted file mode 100644 index e69de29bb..000000000 From 9f0bad5dbe553af68e6de3f8c9ba2d14c9409be3 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Thu, 21 Feb 2013 23:03:37 -0800 Subject: [PATCH 035/109] Ticket #269: Removed whitespace at end of lines. --- .../net/auth/mysql/ConnectionDirectory.java | 2 +- .../net/auth/mysql/MySQLConstants.java | 8 +-- .../ConfigurationTranslationUtility.java | 20 +++---- .../utility/PasswordEncryptionUtility.java | 4 +- .../auth/mysql/utility/ProviderUtility.java | 54 +++++++++---------- .../utility/SecureRandomSaltUtility.java | 4 +- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index b98e00653..681ec4057 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -224,7 +224,7 @@ public class ConnectionDirectory implements Directory{ ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample(); connectionParameterExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); connectionParameterDAO.deleteByExample(connectionParameterExample); - + // delete all permissions that refer to this connection ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index 99de9fdc8..d20315f2e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -45,25 +45,25 @@ import net.sourceforge.guacamole.net.auth.permission.UserPermission; * @author James Muehlner */ public final class MySQLConstants { - + /** * This class should not be instantiated. */ private MySQLConstants() {} - + // Permission constants public static final String USER_READ = UserPermission.Type.READ.name(); public static final String USER_UPDATE = UserPermission.Type.UPDATE.name(); public static final String USER_DELETE = UserPermission.Type.DELETE.name(); public static final String USER_ADMINISTER = UserPermission.Type.ADMINISTER.name(); public static final String USER_CREATE = UserDirectoryPermission.Type.CREATE.name(); - + public static final String CONNECTION_READ = ConnectionPermission.Type.READ.name(); public static final String CONNECTION_UPDATE = ConnectionPermission.Type.UPDATE.name(); public static final String CONNECTION_DELETE = ConnectionPermission.Type.DELETE.name(); public static final String CONNECTION_ADMINISTER = ConnectionPermission.Type.ADMINISTER.name(); public static final String CONNECTION_CREATE = ConnectionDirectoryPermission.Type.CREATE.name(); - + public static final String SYSTEM_USER_CREATE = "USER_CREATE"; public static final String SYSTEM_CONNECTION_CREATE = "CONNECTION_CREATE"; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java index 98f3c2b28..658638268 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java @@ -41,48 +41,48 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; /** - * Provides functions for translating between GuacamoleConfiguration objects + * Provides functions for translating between GuacamoleConfiguration objects * and a collection of ConnectionParameter database records. * @author James Muehlner */ public class ConfigurationTranslationUtility { - + /** * Get a GuacamoleConfiguration based on the provided protocol and parameters. * @param protocol the protocol used (VNC, RDP, etc) * @param parameters the parameter database records to translate - * @return + * @return */ public GuacamoleConfiguration getConfiguration(String protocol, Iterable parameters) { GuacamoleConfiguration configuration = new GuacamoleConfiguration(); configuration.setProtocol(protocol); - + for(ConnectionParameter parameter : parameters) { configuration.setParameter(parameter.getParameter_name(), parameter.getParameter_value()); } - + return configuration; } - + /** * Creates a list of ConnectionParameter database records based on the provided connectionID and GuacamoleConfiguration. * @param connectionID the ID of the connection that these parameters are for * @param configuration the configuration to pull the parameter values from - * @return + * @return */ public List getConnectionParameters(int connectionID, GuacamoleConfiguration configuration) { List connectionParameters = new ArrayList(); - + for(String parameterName : configuration.getParameterNames()) { ConnectionParameter connectionParameter = new ConnectionParameter(); String parameterValue = configuration.getParameter(parameterName); connectionParameter.setConnection_id(connectionID); connectionParameter.setParameter_name(parameterName); connectionParameter.setParameter_value(parameterValue); - + connectionParameters.add(connectionParameter); } - + return connectionParameters; } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java index 0ebe3d819..90c4ed083 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java @@ -42,7 +42,7 @@ import net.sourceforge.guacamole.net.auth.Credentials; * @author James Muehlner */ public interface PasswordEncryptionUtility { - + /** * Checks if the provided Credentials are correct, compared with what the values from the database. * @param credentials @@ -52,7 +52,7 @@ public interface PasswordEncryptionUtility { * @return true if the provided credentials match what's in the database for that user. */ public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt); - + /** * Creates a password hash based on the provided username, password, and salt. * @param username diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java index a449e7154..916ea05ce 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java @@ -63,59 +63,59 @@ import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; public class ProviderUtility { @Inject UserMapper userDAO; - + @Inject ConnectionMapper connectionDAO; - + @Inject ConnectionHistoryMapper connectionHistoryDAO; - + @Inject Provider mySQLUserProvider; - + @Inject Provider mySQLConnectionProvider; - + @Inject Provider mySQLConnectionRecordProvider; - + @Inject Provider mySQLGuacamoleSocketProvider; - + /** * Create a new user based on the provided object. * @param user * @return the new MySQLUser object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLUser getNewMySQLUser(User user) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); mySQLUser.initNew(user); return mySQLUser; } - + /** * Get the user based on the username of the provided object. * @param user * @return the new MySQLUser object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLUser getExistingMySQLUser(User user) throws GuacamoleException { return getExistingMySQLUser(user.getUsername()); } - + /** * Get the user based on the username of the provided object. * @param name * @return the new MySQLUser object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); mySQLUser.initExisting(name); return mySQLUser; } - + /** * Get an existing MySQLUser from a user database record. * @param user @@ -126,7 +126,7 @@ public class ProviderUtility { mySQLUser.init(user); return mySQLUser; } - + /** * Get an existing MySQLUser from a user ID. * @param id @@ -140,42 +140,42 @@ public class ProviderUtility { return null; return getExistingMySQLUser(users.get(0)); } - - + + /** * Create a new connection based on the provided object. * @param connection * @return the new Connection object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLConnection getNewMySQLConnection(Connection connection) throws GuacamoleException { MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); mySQLConnection.initNew(connection); return mySQLConnection; } - + /** * Get the connection based on the connection name of the provided object. * @param connection * @return the new Connection object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLConnection getExistingMySQLConnection(Connection connection) throws GuacamoleException { return getExistingMySQLConnection(connection.getIdentifier()); } - + /** * Get the connection based on the connection name of the provided object. * @param name * @return the new Connection object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLConnection getExistingMySQLConnection(String name) throws GuacamoleException { MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); mySQLConnection.initExisting(name); return mySQLConnection; } - + /** * Get an existing MySQLConnection from a connection database record. * @param connection @@ -186,7 +186,7 @@ public class ProviderUtility { mySQLConnection.init(connection); return mySQLConnection; } - + /** * Get an existing MySQLConnection from a connection ID. * @param id @@ -200,7 +200,7 @@ public class ProviderUtility { return null; return getExistingMySQLConnection(connections.get(0)); } - + /** * Gets a list of existing MySQLConnectionRecord from the database. These represent * the history records of the connection. @@ -219,7 +219,7 @@ public class ProviderUtility { } return connectionRecords; } - + /** * Create a MySQLConnectionRecord object around a single ConnectionHistory database record. * @param history @@ -230,12 +230,12 @@ public class ProviderUtility { record.init(history); return record; } - + /** * Create a MySQLGuacamoleSocket using the provided ConfiguredGuacamoleSocket and connection ID. * @param socket * @param connectionID - * @return + * @return */ public MySQLGuacamoleSocket getMySQLGuacamoleSocket(ConfiguredGuacamoleSocket socket, int connectionID) { MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java index 3b31322d5..f2c38c477 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -42,9 +42,9 @@ import java.security.SecureRandom; * @author James Muehlner */ public class SecureRandomSaltUtility implements SaltUtility { - + SecureRandom secureRandom = new SecureRandom(); - + @Override public byte[] generateSalt() { byte[] salt = new byte[32]; From 174f0be3dfc7f39853f4a22e8f4c8454a931fd16 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Fri, 22 Feb 2013 19:18:37 -0800 Subject: [PATCH 036/109] Ticket #269: Added documentation for new mysql-disallow-simultaneous-connections parameter. --- extensions/guacamole-auth-mysql/README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/guacamole-auth-mysql/README b/extensions/guacamole-auth-mysql/README index f99deb6ee..bf1e3b1fb 100644 --- a/extensions/guacamole-auth-mysql/README +++ b/extensions/guacamole-auth-mysql/README @@ -79,6 +79,11 @@ guacamole.properties such that the authentication provider is available. mysql-username: user mysql-password: pass + Optionally, the authentication provider can be configured + not to allow multiple users to use the same connection + at the same time: + + mysql-disallow-simultaneous-connections: true ------------------------------------------------------------ Generating MyBatis ORM mappings From 2a4b82dc8eb5af8f1124ea9c93ade87cc2c66fc5 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 22 Feb 2013 19:56:23 -0800 Subject: [PATCH 037/109] Ticket #269: Clean up UserDirectory, fix JavaDoc. --- .../net/auth/mysql/UserDirectory.java | 371 ++++++++++++------ 1 file changed, 253 insertions(+), 118 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 1cc339d42..004ff66b0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import com.google.common.base.Preconditions; import com.google.inject.Inject; @@ -45,17 +47,18 @@ import java.util.Map; import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Directory; -import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.Connection; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.User; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; @@ -73,7 +76,7 @@ import org.mybatis.guice.transactional.Transactional; * A MySQL based implementation of the User Directory. * @author James Muehlner */ -public class UserDirectory implements Directory { +public class UserDirectory implements Directory { /** * The user who this user directory belongs to. @@ -81,24 +84,46 @@ public class UserDirectory implements Directory { */ private MySQLUser user; + /** + * DAO for accessing users, which will be injected. + */ @Inject UserMapper userDAO; + /** + * DAO for accessing connections, which will be injected. + */ @Inject ConnectionMapper connectionDAO; + /** + * DAO for accessing user permissions, which will be injected. + */ @Inject UserPermissionMapper userPermissionDAO; + /** + * DAO for accessing connection permissions, which will be injected. + */ @Inject ConnectionPermissionMapper connectionPermissionDAO; + /** + * DAO for accessing system permissions, which will be injected. + */ @Inject SystemPermissionMapper systemPermissionDAO; + /** + * Utility class for checking various permissions, which will be injected. + */ @Inject PermissionCheckUtility permissionCheckUtility; + /** + * Utility class that provides convenient access to object creation and + * retrieval functions. + */ @Inject ProviderUtility providerUtility; @@ -112,7 +137,8 @@ public class UserDirectory implements Directory { @Transactional @Override - public User get(String identifier) throws GuacamoleException { + public net.sourceforge.guacamole.net.auth.User get(String identifier) + throws GuacamoleException { permissionCheckUtility.verifyUserReadAccess(this.user.getUserID(), identifier); return providerUtility.getExistingMySQLUser(identifier); } @@ -120,301 +146,410 @@ public class UserDirectory implements Directory { @Transactional @Override public Set getIdentifiers() throws GuacamoleException { - Set userNameSet = new HashSet(); + + // Get set of all readable users Set users = permissionCheckUtility.getReadableUsers(user.getUserID()); - for(MySQLUser mySQLUser : users) { + + // Build set of usernames of readable users + Set userNameSet = new HashSet(); + for (MySQLUser mySQLUser : users) userNameSet.add(mySQLUser.getUsername()); - } + return userNameSet; } @Override @Transactional - public void add(User object) throws GuacamoleException { + public void add(net.sourceforge.guacamole.net.auth.User object) + throws GuacamoleException { + + // Verify current user has permission to create users permissionCheckUtility.verifyCreateUserPermission(this.user.getUserID()); Preconditions.checkNotNull(object); - //create user in database + // Create user in database MySQLUser mySQLUser = providerUtility.getNewMySQLUser(object); userDAO.insert(mySQLUser.getUser()); - //create permissions in database + // Create permissions of new user in database updatePermissions(mySQLUser); - //finally, give the current user full access to the newly created user. + // Give the current user full access to the newly created user. UserPermissionKey newUserPermission = new UserPermissionKey(); newUserPermission.setUser_id(this.user.getUserID()); newUserPermission.setAffected_user_id(mySQLUser.getUserID()); + + // READ permission on new user newUserPermission.setPermission(MySQLConstants.USER_READ); userPermissionDAO.insert(newUserPermission); + + // UPDATE permission on new user newUserPermission.setPermission(MySQLConstants.USER_UPDATE); userPermissionDAO.insert(newUserPermission); + + // DELETE permission on new user newUserPermission.setPermission(MySQLConstants.USER_DELETE); userPermissionDAO.insert(newUserPermission); + + // ADMINISTER permission on new user newUserPermission.setPermission(MySQLConstants.USER_ADMINISTER); userPermissionDAO.insert(newUserPermission); + } /** * Update all the permissions for a given user to be only those specified in the user object. * Delete any permissions not in the list, and create any in the list that do not exist * in the database. - * @param user - * @throws GuacamoleException + * + * @param user The user whose permissions should be updated. + * @throws GuacamoleException If an error occurs while updating the + * permissions of the given user. */ private void updatePermissions(MySQLUser user) throws GuacamoleException { + + // Partition given permissions by permission type List userPermissions = new ArrayList(); List connectionPermissions = new ArrayList(); List systemPermissions = new ArrayList(); + + for (Permission permission : user.getPermissions()) { - // Get the list of all the users and connections that the user performing the user save action has. - // Need to make sure the user saving this user has permission to administrate all the objects in the permission list. - Set administerableUsers = permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); - Set administerableConnections = permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); + if (permission instanceof UserPermission) + userPermissions.add((UserPermission) permission); + + else if (permission instanceof ConnectionPermission) + connectionPermissions.add((ConnectionPermission) permission); + + else if (permission instanceof SystemPermission) + systemPermissions.add((SystemPermission) permission); - for(Permission permission : user.getPermissions()) { - if(permission instanceof UserPermission) - userPermissions.add((UserPermission)permission); - else if(permission instanceof ConnectionPermission) - connectionPermissions.add((ConnectionPermission)permission); - else if(permission instanceof SystemPermission) - systemPermissions.add((SystemPermission)permission); } - updateUserPermissions(userPermissions, user, administerableUsers); - updateConnectionPermissions(connectionPermissions, user, administerableConnections); + // Update each type of permission appropriately + updateUserPermissions(userPermissions, user); + updateConnectionPermissions(connectionPermissions, user); updateSystemPermissions(systemPermissions, user); + } /** * Update all the permissions having to do with users for a given user. - * @param permissions - * @param user + * + * @param permissions The permissions the given user should have when + * this operation completes. + * @param user The user to change the permissions of. + * @throws GuacamoleException If permission to alter the access permissions + * of affected objects is denied. */ - private void updateUserPermissions(Iterable permissions, MySQLUser user, Set administerableUsers) throws GuacamoleException { + private void updateUserPermissions(Iterable permissions, + MySQLUser user) + throws GuacamoleException { + // Get set of administerable users + Set administerableUsers = + permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); + + // Get list of usernames for all given user permissions. List usernames = new ArrayList(); - for(UserPermission permission : permissions) { + for (UserPermission permission : permissions) usernames.add(permission.getObjectIdentifier()); - } - // find all the users by username + // Find all the users by username UserExample userExample = new UserExample(); userExample.createCriteria().andUsernameIn(usernames); - List dbUsers = userDAO.selectByExample(userExample); + List dbUsers = userDAO.selectByExample(userExample); List userIDs = new ArrayList(); - Map dbUserMap = new HashMap(); - for(net.sourceforge.guacamole.net.auth.mysql.model.User dbUser : dbUsers) { + // Build map of found users, indexed by username + Map dbUserMap = new HashMap(); + for (User dbUser : dbUsers) { dbUserMap.put(dbUser.getUsername(), dbUser); userIDs.add(dbUser.getUser_id()); } - // find any user permissions that may already exist + // Find any user permissions that may already exist UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andAffected_user_idIn(userIDs); - List existingPermissions = userPermissionDAO.selectByExample(userPermissionExample); - Set existingUserIDs = new HashSet(); - for(UserPermissionKey userPermission : existingPermissions) { - existingUserIDs.add(userPermission.getAffected_user_id()); - } + List existingPermissions = + userPermissionDAO.selectByExample(userPermissionExample); - // delete any permissions that are not in the provided list + // Build list of currently-present permissions + Set existingUserIDs = new HashSet(); + for (UserPermissionKey userPermission : existingPermissions) + existingUserIDs.add(userPermission.getAffected_user_id()); + + // Delete any permissions that are not in the provided list userPermissionExample.clear(); userPermissionExample.createCriteria().andAffected_user_idNotIn(userIDs); - List permissionsToDelete = userPermissionDAO.selectByExample(userPermissionExample); + List permissionsToDelete = + userPermissionDAO.selectByExample(userPermissionExample); - // verify that the user actually has permission to administrate every one of these users - for(UserPermissionKey permissionToDelete : permissionsToDelete) { - if(!administerableUsers.contains(permissionToDelete.getAffected_user_id())) - throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + permissionToDelete.getAffected_user_id()); + // Verify that the user actually has permission to administrate every one of these users + for (UserPermissionKey permissionToDelete : permissionsToDelete) { + if (!administerableUsers.contains(permissionToDelete.getAffected_user_id())) + throw new GuacamolePermissionException( + "User '" + this.user.getUsername() + + "' does not have permission to administrate user " + + permissionToDelete.getAffected_user_id()); } userPermissionDAO.deleteByExample(userPermissionExample); - // finally, insert the new permissions - for(UserPermission permission : permissions) { - net.sourceforge.guacamole.net.auth.mysql.model.User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); - if(dbAffectedUser == null) - throw new GuacamoleException("User '" + permission.getObjectIdentifier() + "' not found."); + // Finally, insert the new permissions + for (UserPermission permission : permissions) { - // the permission for this user already exists, we don't need to create it again - if(existingUserIDs.contains(dbAffectedUser.getUser_id())) + // Get user + User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); + if (dbAffectedUser == null) + throw new GuacamoleException( + "User '" + permission.getObjectIdentifier() + + "' not found."); + + // If the permission for this user already exists, we don't need to + // create it again + if (existingUserIDs.contains(dbAffectedUser.getUser_id())) continue; - // verify that the user actually has permission to administrate every one of these users - if(!administerableUsers.contains(dbAffectedUser.getUser_id())) - throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate user " + dbAffectedUser.getUser_id()); + // Verify that the user actually has permission to administrate + // every one of these users + if (!administerableUsers.contains(dbAffectedUser.getUser_id())) + throw new GuacamolePermissionException( + "User '" + this.user.getUsername() + + "' does not have permission to administrate user " + + dbAffectedUser.getUser_id()); + // Create new permission UserPermissionKey newPermission = new UserPermissionKey(); newPermission.setAffected_user_id(dbAffectedUser.getUser_id()); newPermission.setPermission(permission.getType().name()); newPermission.setUser_id(user.getUserID()); userPermissionDAO.insert(newPermission); + } } /** - * Update all the permissions having to do with connections for a given user. - * @param permissions - * @param user + * Update all the permissions having to do with connections for a given + * user. + * + * @param permissions The permissions the user should have after this + * operation completes. + * @param user The user to assign or remove permissions from. + * @throws GuacamoleException If permission to alter the access permissions + * of affected objects is deniedD */ - private void updateConnectionPermissions(Iterable permissions, MySQLUser user, Set administerableConnections) throws GuacamoleException { + private void updateConnectionPermissions( + Iterable permissions, MySQLUser user) + throws GuacamoleException { - List connectionnames = new ArrayList(); - for(ConnectionPermission permission : permissions) { - connectionnames.add(permission.getObjectIdentifier()); - } + // Get adminsterable connection identifiers + Set administerableConnections = + permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); - // find all the connections by connectionname + // Build list of affected connection names from the permissions given + List connectionNames = new ArrayList(); + for (ConnectionPermission permission : permissions) + connectionNames.add(permission.getObjectIdentifier()); + + // Find all the connections by connection name ConnectionExample connectionExample = new ConnectionExample(); - connectionExample.createCriteria().andConnection_nameIn(connectionnames); - List dbConnections = connectionDAO.selectByExample(connectionExample); + connectionExample.createCriteria().andConnection_nameIn(connectionNames); + List dbConnections = connectionDAO.selectByExample(connectionExample); List connectionIDs = new ArrayList(); - Map dbConnectionMap = new HashMap(); - for(net.sourceforge.guacamole.net.auth.mysql.model.Connection dbConnection : dbConnections) { + // Build map of found connections, indexed by name + Map dbConnectionMap = new HashMap(); + for (Connection dbConnection : dbConnections) { dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); connectionIDs.add(dbConnection.getConnection_id()); } - // find any connection permissions that may already exist + // Find any connection permissions that may already exist ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andConnection_idIn(connectionIDs); - List existingPermissions = connectionPermissionDAO.selectByExample(connectionPermissionExample); + List existingPermissions = + connectionPermissionDAO.selectByExample(connectionPermissionExample); Set existingConnectionIDs = new HashSet(); - for(ConnectionPermissionKey connectionPermission : existingPermissions) { + for (ConnectionPermissionKey connectionPermission : existingPermissions) existingConnectionIDs.add(connectionPermission.getConnection_id()); - } - // delete any permissions that are not in the provided list + // Delete any permissions that are not in the provided list connectionPermissionExample.clear(); connectionPermissionExample.createCriteria().andConnection_idNotIn(connectionIDs); + List connectionPermissionsToDelete = + connectionPermissionDAO.selectByExample(connectionPermissionExample); - //make sure the user has permission to administrate each of these connections - List connectionPermissionsToDelete = connectionPermissionDAO.selectByExample(connectionPermissionExample); - - for(ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { - if(!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) - throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + connectionPermissionToDelete.getConnection_id()); + // Make sure the user has permission to administrate each of these connections + // corresponding to the permissions we are about to delete + for (ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { + if (!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) + throw new GuacamolePermissionException( + "User '" + this.user.getUsername() + + "' does not have permission to administrate connection " + + connectionPermissionToDelete.getConnection_id()); } connectionPermissionDAO.deleteByExample(connectionPermissionExample); - // finally, insert the new permissions - for(ConnectionPermission permission : permissions) { - net.sourceforge.guacamole.net.auth.mysql.model.Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); - if(dbConnection == null) - throw new GuacamoleException("Connection '" + permission.getObjectIdentifier() + "' not found."); + // Finally, insert the new permissions + for (ConnectionPermission permission : permissions) { - // the permission for this connection already exists, we don't need to create it again - if(existingConnectionIDs.contains(dbConnection.getConnection_id())) + // Get permission + Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); + if (dbConnection == null) + throw new GuacamoleException( + "Connection '" + permission.getObjectIdentifier() + + "' not found."); + + // If the permission for this connection already exists, we don't need to create it again + if (existingConnectionIDs.contains(dbConnection.getConnection_id())) continue; - if(!administerableConnections.contains(dbConnection.getConnection_id())) - throw new GuacamolePermissionException("User '" + this.user.getUsername() + "' does not have permission to administrate connection " + dbConnection.getConnection_id()); + // Throw exception if permission to administer this connection + // is not granted + if (!administerableConnections.contains(dbConnection.getConnection_id())) + throw new GuacamolePermissionException( + "User '" + this.user.getUsername() + + "' does not have permission to administrate connection " + + dbConnection.getConnection_id()); + // Insert previously-non-existent connection permission ConnectionPermissionKey newPermission = new ConnectionPermissionKey(); newPermission.setConnection_id(dbConnection.getConnection_id()); newPermission.setPermission(permission.getType().name()); newPermission.setConnection_id(user.getUserID()); connectionPermissionDAO.insert(newPermission); + } } /** - * Update all system permissions for a given user. - * @param permissions - * @param user + * Update all system permissions for a given user. All permissions in + * the given list not already granted to the user will be inserted, and all + * permissions not in the list but already granted to the user will be + * deleted. + * + * @param permissions The system permissions that the given user should + * have. + * @param user The user whose permissions should be updated. */ - private void updateSystemPermissions(Iterable permissions, MySQLUser user) { + private void updateSystemPermissions(Iterable permissions, + MySQLUser user) { + + // Build list of requested system permissions List systemPermissionTypes = new ArrayList(); - for(SystemPermission permission : permissions) { + for (SystemPermission permission : permissions) { + + // Connection directory permission String operation = permission.getType().name(); - if(permission instanceof ConnectionDirectoryPermission) + if (permission instanceof ConnectionDirectoryPermission) systemPermissionTypes.add(operation + "_CONNECTION"); - else if(permission instanceof UserDirectoryPermission) + + // User directory permission + else if (permission instanceof UserDirectoryPermission) systemPermissionTypes.add(operation + "_USER"); + } - //delete all system permissions not in the list + // Delete all system permissions not in the list SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()).andPermissionNotIn(systemPermissionTypes); systemPermissionDAO.deleteByExample(systemPermissionExample); - // find all existing system permissions + // Find all existing system permissions systemPermissionExample.clear(); systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()).andPermissionIn(systemPermissionTypes); List existingPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); Set existingPermissionTypes = new HashSet(); - for(SystemPermissionKey existingPermission : existingPermissions) { + for (SystemPermissionKey existingPermission : existingPermissions) { existingPermissionTypes.add(existingPermission.getPermission()); } - // finally, insert any new system permissions for this user - for(String systemPermissionType : systemPermissionTypes) { - //do not insert the permission if it already exists - if(existingPermissionTypes.contains(systemPermissionType)) + // Finally, insert any NEW system permissions for this user + for (String systemPermissionType : systemPermissionTypes) { + + // Do not insert the permission if it already exists + if (existingPermissionTypes.contains(systemPermissionType)) continue; + // Insert permission SystemPermissionKey newSystemPermission = new SystemPermissionKey(); newSystemPermission.setUser_id(user.getUserID()); newSystemPermission.setPermission(systemPermissionType); systemPermissionDAO.insert(newSystemPermission); + } + } @Override @Transactional - public void update(User object) throws GuacamoleException { - permissionCheckUtility.verifyUserUpdateAccess(this.user.getUserID(), object.getUsername()); - //update the user in the database + public void update(net.sourceforge.guacamole.net.auth.User object) + throws GuacamoleException { + + // Validate permission to update this user is granted + permissionCheckUtility.verifyUserUpdateAccess(this.user.getUserID(), + object.getUsername()); + + // Update the user in the database MySQLUser mySQLUser = providerUtility.getExistingMySQLUser(object); userDAO.updateByPrimaryKey(mySQLUser.getUser()); - //update permissions in database + // Update permissions in database updatePermissions(mySQLUser); + } @Override @Transactional public void remove(String identifier) throws GuacamoleException { - permissionCheckUtility.verifyUserDeleteAccess(this.user.getUserID(), identifier); + // Validate current user has permission to remove the specified user + permissionCheckUtility.verifyUserDeleteAccess(this.user.getUserID(), + identifier); + + // Get specified user MySQLUser mySQLUser = providerUtility.getExistingMySQLUser(identifier); - //delete all the user permissions in the database + // Delete all the user permissions in the database deleteAllPermissions(mySQLUser); - //delete the user in the database + // Delete the user in the database userDAO.deleteByPrimaryKey(mySQLUser.getUserID()); + } /** - * Delete all permissions associated with the provided user. This is only used when deleting a user. - * @param user + * Delete all permissions associated with the provided user. This is only + * used when deleting a user. + * + * @param user The user to delete all permissions of. */ - private void deleteAllPermissions(MySQLUser user) throws GuacamolePermissionException { - //delete all user permissions + private void deleteAllPermissions(MySQLUser user) { + + // Delete all user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); userPermissionDAO.deleteByExample(userPermissionExample); - //delete all connection permissions + // Delete all connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); connectionPermissionDAO.deleteByExample(connectionPermissionExample); - //delete all system permissions + // Delete all system permissions SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()); systemPermissionDAO.deleteByExample(systemPermissionExample); - //delete all permissions that refer to this user + // Delete all permissions that refer to this user userPermissionExample.createCriteria(); userPermissionExample.createCriteria().andAffected_user_idEqualTo(user.getUserID()); userPermissionDAO.deleteByExample(userPermissionExample); + } + } From 4d62cb9c920a1dd83b884f2c280a7326b4bc500e Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 22 Feb 2013 19:58:32 -0800 Subject: [PATCH 038/109] Ticket #269: Remove GuacamolePermissionException, use GuacamoleSecurityException instead. --- .../mysql/GuacamolePermissionException.java | 78 ---------- .../net/auth/mysql/UserDirectory.java | 9 +- .../mysql/utility/PermissionCheckUtility.java | 138 +++++++++--------- 3 files changed, 74 insertions(+), 151 deletions(-) delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java deleted file mode 100644 index 98df8f749..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/GuacamolePermissionException.java +++ /dev/null @@ -1,78 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is guacamole-auth-mysql. - * - * The Initial Developer of the Original Code is - * James Muehlner. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; - -import net.sourceforge.guacamole.GuacamoleException; - -/** - * Represents an error condition when a user tries to perform an action - * that he/she does not have permission to do. - * @author James Muehlner - */ -public class GuacamolePermissionException extends GuacamoleException { - - /** - * Creates a new GuacamoleException with the given message and cause. - * - * @param message A human readable description of the exception that - * occurred. - * @param cause The cause of this exception. - */ - public GuacamolePermissionException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Creates a new GuacamoleException with the given message. - * - * @param message A human readable description of the exception that - * occurred. - */ - public GuacamolePermissionException(String message) { - super(message); - } - - /** - * Creates a new GuacamoleException with the given cause. - * - * @param cause The cause of this exception. - */ - public GuacamolePermissionException(Throwable cause) { - super(cause); - } - - -} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 004ff66b0..3014d33cc 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -46,6 +46,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.GuacamoleSecurityException; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; @@ -288,7 +289,7 @@ public class UserDirectory implements Directory mySQLConnectionProvider; /** - * Verifies that the user has read access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUserID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserReadAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + public void verifyUserReadAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { if(!checkUserReadAccess(userID, affectedUserID)) - throw new GuacamolePermissionException("User " + userID + " does not have read access to user " + affectedUserID); + throw new GuacamoleSecurityException("User " + userID + " does not have read access to user " + affectedUserID); } /** - * Verifies that the user has update access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has update access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUserID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserUpdateAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + public void verifyUserUpdateAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { if(!checkUserUpdateAccess(userID, affectedUserID)) - throw new GuacamolePermissionException("User " + userID + " does not have update access to user " + affectedUserID); + throw new GuacamoleSecurityException("User " + userID + " does not have update access to user " + affectedUserID); } /** - * Verifies that the user has delete access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has delete access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUserID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserDeleteAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + public void verifyUserDeleteAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { if(!checkUserDeleteAccess(userID, affectedUserID)) - throw new GuacamolePermissionException("User " + userID + " does not have delete access to user " + affectedUserID); + throw new GuacamoleSecurityException("User " + userID + " does not have delete access to user " + affectedUserID); } /** - * Verifies that the user has administer access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has administer access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUserID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserAdministerAccess(int userID, int affectedUserID) throws GuacamolePermissionException { + public void verifyUserAdministerAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { if(!checkUserAdministerAccess(userID, affectedUserID)) - throw new GuacamolePermissionException("User " + userID + " does not have administer access to user " + affectedUserID); + throw new GuacamoleSecurityException("User " + userID + " does not have administer access to user " + affectedUserID); } /** - * Verifies that the user has read access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUsername - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserReadAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + public void verifyUserReadAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { if(!checkUserReadAccess(userID, affectedUsername)) - throw new GuacamolePermissionException("User " + userID + " does not have read access to user '" + affectedUsername + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have read access to user '" + affectedUsername + "'"); } /** - * Verifies that the user has update access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has update access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUsername - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserUpdateAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + public void verifyUserUpdateAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { if(!checkUserUpdateAccess(userID, affectedUsername)) - throw new GuacamolePermissionException("User " + userID + " does not have update access to user '" + affectedUsername + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have update access to user '" + affectedUsername + "'"); } /** - * Verifies that the user has delete access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has delete access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUsername - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserDeleteAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + public void verifyUserDeleteAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { if(!checkUserDeleteAccess(userID, affectedUsername)) - throw new GuacamolePermissionException("User " + userID + " does not have delete access to user '" + affectedUsername + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have delete access to user '" + affectedUsername + "'"); } /** - * Verifies that the user has administer access to the given user. If not, throws a GuacamolePermissionException. + * Verifies that the user has administer access to the given user. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedUsername - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyUserAdministerAccess(int userID, String affectedUsername) throws GuacamolePermissionException { + public void verifyUserAdministerAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { if(!checkUserAdministerAccess(userID, affectedUsername)) - throw new GuacamolePermissionException("User " + userID + " does not have administer access to user '" + affectedUsername + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have administer access to user '" + affectedUsername + "'"); } /** @@ -408,91 +408,91 @@ public class PermissionCheckUtility { } /** - * Verifies that the user has read access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has read access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionReadAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + public void verifyConnectionReadAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { if(!checkConnectionReadAccess(userID, affectedConnectionID)) - throw new GuacamolePermissionException("User " + userID + " does not have read access to connection " + affectedConnectionID); + throw new GuacamoleSecurityException("User " + userID + " does not have read access to connection " + affectedConnectionID); } /** - * Verifies that the user has update access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has update access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionUpdateAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + public void verifyConnectionUpdateAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { if(!checkConnectionUpdateAccess(userID, affectedConnectionID)) - throw new GuacamolePermissionException("User " + userID + " does not have update access to connection " + affectedConnectionID); + throw new GuacamoleSecurityException("User " + userID + " does not have update access to connection " + affectedConnectionID); } /** - * Verifies that the user has delete access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has delete access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionDeleteAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + public void verifyConnectionDeleteAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { if(!checkConnectionDeleteAccess(userID, affectedConnectionID)) - throw new GuacamolePermissionException("User " + userID + " does not have delete access to connection " + affectedConnectionID); + throw new GuacamoleSecurityException("User " + userID + " does not have delete access to connection " + affectedConnectionID); } /** - * Verifies that the user has administer access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has administer access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionID - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionAdministerAccess(int userID, int affectedConnectionID) throws GuacamolePermissionException { + public void verifyConnectionAdministerAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { if(!checkConnectionAdministerAccess(userID, affectedConnectionID)) - throw new GuacamolePermissionException("User " + userID + " does not have administer access to connection " + affectedConnectionID); + throw new GuacamoleSecurityException("User " + userID + " does not have administer access to connection " + affectedConnectionID); } /** - * Verifies that the user has read access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has read access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionName - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionReadAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + public void verifyConnectionReadAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { if(!checkConnectionReadAccess(userID, affectedConnectionName)) - throw new GuacamolePermissionException("User " + userID + " does not have read access to connection '" + affectedConnectionName + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have read access to connection '" + affectedConnectionName + "'"); } /** - * Verifies that the user has update access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has update access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionName - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionUpdateAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + public void verifyConnectionUpdateAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { if(!checkConnectionUpdateAccess(userID, affectedConnectionName)) - throw new GuacamolePermissionException("User " + userID + " does not have update access to connection '" + affectedConnectionName + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have update access to connection '" + affectedConnectionName + "'"); } /** - * Verifies that the user has delete access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has delete access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionName - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionDeleteAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + public void verifyConnectionDeleteAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { if(!checkConnectionDeleteAccess(userID, affectedConnectionName)) - throw new GuacamolePermissionException("User " + userID + " does not have delete access to connection '" + affectedConnectionName + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have delete access to connection '" + affectedConnectionName + "'"); } /** - * Verifies that the user has administer access to the given connection. If not, throws a GuacamolePermissionException. + * Verifies that the user has administer access to the given connection. If not, throws a GuacamoleSecurityException. * @param userID * @param affectedConnectionName - * @throws GuacamolePermissionException + * @throws GuacamoleSecurityException */ - public void verifyConnectionAdministerAccess(int userID, String affectedConnectionName) throws GuacamolePermissionException { + public void verifyConnectionAdministerAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { if(!checkConnectionAdministerAccess(userID, affectedConnectionName)) - throw new GuacamolePermissionException("User " + userID + " does not have administer access to connection '" + affectedConnectionName + "'"); + throw new GuacamoleSecurityException("User " + userID + " does not have administer access to connection '" + affectedConnectionName + "'"); } /** @@ -716,14 +716,14 @@ public class PermissionCheckUtility { return connectionIDs; } - public void verifyCreateUserPermission(int userID) throws GuacamolePermissionException { + public void verifyCreateUserPermission(int userID) throws GuacamoleSecurityException { if(!checkCreateUserPermission(userID)) - throw new GuacamolePermissionException("User " + userID + " does not have permission to create users."); + throw new GuacamoleSecurityException("User " + userID + " does not have permission to create users."); } - public void verifyCreateConnectionPermission(int userID) throws GuacamolePermissionException { + public void verifyCreateConnectionPermission(int userID) throws GuacamoleSecurityException { if(!checkCreateConnectionPermission(userID)) - throw new GuacamolePermissionException("User " + userID + " does not have permission to create connections."); + throw new GuacamoleSecurityException("User " + userID + " does not have permission to create connections."); } /** From fec96bcbd6a99345b6b075c5ccfc5d3cb3f044e5 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 22 Feb 2013 20:05:27 -0800 Subject: [PATCH 039/109] Ticket #269: Password check should also compare usernames. Fix styles. --- .../Sha256PasswordEncryptionUtility.java | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java index c191f60ca..844b13d67 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/Sha256PasswordEncryptionUtility.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql.utility; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql.utility; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; @@ -49,25 +51,45 @@ import net.sourceforge.guacamole.net.auth.Credentials; public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtility { @Override - public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt) { + public boolean checkCredentials(Credentials credentials, + byte[] dbPasswordHash, String dbUsername, byte[] dbSalt) { + + // If usernames don't match, don't bother comparing passwords, just fail + if (!dbUsername.equals(credentials.getUsername())) + return false; + + // Compare bytes of password in credentials against hashed password byte[] passwordBytes = createPasswordHash(credentials.getPassword(), dbSalt); return Arrays.equals(passwordBytes, dbPasswordHash); + } @Override public byte[] createPasswordHash(String password, byte[] salt) { - try { - MessageDigest md = MessageDigest.getInstance("SHA-256"); + try { + + // Build salted password StringBuilder builder = new StringBuilder(); builder.append(password); builder.append(DatatypeConverter.printHexBinary(salt)); + + // Hash UTF-8 bytes of salted password + MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(builder.toString().getBytes("UTF-8")); return md.digest(); - } catch (UnsupportedEncodingException ex) { // should not happen - throw new RuntimeException(ex); - } catch (NoSuchAlgorithmException ex) { // should not happen + + } + + // Should not happen + catch (UnsupportedEncodingException ex) { throw new RuntimeException(ex); } + + // Should not happen + catch (NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } } From 1a6d9dae202c7243516565733920bbad06fbdfee Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 22 Feb 2013 20:55:17 -0800 Subject: [PATCH 040/109] Ticket #269: SecureRandomSaltUtility style fixes. --- .../auth/mysql/utility/SecureRandomSaltUtility.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java index f2c38c477..146398d1f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql.utility; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,17 +36,19 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql.utility; import java.security.SecureRandom; /** - * Generates password salts via the SecureRandom utility. + * Generates password salts via SecureRandom. * @author James Muehlner */ public class SecureRandomSaltUtility implements SaltUtility { - SecureRandom secureRandom = new SecureRandom(); + /** + * Instance of SecureRandom for generating the salt. + */ + private SecureRandom secureRandom = new SecureRandom(); @Override public byte[] generateSalt() { @@ -51,4 +56,5 @@ public class SecureRandomSaltUtility implements SaltUtility { secureRandom.nextBytes(salt); return salt; } + } From 4c034f091b46ebe26ea812a616a5d3b20d932cbf Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 23 Feb 2013 00:34:57 -0800 Subject: [PATCH 041/109] Ticket #269: More style fixes, remove unnecessary interface declaration. --- .../net/auth/mysql/ActiveConnectionSet.java | 16 ++++--- .../mysql/MySQLAuthenticationProvider.java | 46 +++++++++++++++---- .../net/auth/mysql/UserDirectory.java | 20 ++++---- .../Sha256PasswordEncryptionUtility.java | 4 +- 4 files changed, 59 insertions(+), 27 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java index 769b7f02f..d04f79871 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,15 +36,14 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import java.util.HashSet; -import java.util.Set; /** - * Represents the set of currently active Connections. Whenever a socket is opened, - * the connection ID should be added to this set, and whenever a socket is closed, - * the connection ID should be removed from this set. - * @author dagger10k + * Represents the set of currently active Connections. Whenever a socket is + * opened, the connection ID should be added to this set, and whenever a socket + * is closed, the connection ID should be removed from this set. + * + * @author James Muehlner */ -public class ActiveConnectionSet extends HashSet implements Set {} +public class ActiveConnectionSet extends HashSet {} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 22a00e7e4..79132b23d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Binder; import com.google.inject.Guice; @@ -63,20 +65,24 @@ import net.sourceforge.guacamole.properties.GuacamoleProperties; import org.mybatis.guice.MyBatisModule; import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider; import org.mybatis.guice.datasource.helper.JdbcHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Provides a MySQL based implementation of the AuthenticationProvider * functionality. + * * @author James Muehlner */ public class MySQLAuthenticationProvider implements AuthenticationProvider { - private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); - + /** + * Set of all active connections. + */ private ActiveConnectionSet activeConnectionSet = new ActiveConnectionSet(); + /** + * Injector which will manage the object graph of this authentication + * provider. + */ private Injector injector; @Override @@ -86,9 +92,19 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { return context; } + /** + * Creates a new MySQLAuthenticationProvider that reads and writes + * authentication data to a MySQL database defined by properties in + * guacamole.properties. + * + * @throws GuacamoleException If a required property is missing, or + * an error occurs while parsing a property. + */ public MySQLAuthenticationProvider() throws GuacamoleException { + final Properties myBatisProperties = new Properties(); - //set the mysql properties for MyBatis. + + // Set the mysql properties for MyBatis. myBatisProperties.setProperty("mybatis.environment.id", "guacamole"); myBatisProperties.setProperty("JDBC.host", GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_HOSTNAME)); myBatisProperties.setProperty("JDBC.port", String.valueOf(GuacamoleProperties.getRequiredProperty(MySQLGuacamoleProperties.MYSQL_PORT))); @@ -100,21 +116,30 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { // Set up Guice injector. injector = Guice.createInjector( JdbcHelper.MySQL, + new Module() { @Override public void configure(Binder binder) { Names.bindProperties(binder, myBatisProperties); } - },new MyBatisModule() { + }, + + new MyBatisModule() { @Override protected void initialize() { + + // Datasource bindDataSourceProviderType(PooledDataSourceProvider.class); + + // Add MyBatis mappers addMapperClass(ConnectionMapper.class); addMapperClass(ConnectionParameterMapper.class); addMapperClass(ConnectionPermissionMapper.class); addMapperClass(SystemPermissionMapper.class); addMapperClass(UserMapper.class); addMapperClass(UserPermissionMapper.class); + + // Bind interfaces bind(MySQLUserContext.class); bind(UserDirectory.class); bind(MySQLUser.class); @@ -124,8 +149,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(ProviderUtility.class); bind(ConfigurationTranslationUtility.class); bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); + } - } + } // end of mybatis module + ); - } + } // end of constructor + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 3014d33cc..5faf31b47 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -130,7 +130,9 @@ public class UserDirectory implements Directory users = permissionCheckUtility.getReadableUsers(user.getUserID()); - + // Build set of usernames of readable users Set userNameSet = new HashSet(); for (MySQLUser mySQLUser : users) @@ -202,7 +204,7 @@ public class UserDirectory implements Directory userPermissions = new ArrayList(); List connectionPermissions = new ArrayList(); List systemPermissions = new ArrayList(); - + for (Permission permission : user.getPermissions()) { if (permission instanceof UserPermission) @@ -231,12 +233,12 @@ public class UserDirectory implements Directory Date: Sat, 23 Feb 2013 00:43:52 -0800 Subject: [PATCH 042/109] Ticket #269: Add package-info.java files. --- .../sourceforge/guacamole/net/auth/mysql/package-info.java | 7 +++++++ .../guacamole/net/auth/mysql/properties/package-info.java | 7 +++++++ .../guacamole/net/auth/mysql/utility/package-info.java | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/package-info.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/package-info.java create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/package-info.java diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/package-info.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/package-info.java new file mode 100644 index 000000000..81f802bbb --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/package-info.java @@ -0,0 +1,7 @@ + +/** + * Base classes which support the MySQL authentication provider, including + * the authentication provider itself. + */ +package net.sourceforge.guacamole.net.auth.mysql; + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/package-info.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/package-info.java new file mode 100644 index 000000000..d327a33bc --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/properties/package-info.java @@ -0,0 +1,7 @@ + +/** + * Properties which control the configuration of the MySQL authentication + * provider. + */ +package net.sourceforge.guacamole.net.auth.mysql.properties; + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/package-info.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/package-info.java new file mode 100644 index 000000000..638a28b36 --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/package-info.java @@ -0,0 +1,7 @@ + +/** + * Service classes which help fill the needs of the MySQL authentication + * provider. + */ +package net.sourceforge.guacamole.net.auth.mysql.utility; + From 7a7ead0c640a5a8d147bed050c16e2c4a366fe9c Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 23 Feb 2013 01:18:23 -0800 Subject: [PATCH 043/109] Ticket #269: More cleanup. --- .../net/auth/mysql/MySQLConnectionRecord.java | 23 ++++++-- .../ConfigurationTranslationUtility.java | 54 +++++++++++++------ 2 files changed, 57 insertions(+), 20 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index ec47b4556..e42de570d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import java.util.Date; @@ -46,6 +48,7 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; /** + * A ConnectionRecord which is based on data stored in MySQL. * * @author James Muehlner */ @@ -56,18 +59,30 @@ public class MySQLConnectionRecord implements ConnectionRecord { */ private ConnectionHistory connectionHistory; + /** + * DAO for accessing users. + */ @Inject UserMapper userDAO; + /** + * DAO for accessing connections. + */ @Inject ConnectionMapper connectionDAO; + /** + * Service for creating and retrieving objects. + */ @Inject ProviderUtility providerUtility; /** - * Initialize this MySQLConnectionRecord with the database record it represents. - * @param connectionHistory + * Initialize this MySQLConnectionRecord with the database record it + * represents. + * + * @param connectionHistory The ConnectionHistory entry from the database + * corresponding to this connection record. */ public void init(ConnectionHistory connectionHistory) { this.connectionHistory = connectionHistory; @@ -95,7 +110,7 @@ public class MySQLConnectionRecord implements ConnectionRecord { @Override public boolean isActive() { - // if the end date hasn't been stored yet, the connection is still open. + // If the end date hasn't been stored yet, the connection is still open. return connectionHistory.getEnd_date() == null; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java index 658638268..e0708b720 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql.utility; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql.utility; import java.util.ArrayList; import java.util.List; @@ -48,39 +50,59 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; public class ConfigurationTranslationUtility { /** - * Get a GuacamoleConfiguration based on the provided protocol and parameters. - * @param protocol the protocol used (VNC, RDP, etc) - * @param parameters the parameter database records to translate - * @return + * Get a GuacamoleConfiguration based on the provided protocol and + * parameters. + * + * @param protocol The protocol used (VNC, RDP, etc) + * @param parameters The parameter database records to translate + * @return A new GuacamoleConfiguration based on the given protocol and + * parameters. */ - public GuacamoleConfiguration getConfiguration(String protocol, Iterable parameters) { + public GuacamoleConfiguration getConfiguration(String protocol, + Iterable parameters) { + + // Create new configuration, set protocol GuacamoleConfiguration configuration = new GuacamoleConfiguration(); configuration.setProtocol(protocol); - for(ConnectionParameter parameter : parameters) { + // Copy parameters from given parameters + for(ConnectionParameter parameter : parameters) configuration.setParameter(parameter.getParameter_name(), parameter.getParameter_value()); - } return configuration; } /** - * Creates a list of ConnectionParameter database records based on the provided connectionID and GuacamoleConfiguration. - * @param connectionID the ID of the connection that these parameters are for - * @param configuration the configuration to pull the parameter values from - * @return + * Creates a list of ConnectionParameter database records based on the + * provided connectionID and GuacamoleConfiguration. + * + * @param connectionID The ID of the connection that these parameters are + * for. + * @param configuration The configuration to pull the parameter values from. + * @return A list of ConnectionParameter database records. */ - public List getConnectionParameters(int connectionID, GuacamoleConfiguration configuration) { - List connectionParameters = new ArrayList(); + public List getConnectionParameters(int connectionID, + GuacamoleConfiguration configuration) { - for(String parameterName : configuration.getParameterNames()) { - ConnectionParameter connectionParameter = new ConnectionParameter(); + List connectionParameters = + new ArrayList(); + + // Each connection parameter in the given configuration, create + // a corresponding database record + for (String parameterName : configuration.getParameterNames()) { + + // Get value of parameter String parameterValue = configuration.getParameter(parameterName); + + // Create corresponding ConnectionParameter + ConnectionParameter connectionParameter = new ConnectionParameter(); connectionParameter.setConnection_id(connectionID); connectionParameter.setParameter_name(parameterName); connectionParameter.setParameter_value(parameterValue); + // Add parameter to list connectionParameters.add(connectionParameter); + } return connectionParameters; From a7e894380ddcb78bba675e88c1c990cd87390f2b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 23 Feb 2013 12:54:16 -0800 Subject: [PATCH 044/109] Ticket #269: Fix JavaDoc, use GuacamoleSocket (no need to require ConfiguredGuacamoleSocket). --- .../net/auth/mysql/MySQLGuacamoleSocket.java | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java index f35d76ae5..bc0c44e03 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,14 +36,12 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.io.GuacamoleReader; import net.sourceforge.guacamole.io.GuacamoleWriter; import net.sourceforge.guacamole.net.GuacamoleSocket; -import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; /** * A MySQL specific wrapper around a ConfiguredGuacamoleSocket. @@ -48,17 +49,31 @@ import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; */ public class MySQLGuacamoleSocket implements GuacamoleSocket { + /** + * Injected ActiveConnectionSet which will contain all active connections. + */ @Inject ActiveConnectionSet activeConnectionSet; - private ConfiguredGuacamoleSocket socket; + /** + * The wrapped socket. + */ + private GuacamoleSocket socket; + + /** + * The ID associated with the connection associated with the wrapped + * socket. + */ private int connectionID; /** - * Initialize this MySQLGuacamoleSocket with the provided ConfiguredGuacamoleSocket. - * @param socket the ConfiguredGuacamoleSocket to wrap. + * Initialize this MySQLGuacamoleSocket with the provided GuacamoleSocket. + * + * @param socket The ConfiguredGuacamoleSocket to wrap. + * @param connectionID The ID of the connection associated with the given + * socket. */ - public void init(ConfiguredGuacamoleSocket socket, int connectionID) { + public void init(GuacamoleSocket socket, int connectionID) { this.socket = socket; this.connectionID = connectionID; } @@ -75,9 +90,13 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { @Override public void close() throws GuacamoleException { + + // Close socket socket.close(); - //mark this connection as inactive + + // Mark this connection as inactive activeConnectionSet.remove(connectionID); + } @Override From 1b71cf72bba416d243e1ae10543911828dbd9865 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 23 Feb 2013 18:09:48 -0800 Subject: [PATCH 045/109] Ticket #269: Yet more cleanup. --- .../net/auth/mysql/MySQLGuacamoleSocket.java | 2 +- .../net/auth/mysql/MySQLUserContext.java | 28 +++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java index bc0c44e03..fcfb82e00 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -68,7 +68,7 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { /** * Initialize this MySQLGuacamoleSocket with the provided GuacamoleSocket. - * + * * @param socket The ConfiguredGuacamoleSocket to wrap. * @param connectionID The ID of the connection associated with the given * socket. diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 2ca81af11..60f8a618b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import net.sourceforge.guacamole.GuacamoleException; @@ -42,8 +44,6 @@ import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.UserContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * The MySQL representation of a UserContext. @@ -51,17 +51,35 @@ import org.slf4j.LoggerFactory; */ public class MySQLUserContext implements UserContext { - private Logger logger = LoggerFactory.getLogger(MySQLUserContext.class); - + /** + * The user owning this context. The permissions of this user dictate + * the access given via the user and connection directories. + */ @Inject private MySQLUser user; + /** + * User directory restricted by the permissions of the user associated + * with this context. + */ @Inject private UserDirectory userDirectory; + /** + * Connection directory restricted by the permissions of the user associated + * with this context. + */ @Inject private ConnectionDirectory connectionDirectory; + /** + * Initializes the user and directories associated with this context. + * + * @param credentials The credentials of the user owning this context. + * @throws GuacamoleException If the credentials given are not valid, + * or an error occurs while initializing the + * directories. + */ void init(Credentials credentials) throws GuacamoleException { user.init(credentials); userDirectory.init(user); From aab2a3c698a8b2ce8fde5de99dbcac4aa6b4b75e Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 01:03:04 -0800 Subject: [PATCH 046/109] Ticket #269: Add missing bindings for transaction factory and connection history mapper. --- .../net/auth/mysql/MySQLAuthenticationProvider.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 79132b23d..c628ec68c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -47,6 +47,7 @@ import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.AuthenticationProvider; import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.UserContext; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; @@ -62,6 +63,7 @@ import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; import net.sourceforge.guacamole.net.auth.mysql.utility.Sha256PasswordEncryptionUtility; import net.sourceforge.guacamole.properties.GuacamoleProperties; +import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; import org.mybatis.guice.MyBatisModule; import org.mybatis.guice.datasource.builtin.PooledDataSourceProvider; import org.mybatis.guice.datasource.helper.JdbcHelper; @@ -131,7 +133,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { // Datasource bindDataSourceProviderType(PooledDataSourceProvider.class); + // Transaction factory + bindTransactionFactoryType(JdbcTransactionFactory.class); + // Add MyBatis mappers + addMapperClass(ConnectionHistoryMapper.class); addMapperClass(ConnectionMapper.class); addMapperClass(ConnectionParameterMapper.class); addMapperClass(ConnectionPermissionMapper.class); From 97c2e3ceb91a9366816ecdf3c2fbe59c2782c265 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 02:07:45 -0800 Subject: [PATCH 047/109] Ticket #269: Clean up MySQLUser, handle null username. Move mybatis XMLs to proper package within resources, fix SQL syntax (guacamole.TABLE, not guacamole..TABLE - likely need to fix generator). --- .../mysql/MySQLAuthenticationProvider.java | 5 ++++ .../guacamole/net/auth/mysql/MySQLUser.java | 30 ++++++++++++++----- .../mysql/dao}/ConnectionHistoryMapper.xml | 22 +++++++------- .../net/auth/mysql/dao}/ConnectionMapper.xml | 22 +++++++------- .../mysql/dao}/ConnectionParameterMapper.xml | 22 +++++++------- .../mysql/dao}/ConnectionPermissionMapper.xml | 16 +++++----- .../mysql/dao}/SystemPermissionMapper.xml | 16 +++++----- .../net/auth/mysql/dao}/UserMapper.xml | 28 ++++++++--------- .../auth/mysql/dao}/UserPermissionMapper.xml | 16 +++++----- 9 files changed, 98 insertions(+), 79 deletions(-) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionHistoryMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionParameterMapper.xml (93%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/ConnectionPermissionMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/SystemPermissionMapper.xml (94%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/UserMapper.xml (95%) rename extensions/guacamole-auth-mysql/src/main/{java/net/sourceforge/guacamole/net/auth/mysql/xml => resources/net/sourceforge/guacamole/net/auth/mysql/dao}/UserPermissionMapper.xml (94%) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index c628ec68c..fef2ede46 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -89,6 +89,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { @Override public UserContext getUserContext(Credentials credentials) throws GuacamoleException { + + // No null users in database + if (credentials.getUsername() == null) + return null; + MySQLUserContext context = injector.getInstance(MySQLUserContext.class); context.init(credentials); return context; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index be69486b3..a542c608d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -86,20 +86,34 @@ public class MySQLUser implements User { * @param credentials * @throws GuacamoleException */ - void init (Credentials credentials) throws GuacamoleException { + void init(Credentials credentials) throws GuacamoleException { + + // Query user UserExample userExample = new UserExample(); userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); List users = userDAO.selectByExampleWithBLOBs(userExample); - if(users.size() > 1) // the unique constraint on the table should prevent this - throw new GuacamoleException("Multiple users found with the same username: " + credentials.getUsername()); - if(users.isEmpty()) - throw new GuacamoleException("No user found with the supplied credentials"); - user = users.get(0); - // check password - if(!passwordUtility.checkCredentials(credentials, user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) + + // The unique constraint on the table should prevent this. + if (users.size() > 1) + throw new GuacamoleException( + "Multiple users found with the same username: " + + credentials.getUsername()); + + // Check that a user was found + if (users.isEmpty()) throw new GuacamoleException("No user found with the supplied credentials"); + // Get first (and only) user + user = users.get(0); + + // Check password + if (!passwordUtility.checkCredentials(credentials, + user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) + throw new GuacamoleException("No user found with the supplied credentials"); + + // Init permissions this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); + } /** diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml index 784d896fd..2a956575e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionHistoryMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml @@ -100,7 +100,7 @@ distinct - from guacamole..guacamole_connection_history + from guacamole.guacamole_connection_history @@ -116,7 +116,7 @@ --> select - from guacamole..guacamole_connection_history + from guacamole.guacamole_connection_history where history_id = #{history_id,jdbcType=INTEGER} @@ -125,7 +125,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_history + delete from guacamole.guacamole_connection_history where history_id = #{history_id,jdbcType=INTEGER} @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_history + delete from guacamole.guacamole_connection_history @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_history (history_id, user_id, connection_id, + insert into guacamole.guacamole_connection_history (history_id, user_id, connection_id, start_date, end_date) values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP}) @@ -156,7 +156,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_history + insert into guacamole.guacamole_connection_history history_id, @@ -198,7 +198,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection_history + select count(*) from guacamole.guacamole_connection_history @@ -209,7 +209,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history history_id = #{record.history_id,jdbcType=INTEGER}, @@ -237,7 +237,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history set history_id = #{record.history_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -253,7 +253,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history user_id = #{user_id,jdbcType=INTEGER}, @@ -276,7 +276,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_history + update guacamole.guacamole_connection_history set user_id = #{user_id,jdbcType=INTEGER}, connection_id = #{connection_id,jdbcType=INTEGER}, start_date = #{start_date,jdbcType=TIMESTAMP}, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml index 80646bd9d..c1265a13d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_connection + from guacamole.guacamole_connection @@ -114,7 +114,7 @@ --> select - from guacamole..guacamole_connection + from guacamole.guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection + delete from guacamole.guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -132,7 +132,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection + delete from guacamole.guacamole_connection @@ -143,7 +143,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection (connection_id, connection_name, protocol + insert into guacamole.guacamole_connection (connection_id, connection_name, protocol ) values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} ) @@ -154,7 +154,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection + insert into guacamole.guacamole_connection connection_id, @@ -184,7 +184,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection + select count(*) from guacamole.guacamole_connection @@ -195,7 +195,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -217,7 +217,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection set connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_name = #{record.connection_name,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR} @@ -231,7 +231,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection connection_name = #{connection_name,jdbcType=VARCHAR}, @@ -248,7 +248,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection + update guacamole.guacamole_connection set connection_name = #{connection_name,jdbcType=VARCHAR}, protocol = #{protocol,jdbcType=VARCHAR} where connection_id = #{connection_id,jdbcType=INTEGER} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml similarity index 93% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml index 146622a62..b609b0f4d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionParameterMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_connection_parameter + from guacamole.guacamole_connection_parameter @@ -114,7 +114,7 @@ --> select - from guacamole..guacamole_connection_parameter + from guacamole.guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} @@ -124,7 +124,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_parameter + delete from guacamole.guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_parameter + delete from guacamole.guacamole_connection_parameter @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_parameter (connection_id, parameter_name, parameter_value + insert into guacamole.guacamole_connection_parameter (connection_id, parameter_name, parameter_value ) values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} ) @@ -156,7 +156,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_parameter + insert into guacamole.guacamole_connection_parameter connection_id, @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection_parameter + select count(*) from guacamole.guacamole_connection_parameter @@ -197,7 +197,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -219,7 +219,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter set connection_id = #{record.connection_id,jdbcType=INTEGER}, parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, parameter_value = #{record.parameter_value,jdbcType=VARCHAR} @@ -233,7 +233,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter parameter_value = #{parameter_value,jdbcType=VARCHAR}, @@ -248,7 +248,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_parameter + update guacamole.guacamole_connection_parameter set parameter_value = #{parameter_value,jdbcType=VARCHAR} where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml index 240d868bb..3e7afd7ff 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_connection_permission + from guacamole.guacamole_connection_permission @@ -112,7 +112,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_permission + delete from guacamole.guacamole_connection_permission where user_id = #{user_id,jdbcType=INTEGER} and connection_id = #{connection_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_connection_permission + delete from guacamole.guacamole_connection_permission @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission + insert into guacamole.guacamole_connection_permission (user_id, connection_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_connection_permission + insert into guacamole.guacamole_connection_permission user_id, @@ -175,7 +175,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_connection_permission + select count(*) from guacamole.guacamole_connection_permission @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_permission + update guacamole.guacamole_connection_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -208,7 +208,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_connection_permission + update guacamole.guacamole_connection_permission set user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml index 2ca6297ac..8de2c4992 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/SystemPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml @@ -97,7 +97,7 @@ distinct - from guacamole..guacamole_system_permission + from guacamole.guacamole_system_permission @@ -111,7 +111,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_system_permission + delete from guacamole.guacamole_system_permission where user_id = #{user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -121,7 +121,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_system_permission + delete from guacamole.guacamole_system_permission @@ -132,7 +132,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_system_permission (user_id, permission) + insert into guacamole.guacamole_system_permission (user_id, permission) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) @@ -141,7 +141,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_system_permission + insert into guacamole.guacamole_system_permission user_id, @@ -165,7 +165,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_system_permission + select count(*) from guacamole.guacamole_system_permission @@ -176,7 +176,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_system_permission + update guacamole.guacamole_system_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -195,7 +195,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_system_permission + update guacamole.guacamole_system_permission set user_id = #{record.user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml similarity index 95% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml index 5fe55f665..47758e3bb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml @@ -116,7 +116,7 @@ , - from guacamole..guacamole_user + from guacamole.guacamole_user @@ -135,7 +135,7 @@ distinct - from guacamole..guacamole_user + from guacamole.guacamole_user @@ -153,7 +153,7 @@ , - from guacamole..guacamole_user + from guacamole.guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -162,7 +162,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user + delete from guacamole.guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -171,7 +171,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user + delete from guacamole.guacamole_user @@ -182,7 +182,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user (user_id, username, password_hash, + insert into guacamole.guacamole_user (user_id, username, password_hash, password_salt) values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, #{password_salt,jdbcType=BINARY}) @@ -193,7 +193,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user + insert into guacamole.guacamole_user user_id, @@ -229,7 +229,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_user + select count(*) from guacamole.guacamole_user @@ -240,7 +240,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user user_id = #{record.user_id,jdbcType=INTEGER}, @@ -265,7 +265,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR}, password_hash = #{record.password_hash,jdbcType=BINARY}, @@ -280,7 +280,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR} @@ -293,7 +293,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user username = #{username,jdbcType=VARCHAR}, @@ -313,7 +313,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set username = #{username,jdbcType=VARCHAR}, password_hash = #{password_hash,jdbcType=BINARY}, password_salt = #{password_salt,jdbcType=BINARY} @@ -325,7 +325,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user + update guacamole.guacamole_user set username = #{username,jdbcType=VARCHAR} where user_id = #{user_id,jdbcType=INTEGER} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml similarity index 94% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml rename to extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml index 97f86bbe5..e8836b833 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/xml/UserPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole..guacamole_user_permission + from guacamole.guacamole_user_permission @@ -112,7 +112,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user_permission + delete from guacamole.guacamole_user_permission where user_id = #{user_id,jdbcType=INTEGER} and affected_user_id = #{affected_user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole..guacamole_user_permission + delete from guacamole.guacamole_user_permission @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user_permission (user_id, affected_user_id, permission + insert into guacamole.guacamole_user_permission (user_id, affected_user_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole..guacamole_user_permission + insert into guacamole.guacamole_user_permission user_id, @@ -175,7 +175,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole..guacamole_user_permission + select count(*) from guacamole.guacamole_user_permission @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user_permission + update guacamole.guacamole_user_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -208,7 +208,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole..guacamole_user_permission + update guacamole.guacamole_user_permission set user_id = #{record.user_id,jdbcType=INTEGER}, affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} From 73641925fce4063edb5aaa59e5f2a79eed8245a8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 02:37:43 -0800 Subject: [PATCH 048/109] Ticket #269: Partial fix of the most immediately apparent (upon login) query errors. Need to rework queries. --- .../mysql/utility/PermissionCheckUtility.java | 140 +++++++++++------- 1 file changed, 85 insertions(+), 55 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java index 9731bc489..1a1c5434c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -39,6 +39,7 @@ import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Provider; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -684,18 +685,30 @@ public class PermissionCheckUtility { * @return the list of all connections this user has access to */ private Set getConnections(int userID, String permissionType) { + + // If connections available, query them Set affectedConnectionIDs = getConnectionIDs(userID, permissionType); - ConnectionExample example = new ConnectionExample(); - example.createCriteria().andConnection_idIn(Lists.newArrayList(affectedConnectionIDs)); - List connectionDBOjects = connectionDAO.selectByExample(example); - Set affectedConnections = new HashSet(); - for(Connection affectedConnection : connectionDBOjects) { - MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); - mySQLConnection.init(affectedConnection); - affectedConnections.add(mySQLConnection); + if (!affectedConnectionIDs.isEmpty()) { + + // Query available connections + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_idIn(Lists.newArrayList(affectedConnectionIDs)); + List connectionDBOjects = connectionDAO.selectByExample(example); + + // Add connections to final set + Set affectedConnections = new HashSet(); + for(Connection affectedConnection : connectionDBOjects) { + MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); + mySQLConnection.init(affectedConnection); + affectedConnections.add(mySQLConnection); + } + + return affectedConnections; } - return affectedConnections; + // Otherwise, no connections available + return Collections.EMPTY_SET; + } /** @@ -795,62 +808,79 @@ public class PermissionCheckUtility { public Set getAllPermissions(int userID) { Set allPermissions = new HashSet(); - // first, user permissions + // First, user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(userID); - List userPermissions = userPermissionDAO.selectByExample(userPermissionExample); - List affectedUserIDs = new ArrayList(); - for(UserPermissionKey userPermission : userPermissions) { - affectedUserIDs.add(userPermission.getAffected_user_id()); + List userPermissions = + userPermissionDAO.selectByExample(userPermissionExample); + + // If user permissions present, add permissions + if (!userPermissions.isEmpty()) { + + // Get list of affected user IDs + List affectedUserIDs = new ArrayList(); + for(UserPermissionKey userPermission : userPermissions) + affectedUserIDs.add(userPermission.getAffected_user_id()); + + // Query all affected users, store in map indexed by user ID + UserExample userExample = new UserExample(); + userExample.createCriteria().andUser_idIn(affectedUserIDs); + List users = userDAO.selectByExample(userExample); + Map userMap = new HashMap(); + for(User user : users) + userMap.put(user.getUser_id(), user); + + // Add user permissions + for(UserPermissionKey userPermission : userPermissions) { + User affectedUser = userMap.get(userPermission.getAffected_user_id()); + UserPermission newPermission = new UserPermission( + UserPermission.Type.valueOf(userPermission.getPermission()), + affectedUser.getUsername() + ); + allPermissions.add(newPermission); + } + } - UserExample userExample = new UserExample(); - userExample.createCriteria().andUser_idIn(affectedUserIDs); - List users = userDAO.selectByExample(userExample); - Map userMap = new HashMap(); - for(User user : users) { - userMap.put(user.getUser_id(), user); - } - - for(UserPermissionKey userPermission : userPermissions) { - User affectedUser = userMap.get(userPermission.getAffected_user_id()); - UserPermission newPermission = new UserPermission( - UserPermission.Type.valueOf(userPermission.getPermission()), - affectedUser.getUsername() - ); - allPermissions.add(newPermission); - } - - //secondly, connection permissions + // Secondly, connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(userID); - List connectionPermissions = connectionPermissionDAO.selectByExample(connectionPermissionExample); - List affectedConnectionIDs = new ArrayList(); - for(ConnectionPermissionKey connectionPermission : connectionPermissions) { - affectedConnectionIDs.add(connectionPermission.getConnection_id()); + List connectionPermissions = + connectionPermissionDAO.selectByExample(connectionPermissionExample); + + // If connection permissions present, add permissions + if (!connectionPermissions.isEmpty()) { + + // Get list of affected connection IDs + List affectedConnectionIDs = new ArrayList(); + for(ConnectionPermissionKey connectionPermission : connectionPermissions) + affectedConnectionIDs.add(connectionPermission.getConnection_id()); + + // Query connections, store in map indexed by connection ID + ConnectionExample connectionExample = new ConnectionExample(); + connectionExample.createCriteria().andConnection_idIn(affectedConnectionIDs); + List connections = connectionDAO.selectByExample(connectionExample); + Map connectionMap = new HashMap(); + for(Connection connection : connections) + connectionMap.put(connection.getConnection_id(), connection); + + // Add connection permissions + for(ConnectionPermissionKey connectionPermission : connectionPermissions) { + Connection affectedConnection = connectionMap.get(connectionPermission.getConnection_id()); + ConnectionPermission newPermission = new ConnectionPermission( + ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), + affectedConnection.getConnection_name() + ); + allPermissions.add(newPermission); + } + } - ConnectionExample connectionExample = new ConnectionExample(); - connectionExample.createCriteria().andConnection_idIn(affectedConnectionIDs); - List connections = connectionDAO.selectByExample(connectionExample); - Map connectionMap = new HashMap(); - for(Connection connection : connections) { - connectionMap.put(connection.getConnection_id(), connection); - } - - for(ConnectionPermissionKey connectionPermission : connectionPermissions) { - Connection affectedConnection = connectionMap.get(connectionPermission.getConnection_id()); - ConnectionPermission newPermission = new ConnectionPermission( - ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), - affectedConnection.getConnection_name() - ); - allPermissions.add(newPermission); - } - - //and finally, system permissions + // And finally, system permissions SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(userID); - List systemPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); + List systemPermissions = + systemPermissionDAO.selectByExample(systemPermissionExample); for(SystemPermissionKey systemPermission : systemPermissions) { SystemPermission newPermission = null; if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) From decf24781557ed50b7215b43f81d0a060a9c7ddc Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 25 Feb 2013 10:58:43 -0800 Subject: [PATCH 049/109] Ticket #269: Updated myBatis example config file to reflect understanding that the mapping files have to be in the same packge, in /resources folder. --- .../doc/examples/mybatisGeneratorConfig.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml index aae06dd98..04f72f78f 100644 --- a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml +++ b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml @@ -22,7 +22,9 @@ - + + + From 06b710e47e960e989da7f9950480036b5393743c Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 16:41:20 -0800 Subject: [PATCH 050/109] Ticket #269: Clean up MySQLConstants, fix permission query for system permissions. --- .../net/auth/mysql/MySQLConstants.java | 71 ++++++++++++++----- .../net/auth/mysql/UserDirectory.java | 38 +++++++--- .../mysql/utility/PermissionCheckUtility.java | 16 ++--- 3 files changed, 93 insertions(+), 32 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index d20315f2e..af6869e40 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -35,10 +35,7 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql; -import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; -import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; -import net.sourceforge.guacamole.net.auth.permission.UserPermission; /** * A set of constants that are useful for the MySQL-based authentication provider. @@ -51,19 +48,61 @@ public final class MySQLConstants { */ private MySQLConstants() {} - // Permission constants - public static final String USER_READ = UserPermission.Type.READ.name(); - public static final String USER_UPDATE = UserPermission.Type.UPDATE.name(); - public static final String USER_DELETE = UserPermission.Type.DELETE.name(); - public static final String USER_ADMINISTER = UserPermission.Type.ADMINISTER.name(); - public static final String USER_CREATE = UserDirectoryPermission.Type.CREATE.name(); + /** + * The string stored in the database to represent READ access to a user. + */ + public static final String USER_READ = "READ"; - public static final String CONNECTION_READ = ConnectionPermission.Type.READ.name(); - public static final String CONNECTION_UPDATE = ConnectionPermission.Type.UPDATE.name(); - public static final String CONNECTION_DELETE = ConnectionPermission.Type.DELETE.name(); - public static final String CONNECTION_ADMINISTER = ConnectionPermission.Type.ADMINISTER.name(); - public static final String CONNECTION_CREATE = ConnectionDirectoryPermission.Type.CREATE.name(); + /** + * The string stored in the database to represent UPDATE access to a user. + */ + public static final String USER_UPDATE = "UPDATE"; + + /** + * The string stored in the database to represent DELETE access to a user. + */ + public static final String USER_DELETE = "DELETE"; + + /** + * The string stored in the database to represent ADMINISTER access to a + * user. + */ + public static final String USER_ADMINISTER = "ADMINISTER"; + + /** + * The string stored in the database to represent READ access to a + * connection. + */ + public static final String CONNECTION_READ = "READ"; + + /** + * The string stored in the database to represent UPDATE access to a + * connection. + */ + public static final String CONNECTION_UPDATE = "UPDATE"; + + /** + * The string stored in the database to represent DELETE access to a + * connection. + */ + public static final String CONNECTION_DELETE = "DELETE"; + + /** + * The string stored in the database to represent ADMINISTER access to a + * connection. + */ + public static final String CONNECTION_ADMINISTER = "ADMINISTER"; + + /** + * The string stored in the database to represent permission to create + * users. + */ + public static final String SYSTEM_USER_CREATE = "CREATE_USER"; + + /** + * The string stored in the database to represent permission to create + * connections. + */ + public static final String SYSTEM_CONNECTION_CREATE = "CREATE_CONNECTION"; - public static final String SYSTEM_USER_CREATE = "USER_CREATE"; - public static final String SYSTEM_CONNECTION_CREATE = "CONNECTION_CREATE"; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 5faf31b47..0a6badc3d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -447,15 +447,38 @@ public class UserDirectory implements Directory existingPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); Set existingPermissionTypes = new HashSet(); - for (SystemPermissionKey existingPermission : existingPermissions) { + for (SystemPermissionKey existingPermission : existingPermissions) existingPermissionTypes.add(existingPermission.getPermission()); - } // Finally, insert any NEW system permissions for this user for (String systemPermissionType : systemPermissionTypes) { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java index 1a1c5434c..3bf29f532 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PermissionCheckUtility.java @@ -68,7 +68,6 @@ import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; -import net.sourceforge.guacamole.net.auth.permission.SystemPermission; import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.UserPermission; @@ -882,14 +881,15 @@ public class PermissionCheckUtility { List systemPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); for(SystemPermissionKey systemPermission : systemPermissions) { - SystemPermission newPermission = null; - if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) - newPermission = new UserDirectoryPermission(UserDirectoryPermission.Type.CREATE); - else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) - newPermission = new ConnectionDirectoryPermission(ConnectionDirectoryPermission.Type.CREATE); - if(newPermission != null) - allPermissions.add(newPermission); + // User creation permission + if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) + allPermissions.add(new UserDirectoryPermission(UserDirectoryPermission.Type.CREATE)); + + // System creation permission + else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) + allPermissions.add(new ConnectionDirectoryPermission(ConnectionDirectoryPermission.Type.CREATE)); + } return allPermissions; From 7a01ddb4f64216fb65e0f3f6610a235bb6b828f2 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 25 Feb 2013 18:39:49 -0800 Subject: [PATCH 051/109] Ticket #269: The utility classes should more properly be known as services. --- .../net/auth/mysql/ConnectionDirectory.java | 8 +++---- .../mysql/MySQLAuthenticationProvider.java | 24 +++++++++---------- .../net/auth/mysql/MySQLConnection.java | 8 +++---- .../net/auth/mysql/MySQLConnectionRecord.java | 4 ++-- .../guacamole/net/auth/mysql/MySQLUser.java | 12 +++++----- .../net/auth/mysql/UserDirectory.java | 8 +++---- .../ConfigurationTranslationService.java} | 4 ++-- .../PasswordEncryptionService.java} | 6 ++--- .../PermissionCheckService.java} | 6 ++--- .../ProviderService.java} | 4 ++-- .../SaltService.java} | 6 ++--- .../SecureRandomSaltService.java} | 4 ++-- .../Sha256PasswordEncryptionService.java} | 4 ++-- .../{utility => service}/package-info.java | 2 +- 14 files changed, 50 insertions(+), 50 deletions(-) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/ConfigurationTranslationUtility.java => service/ConfigurationTranslationService.java} (97%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/PasswordEncryptionUtility.java => service/PasswordEncryptionService.java} (93%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/PermissionCheckUtility.java => service/PermissionCheckService.java} (99%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/ProviderUtility.java => service/ProviderService.java} (99%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/SaltUtility.java => service/SaltService.java} (93%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/SecureRandomSaltUtility.java => service/SecureRandomSaltService.java} (94%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility/Sha256PasswordEncryptionUtility.java => service/Sha256PasswordEncryptionService.java} (95%) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/{utility => service}/package-info.java (62%) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 681ec4057..474309273 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -53,8 +53,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; -import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; +import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; +import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; import org.mybatis.guice.transactional.Transactional; @@ -71,10 +71,10 @@ public class ConnectionDirectory implements Directory{ private MySQLUser user; @Inject - PermissionCheckUtility permissionCheckUtility; + PermissionCheckService permissionCheckUtility; @Inject - ProviderUtility providerUtility; + ProviderService providerUtility; @Inject ConnectionMapper connectionDAO; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index fef2ede46..2ef1dc565 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -55,13 +55,13 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; -import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.Sha256PasswordEncryptionUtility; +import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; +import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; +import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; +import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; +import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; +import net.sourceforge.guacamole.net.auth.mysql.service.SecureRandomSaltService; +import net.sourceforge.guacamole.net.auth.mysql.service.Sha256PasswordEncryptionService; import net.sourceforge.guacamole.properties.GuacamoleProperties; import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; import org.mybatis.guice.MyBatisModule; @@ -154,11 +154,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(MySQLUserContext.class); bind(UserDirectory.class); bind(MySQLUser.class); - bind(SaltUtility.class).to(SecureRandomSaltUtility.class); - bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); - bind(PermissionCheckUtility.class); - bind(ProviderUtility.class); - bind(ConfigurationTranslationUtility.class); + bind(SaltService.class).to(SecureRandomSaltService.class); + bind(PasswordEncryptionService.class).to(Sha256PasswordEncryptionService.class); + bind(PermissionCheckService.class); + bind(ProviderService.class); + bind(ConfigurationTranslationService.class); bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 6dabae6cb..586233e6e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -48,8 +48,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; -import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; +import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; +import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.properties.GuacamoleProperties; import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; @@ -68,13 +68,13 @@ public class MySQLConnection implements Connection { ConnectionParameterMapper connectionParameterDAO; @Inject - ProviderUtility providerUtility; + ProviderService providerUtility; @Inject ActiveConnectionSet activeConnectionSet; @Inject - ConfigurationTranslationUtility configurationTranslationUtility; + ConfigurationTranslationService configurationTranslationUtility; private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index e42de570d..a1a3cd88e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -45,7 +45,7 @@ import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; -import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; +import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; /** * A ConnectionRecord which is based on data stored in MySQL. @@ -75,7 +75,7 @@ public class MySQLConnectionRecord implements ConnectionRecord { * Service for creating and retrieving objects. */ @Inject - ProviderUtility providerUtility; + ProviderService providerUtility; /** * Initialize this MySQLConnectionRecord with the database record it diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index a542c608d..2d9637c21 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -46,9 +46,9 @@ import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; -import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; +import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; +import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; +import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; import net.sourceforge.guacamole.net.auth.permission.Permission; /** @@ -63,13 +63,13 @@ public class MySQLUser implements User { UserMapper userDAO; @Inject - PasswordEncryptionUtility passwordUtility; + PasswordEncryptionService passwordUtility; @Inject - SaltUtility saltUtility; + SaltService saltUtility; @Inject - PermissionCheckUtility permissionCheckUtility; + PermissionCheckService permissionCheckUtility; Set permissions; diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 0a6badc3d..b7dec1100 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -63,8 +63,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.User; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; -import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; -import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; +import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; +import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; @@ -119,14 +119,14 @@ public class UserDirectory implements Directory Date: Mon, 25 Feb 2013 20:59:30 -0800 Subject: [PATCH 052/109] Ticket #269: Modified MySQLUser to keep a set of new and removed permissions for efficiency. --- .../guacamole/net/auth/mysql/MySQLUser.java | 51 ++- .../net/auth/mysql/UserDirectory.java | 394 ++++++++++++------ 2 files changed, 313 insertions(+), 132 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index 2d9637c21..545327dfd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -37,6 +37,7 @@ package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import java.io.UnsupportedEncodingException; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -71,7 +72,53 @@ public class MySQLUser implements User { @Inject PermissionCheckService permissionCheckUtility; + /** + * The set of current permissions a user has. + */ Set permissions; + + /** + * Any newly added permissions that have yet to be committed. + */ + Set newPermissions; + + /** + * Any newly deleted permissions that have yet to be deleted. + */ + Set removedPermissions; + + /** + * Get the current set of permissions this user has. + * @return the current set of permissions. + */ + Set getCurrentPermissions() { + return permissions; + } + + /** + * Get any new permissions that have yet to be inserted. + * @return the new set of permissions. + */ + Set getNewPermissions() { + return newPermissions; + } + + /** + * Get any permissions that have not yet been deleted. + * @return the permissions that need to be deleted. + */ + Set getRemovedPermissions() { + return removedPermissions; + } + + /** + * Reset the new and removed permission sets after they are + * no longer needed. + */ + void resetPermissions() { + newPermissions.clear(); + removedPermissions.clear(); + } /** * Create a default, empty user. @@ -199,7 +246,7 @@ public class MySQLUser implements User { @Override public Set getPermissions() throws GuacamoleException { - return permissions; + return Collections.unmodifiableSet(permissions); } @Override @@ -210,11 +257,13 @@ public class MySQLUser implements User { @Override public void addPermission(Permission permission) throws GuacamoleException { permissions.add(permission); + newPermissions.add(permission); } @Override public void removePermission(Permission permission) throws GuacamoleException { permissions.remove(permission); + removedPermissions.remove(permission); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index b7dec1100..05f8d933a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -40,6 +40,7 @@ package net.sourceforge.guacamole.net.auth.mysql; import com.google.common.base.Preconditions; import com.google.inject.Inject; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -212,42 +213,131 @@ public class UserDirectory implements Directory userPermissions = new ArrayList(); - List connectionPermissions = new ArrayList(); - List systemPermissions = new ArrayList(); + List newUserPermissions = new ArrayList(); + List newConnectionPermissions = new ArrayList(); + List newSystemPermissions = new ArrayList(); - for (Permission permission : user.getPermissions()) { + for (Permission permission : user.getNewPermissions()) { if (permission instanceof UserPermission) - userPermissions.add((UserPermission) permission); + newUserPermissions.add((UserPermission) permission); else if (permission instanceof ConnectionPermission) - connectionPermissions.add((ConnectionPermission) permission); + newConnectionPermissions.add((ConnectionPermission) permission); else if (permission instanceof SystemPermission) - systemPermissions.add((SystemPermission) permission); - + newSystemPermissions.add((SystemPermission) permission); } + + // Partition given permissions by permission type + List removedUserPermissions = new ArrayList(); + List removedConnectionPermissions = new ArrayList(); + List removedSystemPermissions = new ArrayList(); - // Update each type of permission appropriately - updateUserPermissions(userPermissions, user); - updateConnectionPermissions(connectionPermissions, user); - updateSystemPermissions(systemPermissions, user); + for (Permission permission : user.getRemovedPermissions()) { + if (permission instanceof UserPermission) + removedUserPermissions.add((UserPermission) permission); + + else if (permission instanceof ConnectionPermission) + removedConnectionPermissions.add((ConnectionPermission) permission); + + else if (permission instanceof SystemPermission) + removedSystemPermissions.add((SystemPermission) permission); + } + + // Create the new permissions + createUserPermissions(newUserPermissions, user); + createConnectionPermissions(newConnectionPermissions, user); + createSystemPermissions(newSystemPermissions, user); + + // Delete the removed permissions. + deleteUserPermissions(removedUserPermissions, user); + deleteConnectionPermissions(removedConnectionPermissions, user); + deleteSystemPermissions(removedSystemPermissions, user); + + // The appropriate permissions have been inserted and deleted, so + // reset the new and removed permission sets. + user.resetPermissions(); } /** - * Update all the permissions having to do with users for a given user. + * Create any new permissions having to do with users for a given user. * - * @param permissions The permissions the given user should have when + * @param permissions The new permissions the given user should have when * this operation completes. * @param user The user to change the permissions of. * @throws GuacamoleException If permission to alter the access permissions * of affected objects is denied. */ - private void updateUserPermissions(Iterable permissions, + private void createUserPermissions(Collection permissions, MySQLUser user) throws GuacamoleException { + + if(permissions.isEmpty()) + return; + + // Get set of administerable users + Set administerableUsers = + permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); + + // Get list of usernames for all given user permissions. + List usernames = new ArrayList(); + for (UserPermission permission : permissions) + usernames.add(permission.getObjectIdentifier()); + + // Find all the users by username + UserExample userExample = new UserExample(); + userExample.createCriteria().andUsernameIn(usernames); + List dbUsers = userDAO.selectByExample(userExample); + + // Build map of found users, indexed by username + Map dbUserMap = new HashMap(); + for (User dbUser : dbUsers) { + dbUserMap.put(dbUser.getUsername(), dbUser); + } + + for (UserPermission permission : permissions) { + + // Get user + User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); + if (dbAffectedUser == null) + throw new GuacamoleException( + "User '" + permission.getObjectIdentifier() + + "' not found."); + + // Verify that the user actually has permission to administrate + // every one of these users + if (!administerableUsers.contains(dbAffectedUser.getUser_id())) + throw new GuacamoleSecurityException( + "User '" + this.user.getUsername() + + "' does not have permission to administrate user " + + dbAffectedUser.getUser_id()); + + // Create new permission + UserPermissionKey newPermission = new UserPermissionKey(); + newPermission.setAffected_user_id(dbAffectedUser.getUser_id()); + newPermission.setPermission(permission.getType().name()); + newPermission.setUser_id(user.getUserID()); + userPermissionDAO.insert(newPermission); + } + } + + /** + * Delete permissions having to do with users for a given user. + * + * @param permissions The permissions the given user should no longer have + * when this operation completes. + * @param user The user to change the permissions of. + * @throws GuacamoleException If permission to alter the access permissions + * of affected objects is denied. + */ + private void deleteUserPermissions(Collection permissions, + MySQLUser user) + throws GuacamoleException { + + if(permissions.isEmpty()) + return; // Get set of administerable users Set administerableUsers = @@ -270,36 +360,8 @@ public class UserDirectory implements Directory existingPermissions = - userPermissionDAO.selectByExample(userPermissionExample); - - // Build list of currently-present permissions - Set existingUserIDs = new HashSet(); - for (UserPermissionKey userPermission : existingPermissions) - existingUserIDs.add(userPermission.getAffected_user_id()); - - // Delete any permissions that are not in the provided list - userPermissionExample.clear(); - userPermissionExample.createCriteria().andAffected_user_idNotIn(userIDs); - List permissionsToDelete = - userPermissionDAO.selectByExample(userPermissionExample); - - // Verify that the user actually has permission to administrate every one of these users - for (UserPermissionKey permissionToDelete : permissionsToDelete) { - if (!administerableUsers.contains(permissionToDelete.getAffected_user_id())) - throw new GuacamoleSecurityException( - "User '" + this.user.getUsername() - + "' does not have permission to administrate user " - + permissionToDelete.getAffected_user_id()); - } - - userPermissionDAO.deleteByExample(userPermissionExample); - - // Finally, insert the new permissions + + // Verify we have permission to delete each user permission. for (UserPermission permission : permissions) { // Get user @@ -309,12 +371,6 @@ public class UserDirectory implements Directory permissions, MySQLUser user) + private void createConnectionPermissions( + Collection permissions, MySQLUser user) throws GuacamoleException { + + if(permissions.isEmpty()) + return; // Get adminsterable connection identifiers Set administerableConnections = @@ -360,42 +418,13 @@ public class UserDirectory implements Directory dbConnections = connectionDAO.selectByExample(connectionExample); - List connectionIDs = new ArrayList(); // Build map of found connections, indexed by name Map dbConnectionMap = new HashMap(); for (Connection dbConnection : dbConnections) { dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); - connectionIDs.add(dbConnection.getConnection_id()); } - // Find any connection permissions that may already exist - ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); - connectionPermissionExample.createCriteria().andConnection_idIn(connectionIDs); - List existingPermissions = - connectionPermissionDAO.selectByExample(connectionPermissionExample); - Set existingConnectionIDs = new HashSet(); - for (ConnectionPermissionKey connectionPermission : existingPermissions) - existingConnectionIDs.add(connectionPermission.getConnection_id()); - - // Delete any permissions that are not in the provided list - connectionPermissionExample.clear(); - connectionPermissionExample.createCriteria().andConnection_idNotIn(connectionIDs); - List connectionPermissionsToDelete = - connectionPermissionDAO.selectByExample(connectionPermissionExample); - - // Make sure the user has permission to administrate each of these connections - // corresponding to the permissions we are about to delete - for (ConnectionPermissionKey connectionPermissionToDelete : connectionPermissionsToDelete) { - if (!administerableConnections.contains(connectionPermissionToDelete.getConnection_id())) - throw new GuacamoleSecurityException( - "User '" + this.user.getUsername() + - "' does not have permission to administrate connection " - + connectionPermissionToDelete.getConnection_id()); - } - - connectionPermissionDAO.deleteByExample(connectionPermissionExample); - // Finally, insert the new permissions for (ConnectionPermission permission : permissions) { @@ -406,10 +435,6 @@ public class UserDirectory implements Directory permissions, + MySQLUser user) + throws GuacamoleException { + + if(permissions.isEmpty()) + return; + + // Get set of administerable users + Set administerableConnections = + permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); + + // Get list of identifiers for all given user permissions. + List identifiers = new ArrayList(); + for (ConnectionPermission permission : permissions) + identifiers.add(permission.getObjectIdentifier()); + + // Find all the connections by identifiers + ConnectionExample connectionExample = new ConnectionExample(); + connectionExample.createCriteria().andConnection_nameIn(identifiers); + List dbConnections = connectionDAO.selectByExample(connectionExample); + List connectionIDs = new ArrayList(); + + // Build map of found connections, indexed by identifier + Map dbConnectionMap = new HashMap(); + for (Connection dbConnection : dbConnections) { + dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); + connectionIDs.add(dbConnection.getConnection_id()); + } + + // Verify we have permission to delete each connection permission. + for (ConnectionPermission permission : permissions) { + + // Get user + Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); + if (dbConnection == null) + throw new GuacamoleException( + "User '" + permission.getObjectIdentifier() + + "' not found."); + + // Verify that the user actually has permission to administrate + // every one of these connections + if (!administerableConnections.contains(dbConnection.getConnection_id())) + throw new GuacamoleSecurityException( + "User '" + this.user.getUsername() + + "' does not have permission to administrate connection " + + dbConnection.getConnection_id()); + } + + if(!connectionIDs.isEmpty()) { + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()) + .andConnection_idIn(connectionIDs); + connectionPermissionDAO.deleteByExample(connectionPermissionExample); + } + } + + /** + * Create any new system permissions for a given user. All permissions in + * the given list will be inserted. + * + * @param permissions The new system permissions that the given user should + * have when this operation completes. * @param user The user whose permissions should be updated. */ - private void updateSystemPermissions(Iterable permissions, + private void createSystemPermissions(Collection permissions, MySQLUser user) { + if(permissions.isEmpty()) + return; + + // Build list of requested system permissions + List systemPermissionTypes = new ArrayList(); + for (SystemPermission permission : permissions) { + + // Connection directory permission + if (permission instanceof ConnectionDirectoryPermission) { + switch (permission.getType()) { + + // Create permission + case CREATE: + systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); + break; + + // Fail if unexpected type encountered + default: + assert false : "Unsupported type: " + permission.getType(); + + } + } + + // User directory permission + else if (permission instanceof UserDirectoryPermission) { + switch (permission.getType()) { + + // Create permission + case CREATE: + systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); + break; + + // Fail if unexpected type encountered + default: + assert false : "Unsupported type: " + permission.getType(); + + } + } + + } // end for each system permission + + // Finally, insert any NEW system permissions for this user + for (String systemPermissionType : systemPermissionTypes) { + + // Insert permission + SystemPermissionKey newSystemPermission = new SystemPermissionKey(); + newSystemPermission.setUser_id(user.getUserID()); + newSystemPermission.setPermission(systemPermissionType); + systemPermissionDAO.insert(newSystemPermission); + + } + + }/** + * Delete system permissions for a given user. All permissions in + * the given list will be removed from the user. + * + * @param permissions The permissions the given user should no longer have + * when this operation completes. + * @param user The user whose permissions should be updated. + */ + private void deleteSystemPermissions(Collection permissions, + MySQLUser user) { + + if(permissions.isEmpty()) + return; + // Build list of requested system permissions List systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) { @@ -480,34 +633,13 @@ public class UserDirectory implements Directory existingPermissions = systemPermissionDAO.selectByExample(systemPermissionExample); - Set existingPermissionTypes = new HashSet(); - for (SystemPermissionKey existingPermission : existingPermissions) - existingPermissionTypes.add(existingPermission.getPermission()); - - // Finally, insert any NEW system permissions for this user - for (String systemPermissionType : systemPermissionTypes) { - - // Do not insert the permission if it already exists - if (existingPermissionTypes.contains(systemPermissionType)) - continue; - - // Insert permission - SystemPermissionKey newSystemPermission = new SystemPermissionKey(); - newSystemPermission.setUser_id(user.getUserID()); - newSystemPermission.setPermission(systemPermissionType); - systemPermissionDAO.insert(newSystemPermission); - + // Finally, delete the requested system permissions for this user + if(!systemPermissionTypes.isEmpty()) { + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(user.getUserID()) + .andPermissionIn(systemPermissionTypes); + systemPermissionDAO.deleteByExample(systemPermissionExample); } - } @Override From 9f1f1e8197603a16be490c9f3ae3eb11ff4e1782 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 25 Feb 2013 21:20:14 -0800 Subject: [PATCH 053/109] Ticket #269: The first user should have full access to himself as well. --- .../schema/guacamole-auth-mysql-create-default-user.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql index a50584d9f..87aac13ae 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql @@ -2,3 +2,8 @@ insert into guacamole_user values(1, 'guacadmin', x'AE97B20D5B24B2F18BE7921E3C0C insert into guacamole_system_permission values(1, 'CREATE_CONNECTION'); insert into guacamole_system_permission values(1, 'CREATE_USER'); + +insert into guacamole_user_permission values(1, 1, 'READ'); +insert into guacamole_user_permission values(1, 1, 'UPDATE'); +insert into guacamole_user_permission values(1, 1, 'DELETE'); +insert into guacamole_user_permission values(1, 1, 'ADMINISTER'); From 60a8d753c311e1055dd1ac66e4a60708fc12720e Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 21:56:04 -0800 Subject: [PATCH 054/109] Ticket #269: Actually add to removed permissions set, actually create removed/added permissions sets (MySQLUser). --- .../guacamole/net/auth/mysql/MySQLUser.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index 545327dfd..df5227b17 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -75,23 +75,23 @@ public class MySQLUser implements User { /** * The set of current permissions a user has. */ - Set permissions; + private Set permissions; /** * Any newly added permissions that have yet to be committed. */ - Set newPermissions; + private Set newPermissions = new HashSet(); /** * Any newly deleted permissions that have yet to be deleted. */ - Set removedPermissions; + private Set removedPermissions = new HashSet(); /** * Get the current set of permissions this user has. * @return the current set of permissions. */ - Set getCurrentPermissions() { + public Set getCurrentPermissions() { return permissions; } @@ -99,7 +99,7 @@ public class MySQLUser implements User { * Get any new permissions that have yet to be inserted. * @return the new set of permissions. */ - Set getNewPermissions() { + public Set getNewPermissions() { return newPermissions; } @@ -107,7 +107,7 @@ public class MySQLUser implements User { * Get any permissions that have not yet been deleted. * @return the permissions that need to be deleted. */ - Set getRemovedPermissions() { + public Set getRemovedPermissions() { return removedPermissions; } @@ -115,7 +115,7 @@ public class MySQLUser implements User { * Reset the new and removed permission sets after they are * no longer needed. */ - void resetPermissions() { + public void resetPermissions() { newPermissions.clear(); removedPermissions.clear(); } @@ -258,12 +258,14 @@ public class MySQLUser implements User { public void addPermission(Permission permission) throws GuacamoleException { permissions.add(permission); newPermissions.add(permission); + removedPermissions.remove(permission); } @Override public void removePermission(Permission permission) throws GuacamoleException { permissions.remove(permission); - removedPermissions.remove(permission); + newPermissions.remove(permission); + removedPermissions.add(permission); } @Override From eb466c7f70e3772e8dc448d7836601a65eb3e2ee Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 25 Feb 2013 21:56:33 -0800 Subject: [PATCH 055/109] Ticket #269: UserPermissionExample needs to be cleared before reuse. --- .../net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 05f8d933a..2262e37ed 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -703,7 +703,7 @@ public class UserDirectory implements Directory Date: Tue, 26 Feb 2013 00:05:34 -0800 Subject: [PATCH 056/109] Ticket #269: Fix user create/update/delete, fix permission update, reorganize. --- .../net/auth/mysql/ConnectionDirectory.java | 23 +- .../mysql/MySQLAuthenticationProvider.java | 35 ++- .../guacamole/net/auth/mysql/MySQLUser.java | 232 +++++++----------- .../net/auth/mysql/MySQLUserContext.java | 30 +-- .../net/auth/mysql/UserDirectory.java | 175 +++++++------ .../mysql/service/PermissionCheckService.java | 13 + .../auth/mysql/service/ProviderService.java | 26 +- .../net/auth/mysql/dao/UserMapper.xml | 5 +- 8 files changed, 293 insertions(+), 246 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 474309273..e665b77c8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -65,10 +65,10 @@ import org.mybatis.guice.transactional.Transactional; public class ConnectionDirectory implements Directory{ /** - * The user who this connection directory belongs to. + * The ID of the user who this connection directory belongs to. * Access is based on his/her permission settings. */ - private MySQLUser user; + private int user_id; @Inject PermissionCheckService permissionCheckUtility; @@ -87,16 +87,17 @@ public class ConnectionDirectory implements Directory{ /** * Set the user for this directory. - * @param user + * + * @param user_id The ID of the user owning this connection directory. */ - void init(MySQLUser user) { - this.user = user; + void init(int user_id) { + this.user_id = user_id; } @Transactional @Override public Connection get(String identifier) throws GuacamoleException { - permissionCheckUtility.verifyConnectionReadAccess(this.user.getUserID(), identifier); + permissionCheckUtility.verifyConnectionReadAccess(this.user_id, identifier); return providerUtility.getExistingMySQLConnection(identifier); } @@ -104,7 +105,7 @@ public class ConnectionDirectory implements Directory{ @Override public Set getIdentifiers() throws GuacamoleException { Set connectionNameSet = new HashSet(); - Set connections = permissionCheckUtility.getReadableConnections(this.user.getUserID()); + Set connections = permissionCheckUtility.getReadableConnections(this.user_id); for(MySQLConnection mySQLConnection : connections) { connectionNameSet.add(mySQLConnection.getIdentifier()); } @@ -114,7 +115,7 @@ public class ConnectionDirectory implements Directory{ @Transactional @Override public void add(Connection object) throws GuacamoleException { - permissionCheckUtility.verifyCreateConnectionPermission(this.user.getUserID()); + permissionCheckUtility.verifyCreateConnectionPermission(this.user_id); MySQLConnection mySQLConnection = providerUtility.getNewMySQLConnection(object); connectionDAO.insert(mySQLConnection.getConnection()); @@ -123,7 +124,7 @@ public class ConnectionDirectory implements Directory{ //finally, give the current user full access to the newly created connection. ConnectionPermissionKey newConnectionPermission = new ConnectionPermissionKey(); - newConnectionPermission.setUser_id(this.user.getUserID()); + newConnectionPermission.setUser_id(this.user_id); newConnectionPermission.setConnection_id(mySQLConnection.getConnectionID()); newConnectionPermission.setPermission(MySQLConstants.USER_READ); connectionPermissionDAO.insert(newConnectionPermission); @@ -205,7 +206,7 @@ public class ConnectionDirectory implements Directory{ @Transactional @Override public void update(Connection object) throws GuacamoleException { - permissionCheckUtility.verifyConnectionUpdateAccess(this.user.getUserID(), object.getIdentifier()); + permissionCheckUtility.verifyConnectionUpdateAccess(this.user_id, object.getIdentifier()); MySQLConnection mySQLConnection = providerUtility.getExistingMySQLConnection(object); connectionDAO.updateByPrimaryKey(mySQLConnection.getConnection()); @@ -216,7 +217,7 @@ public class ConnectionDirectory implements Directory{ @Transactional @Override public void remove(String identifier) throws GuacamoleException { - permissionCheckUtility.verifyConnectionDeleteAccess(this.user.getUserID(), identifier); + permissionCheckUtility.verifyConnectionDeleteAccess(this.user_id, identifier); MySQLConnection mySQLConnection = providerUtility.getExistingMySQLConnection(identifier); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 2ef1dc565..9229578d2 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -42,6 +42,7 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.name.Names; +import java.util.List; import java.util.Properties; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.AuthenticationProvider; @@ -54,6 +55,8 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; @@ -94,9 +97,39 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { if (credentials.getUsername() == null) return null; + // Get user DAO + UserMapper userDAO = injector.getInstance(UserMapper.class); + + // Query user + UserExample userExample = new UserExample(); + userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); + List users = userDAO.selectByExampleWithBLOBs(userExample); + + // The unique constraint on the table should prevent this. + if (users.size() > 1) + throw new GuacamoleException( + "Multiple users found with the same username: " + + credentials.getUsername()); + + // Check that a user was found + if (users.isEmpty()) + throw new GuacamoleException("No user found with the supplied credentials"); + + // Get first (and only) user + UserWithBLOBs user = users.get(0); + + // Get password service + PasswordEncryptionService passwordService = injector.getInstance(PasswordEncryptionService.class); + + // Check password, if invalid return null + if (!passwordService.checkCredentials(credentials, + user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) + return null; + MySQLUserContext context = injector.getInstance(MySQLUserContext.class); - context.init(credentials); + context.init(user.getUser_id()); return context; + } /** diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java index df5227b17..42809efdd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUser.java @@ -36,16 +36,12 @@ package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; -import java.io.UnsupportedEncodingException; import java.util.Collections; import java.util.HashSet; -import java.util.List; import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; -import net.sourceforge.guacamole.net.auth.Credentials; +import net.sourceforge.guacamole.net.auth.AbstractUser; import net.sourceforge.guacamole.net.auth.User; -import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; -import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; @@ -56,13 +52,13 @@ import net.sourceforge.guacamole.net.auth.permission.Permission; * A MySQL based implementation of the User object. * @author James Muehlner */ -public class MySQLUser implements User { - - private UserWithBLOBs user; - - @Inject - UserMapper userDAO; +public class MySQLUser extends AbstractUser { + /** + * The ID of this user in the database, if any. + */ + private Integer userID; + @Inject PasswordEncryptionService passwordUtility; @@ -75,7 +71,7 @@ public class MySQLUser implements User { /** * The set of current permissions a user has. */ - private Set permissions; + private Set permissions = new HashSet(); /** * Any newly added permissions that have yet to be committed. @@ -87,6 +83,49 @@ public class MySQLUser implements User { */ private Set removedPermissions = new HashSet(); + /** + * Creates a new, empty MySQLUser. + */ + public MySQLUser() { + } + + /** + * Initializes a new MySQLUser having the given username. + * + * @param name The name to assign to this MySQLUser. + */ + public void init(String name) { + setUsername(name); + } + + /** + * Initializes a new MySQLUser, copying all data from the given user + * object. + * + * @param user The user object to copy. + * @throws GuacamoleException If an error occurs while reading the user + * data in the given object. + */ + public void init(User user) throws GuacamoleException { + setUsername(user.getUsername()); + setPassword(user.getPassword()); + permissions.addAll(user.getPermissions()); + } + + /** + * Initializes a new MySQLUser initialized from the given data from the + * database. + * + * @param user The user object, as retrieved from the database. + */ + public void init(UserWithBLOBs user) { + this.userID = user.getUser_id(); + setUsername(user.getUsername()); + + permissions.addAll( + permissionCheckUtility.getAllPermissions(user.getUser_id())); + } + /** * Get the current set of permissions this user has. * @return the current set of permissions. @@ -121,127 +160,22 @@ public class MySQLUser implements User { } /** - * Create a default, empty user. + * Returns the ID of this user in the database, if it exists. + * + * @return The ID of this user in the database, or null if this user + * was not retrieved from the database. */ - MySQLUser() { - user = new UserWithBLOBs(); - permissions = new HashSet(); + public Integer getUserID() { + return userID; } /** - * Create the user, throwing an exception if the credentials do not match what's in the database. - * @param credentials - * @throws GuacamoleException + * Sets the ID of this user to the given value. + * + * @param userID The ID to assign to this user. */ - void init(Credentials credentials) throws GuacamoleException { - - // Query user - UserExample userExample = new UserExample(); - userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); - List users = userDAO.selectByExampleWithBLOBs(userExample); - - // The unique constraint on the table should prevent this. - if (users.size() > 1) - throw new GuacamoleException( - "Multiple users found with the same username: " - + credentials.getUsername()); - - // Check that a user was found - if (users.isEmpty()) - throw new GuacamoleException("No user found with the supplied credentials"); - - // Get first (and only) user - user = users.get(0); - - // Check password - if (!passwordUtility.checkCredentials(credentials, - user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) - throw new GuacamoleException("No user found with the supplied credentials"); - - // Init permissions - this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); - - } - - /** - * Create a new user from the provided information. This represents a user that has not yet been inserted. - * @param user - * @throws GuacamoleException - */ - public void initNew (User user) throws GuacamoleException { - this.setPassword(user.getPassword()); - this.setUsername(user.getUsername()); - this.permissions = user.getPermissions(); - } - - /** - * Loads a user by username. - * @param userName - * @throws GuacamoleException - */ - public void initExisting (String username) throws GuacamoleException { - UserExample example = new UserExample(); - example.createCriteria().andUsernameEqualTo(username); - List userList = userDAO.selectByExampleWithBLOBs(example); - if(userList.size() > 1) // this should never happen; the unique constraint should prevent it - throw new GuacamoleException("Multiple users found with username '" + username + "'."); - if(userList.isEmpty()) - throw new GuacamoleException("No user found with username '" + username + "'."); - - this.user = userList.get(0); - this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); - } - - /** - * Initialize from a database record. - * @param user - */ - public void init(UserWithBLOBs user) { - this.user = user; - this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); - } - - /** - * Get the user id. - * @return - */ - public int getUserID() { - return user.getUser_id(); - } - - /** - * Return the database record held by this object. - * @return - */ - public UserWithBLOBs getUser() { - return user; - } - - @Override - public String getUsername() { - return user.getUsername(); - } - - @Override - public void setUsername(String username) { - user.setUsername(username); - } - - @Override - public String getPassword() { - try { - return new String(user.getPassword_hash(), "UTF-8"); - } catch (UnsupportedEncodingException ex) { - throw new RuntimeException(ex); // should not happen - } - } - - @Override - public void setPassword(String password) { - byte[] salt = saltUtility.generateSalt(); - user.setPassword_salt(salt); - byte[] hash = passwordUtility.createPasswordHash(password, salt); - user.setPassword_hash(hash); + public void setUserID(Integer userID) { + this.userID = userID; } @Override @@ -268,22 +202,32 @@ public class MySQLUser implements User { removedPermissions.add(permission); } - @Override - public boolean equals(Object other) { - if(!(other instanceof MySQLUser)) - return false; - boolean idsAreEqual = ((MySQLUser)other).getUserID() == this.getUserID(); - // they are both new, check if they have the same name - if(idsAreEqual && this.getUserID() == 0) - return this.getUsername().equals(((MySQLUser)other).getUsername()); - return idsAreEqual; + /** + * Converts this MySQLUser into an object that can be inserted/updated + * into the database. Beware that this object does not have associated + * permissions. The permissions of this MySQLUser must be dealt with + * separately. + * + * @return A new UserWithBLOBs containing all associated data of this + * MySQLUser. + */ + public UserWithBLOBs toUserWithBLOBs() { + + // Create new user + UserWithBLOBs user = new UserWithBLOBs(); + user.setUser_id(userID); + user.setUsername(getUsername()); + + // Set password if specified + if (getPassword() != null) { + byte[] salt = saltUtility.generateSalt(); + user.setPassword_salt(salt); + user.setPassword_hash( + passwordUtility.createPasswordHash(getPassword(), salt)); + } + + return user; + } - @Override - public int hashCode() { - int hash = 7; - hash = 73 * hash + getUserID(); - hash = 73 * hash + getUsername().hashCode(); - return hash; - } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 60f8a618b..b4b016230 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -40,10 +40,10 @@ package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Connection; -import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.UserContext; +import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; /** * The MySQL representation of a UserContext. @@ -52,11 +52,10 @@ import net.sourceforge.guacamole.net.auth.UserContext; public class MySQLUserContext implements UserContext { /** - * The user owning this context. The permissions of this user dictate - * the access given via the user and connection directories. + * The ID of the user owning this context. The permissions of this user + * dictate the access given via the user and connection directories. */ - @Inject - private MySQLUser user; + private int user_id; /** * User directory restricted by the permissions of the user associated @@ -72,23 +71,26 @@ public class MySQLUserContext implements UserContext { @Inject private ConnectionDirectory connectionDirectory; + /** + * Service for retrieving existing objects or creating new ones. + */ + @Inject + private ProviderService providerService; + /** * Initializes the user and directories associated with this context. * - * @param credentials The credentials of the user owning this context. - * @throws GuacamoleException If the credentials given are not valid, - * or an error occurs while initializing the - * directories. + * @param user_id The ID of the user owning this context. */ - void init(Credentials credentials) throws GuacamoleException { - user.init(credentials); - userDirectory.init(user); - connectionDirectory.init(user); + void init(int user_id) { + this.user_id = user_id; + userDirectory.init(user_id); + connectionDirectory.init(user_id); } @Override public User self() { - return user; + return providerService.getExistingMySQLUser(user_id); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 2262e37ed..afe4e835d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -64,8 +64,11 @@ import net.sourceforge.guacamole.net.auth.mysql.model.User; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; +import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; +import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; @@ -81,10 +84,10 @@ import org.mybatis.guice.transactional.Transactional; public class UserDirectory implements Directory { /** - * The user who this user directory belongs to. + * The ID of the user who this user directory belongs to. * Access is based on his/her permission settings. */ - private MySQLUser user; + private int user_id; /** * DAO for accessing users, which will be injected. @@ -128,22 +131,28 @@ public class UserDirectory implements Directory getIdentifiers() throws GuacamoleException { // Get set of all readable users - Set users = permissionCheckUtility.getReadableUsers(user.getUserID()); + Set users = permissionCheckUtility.getReadableUsers(this.user_id); // Build set of usernames of readable users Set userNameSet = new HashSet(); @@ -168,20 +177,30 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { // Partition given permissions by permission type List newUserPermissions = new ArrayList(); List newConnectionPermissions = new ArrayList(); List newSystemPermissions = new ArrayList(); - for (Permission permission : user.getNewPermissions()) { + for (Permission permission : permissions) { if (permission instanceof UserPermission) newUserPermissions.add((UserPermission) permission); @@ -228,13 +247,23 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { // Partition given permissions by permission type List removedUserPermissions = new ArrayList(); List removedConnectionPermissions = new ArrayList(); List removedSystemPermissions = new ArrayList(); - for (Permission permission : user.getRemovedPermissions()) { + for (Permission permission : permissions) { if (permission instanceof UserPermission) removedUserPermissions.add((UserPermission) permission); @@ -246,19 +275,11 @@ public class UserDirectory implements Directory permissions, - MySQLUser user) + int user_id) throws GuacamoleException { if(permissions.isEmpty()) @@ -279,7 +300,7 @@ public class UserDirectory implements Directory administerableUsers = - permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); + permissionCheckUtility.getAdministerableUserIDs(this.user_id); // Get list of usernames for all given user permissions. List usernames = new ArrayList(); @@ -310,15 +331,15 @@ public class UserDirectory implements Directory permissions, - MySQLUser user) + int user_id) throws GuacamoleException { if(permissions.isEmpty()) @@ -341,7 +362,7 @@ public class UserDirectory implements Directory administerableUsers = - permissionCheckUtility.getAdministerableUserIDs(this.user.getUserID()); + permissionCheckUtility.getAdministerableUserIDs(this.user_id); // Get list of usernames for all given user permissions. List usernames = new ArrayList(); @@ -375,14 +396,14 @@ public class UserDirectory implements Directory permissions, MySQLUser user) + Collection permissions, int user_id) throws GuacamoleException { if(permissions.isEmpty()) @@ -407,7 +428,7 @@ public class UserDirectory implements Directory administerableConnections = - permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); + permissionCheckUtility.getAdministerableConnectionIDs(this.user_id); // Build list of affected connection names from the permissions given List connectionNames = new ArrayList(); @@ -439,8 +460,8 @@ public class UserDirectory implements Directory permissions, - MySQLUser user) + int user_id) throws GuacamoleException { if(permissions.isEmpty()) @@ -471,7 +492,7 @@ public class UserDirectory implements Directory administerableConnections = - permissionCheckUtility.getAdministerableConnectionIDs(this.user.getUserID()); + permissionCheckUtility.getAdministerableConnectionIDs(this.user_id); // Get list of identifiers for all given user permissions. List identifiers = new ArrayList(); @@ -505,14 +526,14 @@ public class UserDirectory implements Directory permissions, - MySQLUser user) { + int user_id) { if(permissions.isEmpty()) return; @@ -575,22 +596,24 @@ public class UserDirectory implements Directory permissions, - MySQLUser user) { + int user_id) { if(permissions.isEmpty()) return; @@ -636,7 +659,7 @@ public class UserDirectory implements Directory getUsers(int userID, String permissionType) { + + // Get all IDs of all users that the given user can perform the given + // operation on Set affectedUserIDs = getUserIDs(userID, permissionType); + + // If no affected users at all, return empty set + if (affectedUserIDs.isEmpty()) + return Collections.EMPTY_SET; + + // Query corresponding user data for each retrieved ID UserExample example = new UserExample(); example.createCriteria().andUser_idIn(Lists.newArrayList(affectedUserIDs)); List userDBOjects = userDAO.selectByExampleWithBLOBs(example); + + // Build set of MySQLUsers from retrieved user data Set affectedUsers = new HashSet(); for(UserWithBLOBs affectedUser : userDBOjects) { MySQLUser mySQLUser = mySQLUserProvider.get(); @@ -387,6 +399,7 @@ public class PermissionCheckService { } return affectedUsers; + } /** diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java index f2a2629da..aeed45914 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java @@ -38,6 +38,7 @@ package net.sourceforge.guacamole.net.auth.mysql.service; import com.google.inject.Inject; import com.google.inject.Provider; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Connection; @@ -90,7 +91,7 @@ public class ProviderService { */ public MySQLUser getNewMySQLUser(User user) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.initNew(user); + mySQLUser.init(user); return mySQLUser; } @@ -111,9 +112,19 @@ public class ProviderService { * @throws GuacamoleException */ public MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { - MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.initExisting(name); - return mySQLUser; + + // Query user by ID + UserExample example = new UserExample(); + example.createCriteria().andUsernameEqualTo(name); + List users = userDAO.selectByExampleWithBLOBs(example); + + // If no user found, return null + if(users.isEmpty()) + return null; + + // Otherwise, return found user + return getExistingMySQLUser(users.get(0)); + } /** @@ -133,12 +144,19 @@ public class ProviderService { * @return the existing MySQLUser object if found, null if not. */ public MySQLUser getExistingMySQLUser(Integer id) { + + // Query user by ID UserExample example = new UserExample(); example.createCriteria().andUser_idEqualTo(id); List users = userDAO.selectByExampleWithBLOBs(example); + + // If no user found, return null if(users.isEmpty()) return null; + + // Otherwise, return found user return getExistingMySQLUser(users.get(0)); + } diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml index 47758e3bb..9c5255aea 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml @@ -186,6 +186,9 @@ password_salt) values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, #{password_salt,jdbcType=BINARY}) + + select last_insert_id(); + select - from guacamole.guacamole_connection_history + from guacamole_connection_history where history_id = #{history_id,jdbcType=INTEGER} @@ -125,7 +125,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection_history + delete from guacamole_connection_history where history_id = #{history_id,jdbcType=INTEGER} @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection_history + delete from guacamole_connection_history @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection_history (history_id, user_id, connection_id, + insert into guacamole_connection_history (history_id, user_id, connection_id, start_date, end_date) values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP}) @@ -156,7 +156,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection_history + insert into guacamole_connection_history history_id, @@ -198,7 +198,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_connection_history + select count(*) from guacamole_connection_history @@ -209,7 +209,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_history + update guacamole_connection_history history_id = #{record.history_id,jdbcType=INTEGER}, @@ -237,7 +237,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_history + update guacamole_connection_history set history_id = #{record.history_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -253,7 +253,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_history + update guacamole_connection_history user_id = #{user_id,jdbcType=INTEGER}, @@ -276,7 +276,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_history + update guacamole_connection_history set user_id = #{user_id,jdbcType=INTEGER}, connection_id = #{connection_id,jdbcType=INTEGER}, start_date = #{start_date,jdbcType=TIMESTAMP}, diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml index 548d05b57..5e07c94c7 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole.guacamole_connection + from guacamole_connection @@ -114,7 +114,7 @@ --> select - from guacamole.guacamole_connection + from guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection + delete from guacamole_connection where connection_id = #{connection_id,jdbcType=INTEGER} @@ -132,7 +132,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection + delete from guacamole_connection @@ -143,7 +143,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection (connection_id, connection_name, protocol + insert into guacamole_connection (connection_id, connection_name, protocol ) values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} ) @@ -157,7 +157,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection + insert into guacamole_connection connection_id, @@ -187,7 +187,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_connection + select count(*) from guacamole_connection @@ -198,7 +198,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection + update guacamole_connection connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -220,7 +220,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection + update guacamole_connection set connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_name = #{record.connection_name,jdbcType=VARCHAR}, protocol = #{record.protocol,jdbcType=VARCHAR} @@ -234,7 +234,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection + update guacamole_connection connection_name = #{connection_name,jdbcType=VARCHAR}, @@ -251,7 +251,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection + update guacamole_connection set connection_name = #{connection_name,jdbcType=VARCHAR}, protocol = #{protocol,jdbcType=VARCHAR} where connection_id = #{connection_id,jdbcType=INTEGER} diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml index b609b0f4d..ea84a1212 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole.guacamole_connection_parameter + from guacamole_connection_parameter @@ -114,7 +114,7 @@ --> select - from guacamole.guacamole_connection_parameter + from guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} @@ -124,7 +124,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection_parameter + delete from guacamole_connection_parameter where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection_parameter + delete from guacamole_connection_parameter @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection_parameter (connection_id, parameter_name, parameter_value + insert into guacamole_connection_parameter (connection_id, parameter_name, parameter_value ) values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} ) @@ -156,7 +156,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection_parameter + insert into guacamole_connection_parameter connection_id, @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_connection_parameter + select count(*) from guacamole_connection_parameter @@ -197,7 +197,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_parameter + update guacamole_connection_parameter connection_id = #{record.connection_id,jdbcType=INTEGER}, @@ -219,7 +219,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_parameter + update guacamole_connection_parameter set connection_id = #{record.connection_id,jdbcType=INTEGER}, parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, parameter_value = #{record.parameter_value,jdbcType=VARCHAR} @@ -233,7 +233,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_parameter + update guacamole_connection_parameter parameter_value = #{parameter_value,jdbcType=VARCHAR}, @@ -248,7 +248,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_parameter + update guacamole_connection_parameter set parameter_value = #{parameter_value,jdbcType=VARCHAR} where connection_id = #{connection_id,jdbcType=INTEGER} and parameter_name = #{parameter_name,jdbcType=VARCHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml index 3e7afd7ff..0d4c2ae28 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole.guacamole_connection_permission + from guacamole_connection_permission @@ -112,7 +112,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection_permission + delete from guacamole_connection_permission where user_id = #{user_id,jdbcType=INTEGER} and connection_id = #{connection_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_connection_permission + delete from guacamole_connection_permission @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection_permission (user_id, connection_id, permission + insert into guacamole_connection_permission (user_id, connection_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_connection_permission + insert into guacamole_connection_permission user_id, @@ -175,7 +175,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_connection_permission + select count(*) from guacamole_connection_permission @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_permission + update guacamole_connection_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -208,7 +208,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_connection_permission + update guacamole_connection_permission set user_id = #{record.user_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml index 8de2c4992..4818b4527 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml @@ -97,7 +97,7 @@ distinct - from guacamole.guacamole_system_permission + from guacamole_system_permission @@ -111,7 +111,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_system_permission + delete from guacamole_system_permission where user_id = #{user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -121,7 +121,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_system_permission + delete from guacamole_system_permission @@ -132,7 +132,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_system_permission (user_id, permission) + insert into guacamole_system_permission (user_id, permission) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) @@ -141,7 +141,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_system_permission + insert into guacamole_system_permission user_id, @@ -165,7 +165,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_system_permission + select count(*) from guacamole_system_permission @@ -176,7 +176,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_system_permission + update guacamole_system_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -195,7 +195,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_system_permission + update guacamole_system_permission set user_id = #{record.user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml index 9c5255aea..74e01b9f5 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml @@ -116,7 +116,7 @@ , - from guacamole.guacamole_user + from guacamole_user @@ -135,7 +135,7 @@ distinct - from guacamole.guacamole_user + from guacamole_user @@ -153,7 +153,7 @@ , - from guacamole.guacamole_user + from guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -162,7 +162,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_user + delete from guacamole_user where user_id = #{user_id,jdbcType=INTEGER} @@ -171,7 +171,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_user + delete from guacamole_user @@ -182,7 +182,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_user (user_id, username, password_hash, + insert into guacamole_user (user_id, username, password_hash, password_salt) values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, #{password_salt,jdbcType=BINARY}) @@ -196,7 +196,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_user + insert into guacamole_user user_id, @@ -232,7 +232,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_user + select count(*) from guacamole_user @@ -243,7 +243,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user + update guacamole_user user_id = #{record.user_id,jdbcType=INTEGER}, @@ -268,7 +268,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user + update guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR}, password_hash = #{record.password_hash,jdbcType=BINARY}, @@ -283,7 +283,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user + update guacamole_user set user_id = #{record.user_id,jdbcType=INTEGER}, username = #{record.username,jdbcType=VARCHAR} @@ -296,7 +296,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user + update guacamole_user username = #{username,jdbcType=VARCHAR}, @@ -316,7 +316,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user + update guacamole_user set username = #{username,jdbcType=VARCHAR}, password_hash = #{password_hash,jdbcType=BINARY}, password_salt = #{password_salt,jdbcType=BINARY} @@ -328,7 +328,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user + update guacamole_user set username = #{username,jdbcType=VARCHAR} where user_id = #{user_id,jdbcType=INTEGER} diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml index e8836b833..bd4b12ec6 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml @@ -98,7 +98,7 @@ distinct - from guacamole.guacamole_user_permission + from guacamole_user_permission @@ -112,7 +112,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_user_permission + delete from guacamole_user_permission where user_id = #{user_id,jdbcType=INTEGER} and affected_user_id = #{affected_user_id,jdbcType=INTEGER} and permission = #{permission,jdbcType=CHAR} @@ -123,7 +123,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - delete from guacamole.guacamole_user_permission + delete from guacamole_user_permission @@ -134,7 +134,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_user_permission (user_id, affected_user_id, permission + insert into guacamole_user_permission (user_id, affected_user_id, permission ) values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} ) @@ -145,7 +145,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - insert into guacamole.guacamole_user_permission + insert into guacamole_user_permission user_id, @@ -175,7 +175,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - select count(*) from guacamole.guacamole_user_permission + select count(*) from guacamole_user_permission @@ -186,7 +186,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user_permission + update guacamole_user_permission user_id = #{record.user_id,jdbcType=INTEGER}, @@ -208,7 +208,7 @@ This element is automatically generated by MyBatis Generator, do not modify. This element was generated on Tue Feb 19 23:09:22 PST 2013. --> - update guacamole.guacamole_user_permission + update guacamole_user_permission set user_id = #{record.user_id,jdbcType=INTEGER}, affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, permission = #{record.permission,jdbcType=CHAR} From 39a2d4eae7bb9a037d67be9481aa59bc6ec07c8f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 26 Feb 2013 21:17:57 -0800 Subject: [PATCH 072/109] Ticket #269: Add missing JavaDoc for MySQLConnection, remove whitespace at ends of lines. --- .../guacamole/net/auth/mysql/ConnectionDirectory.java | 6 +++--- .../guacamole/net/auth/mysql/MySQLConnection.java | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 894bc3499..abf5c43af 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -57,7 +57,7 @@ import org.mybatis.guice.transactional.Transactional; /** * A MySQL-based implementation of the connection directory. - * + * * @author James Muehlner */ public class ConnectionDirectory implements Directory{ @@ -171,7 +171,7 @@ public class ConnectionDirectory implements Directory{ /** * Inserts all parameter values from the given configuration into the * database, associating them with the connection having the givenID. - * + * * @param connection_id The ID of the connection to associate all * parameters with. * @param config The GuacamoleConfiguration to read parameters from. @@ -219,7 +219,7 @@ public class ConnectionDirectory implements Directory{ ConnectionParameterExample parameterExample = new ConnectionParameterExample(); parameterExample.createCriteria().andConnection_idEqualTo(connection.getConnection_id()); connectionParameterDAO.deleteByExample(parameterExample); - + // Add connection parameters createConfigurationValues(connection.getConnection_id(), object.getConfiguration()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 2eae0e17a..e54bc2a7f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -68,9 +68,15 @@ public class MySQLConnection extends AbstractConnection { */ private List history = new ArrayList(); + /** + * Service for creating and retrieving objects. + */ @Inject private ProviderService providerService; + /** + * Set of all currently active connections. + */ @Inject private ActiveConnectionSet activeConnectionSet; From 66fece64f43548ff0e1074109f912fccf77d3cd2 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 26 Feb 2013 21:24:09 -0800 Subject: [PATCH 073/109] Ticket #269: Do not requery connection when updating. --- .../guacamole/net/auth/mysql/ConnectionDirectory.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index abf5c43af..c9c928677 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -199,12 +199,15 @@ public class ConnectionDirectory implements Directory{ @Override public void update(Connection object) throws GuacamoleException { + // If connection not actually from this auth provider, we can't handle + // the update + if (!(object instanceof MySQLConnection)) + throw new GuacamoleException("Connection not from database."); + // Verify permission to update permissionCheckService.verifyConnectionUpdateAccess(this.user_id, object.getIdentifier()); - // TODO: Rely on update() to be given MySQLConnection - MySQLConnection mySQLConnection = - providerService.getExistingMySQLConnection(object); + MySQLConnection mySQLConnection = (MySQLConnection) object; // Create database object for insert net.sourceforge.guacamole.net.auth.mysql.model.Connection connection = From 64c2faa61dce593770676468d51421936cde9690 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 27 Feb 2013 16:19:51 -0800 Subject: [PATCH 074/109] Ticket #269: Refactor to support new SystemPermission organization (no more *DirectoryPermission classes). --- .../net/auth/mysql/UserDirectory.java | 91 ++++++------------- .../mysql/service/PermissionCheckService.java | 7 +- 2 files changed, 33 insertions(+), 65 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 3d96bfc3a..2aab36cdc 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -69,11 +69,9 @@ import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionServic import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; -import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; import net.sourceforge.guacamole.net.auth.permission.SystemPermission; -import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.UserPermission; import org.mybatis.guice.transactional.Transactional; @@ -572,36 +570,22 @@ public class UserDirectory implements Directory systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) { - // Connection directory permission - if (permission instanceof ConnectionDirectoryPermission) { - switch (permission.getType()) { + switch (permission.getType()) { - // Create permission - case CREATE: - systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); - break; + // Create connection permission + case CREATE_CONNECTION: + systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); + break; - // Fail if unexpected type encountered - default: - assert false : "Unsupported type: " + permission.getType(); + // Create user permission + case CREATE_USER: + systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); + break; - } - } + // Fail if unexpected type encountered + default: + assert false : "Unsupported type: " + permission.getType(); - // User directory permission - else if (permission instanceof UserDirectoryPermission) { - switch (permission.getType()) { - - // Create permission - case CREATE: - systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); - break; - - // Fail if unexpected type encountered - default: - assert false : "Unsupported type: " + permission.getType(); - - } } } // end for each system permission @@ -630,54 +614,39 @@ public class UserDirectory implements Directory permissions) { - if(permissions.isEmpty()) + if (permissions.isEmpty()) return; // Build list of requested system permissions List systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) { - // Connection directory permission - if (permission instanceof ConnectionDirectoryPermission) { - switch (permission.getType()) { + switch (permission.getType()) { - // Create permission - case CREATE: - systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); - break; + // Create connection permission + case CREATE_CONNECTION: + systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); + break; - // Fail if unexpected type encountered - default: - assert false : "Unsupported type: " + permission.getType(); + // Create user permission + case CREATE_USER: + systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); + break; - } - } + // Fail if unexpected type encountered + default: + assert false : "Unsupported type: " + permission.getType(); - // User directory permission - else if (permission instanceof UserDirectoryPermission) { - switch (permission.getType()) { - - // Create permission - case CREATE: - systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); - break; - - // Fail if unexpected type encountered - default: - assert false : "Unsupported type: " + permission.getType(); - - } } } // end for each system permission // Finally, delete the requested system permissions for this user - if(!systemPermissionTypes.isEmpty()) { - SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); - systemPermissionExample.createCriteria().andUser_idEqualTo(user_id) - .andPermissionIn(systemPermissionTypes); - systemPermissionDAO.deleteByExample(systemPermissionExample); - } + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(user_id) + .andPermissionIn(systemPermissionTypes); + systemPermissionDAO.deleteByExample(systemPermissionExample); + } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 96fbda867..02b5f084f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -65,10 +65,9 @@ import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; -import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; -import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; +import net.sourceforge.guacamole.net.auth.permission.SystemPermission; import net.sourceforge.guacamole.net.auth.permission.UserPermission; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; @@ -904,11 +903,11 @@ public class PermissionCheckService { // User creation permission if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) - allPermissions.add(new UserDirectoryPermission(UserDirectoryPermission.Type.CREATE)); + allPermissions.add(new SystemPermission(SystemPermission.Type.CREATE_USER)); // System creation permission else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) - allPermissions.add(new ConnectionDirectoryPermission(ConnectionDirectoryPermission.Type.CREATE)); + allPermissions.add(new SystemPermission(SystemPermission.Type.CREATE_CONNECTION)); } From c105b6261507ad04c91a8199baf6a7f8f8a67afc Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 27 Feb 2013 18:10:45 -0800 Subject: [PATCH 075/109] Ticket #269: Refactor all user access into UserService, remove usage of UserMapper outside UserService. --- .../mysql/MySQLAuthenticationProvider.java | 53 +-- .../net/auth/mysql/MySQLConnectionRecord.java | 17 +- .../net/auth/mysql/MySQLUserContext.java | 8 +- .../net/auth/mysql/UserDirectory.java | 143 ++----- .../mysql/service/PermissionCheckService.java | 52 +-- .../auth/mysql/service/ProviderService.java | 97 ----- .../net/auth/mysql/service/UserService.java | 382 ++++++++++++++++++ 7 files changed, 453 insertions(+), 299 deletions(-) create mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 25604baad..a1063dab8 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -42,7 +42,6 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.name.Names; -import java.util.List; import java.util.Properties; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.AuthenticationProvider; @@ -55,8 +54,6 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; -import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; @@ -65,6 +62,7 @@ import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; import net.sourceforge.guacamole.net.auth.mysql.service.SecureRandomSaltService; import net.sourceforge.guacamole.net.auth.mysql.service.Sha256PasswordEncryptionService; +import net.sourceforge.guacamole.net.auth.mysql.service.UserService; import net.sourceforge.guacamole.properties.GuacamoleProperties; import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; import org.mybatis.guice.MyBatisModule; @@ -93,43 +91,19 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { @Override public UserContext getUserContext(Credentials credentials) throws GuacamoleException { - // No null users in database - if (credentials.getUsername() == null) - return null; + // Get user service + UserService userService = injector.getInstance(UserService.class); + + // Get user + MySQLUser authenticatedUser = userService.retrieveUser(credentials); + if (authenticatedUser != null) { + MySQLUserContext context = injector.getInstance(MySQLUserContext.class); + context.init(authenticatedUser.getUserID()); + return context; + } - // Get user DAO - UserMapper userDAO = injector.getInstance(UserMapper.class); - - // Query user - UserExample userExample = new UserExample(); - userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); - List users = userDAO.selectByExampleWithBLOBs(userExample); - - // The unique constraint on the table should prevent this. - if (users.size() > 1) - throw new GuacamoleException( - "Multiple users found with the same username: " - + credentials.getUsername()); - - // Check that a user was found - if (users.isEmpty()) - throw new GuacamoleException("No user found with the supplied credentials"); - - // Get first (and only) user - UserWithBLOBs user = users.get(0); - - // Get password service - PasswordEncryptionService passwordService = - injector.getInstance(PasswordEncryptionService.class); - - // Check password, if invalid return null - if (!passwordService.checkPassword(credentials.getPassword(), - user.getPassword_hash(), user.getPassword_salt())) - return null; - - MySQLUserContext context = injector.getInstance(MySQLUserContext.class); - context.init(user.getUser_id()); - return context; + // Otherwise, unauthorized + return null; } @@ -192,6 +166,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(PasswordEncryptionService.class).to(Sha256PasswordEncryptionService.class); bind(PermissionCheckService.class); bind(ProviderService.class); + bind(UserService.class); bind(ConfigurationTranslationService.class); bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 552698cb3..499853792 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -42,10 +42,9 @@ import java.util.Date; import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.ConnectionRecord; import net.sourceforge.guacamole.net.auth.User; -import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; +import net.sourceforge.guacamole.net.auth.mysql.service.UserService; /** * A ConnectionRecord which is based on data stored in MySQL. @@ -60,16 +59,10 @@ public class MySQLConnectionRecord implements ConnectionRecord { private ConnectionHistory connectionHistory; /** - * DAO for accessing users. + * Service for accessing users. */ @Inject - private UserMapper userDAO; - - /** - * DAO for accessing connections. - */ - @Inject - private ConnectionMapper connectionDAO; + private UserService userService; /** * Service for creating and retrieving objects. @@ -100,7 +93,9 @@ public class MySQLConnectionRecord implements ConnectionRecord { @Override public User getUser() { - return providerService.getExistingMySQLUser(connectionHistory.getUser_id()); + // FIXME: This will be SLOW - history is queried in bulk. When listed + // to the user in the webapp, this will result in one query per record. + return userService.retrieveUser(connectionHistory.getUser_id()); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java index 308b9c4db..94cc3991e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLUserContext.java @@ -43,7 +43,7 @@ import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.UserContext; -import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; +import net.sourceforge.guacamole.net.auth.mysql.service.UserService; /** * The MySQL representation of a UserContext. @@ -72,10 +72,10 @@ public class MySQLUserContext implements UserContext { private ConnectionDirectory connectionDirectory; /** - * Service for retrieving existing objects or creating new ones. + * Service for accessing users. */ @Inject - private ProviderService providerService; + private UserService userService; /** * Initializes the user and directories associated with this context. @@ -90,7 +90,7 @@ public class MySQLUserContext implements UserContext { @Override public User self() { - return providerService.getExistingMySQLUser(user_id); + return userService.retrieveUser(user_id); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 2aab36cdc..22c12a242 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -52,7 +52,6 @@ import net.sourceforge.guacamole.net.auth.Directory; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.model.Connection; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; @@ -60,15 +59,12 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExampl import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; -import net.sourceforge.guacamole.net.auth.mysql.model.User; -import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; -import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; -import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; +import net.sourceforge.guacamole.net.auth.mysql.service.UserService; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; import net.sourceforge.guacamole.net.auth.permission.SystemPermission; @@ -88,10 +84,10 @@ public class UserDirectory implements Directory dbUsers = userDAO.selectByExample(userExample); + List users = userService.retrieveUsersByUsername(usernames); // Build map of found users, indexed by username - Map dbUserMap = new HashMap(); - for (User dbUser : dbUsers) { - dbUserMap.put(dbUser.getUsername(), dbUser); - } + Map userMap = new HashMap(); + for (MySQLUser user : users) + userMap.put(user.getUsername(), user); for (UserPermission permission : permissions) { // Get user - User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); - if (dbAffectedUser == null) + MySQLUser affectedUser = + userMap.get(permission.getObjectIdentifier()); + if (affectedUser == null) throw new GuacamoleException( "User '" + permission.getObjectIdentifier() + "' not found."); // Verify that the user actually has permission to administrate // every one of these users - if (!administerableUsers.contains(dbAffectedUser.getUser_id())) + if (!administerableUsers.contains(affectedUser.getUserID())) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate user " - + dbAffectedUser.getUser_id()); + + affectedUser.getUsername()); // Create new permission UserPermissionKey newPermission = new UserPermissionKey(); - newPermission.setAffected_user_id(dbAffectedUser.getUser_id()); + newPermission.setAffected_user_id(affectedUser.getUserID()); newPermission.setPermission(permission.getType().name()); newPermission.setUser_id(user_id); userPermissionDAO.insert(newPermission); @@ -383,35 +360,33 @@ public class UserDirectory implements Directory dbUsers = userDAO.selectByExample(userExample); + List users = userService.retrieveUsersByUsername(usernames); List userIDs = new ArrayList(); // Build map of found users, indexed by username - Map dbUserMap = new HashMap(); - for (User dbUser : dbUsers) { - dbUserMap.put(dbUser.getUsername(), dbUser); - userIDs.add(dbUser.getUser_id()); + Map userMap = new HashMap(); + for (MySQLUser user : users) { + userMap.put(user.getUsername(), user); + userIDs.add(user.getUserID()); } // Verify we have permission to delete each user permission. for (UserPermission permission : permissions) { // Get user - User dbAffectedUser = dbUserMap.get(permission.getObjectIdentifier()); - if (dbAffectedUser == null) + MySQLUser affectedUser = userMap.get(permission.getObjectIdentifier()); + if (affectedUser == null) throw new GuacamoleException( "User '" + permission.getObjectIdentifier() + "' not found."); // Verify that the user actually has permission to administrate // every one of these users - if (!administerableUsers.contains(dbAffectedUser.getUser_id())) + if (!administerableUsers.contains(affectedUser.getUserID())) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate user " - + dbAffectedUser.getUser_id()); + + affectedUser.getUsername()); } if(!userIDs.isEmpty()) { @@ -663,22 +638,9 @@ public class UserDirectory implements Directory userDBOjects = userDAO.selectByExampleWithBLOBs(example); - - // Build set of MySQLUsers from retrieved user data - Set affectedUsers = new HashSet(); - for(UserWithBLOBs affectedUser : userDBOjects) { - MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.init(affectedUser.getUsername()); - affectedUsers.add(mySQLUser); - } - - return affectedUsers; + return new HashSet(userService.retrieveUsersByID( + Lists.newArrayList(affectedUserIDs))); } @@ -803,21 +788,6 @@ public class PermissionCheckService { return connections.get(0); } - /** - * Get a user object by username. - * @param userName - * @return - */ - private User getUser(String username) { - UserExample example = new UserExample(); - example.createCriteria().andUsernameEqualTo(username); - List users = userDAO.selectByExample(example); - if(users.isEmpty()) - return null; - - return users.get(0); - } - /** * Get all permissions a given user has. * @param userID @@ -841,16 +811,14 @@ public class PermissionCheckService { affectedUserIDs.add(userPermission.getAffected_user_id()); // Query all affected users, store in map indexed by user ID - UserExample userExample = new UserExample(); - userExample.createCriteria().andUser_idIn(affectedUserIDs); - List users = userDAO.selectByExample(userExample); - Map userMap = new HashMap(); - for(User user : users) - userMap.put(user.getUser_id(), user); + List users = userService.retrieveUsersByID(affectedUserIDs); + Map userMap = new HashMap(); + for (MySQLUser user : users) + userMap.put(user.getUserID(), user); // Add user permissions for(UserPermissionKey userPermission : userPermissions) { - User affectedUser = userMap.get(userPermission.getAffected_user_id()); + MySQLUser affectedUser = userMap.get(userPermission.getAffected_user_id()); UserPermission newPermission = new UserPermission( UserPermission.Type.valueOf(userPermission.getPermission()), affectedUser.getUsername() diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java index c2f5b3902..a562a1629 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java @@ -42,22 +42,17 @@ import java.util.Collections; import java.util.List; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Connection; -import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnectionRecord; import net.sourceforge.guacamole.net.auth.mysql.MySQLGuacamoleSocket; -import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; -import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; -import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; @@ -67,9 +62,6 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; */ public class ProviderService { - @Inject - private UserMapper userDAO; - @Inject private ConnectionMapper connectionDAO; @@ -79,9 +71,6 @@ public class ProviderService { @Inject private ConnectionHistoryMapper connectionHistoryDAO; - @Inject - private Provider mySQLUserProvider; - @Inject private Provider mySQLConnectionProvider; @@ -91,92 +80,6 @@ public class ProviderService { @Inject private Provider mySQLGuacamoleSocketProvider; - /** - * Service for checking permissions. - */ - @Inject - private PermissionCheckService permissionCheckService; - - /** - * Create a new user based on the provided object. - * @param user - * @return the new MySQLUser object. - * @throws GuacamoleException - */ - public MySQLUser getNewMySQLUser(User user) throws GuacamoleException { - MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.init(user); - return mySQLUser; - } - - /** - * Get the user based on the username of the provided object. - * @param user - * @return the new MySQLUser object. - * @throws GuacamoleException - */ - public MySQLUser getExistingMySQLUser(User user) throws GuacamoleException { - return getExistingMySQLUser(user.getUsername()); - } - - /** - * Get the user based on the username of the provided object. - * @param name - * @return the new MySQLUser object. - * @throws GuacamoleException - */ - public MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { - - // Query user by ID - UserExample example = new UserExample(); - example.createCriteria().andUsernameEqualTo(name); - List users = userDAO.selectByExampleWithBLOBs(example); - - // If no user found, return null - if(users.isEmpty()) - return null; - - // Otherwise, return found user - return getExistingMySQLUser(users.get(0)); - - } - - /** - * Get an existing MySQLUser from a user database record. - * @param user - * @return the existing MySQLUser object. - */ - public MySQLUser getExistingMySQLUser(UserWithBLOBs user) { - MySQLUser mySQLUser = mySQLUserProvider.get(); - mySQLUser.init( - user.getUser_id(), - user.getUsername(), - null, - permissionCheckService.getAllPermissions(user.getUser_id()) - ); - - return mySQLUser; - } - - /** - * Get an existing MySQLUser from a user ID. - * @param id - * @return the existing MySQLUser object if found, null if not. - */ - public MySQLUser getExistingMySQLUser(Integer id) { - - // Query user by ID - UserWithBLOBs user = userDAO.selectByPrimaryKey(id); - - // If no user found, return null - if(user == null) - return null; - - // Otherwise, return found user - return getExistingMySQLUser(user); - - } - /** * Get the connection based on the connection name of the provided object. * @param connection diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java new file mode 100644 index 000000000..26fae323a --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -0,0 +1,382 @@ + +package net.sourceforge.guacamole.net.auth.mysql.service; + +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is guacamole-auth-mysql. + * + * The Initial Developer of the Original Code is + * James Muehlner. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +import com.google.inject.Inject; +import com.google.inject.Provider; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.Credentials; +import net.sourceforge.guacamole.net.auth.User; +import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; +import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; +import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; + +/** + * Service which provides convenience methods for creating, retrieving, and + * manipulating users. + * + * @author Michael Jumper, James Muehlner + */ +public class UserService { + + /** + * DAO for accessing users. + */ + @Inject + private UserMapper userDAO; + + /** + * DAO for accessing user permissions, which will be injected. + */ + @Inject + private UserPermissionMapper userPermissionDAO; + + /** + * DAO for accessing connection permissions, which will be injected. + */ + @Inject + private ConnectionPermissionMapper connectionPermissionDAO; + + /** + * DAO for accessing system permissions, which will be injected. + */ + @Inject + private SystemPermissionMapper systemPermissionDAO; + + /** + * Provider for creating users. + */ + @Inject + private Provider mySQLUserProvider; + + /** + * Service for checking permissions. + */ + @Inject + private PermissionCheckService permissionCheckService; + + /** + * Service for encrypting passwords. + */ + @Inject + private PasswordEncryptionService passwordService; + + /** + * Service for generating random salts. + */ + @Inject + private SaltService saltService; + + /** + * Create a new MySQLUser based on the provided User. + * + * @param user The User to use when populating the data of the given + * MySQLUser. + * @return A new MySQLUser object, populated with the data of the given + * user. + * + * @throws GuacamoleException If an error occurs while reading the data + * of the provided User. + */ + public MySQLUser toMySQLUser(User user) throws GuacamoleException { + MySQLUser mySQLUser = mySQLUserProvider.get(); + mySQLUser.init(user); + return mySQLUser; + } + + /** + * Create a new MySQLUser based on the provided database record. + * + * @param user The database record describing the user. + * @return A new MySQLUser object, populated with the data of the given + * database record. + */ + private MySQLUser toMySQLUser(UserWithBLOBs user) { + + // Retrieve user from provider + MySQLUser mySQLUser = mySQLUserProvider.get(); + + // Init with data from given database user + mySQLUser.init( + user.getUser_id(), + user.getUsername(), + null, + permissionCheckService.getAllPermissions(user.getUser_id()) + ); + + // Return new user + return mySQLUser; + + } + + /** + * Retrieves the user having the given ID from the database. + * + * @param id The ID of the user to retrieve. + * @return The existing MySQLUser object if found, null otherwise. + */ + public MySQLUser retrieveUser(Integer id) { + + // Query user by ID + UserWithBLOBs user = userDAO.selectByPrimaryKey(id); + + // If no user found, return null + if(user == null) + return null; + + // Otherwise, return found user + return toMySQLUser(user); + + } + + /** + * Retrieves the users having the given IDs from the database. + * + * @param ids The IDs of the users to retrieve. + * @return A list of existing MySQLUser objects. + */ + public List retrieveUsersByID(List ids) { + + // If no IDs given, just return empty list + if (ids.isEmpty()) + return Collections.EMPTY_LIST; + + // Query users by ID + UserExample example = new UserExample(); + example.createCriteria().andUser_idIn(ids); + List users = userDAO.selectByExampleWithBLOBs(example); + + // Convert to MySQLUser list + List mySQLUsers = new ArrayList(users.size()); + for (UserWithBLOBs user : users) + mySQLUsers.add(toMySQLUser(user)); + + // Return found users + return mySQLUsers; + + } + + /** + * Retrieves the users having the given usernames from the database. + * + * @param names The usernames of the users to retrieve. + * @return A list of existing MySQLUser objects. + */ + public List retrieveUsersByUsername(List names) { + + // If no names given, just return empty list + if (names.isEmpty()) + return Collections.EMPTY_LIST; + + // Query users by ID + UserExample example = new UserExample(); + example.createCriteria().andUsernameIn(names); + List users = userDAO.selectByExampleWithBLOBs(example); + + // Convert to MySQLUser list + List mySQLUsers = new ArrayList(users.size()); + for (UserWithBLOBs user : users) + mySQLUsers.add(toMySQLUser(user)); + + // Return found users + return mySQLUsers; + + } + + /** + * Retrieves the user having the given username from the database. + * + * @param name The username of the user to retrieve. + * @return The existing MySQLUser object if found, null otherwise. + */ + public MySQLUser retrieveUser(String name) { + + // Query user by ID + UserExample example = new UserExample(); + example.createCriteria().andUsernameEqualTo(name); + List users = userDAO.selectByExampleWithBLOBs(example); + + // If no user found, return null + if(users.isEmpty()) + return null; + + // Otherwise, return found user + return toMySQLUser(users.get(0)); + + } + + /** + * Retrieves the user corresponding to the given credentials from the + * database. + * + * @param credentials The credentials to use when locating the user. + * @return The existing MySQLUser object if the credentials given are + * valid, null otherwise. + */ + public MySQLUser retrieveUser(Credentials credentials) { + + // No null users in database + if (credentials.getUsername() == null) + return null; + + // Query user + UserExample userExample = new UserExample(); + userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); + List users = userDAO.selectByExampleWithBLOBs(userExample); + + // Check that a user was found + if (users.isEmpty()) + return null; + + // Assert only one user found + assert users.size() == 1 : "Multiple users with same username."; + + // Get first (and only) user + UserWithBLOBs user = users.get(0); + + // Check password, if invalid return null + if (!passwordService.checkPassword(credentials.getPassword(), + user.getPassword_hash(), user.getPassword_salt())) + return null; + + // Return found user + return toMySQLUser(user); + + } + + /** + * Creates a new user having the given username and password. + * + * @param username The username to assign to the new user. + * @param password The password to assign to the new user. + * @return A new MySQLUser containing the data of the newly created + * user. + */ + public MySQLUser createUser(String username, String password) { + + // Initialize database user + UserWithBLOBs user = new UserWithBLOBs(); + user.setUsername(username); + + // Set password if specified + if (password != null) { + byte[] salt = saltService.generateSalt(); + user.setPassword_salt(salt); + user.setPassword_hash( + passwordService.createPasswordHash(password, salt)); + } + + // Create user + userDAO.insert(user); + return toMySQLUser(user); + + } + + /** + * Deletes the user having the given username from the database + * @param username The username of the user to delete. + */ + public void deleteUser(String username) { + + // Get specified user + MySQLUser mySQLUser = retrieveUser(username); + int user_id = mySQLUser.getUserID(); + + // Delete all user permissions + UserPermissionExample userPermissionExample = new UserPermissionExample(); + userPermissionExample.createCriteria().andUser_idEqualTo(user_id); + userPermissionDAO.deleteByExample(userPermissionExample); + + // Delete all connection permissions + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria().andUser_idEqualTo(user_id); + connectionPermissionDAO.deleteByExample(connectionPermissionExample); + + // Delete all system permissions + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(user_id); + systemPermissionDAO.deleteByExample(systemPermissionExample); + + // Delete all permissions that refer to this user + userPermissionExample.clear(); + userPermissionExample.createCriteria().andAffected_user_idEqualTo(user_id); + userPermissionDAO.deleteByExample(userPermissionExample); + + // Delete the user in the database + userDAO.deleteByPrimaryKey(user_id); + + } + + + /** + * Updates the user in the database corresponding to the given MySQLUser. + * + * @param mySQLUser The MySQLUser to update (save) to the database. This + * user must already exist. + */ + public void updateUser(MySQLUser mySQLUser) { + + UserWithBLOBs user = new UserWithBLOBs(); + user.setUser_id(mySQLUser.getUserID()); + user.setUsername(mySQLUser.getUsername()); + + // Set password if specified + if (mySQLUser.getPassword() != null) { + byte[] salt = saltService.generateSalt(); + user.setPassword_salt(salt); + user.setPassword_hash( + passwordService.createPasswordHash(mySQLUser.getPassword(), salt)); + } + + // Update the user in the database + userDAO.updateByPrimaryKeySelective(user); + + } + + +} From c0d69860cbe3cd74b21d0ba7d7df078ca001df1d Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Wed, 27 Feb 2013 18:16:43 -0800 Subject: [PATCH 076/109] Ticket #269: Added new ADMINISTRATE permission to guacamole_system_permission. --- .../guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index 1c71c65e0..587ae6b0f 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -54,7 +54,7 @@ CREATE TABLE `guacamole_connection_permission` ( CREATE TABLE `guacamole_system_permission` ( `user_id` int(11) NOT NULL, - `permission` enum('CREATE_CONNECTION','CREATE_USER') NOT NULL, + `permission` enum('CREATE_CONNECTION','CREATE_USER','ADMINISTER') NOT NULL, PRIMARY KEY (`user_id`,`permission`), CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 695b05c14d9b3e5d6b2bd72a367b079b7b82c681 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 27 Feb 2013 22:43:24 -0800 Subject: [PATCH 077/109] Ticket #269: Remove unused ConfigurationTranslationService. --- .../mysql/MySQLAuthenticationProvider.java | 2 - .../ConfigurationTranslationService.java | 110 ------------------ 2 files changed, 112 deletions(-) delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConfigurationTranslationService.java diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index a1063dab8..7e630c9c2 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -55,7 +55,6 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; -import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; @@ -167,7 +166,6 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(PermissionCheckService.class); bind(ProviderService.class); bind(UserService.class); - bind(ConfigurationTranslationService.class); bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConfigurationTranslationService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConfigurationTranslationService.java deleted file mode 100644 index 87cd81cf7..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConfigurationTranslationService.java +++ /dev/null @@ -1,110 +0,0 @@ - -package net.sourceforge.guacamole.net.auth.mysql.service; - -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is guacamole-auth-mysql. - * - * The Initial Developer of the Original Code is - * James Muehlner. - * Portions created by the Initial Developer are Copyright (C) 2010 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -import java.util.ArrayList; -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; -import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; - -/** - * Provides functions for translating between GuacamoleConfiguration objects - * and a collection of ConnectionParameter database records. - * @author James Muehlner - */ -public class ConfigurationTranslationService { - - /** - * Get a GuacamoleConfiguration based on the provided protocol and - * parameters. - * - * @param protocol The protocol used (VNC, RDP, etc) - * @param parameters The parameter database records to translate - * @return A new GuacamoleConfiguration based on the given protocol and - * parameters. - */ - public GuacamoleConfiguration getConfiguration(String protocol, - Iterable parameters) { - - // Create new configuration, set protocol - GuacamoleConfiguration configuration = new GuacamoleConfiguration(); - configuration.setProtocol(protocol); - - // Copy parameters from given parameters - for(ConnectionParameter parameter : parameters) - configuration.setParameter(parameter.getParameter_name(), parameter.getParameter_value()); - - return configuration; - } - - /** - * Creates a list of ConnectionParameter database records based on the - * provided connectionID and GuacamoleConfiguration. - * - * @param connectionID The ID of the connection that these parameters are - * for. - * @param configuration The configuration to pull the parameter values from. - * @return A list of ConnectionParameter database records. - */ - public List getConnectionParameters(int connectionID, - GuacamoleConfiguration configuration) { - - List connectionParameters = - new ArrayList(); - - // Each connection parameter in the given configuration, create - // a corresponding database record - for (String parameterName : configuration.getParameterNames()) { - - // Get value of parameter - String parameterValue = configuration.getParameter(parameterName); - - // Create corresponding ConnectionParameter - ConnectionParameter connectionParameter = new ConnectionParameter(); - connectionParameter.setConnection_id(connectionID); - connectionParameter.setParameter_name(parameterName); - connectionParameter.setParameter_value(parameterValue); - - // Add parameter to list - connectionParameters.add(connectionParameter); - - } - - return connectionParameters; - } -} From 1f1b586ab3949602fd88fe50ac6ce3d47d4dcd7f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 27 Feb 2013 22:52:38 -0800 Subject: [PATCH 078/109] Ticket #269: Add support for system ADMINISTER permission. --- .../guacamole/net/auth/mysql/MySQLConstants.java | 6 ++++++ .../net/auth/mysql/service/PermissionCheckService.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index e7186cccf..623c622ab 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -105,4 +105,10 @@ public final class MySQLConstants { */ public static final String SYSTEM_CONNECTION_CREATE = "CREATE_CONNECTION"; + /** + * The string stored in the database to represent permission to administer + * the system as a whole. + */ + public static final String SYSTEM_ADMINISTER = "ADMINISTER"; + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 379416b05..1a44a5eef 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -877,6 +877,10 @@ public class PermissionCheckService { else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) allPermissions.add(new SystemPermission(SystemPermission.Type.CREATE_CONNECTION)); + // System administration permission + else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_ADMINISTER)) + allPermissions.add(new SystemPermission(SystemPermission.Type.ADMINISTER)); + } return allPermissions; From 88cae0c8e07be6693a6bc13807a7f1e070fcef5f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 27 Feb 2013 22:54:08 -0800 Subject: [PATCH 079/109] Remove whitespace at end of lines (again...) --- .../mysql/MySQLAuthenticationProvider.java | 2 +- .../net/auth/mysql/UserDirectory.java | 2 +- .../net/auth/mysql/service/UserService.java | 30 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index 7e630c9c2..c319d56d0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -92,7 +92,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { // Get user service UserService userService = injector.getInstance(UserService.class); - + // Get user MySQLUser authenticatedUser = userService.retrieveUser(credentials); if (authenticatedUser != null) { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 22c12a242..638d45c1c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -660,7 +660,7 @@ public class UserDirectory implements Directory Date: Wed, 27 Feb 2013 23:08:35 -0800 Subject: [PATCH 080/109] Ticket #269: retrieveUser() should take int, not Integer. --- .../guacamole/net/auth/mysql/service/UserService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index 7aafaecbb..c8dc0b4e5 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -160,7 +160,7 @@ public class UserService { * @param id The ID of the user to retrieve. * @return The existing MySQLUser object if found, null otherwise. */ - public MySQLUser retrieveUser(Integer id) { + public MySQLUser retrieveUser(int id) { // Query user by ID UserWithBLOBs user = userDAO.selectByPrimaryKey(id); From b67a074c4b8e81176352eeef70943bb647f413c9 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 27 Feb 2013 23:24:35 -0800 Subject: [PATCH 081/109] Ticket #269: Add missing period. --- .../guacamole/net/auth/mysql/service/UserService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index c8dc0b4e5..311a3b61a 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -318,7 +318,7 @@ public class UserService { } /** - * Deletes the user having the given username from the database + * Deletes the user having the given username from the database. * @param username The username of the user to delete. */ public void deleteUser(String username) { From bc41becdf3125fc5861b5477f7d1b04865475223 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 00:24:28 -0800 Subject: [PATCH 082/109] Ticket #269: Add ConnectionService, get rid of ProviderService. --- .../net/auth/mysql/ConnectionDirectory.java | 12 +- .../mysql/MySQLAuthenticationProvider.java | 4 +- .../net/auth/mysql/MySQLConnection.java | 38 +--- .../net/auth/mysql/MySQLConnectionRecord.java | 8 +- ...derService.java => ConnectionService.java} | 202 ++++++++++++------ 5 files changed, 154 insertions(+), 110 deletions(-) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/{ProviderService.java => ConnectionService.java} (53%) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index c9c928677..ad8e9c900 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -50,8 +50,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; -import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; import org.mybatis.guice.transactional.Transactional; @@ -75,10 +75,10 @@ public class ConnectionDirectory implements Directory{ private PermissionCheckService permissionCheckService; /** - * Service for creating and retrieving objects. + * Service managing connections. */ @Inject - private ProviderService providerService; + private ConnectionService connectionService; /** * Service for manipulating connections in the database. @@ -111,7 +111,7 @@ public class ConnectionDirectory implements Directory{ @Override public Connection get(String identifier) throws GuacamoleException { permissionCheckService.verifyConnectionReadAccess(this.user_id, identifier); - return providerService.getExistingMySQLConnection(identifier); + return connectionService.retrieveConnection(identifier); } @Transactional @@ -236,7 +236,9 @@ public class ConnectionDirectory implements Directory{ // Verify permission to delete permissionCheckService.verifyConnectionDeleteAccess(this.user_id, identifier); - MySQLConnection mySQLConnection = providerService.getExistingMySQLConnection(identifier); + // Get connection + MySQLConnection mySQLConnection = + connectionService.retrieveConnection(identifier); // Delete all configuration values ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample(); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index c319d56d0..ad7bf9034 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -55,9 +55,9 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; -import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; import net.sourceforge.guacamole.net.auth.mysql.service.SecureRandomSaltService; import net.sourceforge.guacamole.net.auth.mysql.service.Sha256PasswordEncryptionService; @@ -164,7 +164,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(SaltService.class).to(SecureRandomSaltService.class); bind(PasswordEncryptionService.class).to(Sha256PasswordEncryptionService.class); bind(PermissionCheckService.class); - bind(ProviderService.class); + bind(ConnectionService.class); bind(UserService.class); bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index e54bc2a7f..901d4d88f 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import java.util.ArrayList; @@ -41,14 +43,10 @@ import java.util.Collections; import java.util.List; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.GuacamoleSocket; -import net.sourceforge.guacamole.net.InetGuacamoleSocket; import net.sourceforge.guacamole.net.auth.AbstractConnection; import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.ConnectionRecord; -import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; -import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; -import net.sourceforge.guacamole.properties.GuacamoleProperties; -import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; +import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; @@ -69,10 +67,10 @@ public class MySQLConnection extends AbstractConnection { private List history = new ArrayList(); /** - * Service for creating and retrieving objects. + * Service for managing connections. */ @Inject - private ProviderService providerService; + private ConnectionService connectionService; /** * Set of all currently active connections. @@ -135,29 +133,7 @@ public class MySQLConnection extends AbstractConnection { @Override public GuacamoleSocket connect(GuacamoleClientInformation info) throws GuacamoleException { - - // If the current connection is active, and multiple simultaneous connections are not allowed. - if(GuacamoleProperties.getProperty(MySQLGuacamoleProperties.MYSQL_DISALLOW_SIMULTANEOUS_CONNECTIONS, false) - && activeConnectionSet.contains(getConnectionID())) - throw new GuacamoleException("Cannot connect. This connection is in use."); - - // Get guacd connection information - String host = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME); - int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT); - - // Get socket - GuacamoleSocket socket = providerService.getMySQLGuacamoleSocket( - new ConfiguredGuacamoleSocket( - new InetGuacamoleSocket(host, port), - getConfiguration() - ), - getConnectionID() - ); - - // Mark this connection as active - activeConnectionSet.add(getConnectionID()); - - return socket; + return connectionService.connect(this, info); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 499853792..334614f59 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -43,7 +43,7 @@ import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.ConnectionRecord; import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; -import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; +import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.net.auth.mysql.service.UserService; /** @@ -65,10 +65,10 @@ public class MySQLConnectionRecord implements ConnectionRecord { private UserService userService; /** - * Service for creating and retrieving objects. + * Service for accessing connections. */ @Inject - private ProviderService providerService; + private ConnectionService connectionService; /** * Initialize this MySQLConnectionRecord with the database record it @@ -100,7 +100,7 @@ public class MySQLConnectionRecord implements ConnectionRecord { @Override public Connection getConnection() { - return providerService.getExistingMySQLConnection(connectionHistory.getConnection_id()); + return connectionService.retrieveConnection(connectionHistory.getConnection_id()); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java similarity index 53% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index a562a1629..02e3c7f05 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ProviderService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -1,3 +1,6 @@ + +package net.sourceforge.guacamole.net.auth.mysql.service; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -33,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -package net.sourceforge.guacamole.net.auth.mysql.service; import com.google.inject.Inject; import com.google.inject.Provider; @@ -41,84 +43,135 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import net.sourceforge.guacamole.GuacamoleException; -import net.sourceforge.guacamole.net.auth.Connection; +import net.sourceforge.guacamole.net.GuacamoleSocket; +import net.sourceforge.guacamole.net.InetGuacamoleSocket; +import net.sourceforge.guacamole.net.auth.mysql.ActiveConnectionSet; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnectionRecord; import net.sourceforge.guacamole.net.auth.mysql.MySQLGuacamoleSocket; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.Connection; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; +import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; +import net.sourceforge.guacamole.properties.GuacamoleProperties; import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; +import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; /** - * Provides convenient provider methods for MySQL specific implementations. - * @author James Muehlner + * Service which provides convenience methods for creating, retrieving, and + * manipulating connections. + * + * @author Michael Jumper, James Muehlner */ -public class ProviderService { +public class ConnectionService { + /** + * DAO for accessing connections. + */ @Inject private ConnectionMapper connectionDAO; + /** + * DAO for accessing connection parameters. + */ @Inject private ConnectionParameterMapper connectionParameterDAO; + /** + * DAO for accessing connection history. + */ @Inject private ConnectionHistoryMapper connectionHistoryDAO; + /** + * Provider which creates MySQLConnections. + */ @Inject private Provider mySQLConnectionProvider; + /** + * Provider which creates MySQLConnectionRecords. + */ @Inject private Provider mySQLConnectionRecordProvider; + /** + * Provider which creates MySQLGuacamoleSockets. + */ @Inject private Provider mySQLGuacamoleSocketProvider; /** - * Get the connection based on the connection name of the provided object. - * @param connection - * @return the new Connection object. - * @throws GuacamoleException + * Set of all currently active connections. */ - public MySQLConnection getExistingMySQLConnection(Connection connection) throws GuacamoleException { - return getExistingMySQLConnection(connection.getIdentifier()); - } + @Inject + private ActiveConnectionSet activeConnectionSet; /** - * Get the connection based on the connection name of the provided object. - * @param name - * @return the new Connection object. - * @throws GuacamoleException + * Retrieves the connection having the given name from the database. + * + * @param name The name of the connection to return. + * @return The connection having the given name, or null if no such + * connection could be found. */ - public MySQLConnection getExistingMySQLConnection(String name) throws GuacamoleException { + public MySQLConnection retrieveConnection(String name) { - // Query connection by ID + // Query connection by connection identifier (name) ConnectionExample example = new ConnectionExample(); example.createCriteria().andConnection_nameEqualTo(name); - List connections = + List connections = connectionDAO.selectByExample(example); // If no connection found, return null if(connections.isEmpty()) return null; + // Assert only one connection found + assert connections.size() == 1 : "Multiple connections with same name."; + // Otherwise, return found connection - return getExistingMySQLConnection(connections.get(0)); + return toMySQLConnection(connections.get(0)); } /** - * Get an existing MySQLConnection from a connection database record. - * @param connection - * @return the existing MySQLConnection object. + * Retrieves the connection having the given ID from the database. + * + * @param id The ID of the connection to retrieve. + * @return The connection having the given ID, or null if no such + * connection was found. */ - public MySQLConnection getExistingMySQLConnection(net.sourceforge.guacamole.net.auth.mysql.model.Connection connection) { + public MySQLConnection retrieveConnection(int id) { + + // Query connection by ID + Connection connection = connectionDAO.selectByPrimaryKey(id); + + // If no connection found, return null + if(connection == null) + return null; + + // Otherwise, return found connection + return toMySQLConnection(connection); + + } + + /** + * Convert the given database-retrieved Connection into a MySQLConnection. + * The parameters of the given connection will be read and added to the + * MySQLConnection in the process. + * + * @param connection The connection to convert. + * @return A new MySQLConnection containing all data associated with the + * specified connection. + */ + private MySQLConnection toMySQLConnection(Connection connection) { // Build configuration GuacamoleConfiguration config = new GuacamoleConfiguration(); @@ -151,64 +204,77 @@ public class ProviderService { } /** - * Get an existing MySQLConnection from a connection ID. - * @param id - * @return the existing MySQLConnection object if found, null if not. + * Retrieves the history of the connection having the given ID. + * + * @param connectionID The ID of the connection to retrieve the history of. + * @return A list of MySQLConnectionRecord documenting the history of this + * connection. */ - public MySQLConnection getExistingMySQLConnection(Integer id) { + public List retrieveHistory(int connectionID) { - // Query connection by ID - net.sourceforge.guacamole.net.auth.mysql.model.Connection connection = - connectionDAO.selectByPrimaryKey(id); - - // If no connection found, return null - if(connection == null) - return null; - - // Otherwise, return found connection - return getExistingMySQLConnection(connection); - - } - - /** - * Gets a list of existing MySQLConnectionRecord from the database. These represent - * the history records of the connection. - * @param connectionID - * @return the list of MySQLConnectionRecord related to this connectionID. - */ - public List getExistingMySQLConnectionRecords(Integer connectionID) { + // Retrieve history records relating to given connection ID ConnectionHistoryExample example = new ConnectionHistoryExample(); example.createCriteria().andConnection_idEqualTo(connectionID); - // we want to return the newest records first + + // We want to return the newest records first example.setOrderByClause("start_date DESC"); + + // Retrieve all connection history entries List connectionHistories = connectionHistoryDAO.selectByExample(example); + + // Convert history entries to connection records List connectionRecords = new ArrayList(); for(ConnectionHistory history : connectionHistories) { - connectionRecords.add(getExistingMySQLConnectionRecord(history)); + + // Create connection record from history + MySQLConnectionRecord record = mySQLConnectionRecordProvider.get(); + record.init(history); + connectionRecords.add(record); + } + return connectionRecords; } /** - * Create a MySQLConnectionRecord object around a single ConnectionHistory database record. - * @param history - * @return the new MySQLConnectionRecord object. + * Create a MySQLGuacamoleSocket using the provided connection. + * + * @param connection The connection to use when connecting the socket. + * @param info The information to use when performing the connection + * handshake. + * @return The connected socket. + * @throws GuacamoleException If an error occurs while connecting the + * socket. */ - public MySQLConnectionRecord getExistingMySQLConnectionRecord(ConnectionHistory history) { - MySQLConnectionRecord record = mySQLConnectionRecordProvider.get(); - record.init(history); - return record; + public MySQLGuacamoleSocket connect(MySQLConnection connection, + GuacamoleClientInformation info) + throws GuacamoleException { + + // If the given connection is active, and multiple simultaneous + // connections are not allowed, disallow connection + if(GuacamoleProperties.getProperty( + MySQLGuacamoleProperties.MYSQL_DISALLOW_SIMULTANEOUS_CONNECTIONS, false) + && activeConnectionSet.contains(connection.getConnectionID())) + throw new GuacamoleException("Cannot connect. This connection is in use."); + + // Get guacd connection information + String host = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_HOSTNAME); + int port = GuacamoleProperties.getProperty(GuacamoleProperties.GUACD_PORT); + + // Get socket + GuacamoleSocket socket = new ConfiguredGuacamoleSocket( + new InetGuacamoleSocket(host, port), + connection.getConfiguration(), info + ); + + // Mark this connection as active + activeConnectionSet.add(connection.getConnectionID()); + + // Return new MySQLGuacamoleSocket + MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); + mySQLGuacamoleSocket.init(socket, connection.getConnectionID()); + return mySQLGuacamoleSocket; + } - /** - * Create a MySQLGuacamoleSocket using the provided ConfiguredGuacamoleSocket and connection ID. - * @param socket - * @param connectionID - * @return - */ - public MySQLGuacamoleSocket getMySQLGuacamoleSocket(ConfiguredGuacamoleSocket socket, int connectionID) { - MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); - mySQLGuacamoleSocket.init(socket, connectionID); - return mySQLGuacamoleSocket; - } } From a854b8f124da0d1b0d4ebb1d9e81fae91624bdf8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 00:51:15 -0800 Subject: [PATCH 083/109] Ticket #269: It's SHA, not Sha. --- ...ryptionService.java => SHA256PasswordEncryptionService.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/{Sha256PasswordEncryptionService.java => SHA256PasswordEncryptionService.java} (98%) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/Sha256PasswordEncryptionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/SHA256PasswordEncryptionService.java similarity index 98% rename from extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/Sha256PasswordEncryptionService.java rename to extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/SHA256PasswordEncryptionService.java index 4ac6eff93..04fea1ae7 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/Sha256PasswordEncryptionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/SHA256PasswordEncryptionService.java @@ -47,7 +47,7 @@ import javax.xml.bind.DatatypeConverter; * Provides a SHA-256 based implementation of the password encryption functionality. * @author James Muehlner */ -public class Sha256PasswordEncryptionService implements PasswordEncryptionService { +public class SHA256PasswordEncryptionService implements PasswordEncryptionService { @Override public boolean checkPassword(String password, byte[] hashedPassword, From cde665346b3a6e83e21ecef2392b45334436aee8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 01:41:20 -0800 Subject: [PATCH 084/109] Ticket #269: Move all use of ConnectionMapper to ConnectionService. --- .../net/auth/mysql/ConnectionDirectory.java | 37 ++---- .../mysql/MySQLAuthenticationProvider.java | 4 +- .../net/auth/mysql/UserDirectory.java | 49 ++++---- .../auth/mysql/service/ConnectionService.java | 119 ++++++++++++++++++ .../mysql/service/PermissionCheckService.java | 82 +++--------- 5 files changed, 170 insertions(+), 121 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index ad8e9c900..8b1e8a805 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -43,7 +43,6 @@ import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.Directory; -import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; @@ -80,12 +79,6 @@ public class ConnectionDirectory implements Directory{ @Inject private ConnectionService connectionService; - /** - * Service for manipulating connections in the database. - */ - @Inject - private ConnectionMapper connectionDAO; - /** * Service for manipulating connection permissions in the database. */ @@ -132,23 +125,19 @@ public class ConnectionDirectory implements Directory{ // Verify permission to create permissionCheckService.verifyCreateConnectionPermission(this.user_id); - // Create database object for insert - net.sourceforge.guacamole.net.auth.mysql.model.Connection connection = - new net.sourceforge.guacamole.net.auth.mysql.model.Connection(); - - connection.setConnection_name(object.getIdentifier()); - connection.setProtocol(object.getConfiguration().getProtocol()); - connectionDAO.insert(connection); + // Create connection + MySQLConnection connection = connectionService.createConnection( + object.getIdentifier(), object.getConfiguration().getProtocol()); // Add connection parameters - createConfigurationValues(connection.getConnection_id(), + createConfigurationValues(connection.getConnectionID(), object.getConfiguration()); // Finally, give the current user full access to the newly created // connection. ConnectionPermissionKey newConnectionPermission = new ConnectionPermissionKey(); newConnectionPermission.setUser_id(this.user_id); - newConnectionPermission.setConnection_id(connection.getConnection_id()); + newConnectionPermission.setConnection_id(connection.getConnectionID()); // Read permission newConnectionPermission.setPermission(MySQLConstants.CONNECTION_READ); @@ -208,23 +197,15 @@ public class ConnectionDirectory implements Directory{ permissionCheckService.verifyConnectionUpdateAccess(this.user_id, object.getIdentifier()); MySQLConnection mySQLConnection = (MySQLConnection) object; - - // Create database object for insert - net.sourceforge.guacamole.net.auth.mysql.model.Connection connection = - new net.sourceforge.guacamole.net.auth.mysql.model.Connection(); - - connection.setConnection_id(mySQLConnection.getConnectionID()); - connection.setConnection_name(object.getIdentifier()); - connection.setProtocol(object.getConfiguration().getProtocol()); - connectionDAO.updateByPrimaryKey(connection); + connectionService.updateConnection(mySQLConnection); // Delete old connection parameters ConnectionParameterExample parameterExample = new ConnectionParameterExample(); - parameterExample.createCriteria().andConnection_idEqualTo(connection.getConnection_id()); + parameterExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); connectionParameterDAO.deleteByExample(parameterExample); // Add connection parameters - createConfigurationValues(connection.getConnection_id(), + createConfigurationValues(mySQLConnection.getConnectionID(), object.getConfiguration()); } @@ -251,7 +232,7 @@ public class ConnectionDirectory implements Directory{ connectionPermissionDAO.deleteByExample(connectionPermissionExample); // Delete the connection itself - connectionDAO.deleteByPrimaryKey(mySQLConnection.getConnectionID()); + connectionService.deleteConnection(mySQLConnection.getConnectionID()); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java index ad7bf9034..e872df0a0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLAuthenticationProvider.java @@ -60,7 +60,7 @@ import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionServic import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; import net.sourceforge.guacamole.net.auth.mysql.service.SecureRandomSaltService; -import net.sourceforge.guacamole.net.auth.mysql.service.Sha256PasswordEncryptionService; +import net.sourceforge.guacamole.net.auth.mysql.service.SHA256PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.UserService; import net.sourceforge.guacamole.properties.GuacamoleProperties; import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; @@ -162,7 +162,7 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { bind(UserDirectory.class); bind(MySQLUser.class); bind(SaltService.class).to(SecureRandomSaltService.class); - bind(PasswordEncryptionService.class).to(Sha256PasswordEncryptionService.class); + bind(PasswordEncryptionService.class).to(SHA256PasswordEncryptionService.class); bind(PermissionCheckService.class); bind(ConnectionService.class); bind(UserService.class); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 638d45c1c..2db93fca1 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -49,18 +49,16 @@ import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.GuacamoleSecurityException; import net.sourceforge.guacamole.net.auth.Directory; -import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.model.Connection; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; +import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; @@ -90,10 +88,10 @@ public class UserDirectory implements Directory dbConnections = connectionDAO.selectByExample(connectionExample); + List connections = connectionService.retrieveConnectionsByName(connectionNames); // Build map of found connections, indexed by name - Map dbConnectionMap = new HashMap(); - for (Connection dbConnection : dbConnections) { - dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); - } + Map connectionMap = new HashMap(); + for (MySQLConnection connection : connections) + connectionMap.put(connection.getIdentifier(), connection); // Finally, insert the new permissions for (ConnectionPermission permission : permissions) { // Get permission - Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); - if (dbConnection == null) + MySQLConnection connection = connectionMap.get(permission.getObjectIdentifier()); + if (connection == null) throw new GuacamoleException( "Connection '" + permission.getObjectIdentifier() + "' not found."); // Throw exception if permission to administer this connection // is not granted - if (!administerableConnections.contains(dbConnection.getConnection_id())) + if (!administerableConnections.contains(connection.getConnectionID())) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate connection " - + dbConnection.getConnection_id()); + + connection.getIdentifier()); // Insert previously-non-existent connection permission ConnectionPermissionKey newPermission = new ConnectionPermissionKey(); - newPermission.setConnection_id(dbConnection.getConnection_id()); + newPermission.setConnection_id(connection.getConnectionID()); newPermission.setPermission(permission.getType().name()); newPermission.setUser_id(user_id); connectionPermissionDAO.insert(newPermission); @@ -488,35 +483,33 @@ public class UserDirectory implements Directory dbConnections = connectionDAO.selectByExample(connectionExample); + List connections = connectionService.retrieveConnectionsByName(identifiers); List connectionIDs = new ArrayList(); // Build map of found connections, indexed by identifier - Map dbConnectionMap = new HashMap(); - for (Connection dbConnection : dbConnections) { - dbConnectionMap.put(dbConnection.getConnection_name(), dbConnection); - connectionIDs.add(dbConnection.getConnection_id()); + Map connectionMap = new HashMap(); + for (MySQLConnection connection : connections) { + connectionMap.put(connection.getIdentifier(), connection); + connectionIDs.add(connection.getConnectionID()); } // Verify we have permission to delete each connection permission. for (ConnectionPermission permission : permissions) { // Get user - Connection dbConnection = dbConnectionMap.get(permission.getObjectIdentifier()); - if (dbConnection == null) + MySQLConnection connection = connectionMap.get(permission.getObjectIdentifier()); + if (connection == null) throw new GuacamoleException( "User '" + permission.getObjectIdentifier() + "' not found."); // Verify that the user actually has permission to administrate // every one of these connections - if (!administerableConnections.contains(dbConnection.getConnection_id())) + if (!administerableConnections.contains(connection.getConnectionID())) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate connection " - + dbConnection.getConnection_id()); + + connection.getIdentifier()); } if(!connectionIDs.isEmpty()) { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index 02e3c7f05..0cf9bc83e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -162,6 +162,60 @@ public class ConnectionService { } + /** + * Retrieves the connections having the given IDs from the database. + * + * @param ids The IDs of the connections to retrieve. + * @return A list of existing MySQLConnection objects. + */ + public List retrieveConnectionsByID(List ids) { + + // If no IDs given, just return empty list + if (ids.isEmpty()) + return Collections.EMPTY_LIST; + + // Query connections by ID + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_idIn(ids); + List connections = connectionDAO.selectByExample(example); + + // Convert to MySQLConnection list + List mySQLConnections = new ArrayList(connections.size()); + for (Connection connection : connections) + mySQLConnections.add(toMySQLConnection(connection)); + + // Return found connections + return mySQLConnections; + + } + + /** + * Retrieves the connections having the given names from the database. + * + * @param names The names of the connections to retrieve. + * @return A list of existing MySQLConnection objects. + */ + public List retrieveConnectionsByName(List names) { + + // If no names given, just return empty list + if (names.isEmpty()) + return Collections.EMPTY_LIST; + + // Query connections by ID + ConnectionExample example = new ConnectionExample(); + example.createCriteria().andConnection_nameIn(names); + List connections = connectionDAO.selectByExample(example); + + // Convert to MySQLConnection list + List mySQLConnections = new ArrayList(connections.size()); + for (Connection connection : connections) + mySQLConnections.add(toMySQLConnection(connection)); + + // Return found connections + return mySQLConnections; + + } + /** * Convert the given database-retrieved Connection into a MySQLConnection. * The parameters of the given connection will be read and added to the @@ -277,4 +331,69 @@ public class ConnectionService { } + /** + * Creates a new connection having the given name and protocol. + * + * @param name The name to assign to the new connection. + * @param protocol The protocol to assign to the new connection. + * @return A new MySQLConnection containing the data of the newly created + * connection. + */ + public MySQLConnection createConnection(String name, String protocol) { + + // Initialize database connection + Connection connection = new Connection(); + connection.setConnection_name(name); + connection.setProtocol(protocol); + + // Create connection + connectionDAO.insert(connection); + return toMySQLConnection(connection); + + } + + /** + * Deletes the connection having the given name from the database. + * @param name The name of the connection to delete. + */ + public void deleteConnection(String name) { + + // Get specified connection + MySQLConnection mySQLConnection = retrieveConnection(name); + int connection_id = mySQLConnection.getConnectionID(); + + // Delete the connection in the database + deleteConnection(connection_id); + + } + + /** + * Deletes the connection having the given ID from the database. + * @param id The ID of the connection to delete. + */ + public void deleteConnection(int id) { + connectionDAO.deleteByPrimaryKey(id); + } + + /** + * Updates the connection in the database corresponding to the given + * MySQLConnection. + * + * @param mySQLConnection The MySQLConnection to update (save) to the + * database. This connection must already exist. + */ + public void updateConnection(MySQLConnection mySQLConnection) { + + // Populate connection + Connection connection = new Connection(); + connection.setConnection_id(mySQLConnection.getConnectionID()); + connection.setConnection_name(mySQLConnection.getIdentifier()); + connection.setProtocol(mySQLConnection.getConfiguration().getProtocol()); + + // Update the connection in the database + connectionDAO.updateByPrimaryKeySelective(connection); + + } + + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 1a44a5eef..7957a379c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -37,7 +37,6 @@ package net.sourceforge.guacamole.net.auth.mysql.service; import com.google.common.collect.Lists; import com.google.inject.Inject; -import com.google.inject.Provider; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -49,12 +48,9 @@ import net.sourceforge.guacamole.GuacamoleSecurityException; import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; import net.sourceforge.guacamole.net.auth.mysql.MySQLConstants; import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; -import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.model.Connection; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; @@ -65,7 +61,6 @@ import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; import net.sourceforge.guacamole.net.auth.permission.SystemPermission; import net.sourceforge.guacamole.net.auth.permission.UserPermission; -import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; /** * A service to retrieve information about what objects a user has permission to. @@ -73,11 +68,17 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; */ public class PermissionCheckService { + /** + * Service for accessing users. + */ @Inject private UserService userService; + /** + * Service for accessing connections. + */ @Inject - private ConnectionMapper connectionDAO; + private ConnectionService connectionService; @Inject private UserPermissionMapper userPermissionDAO; @@ -88,12 +89,6 @@ public class PermissionCheckService { @Inject private SystemPermissionMapper systemPermissionDAO; - @Inject - private Provider mySQLUserProvider; - - @Inject - private Provider mySQLConnectionProvider; - /** * Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException. * @param userID @@ -581,9 +576,9 @@ public class PermissionCheckService { * @return */ private boolean checkConnectionAccess(int userID, String affectedConnectionName, String permissionType) { - Connection connection = getConnection(affectedConnectionName); + MySQLConnection connection = connectionService.retrieveConnection(affectedConnectionName); if(connection != null) - return checkConnectionAccess(userID, connection.getConnection_id(), permissionType); + return checkConnectionAccess(userID, connection.getConnectionID(), permissionType); return false; } @@ -684,33 +679,9 @@ public class PermissionCheckService { @Deprecated /* FIXME: Totally useless (we only ever need identifiers, and querying ALL CONNECTION DATA will take ages) */ private Set getConnections(int userID, String permissionType) { - // If connections available, query them Set affectedConnectionIDs = getConnectionIDs(userID, permissionType); - if (!affectedConnectionIDs.isEmpty()) { - - // Query available connections - ConnectionExample example = new ConnectionExample(); - example.createCriteria().andConnection_idIn(Lists.newArrayList(affectedConnectionIDs)); - List connectionDBOjects = connectionDAO.selectByExample(example); - - // Add connections to final set - Set affectedConnections = new HashSet(); - for(Connection affectedConnection : connectionDBOjects) { - MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); - mySQLConnection.init( - affectedConnection.getConnection_id(), - affectedConnection.getConnection_name(), - new GuacamoleConfiguration(), - Collections.EMPTY_LIST - ); - affectedConnections.add(mySQLConnection); - } - - return affectedConnections; - } - - // Otherwise, no connections available - return Collections.EMPTY_SET; + return new HashSet( + connectionService.retrieveConnectionsByID(Lists.newArrayList(affectedConnectionIDs))); } @@ -773,21 +744,6 @@ public class PermissionCheckService { return count > 0; } - /** - * Get a connection object by name. - * @param name - * @return - */ - private Connection getConnection(String name) { - ConnectionExample example = new ConnectionExample(); - example.createCriteria().andConnection_nameEqualTo(name); - List connections = connectionDAO.selectByExample(example); - if(connections.isEmpty()) - return null; - - return connections.get(0); - } - /** * Get all permissions a given user has. * @param userID @@ -843,19 +799,19 @@ public class PermissionCheckService { affectedConnectionIDs.add(connectionPermission.getConnection_id()); // Query connections, store in map indexed by connection ID - ConnectionExample connectionExample = new ConnectionExample(); - connectionExample.createCriteria().andConnection_idIn(affectedConnectionIDs); - List connections = connectionDAO.selectByExample(connectionExample); - Map connectionMap = new HashMap(); - for(Connection connection : connections) - connectionMap.put(connection.getConnection_id(), connection); + List connections = + connectionService.retrieveConnectionsByID(affectedConnectionIDs); + Map connectionMap = new HashMap(); + for(MySQLConnection connection : connections) + connectionMap.put(connection.getConnectionID(), connection); // Add connection permissions for(ConnectionPermissionKey connectionPermission : connectionPermissions) { - Connection affectedConnection = connectionMap.get(connectionPermission.getConnection_id()); + MySQLConnection affectedConnection = + connectionMap.get(connectionPermission.getConnection_id()); ConnectionPermission newPermission = new ConnectionPermission( ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), - affectedConnection.getConnection_name() + affectedConnection.getIdentifier() ); allPermissions.add(newPermission); } From 06b1d4df18370ba3233459f386570486ede7bb01 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 11:05:44 -0800 Subject: [PATCH 085/109] Ticket #269: Rely on ON CASCADE DELETE for deletion of entries related to connections and users. --- .../schema/guacamole-auth-mysql-schema.sql | 130 +++++++++++++----- .../net/auth/mysql/ConnectionDirectory.java | 11 -- .../net/auth/mysql/service/UserService.java | 20 --- 3 files changed, 96 insertions(+), 65 deletions(-) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql index 587ae6b0f..357885913 100644 --- a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql @@ -1,91 +1,153 @@ + -- --- Table structure for table `guacamole_connection` +-- Table of connections. Each connection has a name, protocol, and +-- associated set of parameters. -- CREATE TABLE `guacamole_connection` ( - `connection_id` int(11) NOT NULL AUTO_INCREMENT, + + `connection_id` int(11) NOT NULL AUTO_INCREMENT, `connection_name` varchar(128) NOT NULL, - `protocol` varchar(32) NOT NULL, + `protocol` varchar(32) NOT NULL, + PRIMARY KEY (`connection_id`), UNIQUE KEY `connection_name` (`connection_name`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --- Table structure for table `guacamole_user` +-- Table of users. Each user has a unique username and a hashed password +-- with corresponding salt. -- CREATE TABLE `guacamole_user` ( - `user_id` int(11) NOT NULL AUTO_INCREMENT, - `username` varchar(128) NOT NULL, - `password_hash` binary(32) NOT NULL, - `password_salt` binary(32) NOT NULL, + + `user_id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(128) NOT NULL, + `password_hash` binary(32) NOT NULL, + `password_salt` binary(32) NOT NULL, + PRIMARY KEY (`user_id`), UNIQUE KEY `username` (`username`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --- Table structure for table `guacamole_connection_parameter` +-- Table of connection parameters. Each parameter is simply a name/value pair +-- associated with a connection. -- CREATE TABLE `guacamole_connection_parameter` ( - `connection_id` int(11) NOT NULL, - `parameter_name` varchar(128) NOT NULL, + + `connection_id` int(11) NOT NULL, + `parameter_name` varchar(128) NOT NULL, `parameter_value` varchar(4096) NOT NULL, + PRIMARY KEY (`connection_id`,`parameter_name`), - CONSTRAINT `guacamole_connection_parameter_ibfk_1` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) + + CONSTRAINT `guacamole_connection_parameter_ibfk_1` + FOREIGN KEY (`connection_id`) + REFERENCES `guacamole_connection` (`connection_id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --- Table structure for table `guacamole_connection_permission` +-- Table of connection permissions. Each connection permission grants a user +-- specific access to a connection. -- CREATE TABLE `guacamole_connection_permission` ( - `user_id` int(11) NOT NULL, + + `user_id` int(11) NOT NULL, `connection_id` int(11) NOT NULL, - `permission` enum('READ','UPDATE','DELETE','ADMINISTER') NOT NULL, + `permission` enum('READ', + 'UPDATE', + 'DELETE', + 'ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`connection_id`,`permission`), - CONSTRAINT `guacamole_connection_permission_ibfk_1` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`), - CONSTRAINT `guacamole_connection_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) + + CONSTRAINT `guacamole_connection_permission_ibfk_1` + FOREIGN KEY (`connection_id`) + REFERENCES `guacamole_connection` (`connection_id`) ON DELETE CASCADE, + + CONSTRAINT `guacamole_connection_permission_ibfk_2` + FOREIGN KEY (`user_id`) + REFERENCES `guacamole_user` (`user_id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --- Table structure for table `guacamole_system_permission` +-- Table of system permissions. Each system permission grants a user a +-- system-level privilege of some kind. -- CREATE TABLE `guacamole_system_permission` ( - `user_id` int(11) NOT NULL, - `permission` enum('CREATE_CONNECTION','CREATE_USER','ADMINISTER') NOT NULL, + + `user_id` int(11) NOT NULL, + `permission` enum('CREATE_CONNECTION', + 'CREATE_USER', + 'ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`permission`), - CONSTRAINT `guacamole_system_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) + + CONSTRAINT `guacamole_system_permission_ibfk_1` + FOREIGN KEY (`user_id`) + REFERENCES `guacamole_user` (`user_id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --- Table structure for table `guacamole_user_permission` +-- Table of user permissions. Each user permission grants a user access to +-- another user (the "affected" user) for a specific type of operation. -- CREATE TABLE `guacamole_user_permission` ( - `user_id` int(11) NOT NULL, + + `user_id` int(11) NOT NULL, `affected_user_id` int(11) NOT NULL, - `permission` enum('READ','UPDATE','DELETE','ADMINISTER') NOT NULL, + `permission` enum('READ', + 'UPDATE', + 'DELETE', + 'ADMINISTER') NOT NULL, + PRIMARY KEY (`user_id`,`affected_user_id`,`permission`), - CONSTRAINT `guacamole_user_permission_ibfk_1` FOREIGN KEY (`affected_user_id`) REFERENCES `guacamole_user` (`user_id`), - CONSTRAINT `guacamole_user_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`) + + CONSTRAINT `guacamole_user_permission_ibfk_1` + FOREIGN KEY (`affected_user_id`) + REFERENCES `guacamole_user` (`user_id`) ON DELETE CASCADE, + + CONSTRAINT `guacamole_user_permission_ibfk_2` + FOREIGN KEY (`user_id`) + REFERENCES `guacamole_user` (`user_id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --- Table structure for table `guacamole_connection_history` +-- Table of connection history records. Each record defines a specific user's +-- session, including the connection used, the start time, and the end time +-- (if any). -- CREATE TABLE `guacamole_connection_history` ( - `history_id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `connection_id` int(11) NOT NULL, - `start_date` datetime NOT NULL, - `end_date` datetime DEFAULT NULL, + + `history_id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `connection_id` int(11) NOT NULL, + `start_date` datetime NOT NULL, + `end_date` datetime DEFAULT NULL, + PRIMARY KEY (`history_id`), KEY `user_id` (`user_id`), KEY `connection_id` (`connection_id`), - CONSTRAINT `guacamole_connection_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `guacamole_user` (`user_id`), - CONSTRAINT `guacamole_connection_history_ibfk_2` FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) + + CONSTRAINT `guacamole_connection_history_ibfk_1` + FOREIGN KEY (`user_id`) + REFERENCES `guacamole_user` (`user_id`) ON DELETE CASCADE, + + CONSTRAINT `guacamole_connection_history_ibfk_2` + FOREIGN KEY (`connection_id`) + REFERENCES `guacamole_connection` (`connection_id`) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 8b1e8a805..5f2544ea4 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -47,7 +47,6 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; @@ -221,16 +220,6 @@ public class ConnectionDirectory implements Directory{ MySQLConnection mySQLConnection = connectionService.retrieveConnection(identifier); - // Delete all configuration values - ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample(); - connectionParameterExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); - connectionParameterDAO.deleteByExample(connectionParameterExample); - - // Delete all permissions that refer to this connection - ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); - connectionPermissionExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); - connectionPermissionDAO.deleteByExample(connectionPermissionExample); - // Delete the connection itself connectionService.deleteConnection(mySQLConnection.getConnectionID()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index 311a3b61a..21f173296 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -327,26 +327,6 @@ public class UserService { MySQLUser mySQLUser = retrieveUser(username); int user_id = mySQLUser.getUserID(); - // Delete all user permissions - UserPermissionExample userPermissionExample = new UserPermissionExample(); - userPermissionExample.createCriteria().andUser_idEqualTo(user_id); - userPermissionDAO.deleteByExample(userPermissionExample); - - // Delete all connection permissions - ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); - connectionPermissionExample.createCriteria().andUser_idEqualTo(user_id); - connectionPermissionDAO.deleteByExample(connectionPermissionExample); - - // Delete all system permissions - SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); - systemPermissionExample.createCriteria().andUser_idEqualTo(user_id); - systemPermissionDAO.deleteByExample(systemPermissionExample); - - // Delete all permissions that refer to this user - userPermissionExample.clear(); - userPermissionExample.createCriteria().andAffected_user_idEqualTo(user_id); - userPermissionDAO.deleteByExample(userPermissionExample); - // Delete the user in the database userDAO.deleteByPrimaryKey(user_id); From f8fec18909d7baf4a8733270672c3ce90a674e5e Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 20:00:31 -0800 Subject: [PATCH 086/109] Ticket #269: Leverage Maven's source generation features to generate MyBatis mappings. --- .../example/create-admin-user.sql} | 0 .../doc/example/settings.xml | 21 + .../doc/examples/mybatisGeneratorConfig.xml | 75 --- extensions/guacamole-auth-mysql/pom.xml | 26 + .../mysql/dao/ConnectionHistoryMapper.java | 96 --- .../net/auth/mysql/dao/ConnectionMapper.java | 96 --- .../mysql/dao/ConnectionParameterMapper.java | 97 --- .../mysql/dao/ConnectionPermissionMapper.java | 72 --- .../mysql/dao/SystemPermissionMapper.java | 72 --- .../net/auth/mysql/dao/UserMapper.java | 121 ---- .../auth/mysql/dao/UserPermissionMapper.java | 72 --- .../net/auth/mysql/model/Connection.java | 99 --- .../auth/mysql/model/ConnectionExample.java | 502 --------------- .../auth/mysql/model/ConnectionHistory.java | 165 ----- .../mysql/model/ConnectionHistoryExample.java | 603 ------------------ .../auth/mysql/model/ConnectionParameter.java | 35 - .../model/ConnectionParameterExample.java | 502 --------------- .../mysql/model/ConnectionParameterKey.java | 67 -- .../model/ConnectionPermissionExample.java | 492 -------------- .../mysql/model/ConnectionPermissionKey.java | 99 --- .../mysql/model/SystemPermissionExample.java | 432 ------------- .../auth/mysql/model/SystemPermissionKey.java | 67 -- .../guacamole/net/auth/mysql/model/User.java | 67 -- .../net/auth/mysql/model/UserExample.java | 432 ------------- .../mysql/model/UserPermissionExample.java | 492 -------------- .../auth/mysql/model/UserPermissionKey.java | 99 --- .../net/auth/mysql/model/UserWithBLOBs.java | 67 -- .../src/main/resources/generatorConfig.xml | 87 +++ .../mysql/dao/ConnectionHistoryMapper.xml | 286 --------- .../net/auth/mysql/dao/ConnectionMapper.xml | 259 -------- .../mysql/dao/ConnectionParameterMapper.xml | 256 -------- .../mysql/dao/ConnectionPermissionMapper.xml | 219 ------- .../auth/mysql/dao/SystemPermissionMapper.xml | 205 ------ .../net/auth/mysql/dao/UserMapper.xml | 335 ---------- .../auth/mysql/dao/UserPermissionMapper.xml | 219 ------- 35 files changed, 134 insertions(+), 6700 deletions(-) rename extensions/guacamole-auth-mysql/{schema/guacamole-auth-mysql-create-default-user.sql => doc/example/create-admin-user.sql} (100%) create mode 100644 extensions/guacamole-auth-mysql/doc/example/settings.xml delete mode 100644 extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java delete mode 100644 extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java create mode 100644 extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml delete mode 100644 extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql b/extensions/guacamole-auth-mysql/doc/example/create-admin-user.sql similarity index 100% rename from extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-create-default-user.sql rename to extensions/guacamole-auth-mysql/doc/example/create-admin-user.sql diff --git a/extensions/guacamole-auth-mysql/doc/example/settings.xml b/extensions/guacamole-auth-mysql/doc/example/settings.xml new file mode 100644 index 000000000..d0fb6d5bd --- /dev/null +++ b/extensions/guacamole-auth-mysql/doc/example/settings.xml @@ -0,0 +1,21 @@ + + + + + + guacamole-mybatis + + SCHEMA + DATABASE + USER + PASS + + + + + + + guacamole-mybatis + + + diff --git a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml b/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml deleted file mode 100644 index 04f72f78f..000000000 --- a/extensions/guacamole-auth-mysql/doc/examples/mybatisGeneratorConfig.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- -
-
- diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index a1924b376..e4603b622 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -48,6 +48,32 @@ + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.0 + + + + Generate MyBatis Artifacts + + generate + + + + + + + + mysql + mysql-connector-java + 5.1.23 + + + + + diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java deleted file mode 100644 index 8a28bdc8c..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.java +++ /dev/null @@ -1,96 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionHistoryMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(ConnectionHistoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(ConnectionHistoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(Integer history_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(ConnectionHistory record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(ConnectionHistory record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(ConnectionHistoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - ConnectionHistory selectByPrimaryKey(Integer history_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") ConnectionHistory record, @Param("example") ConnectionHistoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") ConnectionHistory record, @Param("example") ConnectionHistoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKeySelective(ConnectionHistory record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKey(ConnectionHistory record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java deleted file mode 100644 index 659e11ef6..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.java +++ /dev/null @@ -1,96 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.Connection; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(Integer connection_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(Connection record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(Connection record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - Connection selectByPrimaryKey(Integer connection_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") Connection record, @Param("example") ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") Connection record, @Param("example") ConnectionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKeySelective(Connection record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKey(Connection record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java deleted file mode 100644 index cd4b1df63..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.java +++ /dev/null @@ -1,97 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterKey; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionParameterMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(ConnectionParameterKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(ConnectionParameter record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(ConnectionParameter record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - ConnectionParameter selectByPrimaryKey(ConnectionParameterKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") ConnectionParameter record, @Param("example") ConnectionParameterExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKeySelective(ConnectionParameter record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKey(ConnectionParameter record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java deleted file mode 100644 index 5ba73ce6d..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; -import org.apache.ibatis.annotations.Param; - -public interface ConnectionPermissionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(ConnectionPermissionKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(ConnectionPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(ConnectionPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") ConnectionPermissionKey record, @Param("example") ConnectionPermissionExample example); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java deleted file mode 100644 index 1d12f9e07..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; -import org.apache.ibatis.annotations.Param; - -public interface SystemPermissionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(SystemPermissionKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(SystemPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(SystemPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") SystemPermissionKey record, @Param("example") SystemPermissionExample example); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java deleted file mode 100644 index acbcfd299..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.java +++ /dev/null @@ -1,121 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.User; -import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; -import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; -import org.apache.ibatis.annotations.Param; - -public interface UserMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(Integer user_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(UserWithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(UserWithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExampleWithBLOBs(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - UserWithBLOBs selectByPrimaryKey(Integer user_id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleWithBLOBs(@Param("record") UserWithBLOBs record, @Param("example") UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") User record, @Param("example") UserExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKeySelective(UserWithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKeyWithBLOBs(UserWithBLOBs record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByPrimaryKey(User record); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java deleted file mode 100644 index 132d00eca..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.dao; - -import java.util.List; -import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; -import org.apache.ibatis.annotations.Param; - -public interface UserPermissionMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int countByExample(UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByExample(UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int deleteByPrimaryKey(UserPermissionKey key); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insert(UserPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int insertSelective(UserPermissionKey record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - List selectByExample(UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExampleSelective(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - int updateByExample(@Param("record") UserPermissionKey record, @Param("example") UserPermissionExample example); -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java deleted file mode 100644 index 3be686d99..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/Connection.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class Connection { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection.connection_name - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String connection_name; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection.protocol - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String protocol; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection.connection_id - * - * @return the value of guacamole..guacamole_connection.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection.connection_name - * - * @return the value of guacamole..guacamole_connection.connection_name - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getConnection_name() { - return connection_name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection.connection_name - * - * @param connection_name the value for guacamole..guacamole_connection.connection_name - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setConnection_name(String connection_name) { - this.connection_name = connection_name; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection.protocol - * - * @return the value of guacamole..guacamole_connection.protocol - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getProtocol() { - return protocol; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection.protocol - * - * @param protocol the value for guacamole..guacamole_connection.protocol - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setProtocol(String protocol) { - this.protocol = protocol; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java deleted file mode 100644 index 4e5d37c61..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionExample.java +++ /dev/null @@ -1,502 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.List; - -public class ConnectionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public ConnectionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_nameIsNull() { - addCriterion("connection_name is null"); - return (Criteria) this; - } - - public Criteria andConnection_nameIsNotNull() { - addCriterion("connection_name is not null"); - return (Criteria) this; - } - - public Criteria andConnection_nameEqualTo(String value) { - addCriterion("connection_name =", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotEqualTo(String value) { - addCriterion("connection_name <>", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameGreaterThan(String value) { - addCriterion("connection_name >", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameGreaterThanOrEqualTo(String value) { - addCriterion("connection_name >=", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameLessThan(String value) { - addCriterion("connection_name <", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameLessThanOrEqualTo(String value) { - addCriterion("connection_name <=", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameLike(String value) { - addCriterion("connection_name like", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotLike(String value) { - addCriterion("connection_name not like", value, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameIn(List values) { - addCriterion("connection_name in", values, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotIn(List values) { - addCriterion("connection_name not in", values, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameBetween(String value1, String value2) { - addCriterion("connection_name between", value1, value2, "connection_name"); - return (Criteria) this; - } - - public Criteria andConnection_nameNotBetween(String value1, String value2) { - addCriterion("connection_name not between", value1, value2, "connection_name"); - return (Criteria) this; - } - - public Criteria andProtocolIsNull() { - addCriterion("protocol is null"); - return (Criteria) this; - } - - public Criteria andProtocolIsNotNull() { - addCriterion("protocol is not null"); - return (Criteria) this; - } - - public Criteria andProtocolEqualTo(String value) { - addCriterion("protocol =", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotEqualTo(String value) { - addCriterion("protocol <>", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolGreaterThan(String value) { - addCriterion("protocol >", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolGreaterThanOrEqualTo(String value) { - addCriterion("protocol >=", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLessThan(String value) { - addCriterion("protocol <", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLessThanOrEqualTo(String value) { - addCriterion("protocol <=", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolLike(String value) { - addCriterion("protocol like", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotLike(String value) { - addCriterion("protocol not like", value, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolIn(List values) { - addCriterion("protocol in", values, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotIn(List values) { - addCriterion("protocol not in", values, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolBetween(String value1, String value2) { - addCriterion("protocol between", value1, value2, "protocol"); - return (Criteria) this; - } - - public Criteria andProtocolNotBetween(String value1, String value2) { - addCriterion("protocol not between", value1, value2, "protocol"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java deleted file mode 100644 index 937a7b989..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistory.java +++ /dev/null @@ -1,165 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.Date; - -public class ConnectionHistory { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_history.history_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer history_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_history.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_history.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_history.start_date - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Date start_date; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_history.end_date - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Date end_date; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_history.history_id - * - * @return the value of guacamole..guacamole_connection_history.history_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getHistory_id() { - return history_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_history.history_id - * - * @param history_id the value for guacamole..guacamole_connection_history.history_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setHistory_id(Integer history_id) { - this.history_id = history_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_history.user_id - * - * @return the value of guacamole..guacamole_connection_history.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_history.user_id - * - * @param user_id the value for guacamole..guacamole_connection_history.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_history.connection_id - * - * @return the value of guacamole..guacamole_connection_history.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_history.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection_history.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_history.start_date - * - * @return the value of guacamole..guacamole_connection_history.start_date - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Date getStart_date() { - return start_date; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_history.start_date - * - * @param start_date the value for guacamole..guacamole_connection_history.start_date - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setStart_date(Date start_date) { - this.start_date = start_date; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_history.end_date - * - * @return the value of guacamole..guacamole_connection_history.end_date - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Date getEnd_date() { - return end_date; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_history.end_date - * - * @param end_date the value for guacamole..guacamole_connection_history.end_date - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setEnd_date(Date end_date) { - this.end_date = end_date; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java deleted file mode 100644 index 2d3db94e8..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionHistoryExample.java +++ /dev/null @@ -1,603 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class ConnectionHistoryExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public ConnectionHistoryExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andHistory_idIsNull() { - addCriterion("history_id is null"); - return (Criteria) this; - } - - public Criteria andHistory_idIsNotNull() { - addCriterion("history_id is not null"); - return (Criteria) this; - } - - public Criteria andHistory_idEqualTo(Integer value) { - addCriterion("history_id =", value, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idNotEqualTo(Integer value) { - addCriterion("history_id <>", value, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idGreaterThan(Integer value) { - addCriterion("history_id >", value, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idGreaterThanOrEqualTo(Integer value) { - addCriterion("history_id >=", value, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idLessThan(Integer value) { - addCriterion("history_id <", value, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idLessThanOrEqualTo(Integer value) { - addCriterion("history_id <=", value, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idIn(List values) { - addCriterion("history_id in", values, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idNotIn(List values) { - addCriterion("history_id not in", values, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idBetween(Integer value1, Integer value2) { - addCriterion("history_id between", value1, value2, "history_id"); - return (Criteria) this; - } - - public Criteria andHistory_idNotBetween(Integer value1, Integer value2) { - addCriterion("history_id not between", value1, value2, "history_id"); - return (Criteria) this; - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andStart_dateIsNull() { - addCriterion("start_date is null"); - return (Criteria) this; - } - - public Criteria andStart_dateIsNotNull() { - addCriterion("start_date is not null"); - return (Criteria) this; - } - - public Criteria andStart_dateEqualTo(Date value) { - addCriterion("start_date =", value, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateNotEqualTo(Date value) { - addCriterion("start_date <>", value, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateGreaterThan(Date value) { - addCriterion("start_date >", value, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateGreaterThanOrEqualTo(Date value) { - addCriterion("start_date >=", value, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateLessThan(Date value) { - addCriterion("start_date <", value, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateLessThanOrEqualTo(Date value) { - addCriterion("start_date <=", value, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateIn(List values) { - addCriterion("start_date in", values, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateNotIn(List values) { - addCriterion("start_date not in", values, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateBetween(Date value1, Date value2) { - addCriterion("start_date between", value1, value2, "start_date"); - return (Criteria) this; - } - - public Criteria andStart_dateNotBetween(Date value1, Date value2) { - addCriterion("start_date not between", value1, value2, "start_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateIsNull() { - addCriterion("end_date is null"); - return (Criteria) this; - } - - public Criteria andEnd_dateIsNotNull() { - addCriterion("end_date is not null"); - return (Criteria) this; - } - - public Criteria andEnd_dateEqualTo(Date value) { - addCriterion("end_date =", value, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateNotEqualTo(Date value) { - addCriterion("end_date <>", value, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateGreaterThan(Date value) { - addCriterion("end_date >", value, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateGreaterThanOrEqualTo(Date value) { - addCriterion("end_date >=", value, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateLessThan(Date value) { - addCriterion("end_date <", value, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateLessThanOrEqualTo(Date value) { - addCriterion("end_date <=", value, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateIn(List values) { - addCriterion("end_date in", values, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateNotIn(List values) { - addCriterion("end_date not in", values, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateBetween(Date value1, Date value2) { - addCriterion("end_date between", value1, value2, "end_date"); - return (Criteria) this; - } - - public Criteria andEnd_dateNotBetween(Date value1, Date value2) { - addCriterion("end_date not between", value1, value2, "end_date"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_history - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java deleted file mode 100644 index 95deac7df..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameter.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class ConnectionParameter extends ConnectionParameterKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_value - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String parameter_value; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_value - * - * @return the value of guacamole..guacamole_connection_parameter.parameter_value - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getParameter_value() { - return parameter_value; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_value - * - * @param parameter_value the value for guacamole..guacamole_connection_parameter.parameter_value - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setParameter_value(String parameter_value) { - this.parameter_value = parameter_value; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java deleted file mode 100644 index bdc44b136..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterExample.java +++ /dev/null @@ -1,502 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.List; - -public class ConnectionParameterExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public ConnectionParameterExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andParameter_nameIsNull() { - addCriterion("parameter_name is null"); - return (Criteria) this; - } - - public Criteria andParameter_nameIsNotNull() { - addCriterion("parameter_name is not null"); - return (Criteria) this; - } - - public Criteria andParameter_nameEqualTo(String value) { - addCriterion("parameter_name =", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotEqualTo(String value) { - addCriterion("parameter_name <>", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameGreaterThan(String value) { - addCriterion("parameter_name >", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameGreaterThanOrEqualTo(String value) { - addCriterion("parameter_name >=", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameLessThan(String value) { - addCriterion("parameter_name <", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameLessThanOrEqualTo(String value) { - addCriterion("parameter_name <=", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameLike(String value) { - addCriterion("parameter_name like", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotLike(String value) { - addCriterion("parameter_name not like", value, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameIn(List values) { - addCriterion("parameter_name in", values, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotIn(List values) { - addCriterion("parameter_name not in", values, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameBetween(String value1, String value2) { - addCriterion("parameter_name between", value1, value2, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_nameNotBetween(String value1, String value2) { - addCriterion("parameter_name not between", value1, value2, "parameter_name"); - return (Criteria) this; - } - - public Criteria andParameter_valueIsNull() { - addCriterion("parameter_value is null"); - return (Criteria) this; - } - - public Criteria andParameter_valueIsNotNull() { - addCriterion("parameter_value is not null"); - return (Criteria) this; - } - - public Criteria andParameter_valueEqualTo(String value) { - addCriterion("parameter_value =", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotEqualTo(String value) { - addCriterion("parameter_value <>", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueGreaterThan(String value) { - addCriterion("parameter_value >", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueGreaterThanOrEqualTo(String value) { - addCriterion("parameter_value >=", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueLessThan(String value) { - addCriterion("parameter_value <", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueLessThanOrEqualTo(String value) { - addCriterion("parameter_value <=", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueLike(String value) { - addCriterion("parameter_value like", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotLike(String value) { - addCriterion("parameter_value not like", value, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueIn(List values) { - addCriterion("parameter_value in", values, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotIn(List values) { - addCriterion("parameter_value not in", values, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueBetween(String value1, String value2) { - addCriterion("parameter_value between", value1, value2, "parameter_value"); - return (Criteria) this; - } - - public Criteria andParameter_valueNotBetween(String value1, String value2) { - addCriterion("parameter_value not between", value1, value2, "parameter_value"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_parameter - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java deleted file mode 100644 index 2bc72662d..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionParameterKey.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class ConnectionParameterKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_parameter.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_parameter.parameter_name - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String parameter_name; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_parameter.connection_id - * - * @return the value of guacamole..guacamole_connection_parameter.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_parameter.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection_parameter.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_parameter.parameter_name - * - * @return the value of guacamole..guacamole_connection_parameter.parameter_name - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getParameter_name() { - return parameter_name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_parameter.parameter_name - * - * @param parameter_name the value for guacamole..guacamole_connection_parameter.parameter_name - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setParameter_name(String parameter_name) { - this.parameter_name = parameter_name; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java deleted file mode 100644 index 5e4264f6f..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionExample.java +++ /dev/null @@ -1,492 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.List; - -public class ConnectionPermissionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public ConnectionPermissionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNull() { - addCriterion("connection_id is null"); - return (Criteria) this; - } - - public Criteria andConnection_idIsNotNull() { - addCriterion("connection_id is not null"); - return (Criteria) this; - } - - public Criteria andConnection_idEqualTo(Integer value) { - addCriterion("connection_id =", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotEqualTo(Integer value) { - addCriterion("connection_id <>", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThan(Integer value) { - addCriterion("connection_id >", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idGreaterThanOrEqualTo(Integer value) { - addCriterion("connection_id >=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThan(Integer value) { - addCriterion("connection_id <", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idLessThanOrEqualTo(Integer value) { - addCriterion("connection_id <=", value, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idIn(List values) { - addCriterion("connection_id in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotIn(List values) { - addCriterion("connection_id not in", values, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idBetween(Integer value1, Integer value2) { - addCriterion("connection_id between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andConnection_idNotBetween(Integer value1, Integer value2) { - addCriterion("connection_id not between", value1, value2, "connection_id"); - return (Criteria) this; - } - - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); - return (Criteria) this; - } - - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); - return (Criteria) this; - } - - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_connection_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java deleted file mode 100644 index f93afff7f..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/ConnectionPermissionKey.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class ConnectionPermissionKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_permission.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer connection_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_connection_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String permission; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_permission.user_id - * - * @return the value of guacamole..guacamole_connection_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_permission.user_id - * - * @param user_id the value for guacamole..guacamole_connection_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_permission.connection_id - * - * @return the value of guacamole..guacamole_connection_permission.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getConnection_id() { - return connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_permission.connection_id - * - * @param connection_id the value for guacamole..guacamole_connection_permission.connection_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setConnection_id(Integer connection_id) { - this.connection_id = connection_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_connection_permission.permission - * - * @return the value of guacamole..guacamole_connection_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getPermission() { - return permission; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_connection_permission.permission - * - * @param permission the value for guacamole..guacamole_connection_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setPermission(String permission) { - this.permission = permission; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java deleted file mode 100644 index 3a042a6a3..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionExample.java +++ /dev/null @@ -1,432 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.List; - -public class SystemPermissionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public SystemPermissionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); - return (Criteria) this; - } - - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); - return (Criteria) this; - } - - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_system_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java deleted file mode 100644 index 707614471..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/SystemPermissionKey.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class SystemPermissionKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_system_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_system_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String permission; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_system_permission.user_id - * - * @return the value of guacamole..guacamole_system_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_system_permission.user_id - * - * @param user_id the value for guacamole..guacamole_system_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_system_permission.permission - * - * @return the value of guacamole..guacamole_system_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getPermission() { - return permission; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_system_permission.permission - * - * @param permission the value for guacamole..guacamole_system_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setPermission(String permission) { - this.permission = permission; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java deleted file mode 100644 index 516249839..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/User.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class User { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String username; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.user_id - * - * @return the value of guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.user_id - * - * @param user_id the value for guacamole..guacamole_user.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.username - * - * @return the value of guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getUsername() { - return username; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.username - * - * @param username the value for guacamole..guacamole_user.username - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setUsername(String username) { - this.username = username; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java deleted file mode 100644 index a766bc074..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserExample.java +++ /dev/null @@ -1,432 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.List; - -public class UserExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public UserExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUsernameIsNull() { - addCriterion("username is null"); - return (Criteria) this; - } - - public Criteria andUsernameIsNotNull() { - addCriterion("username is not null"); - return (Criteria) this; - } - - public Criteria andUsernameEqualTo(String value) { - addCriterion("username =", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotEqualTo(String value) { - addCriterion("username <>", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThan(String value) { - addCriterion("username >", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameGreaterThanOrEqualTo(String value) { - addCriterion("username >=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThan(String value) { - addCriterion("username <", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLessThanOrEqualTo(String value) { - addCriterion("username <=", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameLike(String value) { - addCriterion("username like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotLike(String value) { - addCriterion("username not like", value, "username"); - return (Criteria) this; - } - - public Criteria andUsernameIn(List values) { - addCriterion("username in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotIn(List values) { - addCriterion("username not in", values, "username"); - return (Criteria) this; - } - - public Criteria andUsernameBetween(String value1, String value2) { - addCriterion("username between", value1, value2, "username"); - return (Criteria) this; - } - - public Criteria andUsernameNotBetween(String value1, String value2) { - addCriterion("username not between", value1, value2, "username"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java deleted file mode 100644 index bdb1c89dc..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionExample.java +++ /dev/null @@ -1,492 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -import java.util.ArrayList; -import java.util.List; - -public class UserPermissionExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public UserPermissionExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUser_idIsNull() { - addCriterion("user_id is null"); - return (Criteria) this; - } - - public Criteria andUser_idIsNotNull() { - addCriterion("user_id is not null"); - return (Criteria) this; - } - - public Criteria andUser_idEqualTo(Integer value) { - addCriterion("user_id =", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotEqualTo(Integer value) { - addCriterion("user_id <>", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThan(Integer value) { - addCriterion("user_id >", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idGreaterThanOrEqualTo(Integer value) { - addCriterion("user_id >=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThan(Integer value) { - addCriterion("user_id <", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idLessThanOrEqualTo(Integer value) { - addCriterion("user_id <=", value, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idIn(List values) { - addCriterion("user_id in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotIn(List values) { - addCriterion("user_id not in", values, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idBetween(Integer value1, Integer value2) { - addCriterion("user_id between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andUser_idNotBetween(Integer value1, Integer value2) { - addCriterion("user_id not between", value1, value2, "user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idIsNull() { - addCriterion("affected_user_id is null"); - return (Criteria) this; - } - - public Criteria andAffected_user_idIsNotNull() { - addCriterion("affected_user_id is not null"); - return (Criteria) this; - } - - public Criteria andAffected_user_idEqualTo(Integer value) { - addCriterion("affected_user_id =", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idNotEqualTo(Integer value) { - addCriterion("affected_user_id <>", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idGreaterThan(Integer value) { - addCriterion("affected_user_id >", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idGreaterThanOrEqualTo(Integer value) { - addCriterion("affected_user_id >=", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idLessThan(Integer value) { - addCriterion("affected_user_id <", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idLessThanOrEqualTo(Integer value) { - addCriterion("affected_user_id <=", value, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idIn(List values) { - addCriterion("affected_user_id in", values, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idNotIn(List values) { - addCriterion("affected_user_id not in", values, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idBetween(Integer value1, Integer value2) { - addCriterion("affected_user_id between", value1, value2, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andAffected_user_idNotBetween(Integer value1, Integer value2) { - addCriterion("affected_user_id not between", value1, value2, "affected_user_id"); - return (Criteria) this; - } - - public Criteria andPermissionIsNull() { - addCriterion("permission is null"); - return (Criteria) this; - } - - public Criteria andPermissionIsNotNull() { - addCriterion("permission is not null"); - return (Criteria) this; - } - - public Criteria andPermissionEqualTo(String value) { - addCriterion("permission =", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotEqualTo(String value) { - addCriterion("permission <>", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThan(String value) { - addCriterion("permission >", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionGreaterThanOrEqualTo(String value) { - addCriterion("permission >=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThan(String value) { - addCriterion("permission <", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLessThanOrEqualTo(String value) { - addCriterion("permission <=", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionLike(String value) { - addCriterion("permission like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotLike(String value) { - addCriterion("permission not like", value, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionIn(List values) { - addCriterion("permission in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotIn(List values) { - addCriterion("permission not in", values, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionBetween(String value1, String value2) { - addCriterion("permission between", value1, value2, "permission"); - return (Criteria) this; - } - - public Criteria andPermissionNotBetween(String value1, String value2) { - addCriterion("permission not between", value1, value2, "permission"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated do_not_delete_during_merge Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table guacamole..guacamole_user_permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java deleted file mode 100644 index 35e4b95e0..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserPermissionKey.java +++ /dev/null @@ -1,99 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class UserPermissionKey { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user_permission.affected_user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private Integer affected_user_id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private String permission; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user_permission.user_id - * - * @return the value of guacamole..guacamole_user_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getUser_id() { - return user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user_permission.user_id - * - * @param user_id the value for guacamole..guacamole_user_permission.user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setUser_id(Integer user_id) { - this.user_id = user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user_permission.affected_user_id - * - * @return the value of guacamole..guacamole_user_permission.affected_user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public Integer getAffected_user_id() { - return affected_user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user_permission.affected_user_id - * - * @param affected_user_id the value for guacamole..guacamole_user_permission.affected_user_id - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setAffected_user_id(Integer affected_user_id) { - this.affected_user_id = affected_user_id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user_permission.permission - * - * @return the value of guacamole..guacamole_user_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public String getPermission() { - return permission; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user_permission.permission - * - * @param permission the value for guacamole..guacamole_user_permission.permission - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setPermission(String permission) { - this.permission = permission; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java deleted file mode 100644 index 27d44d714..000000000 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/model/UserWithBLOBs.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.sourceforge.guacamole.net.auth.mysql.model; - -public class UserWithBLOBs extends User { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private byte[] password_hash; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - private byte[] password_salt; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.password_hash - * - * @return the value of guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public byte[] getPassword_hash() { - return password_hash; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.password_hash - * - * @param password_hash the value for guacamole..guacamole_user.password_hash - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setPassword_hash(byte[] password_hash) { - this.password_hash = password_hash; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column guacamole..guacamole_user.password_salt - * - * @return the value of guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public byte[] getPassword_salt() { - return password_salt; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column guacamole..guacamole_user.password_salt - * - * @param password_salt the value for guacamole..guacamole_user.password_salt - * - * @mbggenerated Tue Feb 19 23:09:22 PST 2013 - */ - public void setPassword_salt(byte[] password_salt) { - this.password_salt = password_salt; - } -} \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml new file mode 100644 index 000000000..fed85030c --- /dev/null +++ b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ +
+
+ diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml deleted file mode 100644 index bb8866d64..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionHistoryMapper.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - history_id, user_id, connection_id, start_date, end_date - - - - - - delete from guacamole_connection_history - where history_id = #{history_id,jdbcType=INTEGER} - - - - delete from guacamole_connection_history - - - - - - - insert into guacamole_connection_history (history_id, user_id, connection_id, - start_date, end_date) - values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, - #{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP}) - - - - insert into guacamole_connection_history - - - history_id, - - - user_id, - - - connection_id, - - - start_date, - - - end_date, - - - - - #{history_id,jdbcType=INTEGER}, - - - #{user_id,jdbcType=INTEGER}, - - - #{connection_id,jdbcType=INTEGER}, - - - #{start_date,jdbcType=TIMESTAMP}, - - - #{end_date,jdbcType=TIMESTAMP}, - - - - - - - update guacamole_connection_history - - - history_id = #{record.history_id,jdbcType=INTEGER}, - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - start_date = #{record.start_date,jdbcType=TIMESTAMP}, - - - end_date = #{record.end_date,jdbcType=TIMESTAMP}, - - - - - - - - - update guacamole_connection_history - set history_id = #{record.history_id,jdbcType=INTEGER}, - user_id = #{record.user_id,jdbcType=INTEGER}, - connection_id = #{record.connection_id,jdbcType=INTEGER}, - start_date = #{record.start_date,jdbcType=TIMESTAMP}, - end_date = #{record.end_date,jdbcType=TIMESTAMP} - - - - - - - update guacamole_connection_history - - - user_id = #{user_id,jdbcType=INTEGER}, - - - connection_id = #{connection_id,jdbcType=INTEGER}, - - - start_date = #{start_date,jdbcType=TIMESTAMP}, - - - end_date = #{end_date,jdbcType=TIMESTAMP}, - - - where history_id = #{history_id,jdbcType=INTEGER} - - - - update guacamole_connection_history - set user_id = #{user_id,jdbcType=INTEGER}, - connection_id = #{connection_id,jdbcType=INTEGER}, - start_date = #{start_date,jdbcType=TIMESTAMP}, - end_date = #{end_date,jdbcType=TIMESTAMP} - where history_id = #{history_id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml deleted file mode 100644 index 5e07c94c7..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionMapper.xml +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - connection_id, connection_name, protocol - - - - - - delete from guacamole_connection - where connection_id = #{connection_id,jdbcType=INTEGER} - - - - delete from guacamole_connection - - - - - - - insert into guacamole_connection (connection_id, connection_name, protocol - ) - values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} - ) - - select last_insert_id(); - - - - - insert into guacamole_connection - - - connection_id, - - - connection_name, - - - protocol, - - - - - #{connection_id,jdbcType=INTEGER}, - - - #{connection_name,jdbcType=VARCHAR}, - - - #{protocol,jdbcType=VARCHAR}, - - - - - - - update guacamole_connection - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - connection_name = #{record.connection_name,jdbcType=VARCHAR}, - - - protocol = #{record.protocol,jdbcType=VARCHAR}, - - - - - - - - - update guacamole_connection - set connection_id = #{record.connection_id,jdbcType=INTEGER}, - connection_name = #{record.connection_name,jdbcType=VARCHAR}, - protocol = #{record.protocol,jdbcType=VARCHAR} - - - - - - - update guacamole_connection - - - connection_name = #{connection_name,jdbcType=VARCHAR}, - - - protocol = #{protocol,jdbcType=VARCHAR}, - - - where connection_id = #{connection_id,jdbcType=INTEGER} - - - - update guacamole_connection - set connection_name = #{connection_name,jdbcType=VARCHAR}, - protocol = #{protocol,jdbcType=VARCHAR} - where connection_id = #{connection_id,jdbcType=INTEGER} - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml deleted file mode 100644 index ea84a1212..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionParameterMapper.xml +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - connection_id, parameter_name, parameter_value - - - - - - delete from guacamole_connection_parameter - where connection_id = #{connection_id,jdbcType=INTEGER} - and parameter_name = #{parameter_name,jdbcType=VARCHAR} - - - - delete from guacamole_connection_parameter - - - - - - - insert into guacamole_connection_parameter (connection_id, parameter_name, parameter_value - ) - values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR} - ) - - - - insert into guacamole_connection_parameter - - - connection_id, - - - parameter_name, - - - parameter_value, - - - - - #{connection_id,jdbcType=INTEGER}, - - - #{parameter_name,jdbcType=VARCHAR}, - - - #{parameter_value,jdbcType=VARCHAR}, - - - - - - - update guacamole_connection_parameter - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, - - - parameter_value = #{record.parameter_value,jdbcType=VARCHAR}, - - - - - - - - - update guacamole_connection_parameter - set connection_id = #{record.connection_id,jdbcType=INTEGER}, - parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, - parameter_value = #{record.parameter_value,jdbcType=VARCHAR} - - - - - - - update guacamole_connection_parameter - - - parameter_value = #{parameter_value,jdbcType=VARCHAR}, - - - where connection_id = #{connection_id,jdbcType=INTEGER} - and parameter_name = #{parameter_name,jdbcType=VARCHAR} - - - - update guacamole_connection_parameter - set parameter_value = #{parameter_value,jdbcType=VARCHAR} - where connection_id = #{connection_id,jdbcType=INTEGER} - and parameter_name = #{parameter_name,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml deleted file mode 100644 index 0d4c2ae28..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/ConnectionPermissionMapper.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, connection_id, permission - - - - - delete from guacamole_connection_permission - where user_id = #{user_id,jdbcType=INTEGER} - and connection_id = #{connection_id,jdbcType=INTEGER} - and permission = #{permission,jdbcType=CHAR} - - - - delete from guacamole_connection_permission - - - - - - - insert into guacamole_connection_permission (user_id, connection_id, permission - ) - values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} - ) - - - - insert into guacamole_connection_permission - - - user_id, - - - connection_id, - - - permission, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{connection_id,jdbcType=INTEGER}, - - - #{permission,jdbcType=CHAR}, - - - - - - - update guacamole_connection_permission - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - connection_id = #{record.connection_id,jdbcType=INTEGER}, - - - permission = #{record.permission,jdbcType=CHAR}, - - - - - - - - - update guacamole_connection_permission - set user_id = #{record.user_id,jdbcType=INTEGER}, - connection_id = #{record.connection_id,jdbcType=INTEGER}, - permission = #{record.permission,jdbcType=CHAR} - - - - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml deleted file mode 100644 index 4818b4527..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/SystemPermissionMapper.xml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, permission - - - - - delete from guacamole_system_permission - where user_id = #{user_id,jdbcType=INTEGER} - and permission = #{permission,jdbcType=CHAR} - - - - delete from guacamole_system_permission - - - - - - - insert into guacamole_system_permission (user_id, permission) - values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) - - - - insert into guacamole_system_permission - - - user_id, - - - permission, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{permission,jdbcType=CHAR}, - - - - - - - update guacamole_system_permission - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - permission = #{record.permission,jdbcType=CHAR}, - - - - - - - - - update guacamole_system_permission - set user_id = #{record.user_id,jdbcType=INTEGER}, - permission = #{record.permission,jdbcType=CHAR} - - - - - \ No newline at end of file diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml deleted file mode 100644 index 74e01b9f5..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserMapper.xml +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, username - - - - password_hash, password_salt - - - - - - - delete from guacamole_user - where user_id = #{user_id,jdbcType=INTEGER} - - - - delete from guacamole_user - - - - - - - insert into guacamole_user (user_id, username, password_hash, - password_salt) - values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, - #{password_salt,jdbcType=BINARY}) - - select last_insert_id(); - - - - - insert into guacamole_user - - - user_id, - - - username, - - - password_hash, - - - password_salt, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{username,jdbcType=VARCHAR}, - - - #{password_hash,jdbcType=BINARY}, - - - #{password_salt,jdbcType=BINARY}, - - - - - - - update guacamole_user - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - username = #{record.username,jdbcType=VARCHAR}, - - - password_hash = #{record.password_hash,jdbcType=BINARY}, - - - password_salt = #{record.password_salt,jdbcType=BINARY}, - - - - - - - - - update guacamole_user - set user_id = #{record.user_id,jdbcType=INTEGER}, - username = #{record.username,jdbcType=VARCHAR}, - password_hash = #{record.password_hash,jdbcType=BINARY}, - password_salt = #{record.password_salt,jdbcType=BINARY} - - - - - - - update guacamole_user - set user_id = #{record.user_id,jdbcType=INTEGER}, - username = #{record.username,jdbcType=VARCHAR} - - - - - - - update guacamole_user - - - username = #{username,jdbcType=VARCHAR}, - - - password_hash = #{password_hash,jdbcType=BINARY}, - - - password_salt = #{password_salt,jdbcType=BINARY}, - - - where user_id = #{user_id,jdbcType=INTEGER} - - - - update guacamole_user - set username = #{username,jdbcType=VARCHAR}, - password_hash = #{password_hash,jdbcType=BINARY}, - password_salt = #{password_salt,jdbcType=BINARY} - where user_id = #{user_id,jdbcType=INTEGER} - - - - update guacamole_user - set username = #{username,jdbcType=VARCHAR} - where user_id = #{user_id,jdbcType=INTEGER} - - diff --git a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml b/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml deleted file mode 100644 index bd4b12ec6..000000000 --- a/extensions/guacamole-auth-mysql/src/main/resources/net/sourceforge/guacamole/net/auth/mysql/dao/UserPermissionMapper.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - user_id, affected_user_id, permission - - - - - delete from guacamole_user_permission - where user_id = #{user_id,jdbcType=INTEGER} - and affected_user_id = #{affected_user_id,jdbcType=INTEGER} - and permission = #{permission,jdbcType=CHAR} - - - - delete from guacamole_user_permission - - - - - - - insert into guacamole_user_permission (user_id, affected_user_id, permission - ) - values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} - ) - - - - insert into guacamole_user_permission - - - user_id, - - - affected_user_id, - - - permission, - - - - - #{user_id,jdbcType=INTEGER}, - - - #{affected_user_id,jdbcType=INTEGER}, - - - #{permission,jdbcType=CHAR}, - - - - - - - update guacamole_user_permission - - - user_id = #{record.user_id,jdbcType=INTEGER}, - - - affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, - - - permission = #{record.permission,jdbcType=CHAR}, - - - - - - - - - update guacamole_user_permission - set user_id = #{record.user_id,jdbcType=INTEGER}, - affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, - permission = #{record.permission,jdbcType=CHAR} - - - - - \ No newline at end of file From 813fa5c524059a6fbd157fa153ab342b4433a021 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 20:21:39 -0800 Subject: [PATCH 087/109] Ticket #269: Rename scripts such that they can be easily run in order. --- .../{guacamole-auth-mysql-schema.sql => 001-create-schema.sql} | 0 .../create-admin-user.sql => schema/002-create-admin-user.sql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename extensions/guacamole-auth-mysql/schema/{guacamole-auth-mysql-schema.sql => 001-create-schema.sql} (100%) rename extensions/guacamole-auth-mysql/{doc/example/create-admin-user.sql => schema/002-create-admin-user.sql} (100%) diff --git a/extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql b/extensions/guacamole-auth-mysql/schema/001-create-schema.sql similarity index 100% rename from extensions/guacamole-auth-mysql/schema/guacamole-auth-mysql-schema.sql rename to extensions/guacamole-auth-mysql/schema/001-create-schema.sql diff --git a/extensions/guacamole-auth-mysql/doc/example/create-admin-user.sql b/extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql similarity index 100% rename from extensions/guacamole-auth-mysql/doc/example/create-admin-user.sql rename to extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql From ccb4730bc478194184b5b3991bfcf4cc6fe5c1f0 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 21:08:58 -0800 Subject: [PATCH 088/109] Ticket #269: Add missing semicolon to end of script. --- extensions/guacamole-auth-mysql/schema/001-create-schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/schema/001-create-schema.sql b/extensions/guacamole-auth-mysql/schema/001-create-schema.sql index 357885913..6351dd6ff 100644 --- a/extensions/guacamole-auth-mysql/schema/001-create-schema.sql +++ b/extensions/guacamole-auth-mysql/schema/001-create-schema.sql @@ -149,5 +149,5 @@ CREATE TABLE `guacamole_connection_history` ( FOREIGN KEY (`connection_id`) REFERENCES `guacamole_connection` (`connection_id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 1348164a3252768e0320fae2be550d92a2b43402 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 28 Feb 2013 21:18:52 -0800 Subject: [PATCH 089/109] Ticket #269: Remove unused imports. --- .../guacamole/net/auth/mysql/service/UserService.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index 21f173296..5d6f6177b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -50,10 +50,7 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; -import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; -import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; /** From a42167ecc3847079db620517573abb50a6aca914 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 1 Mar 2013 02:39:36 -0800 Subject: [PATCH 090/109] Ticket #269: Add functions for converting permsion type enum values to MySQL constants. --- .../net/auth/mysql/MySQLConstants.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index 623c622ab..9b72c3f57 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -1,6 +1,9 @@ package net.sourceforge.guacamole.net.auth.mysql; +import net.sourceforge.guacamole.net.auth.permission.ObjectPermission; +import net.sourceforge.guacamole.net.auth.permission.SystemPermission; + /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * @@ -111,4 +114,73 @@ public final class MySQLConstants { */ public static final String SYSTEM_ADMINISTER = "ADMINISTER"; + /** + * Given the type of a permission affecting a user, returns the MySQL + * constant representing that permission type. + * + * @param type The type of permission to look up. + * @return The MySQL constant corresponding to the given permission type. + */ + public static String getUserConstant(ObjectPermission.Type type) { + + // Convert permission type to MySQL constant + switch (type) { + case READ: return USER_READ; + case UPDATE: return USER_UPDATE; + case ADMINISTER: return USER_ADMINISTER; + case DELETE: return USER_DELETE; + } + + // If we get here, permission support was not properly implemented + throw new UnsupportedOperationException( + "Unsupported permission type: " + type); + + } + + /** + * Given the type of a permission affecting a connection, returns the MySQL + * constant representing that permission type. + * + * @param type The type of permission to look up. + * @return The MySQL constant corresponding to the given permission type. + */ + public static String getConnectionConstant(ObjectPermission.Type type) { + + // Convert permission type to MySQL constant + switch (type) { + case READ: return CONNECTION_READ; + case UPDATE: return CONNECTION_UPDATE; + case ADMINISTER: return CONNECTION_ADMINISTER; + case DELETE: return CONNECTION_DELETE; + } + + // If we get here, permission support was not properly implemented + throw new UnsupportedOperationException( + "Unsupported permission type: " + type); + + } + + + /** + * Given the type of a permission affecting the system, returns the MySQL + * constant representing that permission type. + * + * @param type The type of permission to look up. + * @return The MySQL constant corresponding to the given permission type. + */ + public static String getSystemConstant(SystemPermission.Type type) { + + // Convert permission type to MySQL constant + switch (type) { + case CREATE_USER: return SYSTEM_USER_CREATE; + case CREATE_CONNECTION: return SYSTEM_CONNECTION_CREATE; + case ADMINISTER: return SYSTEM_ADMINISTER; + } + + // If we get here, permission support was not properly implemented + throw new UnsupportedOperationException( + "Unsupported permission type: " + type); + + } + } From dbafe68cd40dc5d4d2876376007582a065d90764 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 1 Mar 2013 03:39:49 -0800 Subject: [PATCH 091/109] Ticket #269: Major cleanup of permissions service. --- .../net/auth/mysql/ConnectionDirectory.java | 54 +- .../net/auth/mysql/UserDirectory.java | 253 +++-- .../auth/mysql/service/ConnectionService.java | 76 +- .../mysql/service/PermissionCheckService.java | 865 +++++------------- .../net/auth/mysql/service/UserService.java | 133 ++- 5 files changed, 459 insertions(+), 922 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 5f2544ea4..984aac7a0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -38,7 +38,7 @@ package net.sourceforge.guacamole.net.auth.mysql; * ***** END LICENSE BLOCK ***** */ import com.google.inject.Inject; -import java.util.HashSet; +import java.util.List; import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Connection; @@ -102,19 +102,34 @@ public class ConnectionDirectory implements Directory{ @Transactional @Override public Connection get(String identifier) throws GuacamoleException { - permissionCheckService.verifyConnectionReadAccess(this.user_id, identifier); - return connectionService.retrieveConnection(identifier); + + // Get connection + MySQLConnection connection = + connectionService.retrieveConnection(identifier); + + // Verify access is granted + permissionCheckService.verifyConnectionAccess( + this.user_id, + connection.getConnectionID(), + MySQLConstants.CONNECTION_READ); + + // Return connection + return connection; + } @Transactional @Override public Set getIdentifiers() throws GuacamoleException { - Set connectionNameSet = new HashSet(); - Set connections = permissionCheckService.getReadableConnections(this.user_id); - for(MySQLConnection mySQLConnection : connections) { - connectionNameSet.add(mySQLConnection.getIdentifier()); - } - return connectionNameSet; + + // List of all connection IDs for which this user has read access + List connectionIDs = + permissionCheckService.retrieveConnectionIDs(this.user_id, + MySQLConstants.CONNECTION_READ); + + // Query all associated connections + return connectionService.translateNames(connectionIDs).keySet(); + } @Transactional @@ -122,7 +137,8 @@ public class ConnectionDirectory implements Directory{ public void add(Connection object) throws GuacamoleException { // Verify permission to create - permissionCheckService.verifyCreateConnectionPermission(this.user_id); + permissionCheckService.verifySystemAccess(this.user_id, + MySQLConstants.SYSTEM_CONNECTION_CREATE); // Create connection MySQLConnection connection = connectionService.createConnection( @@ -192,10 +208,14 @@ public class ConnectionDirectory implements Directory{ if (!(object instanceof MySQLConnection)) throw new GuacamoleException("Connection not from database."); - // Verify permission to update - permissionCheckService.verifyConnectionUpdateAccess(this.user_id, object.getIdentifier()); - MySQLConnection mySQLConnection = (MySQLConnection) object; + + // Verify permission to update + permissionCheckService.verifyConnectionAccess(this.user_id, + mySQLConnection.getConnectionID(), + MySQLConstants.CONNECTION_UPDATE); + + // Perform update connectionService.updateConnection(mySQLConnection); // Delete old connection parameters @@ -213,13 +233,15 @@ public class ConnectionDirectory implements Directory{ @Override public void remove(String identifier) throws GuacamoleException { - // Verify permission to delete - permissionCheckService.verifyConnectionDeleteAccess(this.user_id, identifier); - // Get connection MySQLConnection mySQLConnection = connectionService.retrieveConnection(identifier); + // Verify permission to delete + permissionCheckService.verifyConnectionAccess(this.user_id, + mySQLConnection.getConnectionID(), + MySQLConstants.CONNECTION_DELETE); + // Delete the connection itself connectionService.deleteConnection(mySQLConnection.getConnectionID()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 2db93fca1..b22124f0d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -41,8 +41,6 @@ import com.google.common.base.Preconditions; import com.google.inject.Inject; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -143,23 +141,32 @@ public class UserDirectory implements Directory getIdentifiers() throws GuacamoleException { - // Get set of all readable users - Set users = permissionCheckService.getReadableUsers(this.user_id); + // List of all user IDs for which this user has read access + List userIDs = + permissionCheckService.retrieveConnectionIDs(this.user_id, + MySQLConstants.USER_READ); - // Build set of usernames of readable users - Set userNameSet = new HashSet(); - for (MySQLUser mySQLUser : users) - userNameSet.add(mySQLUser.getUsername()); + // Query all associated users + return userService.translateUsernames(userIDs).keySet(); - return userNameSet; } @Override @@ -168,7 +175,8 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { + // If no permissions given, stop now if(permissions.isEmpty()) return; - // Get set of administerable users - Set administerableUsers = - permissionCheckService.getAdministerableUserIDs(this.user_id); + // Get list of administerable user IDs + List administerableUserIDs = + permissionCheckService.retrieveUserIDs(this.user_id, + MySQLConstants.USER_ADMINISTER); - // Get list of usernames for all given user permissions. - List usernames = new ArrayList(); - for (UserPermission permission : permissions) - usernames.add(permission.getObjectIdentifier()); - - // Find all the users by username - List users = userService.retrieveUsersByUsername(usernames); - - // Build map of found users, indexed by username - Map userMap = new HashMap(); - for (MySQLUser user : users) - userMap.put(user.getUsername(), user); + // Get set of usernames corresponding to administerable users + Map administerableUsers = + userService.translateUsernames(administerableUserIDs); + // Insert all given permissions for (UserPermission permission : permissions) { - // Get user - MySQLUser affectedUser = - userMap.get(permission.getObjectIdentifier()); - if (affectedUser == null) - throw new GuacamoleException( - "User '" + permission.getObjectIdentifier() - + "' not found."); + // Get original ID + Integer affected_id = + administerableUsers.get(permission.getObjectIdentifier()); // Verify that the user actually has permission to administrate // every one of these users - if (!administerableUsers.contains(affectedUser.getUserID())) + if (affected_id == null) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate user " - + affectedUser.getUsername()); + + permission.getObjectIdentifier()); // Create new permission UserPermissionKey newPermission = new UserPermissionKey(); - newPermission.setAffected_user_id(affectedUser.getUserID()); - newPermission.setPermission(permission.getType().name()); newPermission.setUser_id(user_id); + newPermission.setPermission(MySQLConstants.getUserConstant(permission.getType())); + newPermission.setAffected_user_id(affected_id); userPermissionDAO.insert(newPermission); + } + } /** @@ -345,54 +345,44 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { + // If no permissions given, stop now if(permissions.isEmpty()) return; - // Get set of administerable users - Set administerableUsers = - permissionCheckService.getAdministerableUserIDs(this.user_id); + // Get list of administerable user IDs + List administerableUserIDs = + permissionCheckService.retrieveUserIDs(this.user_id, + MySQLConstants.USER_ADMINISTER); - // Get list of usernames for all given user permissions. - List usernames = new ArrayList(); - for (UserPermission permission : permissions) - usernames.add(permission.getObjectIdentifier()); + // Get set of usernames corresponding to administerable users + Map administerableUsers = + userService.translateUsernames(administerableUserIDs); - // Find all the users by username - List users = userService.retrieveUsersByUsername(usernames); - List userIDs = new ArrayList(); - - // Build map of found users, indexed by username - Map userMap = new HashMap(); - for (MySQLUser user : users) { - userMap.put(user.getUsername(), user); - userIDs.add(user.getUserID()); - } - - // Verify we have permission to delete each user permission. + // Delete requested permissions for (UserPermission permission : permissions) { - // Get user - MySQLUser affectedUser = userMap.get(permission.getObjectIdentifier()); - if (affectedUser == null) - throw new GuacamoleException( - "User '" + permission.getObjectIdentifier() - + "' not found."); + // Get original ID + Integer affected_id = + administerableUsers.get(permission.getObjectIdentifier()); // Verify that the user actually has permission to administrate // every one of these users - if (!administerableUsers.contains(affectedUser.getUserID())) + if (affected_id == null) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate user " - + affectedUser.getUsername()); + + permission.getObjectIdentifier()); + + // Delete requested permission + UserPermissionExample userPermissionExample = new UserPermissionExample(); + userPermissionExample.createCriteria() + .andUser_idEqualTo(user_id) + .andPermissionEqualTo(MySQLConstants.getUserConstant(permission.getType())) + .andAffected_user_idEqualTo(affected_id); + userPermissionDAO.deleteByExample(userPermissionExample); + } - if(!userIDs.isEmpty()) { - UserPermissionExample userPermissionExample = new UserPermissionExample(); - userPermissionExample.createCriteria().andUser_idEqualTo(user_id) - .andAffected_user_idIn(userIDs); - userPermissionDAO.deleteByExample(userPermissionExample); - } } /** @@ -409,51 +399,42 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { + // If no permissions given, stop now if(permissions.isEmpty()) return; - // Get adminsterable connection identifiers - Set administerableConnections = - permissionCheckService.getAdministerableConnectionIDs(this.user_id); + // Get list of administerable connection IDs + List administerableConnectionIDs = + permissionCheckService.retrieveUserIDs(this.user_id, + MySQLConstants.CONNECTION_ADMINISTER); - // Build list of affected connection names from the permissions given - List connectionNames = new ArrayList(); - for (ConnectionPermission permission : permissions) - connectionNames.add(permission.getObjectIdentifier()); + // Get set of names corresponding to administerable connections + Map administerableConnections = + userService.translateUsernames(administerableConnectionIDs); - // Find all the connections by connection name - List connections = connectionService.retrieveConnectionsByName(connectionNames); - - // Build map of found connections, indexed by name - Map connectionMap = new HashMap(); - for (MySQLConnection connection : connections) - connectionMap.put(connection.getIdentifier(), connection); - - // Finally, insert the new permissions + // Insert all given permissions for (ConnectionPermission permission : permissions) { - // Get permission - MySQLConnection connection = connectionMap.get(permission.getObjectIdentifier()); - if (connection == null) - throw new GuacamoleException( - "Connection '" + permission.getObjectIdentifier() - + "' not found."); + // Get original ID + Integer connection_id = + administerableConnections.get(permission.getObjectIdentifier()); // Throw exception if permission to administer this connection // is not granted - if (!administerableConnections.contains(connection.getConnectionID())) + if (connection_id == null) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate connection " - + connection.getIdentifier()); + + permission.getObjectIdentifier()); - // Insert previously-non-existent connection permission + // Create new permission ConnectionPermissionKey newPermission = new ConnectionPermissionKey(); - newPermission.setConnection_id(connection.getConnectionID()); - newPermission.setPermission(permission.getType().name()); newPermission.setUser_id(user_id); + newPermission.setPermission(MySQLConstants.getConnectionConstant(permission.getType())); + newPermission.setConnection_id(connection_id); connectionPermissionDAO.insert(newPermission); + } } @@ -470,54 +451,43 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { + // If no permissions given, stop now if(permissions.isEmpty()) return; - // Get set of administerable users - Set administerableConnections = - permissionCheckService.getAdministerableConnectionIDs(this.user_id); + // Get list of administerable connection IDs + List administerableConnectionIDs = + permissionCheckService.retrieveUserIDs(this.user_id, + MySQLConstants.CONNECTION_ADMINISTER); - // Get list of identifiers for all given user permissions. - List identifiers = new ArrayList(); - for (ConnectionPermission permission : permissions) - identifiers.add(permission.getObjectIdentifier()); + // Get set of names corresponding to administerable connections + Map administerableConnections = + userService.translateUsernames(administerableConnectionIDs); - // Find all the connections by identifiers - List connections = connectionService.retrieveConnectionsByName(identifiers); - List connectionIDs = new ArrayList(); - - // Build map of found connections, indexed by identifier - Map connectionMap = new HashMap(); - for (MySQLConnection connection : connections) { - connectionMap.put(connection.getIdentifier(), connection); - connectionIDs.add(connection.getConnectionID()); - } - - // Verify we have permission to delete each connection permission. + // Delete requested permissions for (ConnectionPermission permission : permissions) { - // Get user - MySQLConnection connection = connectionMap.get(permission.getObjectIdentifier()); - if (connection == null) - throw new GuacamoleException( - "User '" + permission.getObjectIdentifier() - + "' not found."); + // Get original ID + Integer connection_id = + administerableConnections.get(permission.getObjectIdentifier()); // Verify that the user actually has permission to administrate // every one of these connections - if (!administerableConnections.contains(connection.getConnectionID())) + if (connection_id == null) throw new GuacamoleSecurityException( "User #" + this.user_id + " does not have permission to administrate connection " - + connection.getIdentifier()); + + permission.getObjectIdentifier()); + + ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); + connectionPermissionExample.createCriteria() + .andUser_idEqualTo(user_id) + .andPermissionEqualTo(MySQLConstants.getConnectionConstant(permission.getType())) + .andConnection_idEqualTo(connection_id); + connectionPermissionDAO.deleteByExample(connectionPermissionExample); + } - if(!connectionIDs.isEmpty()) { - ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); - connectionPermissionExample.createCriteria().andUser_idEqualTo(user_id) - .andConnection_idIn(connectionIDs); - connectionPermissionDAO.deleteByExample(connectionPermissionExample); - } } /** @@ -538,7 +508,7 @@ public class UserDirectory implements Directory systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) { - switch (permission.getType()) { + switch (permission.getType()) { // TODO: Move this into MySQLConstants // Create connection permission case CREATE_CONNECTION: @@ -627,12 +597,14 @@ public class UserDirectory implements Directory retrieveConnectionsByID(List ids) { + public Map translateNames(List ids) { - // If no IDs given, just return empty list + // If no IDs given, just return empty map if (ids.isEmpty()) - return Collections.EMPTY_LIST; + return Collections.EMPTY_MAP; - // Query connections by ID + // Map of all names onto their corresponding IDs. + Map names = new HashMap(); + + // Get all connections having the given IDs ConnectionExample example = new ConnectionExample(); example.createCriteria().andConnection_idIn(ids); List connections = connectionDAO.selectByExample(example); - // Convert to MySQLConnection list - List mySQLConnections = new ArrayList(connections.size()); + // Produce set of names for (Connection connection : connections) - mySQLConnections.add(toMySQLConnection(connection)); + names.put(connection.getConnection_name(), + connection.getConnection_id()); - // Return found connections - return mySQLConnections; + return names; } /** - * Retrieves the connections having the given names from the database. + * Retrieves a map of all connection names for the given IDs. * - * @param names The names of the connections to retrieve. - * @return A list of existing MySQLConnection objects. + * @param ids The IDs of the connections to retrieve the names of. + * @return A map containing the names of all connections and their + * corresponding IDs. */ - public List retrieveConnectionsByName(List names) { + public Map retrieveNames(List ids) { - // If no names given, just return empty list - if (names.isEmpty()) - return Collections.EMPTY_LIST; + // If no IDs given, just return empty map + if (ids.isEmpty()) + return Collections.EMPTY_MAP; - // Query connections by ID + // Map of all names onto their corresponding IDs. + Map names = new HashMap(); + + // Get all connections having the given IDs ConnectionExample example = new ConnectionExample(); - example.createCriteria().andConnection_nameIn(names); + example.createCriteria().andConnection_idIn(ids); List connections = connectionDAO.selectByExample(example); - // Convert to MySQLConnection list - List mySQLConnections = new ArrayList(connections.size()); + // Produce set of names for (Connection connection : connections) - mySQLConnections.add(toMySQLConnection(connection)); + names.put(connection.getConnection_id(), + connection.getConnection_name()); - // Return found connections - return mySQLConnections; + return names; } @@ -352,21 +361,6 @@ public class ConnectionService { } - /** - * Deletes the connection having the given name from the database. - * @param name The name of the connection to delete. - */ - public void deleteConnection(String name) { - - // Get specified connection - MySQLConnection mySQLConnection = retrieveConnection(name); - int connection_id = mySQLConnection.getConnectionID(); - - // Delete the connection in the database - deleteConnection(connection_id); - - } - /** * Deletes the connection having the given ID from the database. * @param id The ID of the connection to delete. diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 7957a379c..c159e1599 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -35,19 +35,14 @@ * ***** END LICENSE BLOCK ***** */ package net.sourceforge.guacamole.net.auth.mysql.service; -import com.google.common.collect.Lists; import com.google.inject.Inject; import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.guacamole.GuacamoleSecurityException; -import net.sourceforge.guacamole.net.auth.mysql.MySQLConnection; import net.sourceforge.guacamole.net.auth.mysql.MySQLConstants; -import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; @@ -80,744 +75,299 @@ public class PermissionCheckService { @Inject private ConnectionService connectionService; + /** + * DAO for accessing permissions related to users. + */ @Inject private UserPermissionMapper userPermissionDAO; + /** + * DAO for accessing permissions related to connections. + */ @Inject private ConnectionPermissionMapper connectionPermissionDAO; + /** + * DAO for accessing permissions related to the system as a whole. + */ @Inject private SystemPermissionMapper systemPermissionDAO; /** - * Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUserID - * @throws GuacamoleSecurityException + * Verifies that the user has the specified access to the given other + * user. If permission is denied, a GuacamoleSecurityException is thrown. + * + * @param userID The ID of the user to check. + * @param affectedUserID The user that would be affected by the operation + * if permission is granted. + * @param permissionType The type of permission to check for. + * @throws GuacamoleSecurityException If the specified permission is not + * granted. */ - public void verifyUserReadAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { - if(!checkUserReadAccess(userID, affectedUserID)) - throw new GuacamoleSecurityException("User " + userID + " does not have read access to user " + affectedUserID); + public void verifyUserAccess(int userID, int affectedUserID, + String permissionType) throws GuacamoleSecurityException { + + // If permission does not exist, throw exception + if(!checkUserAccess(userID, affectedUserID, permissionType)) + throw new GuacamoleSecurityException("Permission denied."); + } /** - * Verifies that the user has update access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUserID - * @throws GuacamoleSecurityException + * Verifies that the user has the specified access to the given connection. + * If permission is denied, a GuacamoleSecurityException is thrown. + * + * @param userID The ID of the user to check. + * @param affectedConnectionID The connection that would be affected by the + * operation if permission is granted. + * @param permissionType The type of permission to check for. + * @throws GuacamoleSecurityException If the specified permission is not + * granted. */ - public void verifyUserUpdateAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { - if(!checkUserUpdateAccess(userID, affectedUserID)) - throw new GuacamoleSecurityException("User " + userID + " does not have update access to user " + affectedUserID); + public void verifyConnectionAccess(int userID, int affectedConnectionID, String permissionType) throws GuacamoleSecurityException { + + // If permission does not exist, throw exception + if(!checkConnectionAccess(userID, affectedConnectionID, permissionType)) + throw new GuacamoleSecurityException("Permission denied."); + + } + /** + * Verifies that the user has the specified access to the system. If + * permission is denied, a GuacamoleSecurityException is thrown. + * + * @param userID The ID of the user to check. + * @param systemPermissionType The type of permission to check for. + * @throws GuacamoleSecurityException If the specified permission is not + * granted. + */ + public void verifySystemAccess(int userID, String systemPermissionType) + throws GuacamoleSecurityException { + + // If permission does not exist, throw exception + if(!checkSystemAccess(userID, systemPermissionType)) + throw new GuacamoleSecurityException("Permission denied."); + } /** - * Verifies that the user has delete access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUserID - * @throws GuacamoleSecurityException + * Checks whether a user has the specified type of access to the affected + * user. + * + * @param userID The ID of the user to check. + * @param affectedUserID The user that would be affected by the operation + * if permission is granted. + * @param permissionType The type of permission to check for. + * @return true if the specified permission is granted, false otherwise. */ - public void verifyUserDeleteAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { - if(!checkUserDeleteAccess(userID, affectedUserID)) - throw new GuacamoleSecurityException("User " + userID + " does not have delete access to user " + affectedUserID); - } + public boolean checkUserAccess(int userID, Integer affectedUserID, String permissionType) { - /** - * Verifies that the user has administer access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUserID - * @throws GuacamoleSecurityException - */ - public void verifyUserAdministerAccess(int userID, int affectedUserID) throws GuacamoleSecurityException { - if(!checkUserAdministerAccess(userID, affectedUserID)) - throw new GuacamoleSecurityException("User " + userID + " does not have administer access to user " + affectedUserID); - } - - /** - * Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUsername - * @throws GuacamoleSecurityException - */ - public void verifyUserReadAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { - if(!checkUserReadAccess(userID, affectedUsername)) - throw new GuacamoleSecurityException("User " + userID + " does not have read access to user '" + affectedUsername + "'"); - } - - /** - * Verifies that the user has update access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUsername - * @throws GuacamoleSecurityException - */ - public void verifyUserUpdateAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { - if(!checkUserUpdateAccess(userID, affectedUsername)) - throw new GuacamoleSecurityException("User " + userID + " does not have update access to user '" + affectedUsername + "'"); - } - - /** - * Verifies that the user has delete access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUsername - * @throws GuacamoleSecurityException - */ - public void verifyUserDeleteAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { - if(!checkUserDeleteAccess(userID, affectedUsername)) - throw new GuacamoleSecurityException("User " + userID + " does not have delete access to user '" + affectedUsername + "'"); - } - - /** - * Verifies that the user has administer access to the given user. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedUsername - * @throws GuacamoleSecurityException - */ - public void verifyUserAdministerAccess(int userID, String affectedUsername) throws GuacamoleSecurityException { - if(!checkUserAdministerAccess(userID, affectedUsername)) - throw new GuacamoleSecurityException("User " + userID + " does not have administer access to user '" + affectedUsername + "'"); - } - - /** - * Checks if the user has read access to the given user. - * @param userID - * @param affectedUserID - * @return true if the user has access to this user. - */ - public boolean checkUserReadAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_READ); - } - - /** - * Checks if the user has update access to the given user. - * @param userID - * @param affectedUserID - * @return true if the user has access to this user. - */ - public boolean checkUserUpdateAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_UPDATE); - } - - /** - * Checks if the user has delete access to the given user. - * @param userID - * @param affectedUserID - * @return true if the user has access to this user. - */ - public boolean checkUserDeleteAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_DELETE); - } - - /** - * Checks if the user has administer access to the given user. - * @param userID - * @param affectedUserID - * @return true if the user has access to this user. - */ - public boolean checkUserAdministerAccess(int userID, int affectedUserID) { - return checkUserAccess(userID, affectedUserID, MySQLConstants.USER_ADMINISTER); - } - - /** - * Checks if the user has read access to the given user. - * @param userID - * @param affectedUsername - * @return true if the user has access to this user. - */ - public boolean checkUserReadAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_READ); - } - - /** - * Checks if the user has update access to the given user. - * @param userID - * @param affectedUsername - * @return true if the user has access to this user. - */ - public boolean checkUserUpdateAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_UPDATE); - } - - /** - * Checks if the user has delete access to the given user. - * @param userID - * @param affectedUsername - * @return true if the user has access to this user. - */ - public boolean checkUserDeleteAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_DELETE); - } - - /** - * Checks if the user has administer access to the given user. - * @param userID - * @param affectedUsername - * @return true if the user has access to this user. - */ - public boolean checkUserAdministerAccess(int userID, String affectedUsername) { - return checkUserAccess(userID, affectedUsername, MySQLConstants.USER_ADMINISTER); - } - - /** - * Check if the user has the selected type of access to the affected user. - * @param userID - * @param affectedUsername - * @param permissionType - * @return - */ - private boolean checkUserAccess(int userID, String affectedUsername, String permissionType) { - MySQLUser affectedUser = userService.retrieveUser(affectedUsername); - if(affectedUser != null) - return checkUserAccess(userID, affectedUser.getUserID(), permissionType); - - return false; - } - - /** - * Check if the user has the selected type of access to the affected user. - * @param userID - * @param affectedUserID - * @param permissionType - * @return - */ - private boolean checkUserAccess(int userID, Integer affectedUserID, String permissionType) { + // Check existence of requested permission UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andAffected_user_idEqualTo(affectedUserID).andPermissionEqualTo(permissionType); - int count = userPermissionDAO.countByExample(example); - return count > 0; + return userPermissionDAO.countByExample(example) > 0; + } /** - * Find the list of all user IDs a user has permission to administer. - * @param userID - * @return the list of all user IDs this user has administer access to + * Checks whether a user has the specified type of access to the affected + * connection. + * + * @param userID The ID of the user to check. + * @param affectedConnectionID The connection that would be affected by the + * operation if permission is granted. + * @param permissionType The type of permission to check for. + * @return true if the specified permission is granted, false otherwise. */ - public Set getAdministerableUserIDs(int userID) { - return getUserIDs(userID, MySQLConstants.USER_ADMINISTER); + public boolean checkConnectionAccess(int userID, Integer affectedConnectionID, String permissionType) { + + // Check existence of requested permission + ConnectionPermissionExample example = new ConnectionPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andConnection_idEqualTo(affectedConnectionID).andPermissionEqualTo(permissionType); + return connectionPermissionDAO.countByExample(example) > 0; + } /** - * Find the list of all user IDs a user has permission to delete. - * @param userID - * @return the list of all user IDs this user has delete access to + * Checks whether a user has the specified type of access to the system. + * + * @param userID The ID of the user to check. + * @param systemPermissionType The type of permission to check for. + * @return true if the specified permission is granted, false otherwise. */ - public Set getDeletableUserIDs(int userID) { - return getUserIDs(userID, MySQLConstants.USER_DELETE); - } + private boolean checkSystemAccess(int userID, String systemPermissionType) { - /** - * Find the list of all user IDs a user has permission to write. - * @param userID - * @return the list of all user IDs this user has write access to - */ - public Set getUpdateableUserIDs(int userID) { - return getUserIDs(userID, MySQLConstants.USER_UPDATE); - } - - /** - * Find the list of all user IDs a user has permission to read. - * @param userID - * @return the list of all user IDs this user has read access to - */ - public Set getReadableUserIDs(int userID) { - return getUserIDs(userID, MySQLConstants.USER_READ); - } - - /** - * Find the list of all users a user has permission to administer. - * @param userID - * @return the list of all users this user has administer access to - */ - public Set getAdministerableUsers(int userID) { - return getUsers(userID, MySQLConstants.USER_ADMINISTER); - } - - /** - * Find the list of all users a user has permission to delete. - * @param userID - * @return the list of all users this user has delete access to - */ - public Set getDeletableUsers(int userID) { - return getUsers(userID, MySQLConstants.USER_DELETE); - } - - /** - * Find the list of all users a user has permission to write. - * @param userID - * @return the list of all users this user has write access to - */ - public Set getUpdateableUsers(int userID) { - return getUsers(userID, MySQLConstants.USER_UPDATE); - } - - /** - * Find the list of all users a user has permission to read. - * @param userID - * @return the list of all users this user read has access to - */ - public Set getReadableUsers(int userID) { - return getUsers(userID, MySQLConstants.USER_READ); - } - - /** - * Find the list of all users a user has permission to. - * The access type is defined by permissionType. - * @param userID - * @param permissionType - * @return the list of all users this user has access to - */ - @Deprecated /* FIXME: Totally useless (we only ever need usernames, and querying ALL USER DATA will take ages) */ - private Set getUsers(int userID, String permissionType) { - - // Get all IDs of all users that the given user can perform the given - // operation on - Set affectedUserIDs = getUserIDs(userID, permissionType); - - // If no affected users at all, return empty set - if (affectedUserIDs.isEmpty()) - return Collections.EMPTY_SET; - - // Query corresponding user data for each retrieved ID - return new HashSet(userService.retrieveUsersByID( - Lists.newArrayList(affectedUserIDs))); + // Check existence of requested permission + SystemPermissionExample example = new SystemPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(systemPermissionType); + return systemPermissionDAO.countByExample(example) > 0; } /** * Find the list of the IDs of all users a user has permission to. * The access type is defined by permissionType. - * @param userID - * @param permissionType - * @return the list of all user IDs this user has access to + * + * @param userID The ID of the user to check. + * @param permissionType The type of permission to check for. + * @return A list of all user IDs this user has the specified access to. */ - private Set getUserIDs(int userID, String permissionType) { - Set userIDs = new HashSet(); + public List retrieveUserIDs(int userID, String permissionType) { + + // Query all user permissions for the given user and permission type UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); - List userPermissions = userPermissionDAO.selectByExample(example); + example.setDistinct(true); + List userPermissions = + userPermissionDAO.selectByExample(example); + + // Convert result into list of IDs + List userIDs = new ArrayList(userPermissions.size()); for(UserPermissionKey permission : userPermissions) userIDs.add(permission.getAffected_user_id()); return userIDs; - } - - /** - * Verifies that the user has read access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionID - * @throws GuacamoleSecurityException - */ - public void verifyConnectionReadAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { - if(!checkConnectionReadAccess(userID, affectedConnectionID)) - throw new GuacamoleSecurityException("User " + userID + " does not have read access to connection " + affectedConnectionID); - } - - /** - * Verifies that the user has update access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionID - * @throws GuacamoleSecurityException - */ - public void verifyConnectionUpdateAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { - if(!checkConnectionUpdateAccess(userID, affectedConnectionID)) - throw new GuacamoleSecurityException("User " + userID + " does not have update access to connection " + affectedConnectionID); - } - - /** - * Verifies that the user has delete access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionID - * @throws GuacamoleSecurityException - */ - public void verifyConnectionDeleteAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { - if(!checkConnectionDeleteAccess(userID, affectedConnectionID)) - throw new GuacamoleSecurityException("User " + userID + " does not have delete access to connection " + affectedConnectionID); - } - - /** - * Verifies that the user has administer access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionID - * @throws GuacamoleSecurityException - */ - public void verifyConnectionAdministerAccess(int userID, int affectedConnectionID) throws GuacamoleSecurityException { - if(!checkConnectionAdministerAccess(userID, affectedConnectionID)) - throw new GuacamoleSecurityException("User " + userID + " does not have administer access to connection " + affectedConnectionID); - } - - /** - * Verifies that the user has read access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionName - * @throws GuacamoleSecurityException - */ - public void verifyConnectionReadAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { - if(!checkConnectionReadAccess(userID, affectedConnectionName)) - throw new GuacamoleSecurityException("User " + userID + " does not have read access to connection '" + affectedConnectionName + "'"); - } - - /** - * Verifies that the user has update access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionName - * @throws GuacamoleSecurityException - */ - public void verifyConnectionUpdateAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { - if(!checkConnectionUpdateAccess(userID, affectedConnectionName)) - throw new GuacamoleSecurityException("User " + userID + " does not have update access to connection '" + affectedConnectionName + "'"); - } - - /** - * Verifies that the user has delete access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionName - * @throws GuacamoleSecurityException - */ - public void verifyConnectionDeleteAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { - if(!checkConnectionDeleteAccess(userID, affectedConnectionName)) - throw new GuacamoleSecurityException("User " + userID + " does not have delete access to connection '" + affectedConnectionName + "'"); - } - - /** - * Verifies that the user has administer access to the given connection. If not, throws a GuacamoleSecurityException. - * @param userID - * @param affectedConnectionName - * @throws GuacamoleSecurityException - */ - public void verifyConnectionAdministerAccess(int userID, String affectedConnectionName) throws GuacamoleSecurityException { - if(!checkConnectionAdministerAccess(userID, affectedConnectionName)) - throw new GuacamoleSecurityException("User " + userID + " does not have administer access to connection '" + affectedConnectionName + "'"); - } - - /** - * Checks if the user has read access to the given connection. - * @param userID - * @param affectedConnectionID - * @return true if the user has access to this connection. - */ - public boolean checkConnectionReadAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_READ); - } - - /** - * Checks if the user has update access to the given connection. - * @param userID - * @param affectedConnectionID - * @return true if the user has access to this connection. - */ - public boolean checkConnectionUpdateAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_UPDATE); - } - - /** - * Checks if the user has delete access to the given connection. - * @param userID - * @param affectedConnectionID - * @return true if the user has access to this connection. - */ - public boolean checkConnectionDeleteAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_DELETE); - } - - /** - * Checks if the user has administer access to the given connection. - * @param userID - * @param affectedConnectionID - * @return true if the user has access to this connection. - */ - public boolean checkConnectionAdministerAccess(int userID, int affectedConnectionID) { - return checkConnectionAccess(userID, affectedConnectionID, MySQLConstants.CONNECTION_ADMINISTER); - } - - /** - * Checks if the user has read access to the given connection. - * @param userID - * @param affectedConnectionName - * @return true if the user has access to this connection. - */ - public boolean checkConnectionReadAccess(int userID, String affectedConnectionName) { - return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_READ); - } - - /** - * Checks if the user has update access to the given connection. - * @param userID - * @param affectedConnectionName - * @return true if the user has access to this connection. - */ - public boolean checkConnectionUpdateAccess(int userID, String affectedConnectionName) { - return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_UPDATE); - } - - /** - * Checks if the user has delete access to the given connection. - * @param userID - * @param affectedConnectionID - * @return true if the user has access to this connection. - */ - public boolean checkConnectionDeleteAccess(int userID, String affectedConnectionname) { - return checkConnectionAccess(userID, affectedConnectionname, MySQLConstants.CONNECTION_DELETE); - } - - /** - * Checks if the user has administer access to the given connection. - * @param userID - * @param affectedConnectionName - * @return true if the user has access to this connection. - */ - public boolean checkConnectionAdministerAccess(int userID, String affectedConnectionName) { - return checkConnectionAccess(userID, affectedConnectionName, MySQLConstants.CONNECTION_ADMINISTER); - } - - /** - * Check if the user has the selected type of access to the affected connection. - * @param connectionID - * @param affectedConnectionname - * @param permissionType - * @return - */ - private boolean checkConnectionAccess(int userID, String affectedConnectionName, String permissionType) { - MySQLConnection connection = connectionService.retrieveConnection(affectedConnectionName); - if(connection != null) - return checkConnectionAccess(userID, connection.getConnectionID(), permissionType); - - return false; - } - - /** - * Check if the user has the selected type of access to the affected connection. - * @param connectionID - * @param affectedConnectionID - * @param permissionType - * @return - */ - private boolean checkConnectionAccess(int userID, Integer affectedConnectionID, String permissionType) { - ConnectionPermissionExample example = new ConnectionPermissionExample(); - example.createCriteria().andUser_idEqualTo(userID).andConnection_idEqualTo(affectedConnectionID).andPermissionEqualTo(permissionType); - int count = connectionPermissionDAO.countByExample(example); - return count > 0; - } - - /** - * Find the list of all connection IDs a user has permission to administer. - * @param userID - * @return the list of all connection IDs this user has administer access to - */ - public Set getAdministerableConnectionIDs(int userID) { - return getConnectionIDs(userID, MySQLConstants.CONNECTION_ADMINISTER); - } - - /** - * Find the list of all connection IDs a user has permission to delete. - * @param userID - * @return the list of all connection IDs this user has delete access to - */ - public Set getDeletableConnectionIDs(int userID) { - return getConnectionIDs(userID, MySQLConstants.CONNECTION_DELETE); - } - - /** - * Find the list of all connection IDs a user has permission to write. - * @param userID - * @return the list of all connection IDs this user has write access to - */ - public Set getUpdateableConnectionIDs(int userID) { - return getConnectionIDs(userID, MySQLConstants.CONNECTION_UPDATE); - } - - /** - * Find the list of all connection IDs a user has permission to read. - * @param userID - * @return the list of all connection IDs this user has ready access to - */ - public Set getReadableConnectionIDs(int userID) { - return getConnectionIDs(userID, MySQLConstants.CONNECTION_READ); - } - - /** - * Find the list of all connections a user has permission to administer. - * @param userID - * @return the list of all connections this user has administer access to - */ - public Set getAdministerableConnections(int userID) { - return getConnections(userID, MySQLConstants.CONNECTION_ADMINISTER); - } - - /** - * Find the list of all connections a user has permission to delete. - * @param userID - * @return the list of all connections this user has delete access to - */ - public Set getDeletableConnections(int userID) { - return getConnections(userID, MySQLConstants.CONNECTION_DELETE); - } - - /** - * Find the list of all connections a user has permission to write. - * @param userID - * @return the list of all connections this user has write access to - */ - public Set getUpdateableConnections(int userID) { - return getConnections(userID, MySQLConstants.CONNECTION_UPDATE); - } - - /** - * Find the list of all connections a user has permission to read. - * @param userID - * @return the list of all connections this user has read access to - */ - public Set getReadableConnections(int userID) { - return getConnections(userID, MySQLConstants.CONNECTION_READ); - } - - /** - * Find the list of all connections a user has permission to. - * The access type is defined by permissionType. - * @param connectionID - * @param permissionType - * @return the list of all connections this user has access to - */ - @Deprecated /* FIXME: Totally useless (we only ever need identifiers, and querying ALL CONNECTION DATA will take ages) */ - private Set getConnections(int userID, String permissionType) { - - Set affectedConnectionIDs = getConnectionIDs(userID, permissionType); - return new HashSet( - connectionService.retrieveConnectionsByID(Lists.newArrayList(affectedConnectionIDs))); } /** * Find the list of the IDs of all connections a user has permission to. * The access type is defined by permissionType. - * @param connectionID - * @param permissionType - * @return the list of all connection IDs this user has access to + * + * @param userID The ID of the user to check. + * @param permissionType The type of permission to check for. + * @return A list of all connection IDs this user has the specified access + * to. */ - private Set getConnectionIDs(int userID, String permissionType) { - Set connectionIDs = new HashSet(); + public List retrieveConnectionIDs(int userID, + String permissionType) { + + // Query all connection permissions for the given user and permission type ConnectionPermissionExample example = new ConnectionPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); - List connectionPermissions = connectionPermissionDAO.selectByExample(example); + example.setDistinct(true); + List connectionPermissions = + connectionPermissionDAO.selectByExample(example); + + // Convert result into list of IDs + List connectionIDs = new ArrayList(connectionPermissions.size()); for(ConnectionPermissionKey permission : connectionPermissions) connectionIDs.add(permission.getConnection_id()); return connectionIDs; - } - public void verifyCreateUserPermission(int userID) throws GuacamoleSecurityException { - if(!checkCreateUserPermission(userID)) - throw new GuacamoleSecurityException("User " + userID + " does not have permission to create users."); - } - - public void verifyCreateConnectionPermission(int userID) throws GuacamoleSecurityException { - if(!checkCreateConnectionPermission(userID)) - throw new GuacamoleSecurityException("User " + userID + " does not have permission to create connections."); } /** - * Check if the user has the permission to create users. - * @param userID - * @return + * Retrieves all user permissions granted to the user having the given ID. + * + * @param userID The ID of the user to retrieve permissions of. + * @return A set of all user permissions granted to the user having the + * given ID. */ - public boolean checkCreateUserPermission(int userID) { - return checkSystemPermission(userID, MySQLConstants.SYSTEM_USER_CREATE); - } + public Set retrieveUserPermissions(int userID) { - /** - * Check if the user has the permission to create connections. - * @param userID - * @return - */ - public boolean checkCreateConnectionPermission(int userID) { - return checkSystemPermission(userID, MySQLConstants.SYSTEM_CONNECTION_CREATE); - } + // Set of all permissions + Set permissions = new HashSet(); - /** - * Check if the user has the selected system permission. - * @param userID - * @param systemPermissionType - * @return - */ - private boolean checkSystemPermission(int userID, String systemPermissionType) { - SystemPermissionExample example = new SystemPermissionExample(); - example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(systemPermissionType); - int count = systemPermissionDAO.countByExample(example); - return count > 0; - } - - /** - * Get all permissions a given user has. - * @param userID - * @return all permissions a user has. - */ - public Set getAllPermissions(int userID) { - Set allPermissions = new HashSet(); - - // First, user permissions + // Query all user permissions UserPermissionExample userPermissionExample = new UserPermissionExample(); userPermissionExample.createCriteria().andUser_idEqualTo(userID); List userPermissions = userPermissionDAO.selectByExample(userPermissionExample); - // If user permissions present, add permissions - if (!userPermissions.isEmpty()) { + // Get list of affected user IDs + List affectedUserIDs = new ArrayList(); + for(UserPermissionKey userPermission : userPermissions) + affectedUserIDs.add(userPermission.getAffected_user_id()); - // Get list of affected user IDs - List affectedUserIDs = new ArrayList(); - for(UserPermissionKey userPermission : userPermissions) - affectedUserIDs.add(userPermission.getAffected_user_id()); + // Get corresponding usernames + Map affectedUsers = + userService.retrieveUsernames(affectedUserIDs); - // Query all affected users, store in map indexed by user ID - List users = userService.retrieveUsersByID(affectedUserIDs); - Map userMap = new HashMap(); - for (MySQLUser user : users) - userMap.put(user.getUserID(), user); + // Add user permissions + for(UserPermissionKey userPermission : userPermissions) { - // Add user permissions - for(UserPermissionKey userPermission : userPermissions) { - MySQLUser affectedUser = userMap.get(userPermission.getAffected_user_id()); - UserPermission newPermission = new UserPermission( - UserPermission.Type.valueOf(userPermission.getPermission()), - affectedUser.getUsername() - ); - allPermissions.add(newPermission); - } + // Construct permission from data + UserPermission permission = new UserPermission( + UserPermission.Type.valueOf(userPermission.getPermission()), + affectedUsers.get(userPermission.getUser_id()) + ); + + // Add to set + permissions.add(permission); } - // Secondly, connection permissions + return permissions; + + } + + /** + * Retrieves all connection permissions granted to the user having the + * given ID. + * + * @param userID The ID of the user to retrieve permissions of. + * @return A set of all user permissions granted to the user having the + * given ID. + */ + public Set retrieveConnectionPermissions(int userID) { + + // Set of all permissions + Set permissions = new HashSet(); + + // Query all connection permissions ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andUser_idEqualTo(userID); List connectionPermissions = connectionPermissionDAO.selectByExample(connectionPermissionExample); - // If connection permissions present, add permissions - if (!connectionPermissions.isEmpty()) { + // Get list of affected connection IDs + List connectionIDs = new ArrayList(); + for(ConnectionPermissionKey connectionPermission : connectionPermissions) + connectionIDs.add(connectionPermission.getConnection_id()); - // Get list of affected connection IDs - List affectedConnectionIDs = new ArrayList(); - for(ConnectionPermissionKey connectionPermission : connectionPermissions) - affectedConnectionIDs.add(connectionPermission.getConnection_id()); + // Get corresponding names + Map affectedUsers = + connectionService.retrieveNames(connectionIDs); - // Query connections, store in map indexed by connection ID - List connections = - connectionService.retrieveConnectionsByID(affectedConnectionIDs); - Map connectionMap = new HashMap(); - for(MySQLConnection connection : connections) - connectionMap.put(connection.getConnectionID(), connection); + // Add connection permissions + for(ConnectionPermissionKey connectionPermission : connectionPermissions) { - // Add connection permissions - for(ConnectionPermissionKey connectionPermission : connectionPermissions) { - MySQLConnection affectedConnection = - connectionMap.get(connectionPermission.getConnection_id()); - ConnectionPermission newPermission = new ConnectionPermission( - ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), - affectedConnection.getIdentifier() - ); - allPermissions.add(newPermission); - } + // Construct permission from data + ConnectionPermission permission = new ConnectionPermission( + ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), + affectedUsers.get(connectionPermission.getUser_id()) + ); + + // Add to set + permissions.add(permission); } + return permissions; + + } + + /** + * Retrieves all permissions granted to the user having the given ID. + * + * @param userID The ID of the user to retrieve permissions of. + * @return A set of all permissions granted to the user having the given + * ID. + */ + public Set retrieveAllPermissions(int userID) { + + // Set which will contain all permissions + Set allPermissions = new HashSet(); + + // Add user permissions + allPermissions.addAll(retrieveUserPermissions(userID)); + + // Add connection permissions + allPermissions.addAll(retrieveConnectionPermissions(userID)); + + // TODO: Move to retrieveSystemPermissions() + // And finally, system permissions SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(userID); @@ -841,4 +391,5 @@ public class PermissionCheckService { return allPermissions; } + } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index 5d6f6177b..dc1e466dd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -39,9 +39,10 @@ package net.sourceforge.guacamole.net.auth.mysql.service; import com.google.inject.Inject; import com.google.inject.Provider; -import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Credentials; import net.sourceforge.guacamole.net.auth.User; @@ -143,7 +144,7 @@ public class UserService { user.getUser_id(), user.getUsername(), null, - permissionCheckService.getAllPermissions(user.getUser_id()) + permissionCheckService.retrieveAllPermissions(user.getUser_id()) ); // Return new user @@ -171,60 +172,6 @@ public class UserService { } - /** - * Retrieves the users having the given IDs from the database. - * - * @param ids The IDs of the users to retrieve. - * @return A list of existing MySQLUser objects. - */ - public List retrieveUsersByID(List ids) { - - // If no IDs given, just return empty list - if (ids.isEmpty()) - return Collections.EMPTY_LIST; - - // Query users by ID - UserExample example = new UserExample(); - example.createCriteria().andUser_idIn(ids); - List users = userDAO.selectByExampleWithBLOBs(example); - - // Convert to MySQLUser list - List mySQLUsers = new ArrayList(users.size()); - for (UserWithBLOBs user : users) - mySQLUsers.add(toMySQLUser(user)); - - // Return found users - return mySQLUsers; - - } - - /** - * Retrieves the users having the given usernames from the database. - * - * @param names The usernames of the users to retrieve. - * @return A list of existing MySQLUser objects. - */ - public List retrieveUsersByUsername(List names) { - - // If no names given, just return empty list - if (names.isEmpty()) - return Collections.EMPTY_LIST; - - // Query users by ID - UserExample example = new UserExample(); - example.createCriteria().andUsernameIn(names); - List users = userDAO.selectByExampleWithBLOBs(example); - - // Convert to MySQLUser list - List mySQLUsers = new ArrayList(users.size()); - for (UserWithBLOBs user : users) - mySQLUsers.add(toMySQLUser(user)); - - // Return found users - return mySQLUsers; - - } - /** * Retrieves the user having the given username from the database. * @@ -286,6 +233,66 @@ public class UserService { } + /** + * Retrieves a translation map of usernames to their corresponding IDs. + * + * @param ids The IDs of the users to retrieve the usernames of. + * @return A map containing the names of all users and their corresponding + * IDs. + */ + public Map translateUsernames(List ids) { + + // If no IDs given, just return empty map + if (ids.isEmpty()) + return Collections.EMPTY_MAP; + + // Map of all names onto their corresponding IDs + Map names = new HashMap(); + + // Get all users having the given IDs + UserExample example = new UserExample(); + example.createCriteria().andUser_idIn(ids); + List users = + userDAO.selectByExample(example); + + // Produce set of names + for (net.sourceforge.guacamole.net.auth.mysql.model.User user : users) + names.put(user.getUsername(), user.getUser_id()); + + return names; + + } + + /** + * Retrieves a map of all usernames for the given IDs. + * + * @param ids The IDs of the users to retrieve the usernames of. + * @return A map containing the names of all users and their corresponding + * IDs. + */ + public Map retrieveUsernames(List ids) { + + // If no IDs given, just return empty map + if (ids.isEmpty()) + return Collections.EMPTY_MAP; + + // Map of all names onto their corresponding IDs + Map names = new HashMap(); + + // Get all users having the given IDs + UserExample example = new UserExample(); + example.createCriteria().andUser_idIn(ids); + List users = + userDAO.selectByExample(example); + + // Produce set of names + for (net.sourceforge.guacamole.net.auth.mysql.model.User user : users) + names.put(user.getUser_id(), user.getUsername()); + + return names; + + } + /** * Creates a new user having the given username and password. * @@ -315,21 +322,13 @@ public class UserService { } /** - * Deletes the user having the given username from the database. - * @param username The username of the user to delete. + * Deletes the user having the given ID from the database. + * @param user_id The ID of the user to delete. */ - public void deleteUser(String username) { - - // Get specified user - MySQLUser mySQLUser = retrieveUser(username); - int user_id = mySQLUser.getUserID(); - - // Delete the user in the database + public void deleteUser(int user_id) { userDAO.deleteByPrimaryKey(user_id); - } - /** * Updates the user in the database corresponding to the given MySQLUser. * From 2ee554694ba68d51659880395fcb7fa1ff4f1d8d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 1 Mar 2013 11:41:39 -0800 Subject: [PATCH 092/109] Ticket #269: Connection permission check should actually check connections. Add generatedKey elements to generatorConfig.xml such that IDs are queried back after insert of users and connections. --- .../sourceforge/guacamole/net/auth/mysql/UserDirectory.java | 4 ++-- .../net/auth/mysql/service/PermissionCheckService.java | 6 +++--- .../src/main/resources/generatorConfig.xml | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index b22124f0d..e04905177 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -405,12 +405,12 @@ public class UserDirectory implements Directory administerableConnectionIDs = - permissionCheckService.retrieveUserIDs(this.user_id, + permissionCheckService.retrieveConnectionIDs(this.user_id, MySQLConstants.CONNECTION_ADMINISTER); // Get set of names corresponding to administerable connections Map administerableConnections = - userService.translateUsernames(administerableConnectionIDs); + connectionService.translateNames(administerableConnectionIDs); // Insert all given permissions for (ConnectionPermission permission : permissions) { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index c159e1599..a2dcd3731 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -290,7 +290,7 @@ public class PermissionCheckService { // Construct permission from data UserPermission permission = new UserPermission( UserPermission.Type.valueOf(userPermission.getPermission()), - affectedUsers.get(userPermission.getUser_id()) + affectedUsers.get(userPermission.getAffected_user_id()) ); // Add to set @@ -327,7 +327,7 @@ public class PermissionCheckService { connectionIDs.add(connectionPermission.getConnection_id()); // Get corresponding names - Map affectedUsers = + Map affectedConnections = connectionService.retrieveNames(connectionIDs); // Add connection permissions @@ -336,7 +336,7 @@ public class PermissionCheckService { // Construct permission from data ConnectionPermission permission = new ConnectionPermission( ConnectionPermission.Type.valueOf(connectionPermission.getPermission()), - affectedUsers.get(connectionPermission.getUser_id()) + affectedConnections.get(connectionPermission.getConnection_id()) ); // Add to set diff --git a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml index fed85030c..c15ad15ce 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml @@ -32,6 +32,8 @@ domainObjectName="Connection" > + +
Date: Fri, 1 Mar 2013 16:42:42 -0800 Subject: [PATCH 093/109] Ticket #269: Complete some TODO items, replace with others. --- .../net/auth/mysql/MySQLConnection.java | 6 -- .../net/auth/mysql/UserDirectory.java | 55 ++-------------- .../auth/mysql/service/ConnectionService.java | 4 +- .../mysql/service/PermissionCheckService.java | 66 ++++++++++++------- 4 files changed, 52 insertions(+), 79 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 901d4d88f..4f3068f86 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -72,12 +72,6 @@ public class MySQLConnection extends AbstractConnection { @Inject private ConnectionService connectionService; - /** - * Set of all currently active connections. - */ - @Inject - private ActiveConnectionSet activeConnectionSet; - /** * Create a default, empty connection. */ diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index e04905177..4dca4b45b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -501,40 +501,17 @@ public class UserDirectory implements Directory permissions) { + // If no permissions given, stop now if(permissions.isEmpty()) return; - // Build list of requested system permissions - List systemPermissionTypes = new ArrayList(); + // Insert all requested permissions for (SystemPermission permission : permissions) { - switch (permission.getType()) { // TODO: Move this into MySQLConstants - - // Create connection permission - case CREATE_CONNECTION: - systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); - break; - - // Create user permission - case CREATE_USER: - systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); - break; - - // Fail if unexpected type encountered - default: - assert false : "Unsupported type: " + permission.getType(); - - } - - } // end for each system permission - - // Finally, insert any NEW system permissions for this user - for (String systemPermissionType : systemPermissionTypes) { - // Insert permission SystemPermissionKey newSystemPermission = new SystemPermissionKey(); newSystemPermission.setUser_id(user_id); - newSystemPermission.setPermission(systemPermissionType); + newSystemPermission.setPermission(MySQLConstants.getSystemConstant(permission.getType())); systemPermissionDAO.insert(newSystemPermission); } @@ -552,34 +529,16 @@ public class UserDirectory implements Directory permissions) { + // If no permissions given, stop now if (permissions.isEmpty()) return; // Build list of requested system permissions List systemPermissionTypes = new ArrayList(); - for (SystemPermission permission : permissions) { + for (SystemPermission permission : permissions) + systemPermissionTypes.add(MySQLConstants.getSystemConstant(permission.getType())); - switch (permission.getType()) { - - // Create connection permission - case CREATE_CONNECTION: - systemPermissionTypes.add(MySQLConstants.SYSTEM_CONNECTION_CREATE); - break; - - // Create user permission - case CREATE_USER: - systemPermissionTypes.add(MySQLConstants.SYSTEM_USER_CREATE); - break; - - // Fail if unexpected type encountered - default: - assert false : "Unsupported type: " + permission.getType(); - - } - - } // end for each system permission - - // Finally, delete the requested system permissions for this user + // Delete the requested system permissions for this user SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(user_id) .andPermissionIn(systemPermissionTypes); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index 17ac42cec..9dc1bade0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -259,7 +259,7 @@ public class ConnectionService { connection.getConnection_id(), connection.getConnection_name(), config, - Collections.EMPTY_LIST // TODO: Read history + retrieveHistory(connection.getConnection_id()) ); return mySQLConnection; @@ -333,6 +333,8 @@ public class ConnectionService { // Mark this connection as active activeConnectionSet.add(connection.getConnectionID()); + // TODO: Actually update history... + // Return new MySQLGuacamoleSocket MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); mySQLGuacamoleSocket.init(socket, connection.getConnectionID()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index a2dcd3731..f6669bf33 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -307,8 +307,8 @@ public class PermissionCheckService { * given ID. * * @param userID The ID of the user to retrieve permissions of. - * @return A set of all user permissions granted to the user having the - * given ID. + * @return A set of all connection permissions granted to the user having + * the given ID. */ public Set retrieveConnectionPermissions(int userID) { @@ -348,6 +348,44 @@ public class PermissionCheckService { } + /** + * Retrieves all system permissions granted to the user having the + * given ID. + * + * @param userID The ID of the user to retrieve permissions of. + * @return A set of all system permissions granted to the user having the + * given ID. + */ + public Set retrieveSystemPermissions(int userID) { + + // Set of all permissions + Set permissions = new HashSet(); + + // And finally, system permissions + SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); + systemPermissionExample.createCriteria().andUser_idEqualTo(userID); + List systemPermissions = + systemPermissionDAO.selectByExample(systemPermissionExample); + for(SystemPermissionKey systemPermission : systemPermissions) { + + // User creation permission + if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) + permissions.add(new SystemPermission(SystemPermission.Type.CREATE_USER)); + + // System creation permission + else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) + permissions.add(new SystemPermission(SystemPermission.Type.CREATE_CONNECTION)); + + // System administration permission + else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_ADMINISTER)) + permissions.add(new SystemPermission(SystemPermission.Type.ADMINISTER)); + + } + + return permissions; + + } + /** * Retrieves all permissions granted to the user having the given ID. * @@ -366,28 +404,8 @@ public class PermissionCheckService { // Add connection permissions allPermissions.addAll(retrieveConnectionPermissions(userID)); - // TODO: Move to retrieveSystemPermissions() - - // And finally, system permissions - SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); - systemPermissionExample.createCriteria().andUser_idEqualTo(userID); - List systemPermissions = - systemPermissionDAO.selectByExample(systemPermissionExample); - for(SystemPermissionKey systemPermission : systemPermissions) { - - // User creation permission - if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_USER_CREATE)) - allPermissions.add(new SystemPermission(SystemPermission.Type.CREATE_USER)); - - // System creation permission - else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_CONNECTION_CREATE)) - allPermissions.add(new SystemPermission(SystemPermission.Type.CREATE_CONNECTION)); - - // System administration permission - else if(systemPermission.getPermission().equals(MySQLConstants.SYSTEM_ADMINISTER)) - allPermissions.add(new SystemPermission(SystemPermission.Type.ADMINISTER)); - - } + // Add system permissions + allPermissions.addAll(retrieveSystemPermissions(userID)); return allPermissions; } From 0810d082d3e7e95a9eb8f2412201e9f42039b853 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Sun, 3 Mar 2013 14:28:11 -0800 Subject: [PATCH 094/109] Ticket #269: Improvements made with regards to the connection history. --- .../net/auth/mysql/ActiveConnectionSet.java | 74 +++++++++++++++++- .../net/auth/mysql/ConnectionDirectory.java | 7 +- .../net/auth/mysql/MySQLConnection.java | 26 +++---- .../net/auth/mysql/MySQLConnectionRecord.java | 65 +++++++--------- .../net/auth/mysql/MySQLGuacamoleSocket.java | 14 +++- .../auth/mysql/service/ConnectionService.java | 78 +++++++++++-------- .../net/auth/mysql/service/UserService.java | 6 +- .../src/main/resources/generatorConfig.xml | 2 + 8 files changed, 178 insertions(+), 94 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java index d04f79871..38d651214 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java @@ -37,7 +37,13 @@ package net.sourceforge.guacamole.net.auth.mysql; * * ***** END LICENSE BLOCK ***** */ +import com.google.inject.Inject; +import java.util.Date; import java.util.HashSet; +import java.util.Set; +import net.sourceforge.guacamole.GuacamoleException; +import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; /** * Represents the set of currently active Connections. Whenever a socket is @@ -46,4 +52,70 @@ import java.util.HashSet; * * @author James Muehlner */ -public class ActiveConnectionSet extends HashSet {} +public class ActiveConnectionSet { + + /** + * DAO for accessing connection history. + */ + @Inject + private ConnectionHistoryMapper connectionHistoryDAO; + + /** + * Set of all the connections that are currently active. + */ + private Set activeConnectionSet = new HashSet(); + + /** + * Check if a connection is currently in use. + * @param connectionID The connection to check the status of. + * @return true if the connection is currently in use. + */ + public boolean isActive(int connectionID) { + return activeConnectionSet.contains(connectionID); + } + + /** + * Set a connection as open. + * @param connectionID The ID of the connection that is being opened. + * @param userID The ID of the user who is opening the connection. + * @return The ID of the history record created for this open connection. + */ + public int openConnection(int connectionID, int userID) { + + // Create the connection history record + ConnectionHistory connectionHistory = new ConnectionHistory(); + connectionHistory.setConnection_id(connectionID); + connectionHistory.setUser_id(userID); + connectionHistory.setStart_date(new Date()); + connectionHistoryDAO.insert(connectionHistory); + + // Mark the connection as active + activeConnectionSet.add(connectionID); + + return connectionHistory.getHistory_id(); + } + + /** + * Set a connection as closed. + * @param connectionID The ID of the connection that is being opened. + * @param historyID The ID of the history record about the open connection. + * @throws GuacamoleException If the open connection history is not found. + */ + public void closeConnection(int connectionID, int historyID) + throws GuacamoleException { + + // Get the existing history record + ConnectionHistory connectionHistory = + connectionHistoryDAO.selectByPrimaryKey(historyID); + + if(connectionHistory == null) + throw new GuacamoleException("History record not found."); + + // Update the connection history record to mark that it is now closed + connectionHistory.setEnd_date(new Date()); + connectionHistoryDAO.updateByPrimaryKey(connectionHistory); + + // Remove the connection from the set of active connections. + activeConnectionSet.remove(connectionID); + } +} diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 984aac7a0..2b4b597d2 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -105,7 +105,7 @@ public class ConnectionDirectory implements Directory{ // Get connection MySQLConnection connection = - connectionService.retrieveConnection(identifier); + connectionService.retrieveConnection(identifier, user_id); // Verify access is granted permissionCheckService.verifyConnectionAccess( @@ -142,7 +142,8 @@ public class ConnectionDirectory implements Directory{ // Create connection MySQLConnection connection = connectionService.createConnection( - object.getIdentifier(), object.getConfiguration().getProtocol()); + object.getIdentifier(), object.getConfiguration().getProtocol(), + user_id); // Add connection parameters createConfigurationValues(connection.getConnectionID(), @@ -235,7 +236,7 @@ public class ConnectionDirectory implements Directory{ // Get connection MySQLConnection mySQLConnection = - connectionService.retrieveConnection(identifier); + connectionService.retrieveConnection(identifier, user_id); // Verify permission to delete permissionCheckService.verifyConnectionAccess(this.user_id, diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 4f3068f86..3ce094ada 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -44,7 +44,6 @@ import java.util.List; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.GuacamoleSocket; import net.sourceforge.guacamole.net.auth.AbstractConnection; -import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.ConnectionRecord; import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; @@ -60,6 +59,11 @@ public class MySQLConnection extends AbstractConnection { * The ID associated with this connection in the database. */ private Integer connectionID; + + /** + * The ID of the user who queried or created this connection. + */ + private int userID; /** * History of this connection. @@ -94,18 +98,6 @@ public class MySQLConnection extends AbstractConnection { this.connectionID = connectionID; } - /** - * Initialize a new MySQLConnection from this existing connection. - * - * @param connection The connection to use when populating the identifier - * and configuration of this connection. - * @throws GuacamoleException If permission to read the given connection's - * history is denied. - */ - public void init(Connection connection) throws GuacamoleException { - init(null, connection.getIdentifier(), connection.getConfiguration(), connection.getHistory()); - } - /** * Initialize from explicit values. * @@ -113,21 +105,23 @@ public class MySQLConnection extends AbstractConnection { * @param identifier The unique identifier associated with this connection. * @param config The GuacamoleConfiguration associated with this connection. * @param history All ConnectionRecords associated with this connection. + * @param userID The IID of the user who queried this connection. */ public void init(Integer connectionID, String identifier, GuacamoleConfiguration config, - List history) { + List history, int userID) { this.connectionID = connectionID; setIdentifier(identifier); setConfiguration(config); this.history.addAll(history); - + this.userID = userID; + } @Override public GuacamoleSocket connect(GuacamoleClientInformation info) throws GuacamoleException { - return connectionService.connect(this, info); + return connectionService.connect(this, info, userID); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 334614f59..77ee93af7 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -37,14 +37,8 @@ package net.sourceforge.guacamole.net.auth.mysql; * * ***** END LICENSE BLOCK ***** */ -import com.google.inject.Inject; import java.util.Date; -import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.ConnectionRecord; -import net.sourceforge.guacamole.net.auth.User; -import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; -import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; -import net.sourceforge.guacamole.net.auth.mysql.service.UserService; /** * A ConnectionRecord which is based on data stored in MySQL. @@ -54,59 +48,54 @@ import net.sourceforge.guacamole.net.auth.mysql.service.UserService; public class MySQLConnectionRecord implements ConnectionRecord { /** - * The database record that this ConnectionRecord represents. + * The start date of the ConnectionRecord. */ - private ConnectionHistory connectionHistory; + private Date startDate; + + /** + * The end date of the ConnectionRecord. + */ + private Date endDate; + + /** + * The name of the user that is associated with this ConnectionRecord. + */ + private String username; /** - * Service for accessing users. - */ - @Inject - private UserService userService; - - /** - * Service for accessing connections. - */ - @Inject - private ConnectionService connectionService; - - /** - * Initialize this MySQLConnectionRecord with the database record it - * represents. + * Initialize this MySQLConnectionRecord with the start/end dates, + * and the name of the user it represents. * - * @param connectionHistory The ConnectionHistory entry from the database - * corresponding to this connection record. + * @param startDate The start date of the connection history. + * @param endDate The end date of the connection history. + * @param username The name of the user that used the connection. */ - public void init(ConnectionHistory connectionHistory) { - this.connectionHistory = connectionHistory; + public MySQLConnectionRecord(Date startDate, Date endDate, + String username) { + this.startDate = startDate; + this.endDate = endDate; + this.username = username; } @Override public Date getStartDate() { - return connectionHistory.getStart_date(); + return startDate; } @Override public Date getEndDate() { - return connectionHistory.getEnd_date(); + return endDate; } @Override - public User getUser() { - // FIXME: This will be SLOW - history is queried in bulk. When listed - // to the user in the webapp, this will result in one query per record. - return userService.retrieveUser(connectionHistory.getUser_id()); - } - - @Override - public Connection getConnection() { - return connectionService.retrieveConnection(connectionHistory.getConnection_id()); + public String getUsername() { + return username; } @Override public boolean isActive() { // If the end date hasn't been stored yet, the connection is still open. - return connectionHistory.getEnd_date() == null; + return endDate == null; } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java index 5e0603049..084537d2b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -65,6 +65,12 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { * socket. */ private int connectionID; + + /** + * The ID of the history record associated with this instance of the + * connection. + */ + private int historyID; /** * Initialize this MySQLGuacamoleSocket with the provided GuacamoleSocket. @@ -72,10 +78,13 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { * @param socket The ConfiguredGuacamoleSocket to wrap. * @param connectionID The ID of the connection associated with the given * socket. + * @param historyID The ID of the history record associated with this + * instance of the connection. */ - public void init(GuacamoleSocket socket, int connectionID) { + public void init(GuacamoleSocket socket, int connectionID, int historyID) { this.socket = socket; this.connectionID = connectionID; + this.historyID = historyID; } @Override @@ -95,8 +104,7 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { socket.close(); // Mark this connection as inactive - activeConnectionSet.remove(connectionID); - + activeConnectionSet.closeConnection(connectionID, historyID); } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index 9dc1bade0..cae971d71 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -37,13 +37,18 @@ package net.sourceforge.guacamole.net.auth.mysql.service; * * ***** END LICENSE BLOCK ***** */ +import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Provider; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.GuacamoleSocket; import net.sourceforge.guacamole.net.InetGuacamoleSocket; @@ -98,12 +103,6 @@ public class ConnectionService { @Inject private Provider mySQLConnectionProvider; - /** - * Provider which creates MySQLConnectionRecords. - */ - @Inject - private Provider mySQLConnectionRecordProvider; - /** * Provider which creates MySQLGuacamoleSockets. */ @@ -115,15 +114,22 @@ public class ConnectionService { */ @Inject private ActiveConnectionSet activeConnectionSet; + + /** + * Service managing users. + */ + @Inject + private UserService userService; /** * Retrieves the connection having the given name from the database. * * @param name The name of the connection to return. + * @param userID The ID of the user who queried this connection. * @return The connection having the given name, or null if no such * connection could be found. */ - public MySQLConnection retrieveConnection(String name) { + public MySQLConnection retrieveConnection(String name, int userID) { // Query connection by connection identifier (name) ConnectionExample example = new ConnectionExample(); @@ -139,7 +145,7 @@ public class ConnectionService { assert connections.size() == 1 : "Multiple connections with same name."; // Otherwise, return found connection - return toMySQLConnection(connections.get(0)); + return toMySQLConnection(connections.get(0), userID); } @@ -147,10 +153,11 @@ public class ConnectionService { * Retrieves the connection having the given ID from the database. * * @param id The ID of the connection to retrieve. + * @param userID The ID of the user who queried this connection. * @return The connection having the given ID, or null if no such * connection was found. */ - public MySQLConnection retrieveConnection(int id) { + public MySQLConnection retrieveConnection(int id, int userID) { // Query connection by ID Connection connection = connectionDAO.selectByPrimaryKey(id); @@ -160,8 +167,7 @@ public class ConnectionService { return null; // Otherwise, return found connection - return toMySQLConnection(connection); - + return toMySQLConnection(connection, userID); } /** @@ -202,7 +208,7 @@ public class ConnectionService { * @return A map containing the names of all connections and their * corresponding IDs. */ - public Map retrieveNames(List ids) { + public Map retrieveNames(Collection ids) { // If no IDs given, just return empty map if (ids.isEmpty()) @@ -213,7 +219,7 @@ public class ConnectionService { // Get all connections having the given IDs ConnectionExample example = new ConnectionExample(); - example.createCriteria().andConnection_idIn(ids); + example.createCriteria().andConnection_idIn(Lists.newArrayList(ids)); List connections = connectionDAO.selectByExample(example); // Produce set of names @@ -231,10 +237,11 @@ public class ConnectionService { * MySQLConnection in the process. * * @param connection The connection to convert. + * @param userID The user who queried this connection. * @return A new MySQLConnection containing all data associated with the * specified connection. */ - private MySQLConnection toMySQLConnection(Connection connection) { + private MySQLConnection toMySQLConnection(Connection connection, int userID) { // Build configuration GuacamoleConfiguration config = new GuacamoleConfiguration(); @@ -259,7 +266,8 @@ public class ConnectionService { connection.getConnection_id(), connection.getConnection_name(), config, - retrieveHistory(connection.getConnection_id()) + retrieveHistory(connection.getConnection_id()), + userID ); return mySQLConnection; @@ -274,7 +282,7 @@ public class ConnectionService { * connection. */ public List retrieveHistory(int connectionID) { - + // Retrieve history records relating to given connection ID ConnectionHistoryExample example = new ConnectionHistoryExample(); example.createCriteria().andConnection_idEqualTo(connectionID); @@ -287,13 +295,21 @@ public class ConnectionService { // Convert history entries to connection records List connectionRecords = new ArrayList(); + Set userIDSet = new HashSet(); for(ConnectionHistory history : connectionHistories) { - - // Create connection record from history - MySQLConnectionRecord record = mySQLConnectionRecordProvider.get(); - record.init(history); - connectionRecords.add(record); - + userIDSet.add(history.getUser_id()); + } + + // Get all the usernames for the users who are in the history + Map usernameMap = userService.retrieveUsernames(userIDSet); + + // Create the new ConnectionRecords + for(ConnectionHistory history : connectionHistories) { + Date startDate = history.getStart_date(); + Date endDate = history.getEnd_date(); + String username = usernameMap.get(history.getUser_id()); + MySQLConnectionRecord connectionRecord = new MySQLConnectionRecord(startDate, endDate, username); + connectionRecords.add(connectionRecord); } return connectionRecords; @@ -305,19 +321,20 @@ public class ConnectionService { * @param connection The connection to use when connecting the socket. * @param info The information to use when performing the connection * handshake. + * @param userID The ID of the user who is connecting to the socket. * @return The connected socket. * @throws GuacamoleException If an error occurs while connecting the * socket. */ public MySQLGuacamoleSocket connect(MySQLConnection connection, - GuacamoleClientInformation info) + GuacamoleClientInformation info, int userID) throws GuacamoleException { // If the given connection is active, and multiple simultaneous // connections are not allowed, disallow connection if(GuacamoleProperties.getProperty( MySQLGuacamoleProperties.MYSQL_DISALLOW_SIMULTANEOUS_CONNECTIONS, false) - && activeConnectionSet.contains(connection.getConnectionID())) + && activeConnectionSet.isActive(connection.getConnectionID())) throw new GuacamoleException("Cannot connect. This connection is in use."); // Get guacd connection information @@ -331,13 +348,11 @@ public class ConnectionService { ); // Mark this connection as active - activeConnectionSet.add(connection.getConnectionID()); - - // TODO: Actually update history... - + int historyID = activeConnectionSet.openConnection(connection.getConnectionID(), userID); + // Return new MySQLGuacamoleSocket MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); - mySQLGuacamoleSocket.init(socket, connection.getConnectionID()); + mySQLGuacamoleSocket.init(socket, connection.getConnectionID(), historyID); return mySQLGuacamoleSocket; } @@ -347,10 +362,11 @@ public class ConnectionService { * * @param name The name to assign to the new connection. * @param protocol The protocol to assign to the new connection. + * @param userID The ID of the user who created this connection. * @return A new MySQLConnection containing the data of the newly created * connection. */ - public MySQLConnection createConnection(String name, String protocol) { + public MySQLConnection createConnection(String name, String protocol, int userID) { // Initialize database connection Connection connection = new Connection(); @@ -359,7 +375,7 @@ public class ConnectionService { // Create connection connectionDAO.insert(connection); - return toMySQLConnection(connection); + return toMySQLConnection(connection, userID); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index dc1e466dd..3526b7751 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -37,8 +37,10 @@ package net.sourceforge.guacamole.net.auth.mysql.service; * * ***** END LICENSE BLOCK ***** */ +import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Provider; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -270,7 +272,7 @@ public class UserService { * @return A map containing the names of all users and their corresponding * IDs. */ - public Map retrieveUsernames(List ids) { + public Map retrieveUsernames(Collection ids) { // If no IDs given, just return empty map if (ids.isEmpty()) @@ -281,7 +283,7 @@ public class UserService { // Get all users having the given IDs UserExample example = new UserExample(); - example.createCriteria().andUser_idIn(ids); + example.createCriteria().andUser_idIn(Lists.newArrayList(ids)); List users = userDAO.selectByExample(example); diff --git a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml index c15ad15ce..3a5faf956 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml @@ -84,6 +84,8 @@ domainObjectName="ConnectionHistory" > +
From 8e3ea611265c815538ff360fcc1d84bcd13b8edb Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 3 Mar 2013 14:52:49 -0800 Subject: [PATCH 095/109] Ticket #269: Fix whitespace errors. --- .../net/auth/mysql/ActiveConnectionSet.java | 24 +++++++++---------- .../net/auth/mysql/MySQLConnection.java | 4 ++-- .../net/auth/mysql/MySQLConnectionRecord.java | 4 ++-- .../net/auth/mysql/MySQLGuacamoleSocket.java | 2 +- .../auth/mysql/service/ConnectionService.java | 10 ++++---- .../mysql/service/PermissionCheckService.java | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java index 38d651214..4e5ba4937 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ActiveConnectionSet.java @@ -59,12 +59,12 @@ public class ActiveConnectionSet { */ @Inject private ConnectionHistoryMapper connectionHistoryDAO; - + /** * Set of all the connections that are currently active. */ private Set activeConnectionSet = new HashSet(); - + /** * Check if a connection is currently in use. * @param connectionID The connection to check the status of. @@ -73,7 +73,7 @@ public class ActiveConnectionSet { public boolean isActive(int connectionID) { return activeConnectionSet.contains(connectionID); } - + /** * Set a connection as open. * @param connectionID The ID of the connection that is being opened. @@ -81,20 +81,20 @@ public class ActiveConnectionSet { * @return The ID of the history record created for this open connection. */ public int openConnection(int connectionID, int userID) { - + // Create the connection history record ConnectionHistory connectionHistory = new ConnectionHistory(); connectionHistory.setConnection_id(connectionID); connectionHistory.setUser_id(userID); connectionHistory.setStart_date(new Date()); connectionHistoryDAO.insert(connectionHistory); - + // Mark the connection as active activeConnectionSet.add(connectionID); - + return connectionHistory.getHistory_id(); } - + /** * Set a connection as closed. * @param connectionID The ID of the connection that is being opened. @@ -103,18 +103,18 @@ public class ActiveConnectionSet { */ public void closeConnection(int connectionID, int historyID) throws GuacamoleException { - + // Get the existing history record - ConnectionHistory connectionHistory = + ConnectionHistory connectionHistory = connectionHistoryDAO.selectByPrimaryKey(historyID); - + if(connectionHistory == null) throw new GuacamoleException("History record not found."); - + // Update the connection history record to mark that it is now closed connectionHistory.setEnd_date(new Date()); connectionHistoryDAO.updateByPrimaryKey(connectionHistory); - + // Remove the connection from the set of active connections. activeConnectionSet.remove(connectionID); } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java index 3ce094ada..dc68cfcb4 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnection.java @@ -59,7 +59,7 @@ public class MySQLConnection extends AbstractConnection { * The ID associated with this connection in the database. */ private Integer connectionID; - + /** * The ID of the user who queried or created this connection. */ @@ -116,7 +116,7 @@ public class MySQLConnection extends AbstractConnection { setConfiguration(config); this.history.addAll(history); this.userID = userID; - + } @Override diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 77ee93af7..3ab0bc325 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -51,12 +51,12 @@ public class MySQLConnectionRecord implements ConnectionRecord { * The start date of the ConnectionRecord. */ private Date startDate; - + /** * The end date of the ConnectionRecord. */ private Date endDate; - + /** * The name of the user that is associated with this ConnectionRecord. */ diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java index 084537d2b..8b2b6aade 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLGuacamoleSocket.java @@ -65,7 +65,7 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket { * socket. */ private int connectionID; - + /** * The ID of the history record associated with this instance of the * connection. diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index cae971d71..c28dcdf31 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -114,7 +114,7 @@ public class ConnectionService { */ @Inject private ActiveConnectionSet activeConnectionSet; - + /** * Service managing users. */ @@ -282,7 +282,7 @@ public class ConnectionService { * connection. */ public List retrieveHistory(int connectionID) { - + // Retrieve history records relating to given connection ID ConnectionHistoryExample example = new ConnectionHistoryExample(); example.createCriteria().andConnection_idEqualTo(connectionID); @@ -299,10 +299,10 @@ public class ConnectionService { for(ConnectionHistory history : connectionHistories) { userIDSet.add(history.getUser_id()); } - + // Get all the usernames for the users who are in the history Map usernameMap = userService.retrieveUsernames(userIDSet); - + // Create the new ConnectionRecords for(ConnectionHistory history : connectionHistories) { Date startDate = history.getStart_date(); @@ -349,7 +349,7 @@ public class ConnectionService { // Mark this connection as active int historyID = activeConnectionSet.openConnection(connection.getConnectionID(), userID); - + // Return new MySQLGuacamoleSocket MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); mySQLGuacamoleSocket.init(socket, connection.getConnectionID(), historyID); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index f6669bf33..a0d9b8dde 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -360,7 +360,7 @@ public class PermissionCheckService { // Set of all permissions Set permissions = new HashSet(); - + // And finally, system permissions SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); systemPermissionExample.createCriteria().andUser_idEqualTo(userID); From 5bed9f573507f9dbb647fe5fade5929ba87d19e8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 3 Mar 2013 15:40:55 -0800 Subject: [PATCH 096/109] Ticket #269: Do not allow mutation of external connection record. --- .../guacamole/net/auth/mysql/MySQLConnectionRecord.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 3ab0bc325..40655373d 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -72,19 +72,19 @@ public class MySQLConnectionRecord implements ConnectionRecord { */ public MySQLConnectionRecord(Date startDate, Date endDate, String username) { - this.startDate = startDate; - this.endDate = endDate; + this.startDate = new Date(startDate.getTime()); + this.endDate = new Date(endDate.getTime()); this.username = username; } @Override public Date getStartDate() { - return startDate; + return new Date(startDate.getTime()); } @Override public Date getEndDate() { - return endDate; + return new Date(endDate.getTime()); } @Override From 901424593a4322d5c258266fa6ed9d4bc1db0333 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 3 Mar 2013 16:12:33 -0800 Subject: [PATCH 097/109] Ticket #269: Fix NPE in connection record re: dates. --- .../guacamole/net/auth/mysql/MySQLConnectionRecord.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java index 40655373d..bee0917a0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConnectionRecord.java @@ -72,18 +72,20 @@ public class MySQLConnectionRecord implements ConnectionRecord { */ public MySQLConnectionRecord(Date startDate, Date endDate, String username) { - this.startDate = new Date(startDate.getTime()); - this.endDate = new Date(endDate.getTime()); + if (startDate != null) this.startDate = new Date(startDate.getTime()); + if (endDate != null) this.endDate = new Date(endDate.getTime()); this.username = username; } @Override public Date getStartDate() { + if (startDate == null) return null; return new Date(startDate.getTime()); } @Override public Date getEndDate() { + if (endDate == null) return null; return new Date(endDate.getTime()); } From a26ed664d08b2edeba16f5eb008470533a042836 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 3 Mar 2013 18:56:26 -0800 Subject: [PATCH 098/109] Ticket #269: Allow query with limit. --- extensions/guacamole-auth-mysql/pom.xml | 2 +- .../src/main/resources/generatorConfig.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/pom.xml b/extensions/guacamole-auth-mysql/pom.xml index e4603b622..4938d42f4 100644 --- a/extensions/guacamole-auth-mysql/pom.xml +++ b/extensions/guacamole-auth-mysql/pom.xml @@ -52,7 +52,7 @@ org.mybatis.generator mybatis-generator-maven-plugin - 1.3.0 + 1.3.2 diff --git a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml index 3a5faf956..879ed22c5 100644 --- a/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml +++ b/extensions/guacamole-auth-mysql/src/main/resources/generatorConfig.xml @@ -6,6 +6,9 @@ + + + Date: Sun, 3 Mar 2013 19:12:08 -0800 Subject: [PATCH 099/109] Ticket #269: Limit maximum number of connection history records to 100. --- .../net/auth/mysql/service/ConnectionService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index c28dcdf31..0e4831383 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -70,6 +70,7 @@ import net.sourceforge.guacamole.properties.GuacamoleProperties; import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; +import org.apache.ibatis.session.RowBounds; /** * Service which provides convenience methods for creating, retrieving, and @@ -289,9 +290,13 @@ public class ConnectionService { // We want to return the newest records first example.setOrderByClause("start_date DESC"); + + // Set the maximum number of history records returned to 100 + RowBounds rowBounds = new RowBounds(0, 100); // Retrieve all connection history entries - List connectionHistories = connectionHistoryDAO.selectByExample(example); + List connectionHistories = + connectionHistoryDAO.selectByExampleWithRowbounds(example, rowBounds); // Convert history entries to connection records List connectionRecords = new ArrayList(); From 4bfc21932400535e760ddeb3d4c368256512618f Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Sun, 3 Mar 2013 19:39:43 -0800 Subject: [PATCH 100/109] Ticket #269: ADMINISTER permission granted to admin user. --- extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql b/extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql index 54de10def..1efed1ccb 100644 --- a/extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql +++ b/extensions/guacamole-auth-mysql/schema/002-create-admin-user.sql @@ -7,6 +7,7 @@ insert into guacamole_user values(1, 'guacadmin', -- Grant this user create permissions insert into guacamole_system_permission values(1, 'CREATE_CONNECTION'); insert into guacamole_system_permission values(1, 'CREATE_USER'); +insert into guacamole_system_permission values(1, 'ADMINISTER'); -- Grant admin permission to read/update/administer self insert into guacamole_user_permission values(1, 1, 'READ'); From 00a699ade023a1f419e188b5d4332f755f9c6c2a Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Sun, 3 Mar 2013 20:19:46 -0800 Subject: [PATCH 101/109] Ticket #269: Added full system administrator access to everything, and throwing GuacamoleClientException when empty or duplicate users or connections are added, or multiple connections are attempted when disallowed. --- .../net/auth/mysql/ConnectionDirectory.java | 10 +++++ .../net/auth/mysql/UserDirectory.java | 24 +++++------- .../auth/mysql/service/ConnectionService.java | 37 +++++++++++++++++- .../mysql/service/PermissionCheckService.java | 38 +++++++++++++++++++ .../net/auth/mysql/service/UserService.java | 33 ++++++++++++++++ 5 files changed, 127 insertions(+), 15 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 2b4b597d2..0b66fde06 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -40,6 +40,7 @@ package net.sourceforge.guacamole.net.auth.mysql; import com.google.inject.Inject; import java.util.List; import java.util.Set; +import net.sourceforge.guacamole.GuacamoleClientException; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Connection; import net.sourceforge.guacamole.net.auth.Directory; @@ -136,10 +137,19 @@ public class ConnectionDirectory implements Directory{ @Override public void add(Connection object) throws GuacamoleException { + if(object.getIdentifier().isEmpty()) + throw new GuacamoleClientException("The connection identifier cannot be blank."); + // Verify permission to create permissionCheckService.verifySystemAccess(this.user_id, MySQLConstants.SYSTEM_CONNECTION_CREATE); + // Verify that no connection already exists with this identifier. + MySQLConnection previousConnection = + connectionService.retrieveConnection(object.getIdentifier(), user_id); + if(previousConnection != null) + throw new GuacamoleClientException("That connection identifier is already in use."); + // Create connection MySQLConnection connection = connectionService.createConnection( object.getIdentifier(), object.getConfiguration().getProtocol(), diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 4dca4b45b..2e3f5c0b0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -44,6 +44,7 @@ import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; +import net.sourceforge.guacamole.GuacamoleClientException; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.GuacamoleSecurityException; import net.sourceforge.guacamole.net.auth.Directory; @@ -57,9 +58,7 @@ import net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; import net.sourceforge.guacamole.net.auth.mysql.service.ConnectionService; -import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; -import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; import net.sourceforge.guacamole.net.auth.mysql.service.UserService; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.Permission; @@ -115,18 +114,6 @@ public class UserDirectory implements Directory getAllConnections(int userID) { + + // Get all connections defined in the system. + List allConnections = connectionDAO.selectByExample(new ConnectionExample()); + + // Translate database records to MySQLConnections + List allMySQLConnections = new ArrayList(); + + for(Connection connection : allConnections) { + allMySQLConnections.add(toMySQLConnection(connection, userID)); + } + + return allMySQLConnections; + } + + /** + * Get the IDs of all the connection defined in the system. + * @param userID The ID of the user who is querying the connections. + * @return A list of IDs of all the connections defined in the system. + */ + public List getAllConnectionIDs(int userID) { + List connectionIDs = new ArrayList(); + for(MySQLConnection connection : getAllConnections(userID)) { + connectionIDs.add(connection.getConnectionID()); + } + + return connectionIDs; + } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index a0d9b8dde..c580a10fe 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -161,6 +161,10 @@ public class PermissionCheckService { */ public boolean checkUserAccess(int userID, Integer affectedUserID, String permissionType) { + // A system administrator has full access to everything. + if(checkSystemAdministratorAccess(userID)) + return true; + // Check existence of requested permission UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andAffected_user_idEqualTo(affectedUserID).andPermissionEqualTo(permissionType); @@ -180,6 +184,10 @@ public class PermissionCheckService { */ public boolean checkConnectionAccess(int userID, Integer affectedConnectionID, String permissionType) { + // A system administrator has full access to everything. + if(checkSystemAdministratorAccess(userID)) + return true; + // Check existence of requested permission ConnectionPermissionExample example = new ConnectionPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andConnection_idEqualTo(affectedConnectionID).andPermissionEqualTo(permissionType); @@ -196,12 +204,32 @@ public class PermissionCheckService { */ private boolean checkSystemAccess(int userID, String systemPermissionType) { + // A system administrator has full access to everything. + if(checkSystemAdministratorAccess(userID)) + return true; + // Check existence of requested permission SystemPermissionExample example = new SystemPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(systemPermissionType); return systemPermissionDAO.countByExample(example) > 0; } + + + /** + * Checks whether a user has system administrator access to the system. + * + * @param userID The ID of the user to check. + * @return true if the system administrator access exists, false otherwise. + */ + private boolean checkSystemAdministratorAccess(int userID) { + + // Check existence of system administrator permission + SystemPermissionExample example = new SystemPermissionExample(); + example.createCriteria().andUser_idEqualTo(userID). + andPermissionEqualTo(MySQLConstants.SYSTEM_ADMINISTER); + return systemPermissionDAO.countByExample(example) > 0; + } /** * Find the list of the IDs of all users a user has permission to. @@ -213,6 +241,11 @@ public class PermissionCheckService { */ public List retrieveUserIDs(int userID, String permissionType) { + // A system administrator has access to all users. + if(checkSystemAdministratorAccess(userID)) { + return userService.getAllUserIDs(); + } + // Query all user permissions for the given user and permission type UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); @@ -241,6 +274,11 @@ public class PermissionCheckService { public List retrieveConnectionIDs(int userID, String permissionType) { + // A system administrator has access to all connections. + if(checkSystemAdministratorAccess(userID)) { + return connectionService.getAllConnectionIDs(userID); + } + // Query all connection permissions for the given user and permission type ConnectionPermissionExample example = new ConnectionPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index 3526b7751..828c55bdb 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -40,6 +40,7 @@ package net.sourceforge.guacamole.net.auth.mysql.service; import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Provider; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -355,6 +356,38 @@ public class UserService { userDAO.updateByPrimaryKeySelective(user); } + + /** + * Get all the users defined in the system. + * @return A list of all users defined in the system. + */ + public List getAllUsers() { + + // Get all users defined in the system. + List allUsers = userDAO.selectByExampleWithBLOBs(new UserExample()); + + // Translate database records to MySQLUsers + List allMySQLUsers = new ArrayList(); + + for(UserWithBLOBs user : allUsers) { + allMySQLUsers.add(toMySQLUser(user)); + } + + return allMySQLUsers; + } + + /** + * Get the IDs of all the user defined in the system. + * @return A list of IDs of all the users defined in the system. + */ + public List getAllUserIDs() { + List userIDs = new ArrayList(); + for(MySQLUser user : getAllUsers()) { + userIDs.add(user.getUserID()); + } + + return userIDs; + } } From 3b7618a0305563a03eb5fe8422670bd592354597 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Sun, 3 Mar 2013 21:58:41 -0800 Subject: [PATCH 102/109] Ticket #269: Only a system administrator can add system permissions. --- .../guacamole/net/auth/mysql/UserDirectory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 2e3f5c0b0..109b1060e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -495,15 +495,19 @@ public class UserDirectory implements Directory permissions) { + Collection permissions) throws GuacamoleException { // If no permissions given, stop now if(permissions.isEmpty()) return; + // Only a system administrator can add system permissions. + permissionCheckService.verifySystemAccess( + this.user_id, SystemPermission.Type.ADMINISTER.name()); + // Insert all requested permissions for (SystemPermission permission : permissions) { - + // Insert permission SystemPermissionKey newSystemPermission = new SystemPermissionKey(); newSystemPermission.setUser_id(user_id); From e8bba941e1dfe4d34f47cd7833fc84419102039f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 3 Mar 2013 23:28:24 -0800 Subject: [PATCH 103/109] Ticket #269: Fixed multiple permission validation issues + query efficiency. --- .../net/auth/mysql/ConnectionDirectory.java | 9 +- .../net/auth/mysql/UserDirectory.java | 13 +-- .../auth/mysql/service/ConnectionService.java | 53 ++++++------ .../mysql/service/PermissionCheckService.java | 56 +++++++++++-- .../net/auth/mysql/service/UserService.java | 84 ++++++++----------- 5 files changed, 120 insertions(+), 95 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index 0b66fde06..a08dcbeca 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -122,15 +122,8 @@ public class ConnectionDirectory implements Directory{ @Transactional @Override public Set getIdentifiers() throws GuacamoleException { - - // List of all connection IDs for which this user has read access - List connectionIDs = - permissionCheckService.retrieveConnectionIDs(this.user_id, + return permissionCheckService.retrieveConnectionNames(user_id, MySQLConstants.CONNECTION_READ); - - // Query all associated connections - return connectionService.translateNames(connectionIDs).keySet(); - } @Transactional diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 109b1060e..e3228683b 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -145,15 +145,8 @@ public class UserDirectory implements Directory getIdentifiers() throws GuacamoleException { - - // List of all user IDs for which this user has read access - List userIDs = - permissionCheckService.retrieveConnectionIDs(this.user_id, + return permissionCheckService.retrieveUsernames(user_id, MySQLConstants.USER_READ); - - // Query all associated users - return userService.translateUsernames(userIDs).keySet(); - } @Override @@ -453,12 +446,12 @@ public class UserDirectory implements Directory administerableConnectionIDs = - permissionCheckService.retrieveUserIDs(this.user_id, + permissionCheckService.retrieveConnectionIDs(this.user_id, MySQLConstants.CONNECTION_ADMINISTER); // Get set of names corresponding to administerable connections Map administerableConnections = - userService.translateUsernames(administerableConnectionIDs); + connectionService.translateNames(administerableConnectionIDs); // Delete requested permissions for (ConnectionPermission permission : permissions) { diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java index fd0c7523d..e2fff3ce2 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/ConnectionService.java @@ -414,38 +414,43 @@ public class ConnectionService { } /** - * Get all the connections defined in the system. - * @param userID The ID of the user who is querying the connections. - * @return A list of all connections defined in the system. + * Get the names of all the connections defined in the system. + * + * @return A Set of names of all the connections defined in the system. */ - public List getAllConnections(int userID) { + public Set getAllConnectionNames() { + + // Set of all present connection names + Set names = new HashSet(); + + // Query all connection names + List connections = + connectionDAO.selectByExample(new ConnectionExample()); + for (Connection connection : connections) + names.add(connection.getConnection_name()); - // Get all connections defined in the system. - List allConnections = connectionDAO.selectByExample(new ConnectionExample()); - - // Translate database records to MySQLConnections - List allMySQLConnections = new ArrayList(); - - for(Connection connection : allConnections) { - allMySQLConnections.add(toMySQLConnection(connection, userID)); - } - - return allMySQLConnections; + return names; + } - + /** - * Get the IDs of all the connection defined in the system. - * @param userID The ID of the user who is querying the connections. - * @return A list of IDs of all the connections defined in the system. + * Get the connection IDs of all the connections defined in the system. + * + * @return A list of connection IDs of all the connections defined in the system. */ - public List getAllConnectionIDs(int userID) { + public List getAllConnectionIDs() { + + // Set of all present connection IDs List connectionIDs = new ArrayList(); - for(MySQLConnection connection : getAllConnections(userID)) { - connectionIDs.add(connection.getConnectionID()); - } + + // Query all connection IDs + List connections = + connectionDAO.selectByExample(new ConnectionExample()); + for (Connection connection : connections) + connectionIDs.add(connection.getConnection_id()); return connectionIDs; + } - } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index c580a10fe..059bbeb38 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -242,9 +242,8 @@ public class PermissionCheckService { public List retrieveUserIDs(int userID, String permissionType) { // A system administrator has access to all users. - if(checkSystemAdministratorAccess(userID)) { + if(checkSystemAdministratorAccess(userID)) return userService.getAllUserIDs(); - } // Query all user permissions for the given user and permission type UserPermissionExample example = new UserPermissionExample(); @@ -275,9 +274,8 @@ public class PermissionCheckService { String permissionType) { // A system administrator has access to all connections. - if(checkSystemAdministratorAccess(userID)) { - return connectionService.getAllConnectionIDs(userID); - } + if(checkSystemAdministratorAccess(userID)) + return connectionService.getAllConnectionIDs(); // Query all connection permissions for the given user and permission type ConnectionPermissionExample example = new ConnectionPermissionExample(); @@ -295,6 +293,54 @@ public class PermissionCheckService { } + /** + * Retrieve all existing usernames that the given user has permission to + * perform the given operation upon. + * + * @param userID The user whose permissions should be checked. + * @param permissionType The permission to check. + * @return A set of all usernames for which the given user has the given + * permission. + */ + public Set retrieveUsernames(int userID, String permissionType) { + + // A system administrator has access to all users. + if(checkSystemAdministratorAccess(userID)) + return userService.getAllUsernames(); + + // List of all user IDs for which this user has read access + List userIDs = + retrieveUserIDs(userID, MySQLConstants.USER_READ); + + // Query all associated users + return userService.translateUsernames(userIDs).keySet(); + + } + + /** + * Retrieve all existing usernames that the given user has permission to + * perform the given operation upon. + * + * @param userID The user whose permissions should be checked. + * @param permissionType The permission to check. + * @return A set of all usernames for which the given user has the given + * permission. + */ + public Set retrieveConnectionNames(int userID, String permissionType) { + + // A system administrator has access to all connections. + if(checkSystemAdministratorAccess(userID)) + return connectionService.getAllConnectionNames(); + + // List of all connection IDs for which this connection has read access + List connectionIDs = + retrieveUserIDs(userID, MySQLConstants.CONNECTION_READ); + + // Query all associated connections + return connectionService.translateNames(connectionIDs).keySet(); + + } + /** * Retrieves all user permissions granted to the user having the given ID. * diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index 828c55bdb..e3b0552f0 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -44,16 +44,15 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import net.sourceforge.guacamole.GuacamoleException; import net.sourceforge.guacamole.net.auth.Credentials; -import net.sourceforge.guacamole.net.auth.User; import net.sourceforge.guacamole.net.auth.mysql.MySQLUser; -import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; -import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; +import net.sourceforge.guacamole.net.auth.mysql.model.User; import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; @@ -71,24 +70,6 @@ public class UserService { @Inject private UserMapper userDAO; - /** - * DAO for accessing user permissions, which will be injected. - */ - @Inject - private UserPermissionMapper userPermissionDAO; - - /** - * DAO for accessing connection permissions, which will be injected. - */ - @Inject - private ConnectionPermissionMapper connectionPermissionDAO; - - /** - * DAO for accessing system permissions, which will be injected. - */ - @Inject - private SystemPermissionMapper systemPermissionDAO; - /** * Provider for creating users. */ @@ -124,7 +105,7 @@ public class UserService { * @throws GuacamoleException If an error occurs while reading the data * of the provided User. */ - public MySQLUser toMySQLUser(User user) throws GuacamoleException { + public MySQLUser toMySQLUser(net.sourceforge.guacamole.net.auth.User user) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); mySQLUser.init(user); return mySQLUser; @@ -255,11 +236,11 @@ public class UserService { // Get all users having the given IDs UserExample example = new UserExample(); example.createCriteria().andUser_idIn(ids); - List users = + List users = userDAO.selectByExample(example); // Produce set of names - for (net.sourceforge.guacamole.net.auth.mysql.model.User user : users) + for (User user : users) names.put(user.getUsername(), user.getUser_id()); return names; @@ -285,11 +266,11 @@ public class UserService { // Get all users having the given IDs UserExample example = new UserExample(); example.createCriteria().andUser_idIn(Lists.newArrayList(ids)); - List users = + List users = userDAO.selectByExample(example); // Produce set of names - for (net.sourceforge.guacamole.net.auth.mysql.model.User user : users) + for (User user : users) names.put(user.getUser_id(), user.getUsername()); return names; @@ -358,36 +339,43 @@ public class UserService { } /** - * Get all the users defined in the system. - * @return A list of all users defined in the system. + * Get the usernames of all the users defined in the system. + * + * @return A Set of usernames of all the users defined in the system. */ - public List getAllUsers() { + public Set getAllUsernames() { + + // Set of all present usernames + Set usernames = new HashSet(); + + // Query all usernames + List users = + userDAO.selectByExample(new UserExample()); + for (User user : users) + usernames.add(user.getUsername()); - // Get all users defined in the system. - List allUsers = userDAO.selectByExampleWithBLOBs(new UserExample()); - - // Translate database records to MySQLUsers - List allMySQLUsers = new ArrayList(); - - for(UserWithBLOBs user : allUsers) { - allMySQLUsers.add(toMySQLUser(user)); - } - - return allMySQLUsers; + return usernames; + } - + /** - * Get the IDs of all the user defined in the system. - * @return A list of IDs of all the users defined in the system. + * Get the user IDs of all the users defined in the system. + * + * @return A list of user IDs of all the users defined in the system. */ public List getAllUserIDs() { + + // Set of all present user IDs List userIDs = new ArrayList(); - for(MySQLUser user : getAllUsers()) { - userIDs.add(user.getUserID()); - } + + // Query all user IDs + List users = + userDAO.selectByExample(new UserExample()); + for (User user : users) + userIDs.add(user.getUser_id()); return userIDs; + } - } From 8f43da42bf17fbcc0f78a28942c84effb9c1b59f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 3 Mar 2013 23:41:49 -0800 Subject: [PATCH 104/109] Ticket #269: Trim identifiers on add(). --- .../guacamole/net/auth/mysql/ConnectionDirectory.java | 7 ++++--- .../guacamole/net/auth/mysql/UserDirectory.java | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index a08dcbeca..c5b6c57bd 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -130,7 +130,8 @@ public class ConnectionDirectory implements Directory{ @Override public void add(Connection object) throws GuacamoleException { - if(object.getIdentifier().isEmpty()) + String identifier = object.getIdentifier().trim(); + if(identifier.isEmpty()) throw new GuacamoleClientException("The connection identifier cannot be blank."); // Verify permission to create @@ -139,13 +140,13 @@ public class ConnectionDirectory implements Directory{ // Verify that no connection already exists with this identifier. MySQLConnection previousConnection = - connectionService.retrieveConnection(object.getIdentifier(), user_id); + connectionService.retrieveConnection(identifier, user_id); if(previousConnection != null) throw new GuacamoleClientException("That connection identifier is already in use."); // Create connection MySQLConnection connection = connectionService.createConnection( - object.getIdentifier(), object.getConfiguration().getProtocol(), + identifier, object.getConfiguration().getProtocol(), user_id); // Add connection parameters diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index e3228683b..228c64710 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -154,7 +154,8 @@ public class UserDirectory implements Directory Date: Mon, 4 Mar 2013 00:09:30 -0800 Subject: [PATCH 105/109] Prevent foot shooting. --- .../guacamole/net/auth/mysql/UserDirectory.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 228c64710..67ce9c38c 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -517,14 +517,21 @@ public class UserDirectory implements Directory permissions) { + Collection permissions) + throws GuacamoleException { // If no permissions given, stop now if (permissions.isEmpty()) return; + // Prevent self-de-adminifying + if (user_id == this.user_id) + throw new GuacamoleClientException("Removing your own administrative permissions is not allowed."); + // Build list of requested system permissions List systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) @@ -575,6 +582,10 @@ public class UserDirectory implements Directory Date: Mon, 4 Mar 2013 00:41:29 -0800 Subject: [PATCH 106/109] Fix style issues. --- .../net/auth/mysql/ConnectionDirectory.java | 7 +++---- .../guacamole/net/auth/mysql/UserDirectory.java | 8 +++++--- .../auth/mysql/service/ConnectionService.java | 16 ++++++++-------- .../mysql/service/PermissionCheckService.java | 14 +++++++------- .../net/auth/mysql/service/UserService.java | 12 ++++++------ 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index c5b6c57bd..11398ba12 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -38,7 +38,6 @@ package net.sourceforge.guacamole.net.auth.mysql; * ***** END LICENSE BLOCK ***** */ import com.google.inject.Inject; -import java.util.List; import java.util.Set; import net.sourceforge.guacamole.GuacamoleClientException; import net.sourceforge.guacamole.GuacamoleException; @@ -133,17 +132,17 @@ public class ConnectionDirectory implements Directory{ String identifier = object.getIdentifier().trim(); if(identifier.isEmpty()) throw new GuacamoleClientException("The connection identifier cannot be blank."); - + // Verify permission to create permissionCheckService.verifySystemAccess(this.user_id, MySQLConstants.SYSTEM_CONNECTION_CREATE); // Verify that no connection already exists with this identifier. - MySQLConnection previousConnection = + MySQLConnection previousConnection = connectionService.retrieveConnection(identifier, user_id); if(previousConnection != null) throw new GuacamoleClientException("That connection identifier is already in use."); - + // Create connection MySQLConnection connection = connectionService.createConnection( identifier, object.getConfiguration().getProtocol(), diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 67ce9c38c..4a432cf45 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -485,6 +485,8 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { @@ -499,7 +501,7 @@ public class UserDirectory implements Directory systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) @@ -585,7 +587,7 @@ public class UserDirectory implements Directory connectionHistories = + List connectionHistories = connectionHistoryDAO.selectByExampleWithRowbounds(example, rowBounds); // Convert history entries to connection records @@ -412,10 +412,10 @@ public class ConnectionService { connectionDAO.updateByPrimaryKeySelective(connection); } - + /** * Get the names of all the connections defined in the system. - * + * * @return A Set of names of all the connections defined in the system. */ public Set getAllConnectionNames() { @@ -428,19 +428,19 @@ public class ConnectionService { connectionDAO.selectByExample(new ConnectionExample()); for (Connection connection : connections) names.add(connection.getConnection_name()); - + return names; } /** * Get the connection IDs of all the connections defined in the system. - * + * * @return A list of connection IDs of all the connections defined in the system. */ public List getAllConnectionIDs() { - // Set of all present connection IDs + // Set of all present connection IDs List connectionIDs = new ArrayList(); // Query all connection IDs @@ -448,7 +448,7 @@ public class ConnectionService { connectionDAO.selectByExample(new ConnectionExample()); for (Connection connection : connections) connectionIDs.add(connection.getConnection_id()); - + return connectionIDs; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 059bbeb38..51ead4284 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -164,7 +164,7 @@ public class PermissionCheckService { // A system administrator has full access to everything. if(checkSystemAdministratorAccess(userID)) return true; - + // Check existence of requested permission UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andAffected_user_idEqualTo(affectedUserID).andPermissionEqualTo(permissionType); @@ -187,7 +187,7 @@ public class PermissionCheckService { // A system administrator has full access to everything. if(checkSystemAdministratorAccess(userID)) return true; - + // Check existence of requested permission ConnectionPermissionExample example = new ConnectionPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andConnection_idEqualTo(affectedConnectionID).andPermissionEqualTo(permissionType); @@ -207,14 +207,14 @@ public class PermissionCheckService { // A system administrator has full access to everything. if(checkSystemAdministratorAccess(userID)) return true; - + // Check existence of requested permission SystemPermissionExample example = new SystemPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(systemPermissionType); return systemPermissionDAO.countByExample(example) > 0; } - + /** * Checks whether a user has system administrator access to the system. @@ -244,7 +244,7 @@ public class PermissionCheckService { // A system administrator has access to all users. if(checkSystemAdministratorAccess(userID)) return userService.getAllUserIDs(); - + // Query all user permissions for the given user and permission type UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); @@ -296,7 +296,7 @@ public class PermissionCheckService { /** * Retrieve all existing usernames that the given user has permission to * perform the given operation upon. - * + * * @param userID The user whose permissions should be checked. * @param permissionType The permission to check. * @return A set of all usernames for which the given user has the given @@ -320,7 +320,7 @@ public class PermissionCheckService { /** * Retrieve all existing usernames that the given user has permission to * perform the given operation upon. - * + * * @param userID The user whose permissions should be checked. * @param permissionType The permission to check. * @return A set of all usernames for which the given user has the given diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index e3b0552f0..fe3fa8b34 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -337,10 +337,10 @@ public class UserService { userDAO.updateByPrimaryKeySelective(user); } - + /** * Get the usernames of all the users defined in the system. - * + * * @return A Set of usernames of all the users defined in the system. */ public Set getAllUsernames() { @@ -353,19 +353,19 @@ public class UserService { userDAO.selectByExample(new UserExample()); for (User user : users) usernames.add(user.getUsername()); - + return usernames; } /** * Get the user IDs of all the users defined in the system. - * + * * @return A list of user IDs of all the users defined in the system. */ public List getAllUserIDs() { - // Set of all present user IDs + // Set of all present user IDs List userIDs = new ArrayList(); // Query all user IDs @@ -373,7 +373,7 @@ public class UserService { userDAO.selectByExample(new UserExample()); for (User user : users) userIDs.add(user.getUser_id()); - + return userIDs; } From 5f710a86aff74f104665aa370e67cb15b5470356 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 4 Mar 2013 01:14:35 -0800 Subject: [PATCH 107/109] Ticket #269: Fix that darn typo where we copy the user retrieval code, replace all "user" with "connection", forget a line, and it fails utterly. --- .../net/auth/mysql/service/PermissionCheckService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 51ead4284..ae3a11387 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -318,13 +318,13 @@ public class PermissionCheckService { } /** - * Retrieve all existing usernames that the given user has permission to - * perform the given operation upon. + * Retrieve all existing connection names that the given user has permission + * to perform the given operation upon. * * @param userID The user whose permissions should be checked. * @param permissionType The permission to check. - * @return A set of all usernames for which the given user has the given - * permission. + * @return A set of all connection names for which the given user has the + * given permission. */ public Set retrieveConnectionNames(int userID, String permissionType) { @@ -334,7 +334,7 @@ public class PermissionCheckService { // List of all connection IDs for which this connection has read access List connectionIDs = - retrieveUserIDs(userID, MySQLConstants.CONNECTION_READ); + retrieveConnectionIDs(userID, MySQLConstants.CONNECTION_READ); // Query all associated connections return connectionService.translateNames(connectionIDs).keySet(); From a400fa0e220f9ef811b88e15067ba7df62c75b5e Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Mon, 4 Mar 2013 23:30:44 -0800 Subject: [PATCH 108/109] Ticket #269: Since the MyBatis mapping files are no longer manually generated, README.mybatis is no longer needed. --- .../guacamole-auth-mysql/README.mybatis | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 extensions/guacamole-auth-mysql/README.mybatis diff --git a/extensions/guacamole-auth-mysql/README.mybatis b/extensions/guacamole-auth-mysql/README.mybatis deleted file mode 100644 index 21920cf48..000000000 --- a/extensions/guacamole-auth-mysql/README.mybatis +++ /dev/null @@ -1,37 +0,0 @@ - ------------------------------------------------------------- - About this README ------------------------------------------------------------- - -This README is intended to provide quick and to-the-point documentation for -technical users intending to generate MyBatis ORM code for the -guacamole-auth-mysql project. - ------------------------------------------------------------- - MyBatis? ------------------------------------------------------------- - -MyBatis is the orm used for connection to MySQL in the -guacamole-auth-mysql project. For more information about MyBatis, see -http://code.google.com/p/mybatis/ - ------------------------------------------------------------- - Generating the MyBatis mappings ------------------------------------------------------------- - -1) Download the MyBatis mapping generator - - Go to http://code.google.com/p/mybatis/wiki/Generator to download - the MyBatis mapping generator jar. - -2) Set up the MyBatis mapping generator configuration xml - - A commented sample file is provided in docs/examples. For more information - see the documentation provided in the download from step 1. - -3) Generate the source files - - java -jar mybatis-generator-core-1.3.2.jar -configfile mybatisconfig.xml - - This command will create the generated java and xml source in the location - specified in the configuration xml. From 1e6321a74294d96b30bfe6884e6fba1ebfd7944f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 5 Mar 2013 01:38:35 -0800 Subject: [PATCH 109/109] Update README regarding MyBatis build changes. --- extensions/guacamole-auth-mysql/README | 89 +++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 10 deletions(-) diff --git a/extensions/guacamole-auth-mysql/README b/extensions/guacamole-auth-mysql/README index bf1e3b1fb..5543c124f 100644 --- a/extensions/guacamole-auth-mysql/README +++ b/extensions/guacamole-auth-mysql/README @@ -41,7 +41,77 @@ compiles all classes and packages them into a redistributable .jar file. This .jar file can be installed in the library directory configured in guacamole.properties such that the authentication provider is available. -1) Run mvn package +1) Set up a MySQL database with the Guacamole schema. + + When guacamole-auth-mysql is compiling, it needs to generate source + based on a database schema. Because the source generator uses a + connection to an actual database to do this, you must have a MySQL + database running with the Guacamole schema set up. + + First, create a database. For the sake of these instructions, we will + call the database "guacamole", and will run all scripts as the root user: + + $ mysql -u root -p + Enter password: + mysql> CREATE DATABASE guacamole; + Query OK, 1 row affected (0.00 sec) + + mysql> exit + Bye + + The schema files are in the schema/ subdirectory of the source. If run + in order, they will create the schema and a default user: + + $ cat schema/*.sql | mysql -u root -p guacamole + +2) Set up your ~/.m2/settings.xml + + Once the database is set up, Maven will need to have the credentials + required to connect to it and query the schema. This information is + specified in properties inside your ~/.m2/settings.xml file. If this + file does not exist yet, simply create it. + + For ease of compilation, we've included an example settings.xml + defining the required properties in doc/example/settings.xml. You can + simply copy this file into ~/.m2 and edit as necessary. + + If you wish to write the file yourself, the file should look like this in + general: + + + + ...profiles... + + + + We need to add a profile which defines the required properties by + placing a section like the following within the "profiles" section of your + settings.xml: + + + guacamole-mybatis + + DATABASE + USERNAME + PASSWORD + + + + Obviously, the DATABASE, USERNAME, and PASSWORD placeholders above must + be replaced with the appropriate values for your system. + + Finally, to make the profile available to the build, it must be activated. + Place a section like the following at the bottom of your settings.xml, + right after the profiles section: + + + guacamole-mybatis + + + Maven's documentation has more details on writing the settings.xml file + if you have different needs or the above directions are not clear. + +3) Run mvn package $ mvn package @@ -49,8 +119,12 @@ guacamole.properties such that the authentication provider is available. Once all dependencies have been downloaded, the .jar file will be created in the target/ subdirectory of the current directory. -2) Copy the .jar file into the library directory specified in your - guacamole.properties + If this process fails, check the build errors, and verify that the + contents of your settings.xml file is correct. + +4) Extract the .tar.gz file now present in the target/ directory, and + place the .jar files in the extracted lib/ subdirectory in the library + directory specified in guacamole.properties. You will likely need to do this as root. @@ -58,7 +132,7 @@ guacamole.properties such that the authentication provider is available. guacamole.properties, you will need to specify one. The directory is specified using the "lib-directory" property. -3) Set up your MySQL database to authenticate Guacamole users +5) Set up your MySQL database to authenticate Guacamole users A schema file is provided in the schema directory for creating the guacamole authentication tables in your MySQL database. @@ -67,7 +141,7 @@ guacamole.properties such that the authentication provider is available. with username 'guacadmin' and password 'guacadmin'. This user can be used to set up any other connections and users. -4) Configure guacamole.properties for MySQL +6) Configure guacamole.properties for MySQL There are additional properties required by the MySQL JDBC driver which must be added/changed in your guacamole.properties: @@ -85,11 +159,6 @@ guacamole.properties such that the authentication provider is available. mysql-disallow-simultaneous-connections: true ------------------------------------------------------------- - Generating MyBatis ORM mappings ------------------------------------------------------------- - -See the README.mybatis file. ------------------------------------------------------------ Reporting problems