You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2019/09/09 19:17:40 UTC
[airavata-custos] 36/48: refactored some apis, added database dump
This is an automated email from the ASF dual-hosted git repository.
smarru pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git
commit 3c659497ab64d78b365b7ace14811e73e86539ca
Author: Aarushi <aa...@gmail.com>
AuthorDate: Sat Aug 31 19:14:38 2019 -0400
refactored some apis, added database dump
---
.../src/main/resources/application.properties | 2 +
.../src/main/resources/META-INF/persistence.xml | 16 ++
.../database_scripts/sharing-registry-derby.sql | 147 ++++++++++
.../database_scripts/sharing-registry-mysql.sql | 146 ++++++++++
.../database_scripts/sharing-registry-mysql.sql | 146 ++++++++++
.../sharing-service/sharing-cpi/sharing_cpi.thrift | 274 -------------------
.../sharing-models/sharing_models.thrift | 303 ---------------------
7 files changed, 457 insertions(+), 577 deletions(-)
diff --git a/custos-sharing-registry-service/sharing-service-api/src/main/resources/application.properties b/custos-sharing-registry-service/sharing-service-api/src/main/resources/application.properties
new file mode 100644
index 0000000..2d64be9
--- /dev/null
+++ b/custos-sharing-registry-service/sharing-service-api/src/main/resources/application.properties
@@ -0,0 +1,2 @@
+server.address=0.0.0.0
+server.port= 7070
\ No newline at end of file
diff --git a/custos-sharing-registry-service/sharing-service-core/src/main/resources/META-INF/persistence.xml b/custos-sharing-registry-service/sharing-service-core/src/main/resources/META-INF/persistence.xml
new file mode 100644
index 0000000..61ec4fc
--- /dev/null
+++ b/custos-sharing-registry-service/sharing-service-core/src/main/resources/META-INF/persistence.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
+
+ <persistence-unit name="custos-sharing-registry">
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <class>org.apache.custos.sharing.service.core.db.entities.DomainEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.EntityEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.EntityTypeEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.GroupMembershipEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.PermissionTypeEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.SharingEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.UserEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.GroupAdminEntity</class>
+ <class>org.apache.custos.sharing.service.core.db.entities.UserGroupEntity</class>
+ </persistence-unit>
+</persistence>
diff --git a/custos-sharing-registry-service/sharing-service-core/src/main/resources/database_scripts/sharing-registry-derby.sql b/custos-sharing-registry-service/sharing-service-core/src/main/resources/database_scripts/sharing-registry-derby.sql
new file mode 100644
index 0000000..a7038e2
--- /dev/null
+++ b/custos-sharing-registry-service/sharing-service-core/src/main/resources/database_scripts/sharing-registry-derby.sql
@@ -0,0 +1,147 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+CREATE TABLE DOMAIN (
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (DOMAIN_ID)
+);
+
+CREATE TABLE SHARING_USER (
+ USER_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ USER_NAME VARCHAR(255) NOT NULL,
+ FIRST_NAME VARCHAR (255),
+ LAST_NAME VARCHAR (255),
+ EMAIL VARCHAR (255),
+ ICON BLOB,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (USER_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+CREATE TABLE GROUP_ADMIN (
+ ADMIN_ID VARCHAR(255) NOT NULL,
+ GROUP_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ PRIMARY KEY (ADMIN_ID, GROUP_ID, DOMAIN_ID),
+ FOREIGN KEY (ADMIN_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+CREATE TABLE USER_GROUP (
+ GROUP_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ OWNER_ID VARCHAR(255) NOT NULL,
+ GROUP_TYPE VARCHAR(255) NOT NULL,
+ GROUP_CARDINALITY VARCHAR(255) NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (GROUP_ID, DOMAIN_ID),
+ FOREIGN KEY (OWNER_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+
+CREATE TABLE GROUP_MEMBERSHIP (
+ PARENT_ID VARCHAR(255) NOT NULL,
+ CHILD_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ CHILD_TYPE VARCHAR(255) NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PARENT_ID, CHILD_ID, DOMAIN_ID),
+ FOREIGN KEY (PARENT_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (CHILD_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+CREATE TABLE ENTITY_TYPE (
+ ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (ENTITY_TYPE_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+CREATE TABLE PERMISSION_TYPE (
+ PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PERMISSION_TYPE_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+CREATE TABLE ENTITY (
+ ENTITY_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+ OWNER_ID VARCHAR(255) NOT NULL,
+ PARENT_ENTITY_ID VARCHAR(255),
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ BINARY_DATA BLOB,
+ FULL_TEXT VARCHAR(255),
+ SHARED_COUNT BIGINT DEFAULT 0,
+ ORIGINAL_ENTITY_CREATION_TIME BIGINT NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (ENTITY_ID, DOMAIN_ID),
+ FOREIGN KEY (ENTITY_TYPE_ID, DOMAIN_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (OWNER_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (PARENT_ENTITY_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+-- ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
+
+CREATE TABLE SHARING (
+ PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+ ENTITY_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR (255) NOT NULL,
+ GROUP_ID VARCHAR(255) NOT NULL,
+ SHARING_TYPE VARCHAR(255) NOT NULL,
+ INHERITED_PARENT_ID VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID, DOMAIN_ID, INHERITED_PARENT_ID),
+ FOREIGN KEY (PERMISSION_TYPE_ID, DOMAIN_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (ENTITY_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (INHERITED_PARENT_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (GROUP_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+);
+
+CREATE TABLE CONFIGURATION
+(
+ CONFIG_KEY VARCHAR(255) NOT NULL,
+ CONFIG_VALUE VARCHAR(255) NOT NULL,
+ PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
diff --git a/custos-sharing-registry-service/sharing-service-core/src/main/resources/database_scripts/sharing-registry-mysql.sql b/custos-sharing-registry-service/sharing-service-core/src/main/resources/database_scripts/sharing-registry-mysql.sql
new file mode 100644
index 0000000..145d926
--- /dev/null
+++ b/custos-sharing-registry-service/sharing-service-core/src/main/resources/database_scripts/sharing-registry-mysql.sql
@@ -0,0 +1,146 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+CREATE TABLE DOMAIN (
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (DOMAIN_ID)
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE SHARING_USER (
+ USER_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ USER_NAME VARCHAR(255) NOT NULL,
+ FIRST_NAME VARCHAR (255),
+ LAST_NAME VARCHAR (255),
+ EMAIL VARCHAR (255),
+ ICON BLOB,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (USER_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE USER_GROUP (
+ GROUP_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ OWNER_ID VARCHAR(255) NOT NULL,
+ GROUP_TYPE VARCHAR(255) NOT NULL,
+ GROUP_CARDINALITY VARCHAR(255) NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (GROUP_ID, DOMAIN_ID),
+ FOREIGN KEY (OWNER_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE GROUP_ADMIN (
+ ADMIN_ID VARCHAR(255) NOT NULL,
+ GROUP_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ PRIMARY KEY (ADMIN_ID, GROUP_ID, DOMAIN_ID),
+ FOREIGN KEY (ADMIN_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE GROUP_MEMBERSHIP (
+ PARENT_ID VARCHAR(255) NOT NULL,
+ CHILD_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ CHILD_TYPE VARCHAR(255) NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PARENT_ID, CHILD_ID, DOMAIN_ID),
+ FOREIGN KEY (PARENT_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (CHILD_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE ENTITY_TYPE (
+ ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (ENTITY_TYPE_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE PERMISSION_TYPE (
+ PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PERMISSION_TYPE_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE ENTITY (
+ ENTITY_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+ OWNER_ID VARCHAR(255) NOT NULL,
+ PARENT_ENTITY_ID VARCHAR(255),
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ BINARY_DATA BLOB,
+ FULL_TEXT TEXT,
+ SHARED_COUNT BIGINT DEFAULT 0,
+ ORIGINAL_ENTITY_CREATION_TIME BIGINT NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (ENTITY_ID, DOMAIN_ID),
+ FOREIGN KEY (ENTITY_TYPE_ID, DOMAIN_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (OWNER_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (PARENT_ENTITY_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
+
+CREATE TABLE SHARING (
+ PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+ ENTITY_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR (255) NOT NULL,
+ GROUP_ID VARCHAR(255) NOT NULL,
+ SHARING_TYPE VARCHAR(255) NOT NULL,
+ INHERITED_PARENT_ID VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID, DOMAIN_ID, INHERITED_PARENT_ID),
+ CONSTRAINT `SHARING_PERMISSION_TYPE_ID_DOMAIN_ID_FK` FOREIGN KEY (PERMISSION_TYPE_ID, DOMAIN_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ CONSTRAINT `SHARING_ENTITY_ID_DOMAIN_ID_FK` FOREIGN KEY (ENTITY_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ CONSTRAINT `SHARING_INHERITED_PARENT_ID_DOMAIN_ID_FK` FOREIGN KEY (INHERITED_PARENT_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ CONSTRAINT `SHARING_GROUP_ID_DOMAIN_ID_FK` FOREIGN KEY (GROUP_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE CONFIGURATION
+(
+ CONFIG_KEY VARCHAR(255) NOT NULL,
+ CONFIG_VALUE VARCHAR(255) NOT NULL,
+ PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
\ No newline at end of file
diff --git a/ide-integration/custos-services/src/main/resources/database_scripts/sharing-registry-mysql.sql b/ide-integration/custos-services/src/main/resources/database_scripts/sharing-registry-mysql.sql
new file mode 100644
index 0000000..145d926
--- /dev/null
+++ b/ide-integration/custos-services/src/main/resources/database_scripts/sharing-registry-mysql.sql
@@ -0,0 +1,146 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+CREATE TABLE DOMAIN (
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (DOMAIN_ID)
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE SHARING_USER (
+ USER_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ USER_NAME VARCHAR(255) NOT NULL,
+ FIRST_NAME VARCHAR (255),
+ LAST_NAME VARCHAR (255),
+ EMAIL VARCHAR (255),
+ ICON BLOB,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (USER_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE USER_GROUP (
+ GROUP_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ OWNER_ID VARCHAR(255) NOT NULL,
+ GROUP_TYPE VARCHAR(255) NOT NULL,
+ GROUP_CARDINALITY VARCHAR(255) NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (GROUP_ID, DOMAIN_ID),
+ FOREIGN KEY (OWNER_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE GROUP_ADMIN (
+ ADMIN_ID VARCHAR(255) NOT NULL,
+ GROUP_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ PRIMARY KEY (ADMIN_ID, GROUP_ID, DOMAIN_ID),
+ FOREIGN KEY (ADMIN_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE GROUP_MEMBERSHIP (
+ PARENT_ID VARCHAR(255) NOT NULL,
+ CHILD_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ CHILD_TYPE VARCHAR(255) NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PARENT_ID, CHILD_ID, DOMAIN_ID),
+ FOREIGN KEY (PARENT_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (CHILD_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE ENTITY_TYPE (
+ ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (ENTITY_TYPE_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE PERMISSION_TYPE (
+ PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PERMISSION_TYPE_ID, DOMAIN_ID),
+ FOREIGN KEY (DOMAIN_ID) REFERENCES DOMAIN(DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE ENTITY (
+ ENTITY_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR(255) NOT NULL,
+ ENTITY_TYPE_ID VARCHAR(255) NOT NULL,
+ OWNER_ID VARCHAR(255) NOT NULL,
+ PARENT_ENTITY_ID VARCHAR(255),
+ NAME VARCHAR(255) NOT NULL,
+ DESCRIPTION VARCHAR(255),
+ BINARY_DATA BLOB,
+ FULL_TEXT TEXT,
+ SHARED_COUNT BIGINT DEFAULT 0,
+ ORIGINAL_ENTITY_CREATION_TIME BIGINT NOT NULL,
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (ENTITY_ID, DOMAIN_ID),
+ FOREIGN KEY (ENTITY_TYPE_ID, DOMAIN_ID) REFERENCES ENTITY_TYPE(ENTITY_TYPE_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (OWNER_ID, DOMAIN_ID) REFERENCES SHARING_USER(USER_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ FOREIGN KEY (PARENT_ENTITY_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+ALTER TABLE ENTITY ADD FULLTEXT FULL_TEXT_INDEX(FULL_TEXT);
+
+CREATE TABLE SHARING (
+ PERMISSION_TYPE_ID VARCHAR(255) NOT NULL,
+ ENTITY_ID VARCHAR(255) NOT NULL,
+ DOMAIN_ID VARCHAR (255) NOT NULL,
+ GROUP_ID VARCHAR(255) NOT NULL,
+ SHARING_TYPE VARCHAR(255) NOT NULL,
+ INHERITED_PARENT_ID VARCHAR(255),
+ CREATED_TIME BIGINT NOT NULL,
+ UPDATED_TIME BIGINT NOT NULL,
+ PRIMARY KEY (PERMISSION_TYPE_ID, ENTITY_ID, GROUP_ID, DOMAIN_ID, INHERITED_PARENT_ID),
+ CONSTRAINT `SHARING_PERMISSION_TYPE_ID_DOMAIN_ID_FK` FOREIGN KEY (PERMISSION_TYPE_ID, DOMAIN_ID) REFERENCES PERMISSION_TYPE(PERMISSION_TYPE_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ CONSTRAINT `SHARING_ENTITY_ID_DOMAIN_ID_FK` FOREIGN KEY (ENTITY_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ CONSTRAINT `SHARING_INHERITED_PARENT_ID_DOMAIN_ID_FK` FOREIGN KEY (INHERITED_PARENT_ID, DOMAIN_ID) REFERENCES ENTITY(ENTITY_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION,
+ CONSTRAINT `SHARING_GROUP_ID_DOMAIN_ID_FK` FOREIGN KEY (GROUP_ID, DOMAIN_ID) REFERENCES USER_GROUP(GROUP_ID, DOMAIN_ID) ON DELETE CASCADE ON UPDATE NO ACTION
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+CREATE TABLE CONFIGURATION
+(
+ CONFIG_KEY VARCHAR(255) NOT NULL,
+ CONFIG_VALUE VARCHAR(255) NOT NULL,
+ PRIMARY KEY(CONFIG_KEY, CONFIG_VALUE)
+)ENGINE=InnoDB DEFAULT CHARACTER SET=latin1;
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VALUE) VALUES('sharing_reg_version', '0.17');
\ No newline at end of file
diff --git a/thrift-interfaces/sharing-service/sharing-cpi/sharing_cpi.thrift b/thrift-interfaces/sharing-service/sharing-cpi/sharing_cpi.thrift
deleted file mode 100644
index d253bd7..0000000
--- a/thrift-interfaces/sharing-service/sharing-cpi/sharing_cpi.thrift
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-namespace java org.apache.custos.sharing.registry.service.cpi
-namespace php Custos.API.Sharing
-namespace py custos.api.sharing
-
-include "../sharing-models/sharing_models.thrift"
-
-const string SHARING_CPI_VERSION = "0.18.0"
-
-service SharingRegistryService{
-
- /**
- <p>API method to return the custos sharing registry service version</p>
- */
- string getAPIVersion () throws (1: sharing_models.SharingRegistryException sre)
-
- /**
- <p>API method to create a new domain</p>
- */
- string createDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.SharingRegistryException sre, 2: sharing_models.DuplicateEntryException dee)
- /**
- <p>API method to update a domain</p>
- */
- bool updateDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to check Domain Exists</p>
- */
- bool isDomainExists(1: required string domainId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to delete domain</p>
- */
- bool deleteDomain(1: required string domainId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to retrieve a domain</p>
- */
- sharing_models.Domain getDomain(1: required string domainId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get all domain.</p>
- */
- list<sharing_models.Domain> getDomains(1: required i32 offset, 2: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
-
- /**
- <p>API method to register a user in the system</p>
- */
- string createUser(1: required sharing_models.User user) throws (1: sharing_models.SharingRegistryException sre, 2: sharing_models.DuplicateEntryException dee)
- /**
- <p>API method to update existing user</p>
- */
- bool updatedUser(1: required sharing_models.User user) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to check User Exists</p>
- */
- bool isUserExists(1: required string domainId, 2: required string userId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to delete user</p>
- */
- bool deleteUser(1: required string domainId, 2: required string userId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a user</p>
- */
- sharing_models.User getUser(1: required string domainId, 2: required string userId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a list of users in a specific domain.</p>
- <li>domainId : Domain id</li>
- <li>offset : Starting result number</li>
- <li>limit : Number of max results to be sent</li>
- */
- list<sharing_models.User> getUsers(1: required string domainId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
-
- /**
- <p>API method to create a new group</p>
- */
- string createGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to update a group</p>
- */
- bool updateGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to check Group Exists</p>
- */
- bool isGroupExists(1: required string domainId, 2: required string groupId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to delete a group</p>
- */
- bool deleteGroup(1: required string domainId, 2: required string groupId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a group</p>
- */
- sharing_models.UserGroup getGroup(1: required string domainId, 2: required string groupId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get groups in a domainId.</p>
- */
- list<sharing_models.UserGroup> getGroups(1: required string domainId, 2: required i32 offset, 3: required i32 limit)
-
- /**
- <p>API method to add list of users to a group</p>
- */
- bool addUsersToGroup(1: required string domainId, 2: required list<string> userIds, 3: required string groupId) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to remove users from a group</p>
- */
- bool removeUsersFromGroup(1: required string domainId, 2: required list<string> userIds, 3: required string groupId) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to transfer group ownership</p>
- */
- bool transferGroupOwnership(1: required string domainId, 2: required string groupId, 3: required string newOwnerId) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to add Admin for a group</p>
- */
- bool addGroupAdmins(1: required string domainId, 2: required string groupId, 3: required list<string> adminIds) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to remove Admin for a group</p>
- */
- bool removeGroupAdmins(1: required string domainId, 2: required string groupId, 3: required list<string> adminIds) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to check whether the user has Admin access for the group</p>
- */
- bool hasAdminAccess(1: required string domainId, 2: required string groupId, 3: required string adminId) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to check whether the user has Admin access for the group</p>
- */
- bool hasOwnerAccess(1: required string domainId, 2: required string groupId, 3: required string ownerId) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to get list of child users in a group. Only the direct members will be returned.</p>
- */
- list<sharing_models.User> getGroupMembersOfTypeUser(1: string domainId, 2: required string groupId, 3: required i32 offset, 4: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to get list of child groups in a group. Only the direct members will be returned.</p>
- */
- list<sharing_models.UserGroup> getGroupMembersOfTypeGroup(1: required string domainId, 2: required string groupId, 3: required i32 offset, 4: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to add a child group to a parent group.</p>
- */
- bool addChildGroupsToParentGroup(1: required string domainId, 2: required list<string> childIds, 3: required string groupId) throws (1: sharing_models.SharingRegistryException sre);
- /**
- <p>API method to remove a child group from parent group.</p>
- */
- bool removeChildGroupFromParentGroup(1: required string domainId, 2: required string childId, 3: required string groupId) throws (1: sharing_models.SharingRegistryException sre);
-
- list<sharing_models.UserGroup> getAllMemberGroupsForUser(1: required string domainId, 2: required string userId) throws (1: sharing_models.SharingRegistryException sre);
-
- /**
- <p>API method to create a new entity type</p>
- */
- string createEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.SharingRegistryException sre, 2: sharing_models.DuplicateEntryException dee)
- /**
- <p>API method to update entity type</p>
- */
- bool updateEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to check EntityType Exists</p>
- */
- bool isEntityTypeExists(1: required string domainId, 2: required string entityTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to delete entity type</p>
- */
- bool deleteEntityType(1: required string domainId, 2: required string entityTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get an entity type</p>
- */
- sharing_models.EntityType getEntityType(1: required string domainId, 2: required string entityTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get entity types in a domainId.</p>
- */
- list<sharing_models.EntityType> getEntityTypes(1: required string domainId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException sre);
-
-
- /**
- <p>API method to register new entity</p>
- */
- string createEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to update entity</p>
- */
- bool updateEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to check Entity Exists</p>
- */
- bool isEntityExists(1: required string domainId, 2: required string entityId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to delete entity</p>
- */
- bool deleteEntity(1: required string domainId, 2: required string entityId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get entity</p>
- */
- sharing_models.Entity getEntity(1: required string domainId, 2: required string entityId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to search entities</p>
- */
- list<sharing_models.Entity> searchEntities(1: required string domainId, 2: required string userId, 3: required list<sharing_models.SearchCriteria> filters, 4: required i32 offset, 5: required i32 limit) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a list of shared users given the entity id</p>
- */
- list<sharing_models.User> getListOfSharedUsers(1: required string domainId, 2: required string entityId, 3: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a list of shared users given the entity id where the sharing type is directly applied</p>
- */
- list<sharing_models.User> getListOfDirectlySharedUsers(1: required string domainId, 2: required string entityId, 3: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a list of shared groups given the entity id</p>
- */
- list<sharing_models.UserGroup> getListOfSharedGroups(1: required string domainId, 2: required string entityId, 3: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get a list of directly shared groups given the entity id where the sharing type is directly applied</p>
- */
- list<sharing_models.UserGroup> getListOfDirectlySharedGroups(1: required string domainId, 2: required string entityId, 3: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
-
- /**
- <p>API method to create permission type</p>
- */
- string createPermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.SharingRegistryException sre, 2: sharing_models.DuplicateEntryException dee)
- /**
- <p>API method to update permission type</p>
- */
- bool updatePermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to check Permission Exists</p>
- */
- bool isPermissionExists(1: required string dimainId, 2: required string permissionId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to delete permission type</p>
- */
- bool deletePermissionType(1: required string domainId, 2: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get permission type</p>
- */
- sharing_models.PermissionType getPermissionType(1: required string domainId, 2: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to get list of permission types in a given domainId.</p>
- */
- list<sharing_models.PermissionType> getPermissionTypes(1: required string domainId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException sre)
-
- /**
- <p>API method to share an entity with users</p>
- */
- bool shareEntityWithUsers(1: required string domainId, 2: required string entityId, 3: required list<string> userList, 4: required string permissionTypeId, 5: required bool cascadePermission) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to revoke sharing from a list of users</p>
- */
- bool revokeEntitySharingFromUsers(1: required string domainId, 2: required string entityId, 3: required list<string> userList, 4: required string permissionTypeId ) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to share an entity with list of groups</p>
- */
- bool shareEntityWithGroups(1: required string domainId, 2: required string entityId, 3: required list<string> groupList, 4: required string permissionTypeId, 5: required bool cascadePermission) throws (1: sharing_models.SharingRegistryException sre)
- /**
- <p>API method to revoke sharing from list of users</p>
- */
- bool revokeEntitySharingFromGroups(1: required string domainId, 2: required string entityId, 3: required list<string> groupList, 4: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
-
- /**
- <p>API method to check whether a user has access to a specific entity</p>
- */
- bool userHasAccess(1: required string domainId, 2: required string userId, 3: required string entityId, 4: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException sre)
-}
diff --git a/thrift-interfaces/sharing-service/sharing-models/sharing_models.thrift b/thrift-interfaces/sharing-service/sharing-models/sharing_models.thrift
deleted file mode 100644
index dbaae11..0000000
--- a/thrift-interfaces/sharing-service/sharing-models/sharing_models.thrift
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
- namespace java org.apache.custos.sharing.registry.models
- namespace php Custos.Model.Sharing
- namespace py Custos.model.sharing
-
-const string DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID"
-
-/**
-* <p>Domain is the entity that enables multi-tenency in this componenet. Every tenant will be
-* operating separately it's own silo which is identified by the domain id. In the current implementation domain id
-* will be same as the domain name</p>
-* <li>domainId : Will be generated by the server based on the domain name</li>
-* <li><b>name</b> : A single word name that identifies the domain e.g seagrid, ultrascan</li>
-* <li>description : A short description for the domain</li>
-* <li>createdTime : Will be set by the system</li>
-* <li>updatedTime : Will be set by the system</li>
-**/
-struct Domain {
- 1: optional string domainId = DO_NOT_SET_AT_CLIENTS_ID,
- 2: optional string name,
- 3: optional string description,
- 4: optional i64 createdTime,
- 5: optional i64 updatedTime
-}
-
-/**
-* <p>User is the model used to register a user in the system. Minimal user information will be required to provide
-* regarding the user.</p>
-* <li><b>userId</b> : User id provided by the client</li>
-* <li><b>domainId</b> : Domain id for that user</li>
-* <li><b>userName</b> : User name for the user</li>
-* <li><b>firstName</b> : First name of the user</li>
-* <li><b>lastName</b> : Last name of the user</li>
-* <li><b>email</b> : Email address of the user</li>
-* <li>icon : A binary field for storing the user icon</li>
-* <li>createdTime : If client provides this value then the system will use it if not the current time will be set</li>
-* <li>updatedTime : If client provides this value then the system will use it if not the current time will be set</li>
-**/
-struct User {
- 1: optional string userId,
- 2: optional string domainId,
- 3: optional string userName,
- 4: optional string firstName,
- 5: optional string lastName,
- 6: optional string email,
- 7: optional binary icon,
- 8: optional i64 createdTime,
- 9: optional i64 updatedTime
-}
-
-/*
-* Admin user for a group. Admin will have access to add more users or remove users from the group
-*
-**/
-struct GroupAdmin {
- 1: optional string groupId,
- 2: optional string domainId,
- 3: optional string adminId
-}
-
-/**
-* <p>This is an system internal enum used to define single user groups and multi users groups. Every user is also
-* considered as a group in it's own right for implementation ease</p>
-**/
-enum GroupCardinality {
- SINGLE_USER,
- MULTI_USER
-}
-
-/**
-* <p>Group types can be either user level or domain level groups.</p>
-**/
-enum GroupType {
- DOMAIN_LEVEL_GROUP,
- USER_LEVEL_GROUP
-}
-
-/**
-*<p>User group is a collection of users.</p>
-* <li><b>groupId</b> : Group id provided by the client</li>
-* <li><b>domainId</b> : Domain id for this user group</li>
-* <li><b>name</b> : Name for the user group. should be one word</li>
-* <li>description : Short description for the group.</li>
-* <li><b>ownerId</b> : Owner id of this group.</li>
-* <li><b>groupType</b> : Group type (DOMAIN_LEVEL_GROUP, USER_LEVEL_GROUP)</li>
-* <li><b>groupCardinality</b> : Group cardinality (SINGLE_USER, MULTI_USER)</li>
-* <li>createdTime : Will be set by the system</li>
-* <li>updatedTime : Will be set by the system</li>
-* <li>groupAdmins : Admins for the group</li>
-**/
-struct UserGroup {
- 1: optional string groupId,
- 2: optional string domainId,
- 3: optional string name,
- 4: optional string description,
- 5: optional string ownerId,
- 6: optional GroupType groupType,
- 7: optional GroupCardinality groupCardinality,
- 8: optional i64 createdTime,
- 9: optional i64 updatedTime,
- 10: optional list<GroupAdmin> groupAdmins
-}
-
-/**
-* <p>System internal data type to match group child types</p>
-**/
-enum GroupChildType {
- USER,
- GROUP
-}
-
-/**
-* <p>System internal data type to map group memberships</p>
-**/
-struct GroupMembership {
- 1: optional string parentId,
- 2: optional string childId,
- 3: optional string domainId,
- 4: optional GroupChildType childType
- 5: optional i64 createdTime,
- 6: optional i64 updatedTime
-}
-
-
-/**
-* <p>client defined entity types</p>
-* <li><b>entityTypeId</b> : Entity type id provided by the client</li>
-* <li><b>domainId</b> : Domain id of the domain.</li>
-* <li><b>name</b> : Name for the entity type. Should be a single word.</li>
-* <li>description : Short description for the entity type.</li>
-* <li>createdTime : Will be set by the system</li>
-* <li>updatedTime : Will be set by the system</li>
-**/
-struct EntityType {
- 1: optional string entityTypeId,
- 2: optional string domainId,
- 3: optional string name,
- 4: optional string description,
- 5: optional i64 createdTime,
- 6: optional i64 updatedTime
-}
-
-/**
-* <p>This list of fields that can be used to search entities</p>
-* <li>NAME : Name of the entity</li>
-* <li>DESCRIPTION : Description of the entity</li>
-* <li>FULL_TEXT : Full text field of the entity</li>
-* <li>PARENT_ENTITY_ID : Parent entity id of the entity</li>
-* <li>OWNER_ID : Owner of the entity</li>
-* <li>CREATED_TIME : Created time of the entity</li>
-* <li>UPDATED_TIME : Updated time of the entity</li>
-* <li>SHARED_COUNT : Number of directly shared users and groups</li>
-**/
-enum EntitySearchField {
- NAME,
- DESCRIPTION,
- FULL_TEXT,
- PARRENT_ENTITY_ID,
- OWNER_ID,
- PERMISSION_TYPE_ID,
- CREATED_TIME,
- UPDATED_TIME,
- ENTITY_TYPE_ID,
- SHARED_COUNT
-}
-
-/**
-* <p>Different search operators that can be used with the entity search fields</p>
-* <li>EQUAL : Simply matches for equality. Applicable for name, and parent entity id</li>
-* <li>LIKE : Check for the condition %$FIELD% condition. Applicable for name, and description</li>
-* <li>FULL_TEXT : Does a full text search. Only applicable for the FULL_TEXT field.</li>
-* <li>GTE : Greater than or equal. Only applicable for created time, updated time and shared count.</li>
-* <li>LTE : Less than or equal. Only applicable for created time, updated time and shared count.</li>
-**/
-enum SearchCondition {
- EQUAL,
- LIKE,
- FULL_TEXT,
- GTE,
- LTE,
- NOT
-}
-
-/**
-* <p>Container object for search criteria</p>
-* <li><b>searchField</b> : Entity search field</li>
-* <li><b>value</b> : Search value</li>
-* <li><b>searchCondition</b> : EQUAL, LIKE etc..</li>
-**/
-struct SearchCriteria {
- 1: optional EntitySearchField searchField,
- 2: optional string value,
- 3: optional SearchCondition searchCondition
-}
-
-/**
-* <p>Entity object which is used to register an entity in the system.</p>
-* <li><b>entityId</b> : Entity id provided by the client</li>
-* <li><b>domainId</b> : Domain id</li>
-* <li><b>entityTypeId</b> : Entity type id</li>
-* <li><b>ownerId</b> : Owner id</li>
-* <li>parentEntityId : Parent entity id</li>
-* <li><b>name</b> : Name</li>
-* <li>description : Short description for the entity</li>
-* <li>binaryData : Any information stored in binary format</li>
-* <li>fullText : A string which will be considered for full text search</li>
-* <li><b>originalEntityCreationTime</b> : When registering old records what is the original entity creation time. If not
-* set will be default to current time</li>
-* <li>createdTime : Will be set by the system</li>
-* <li>updatedTime : Will be set by the system</li>
-**/
-struct Entity {
- 1: optional string entityId,
- 2: optional string domainId,
- 3: optional string entityTypeId,
- 4: optional string ownerId,
- 5: optional string parentEntityId,
- 6: optional string name,
- 7: optional string description,
- 8: optional binary binaryData,
- 9: optional string fullText,
- 10: optional i64 sharedCount = 0,
- 11: optional i64 originalEntityCreationTime,
- 12: optional i64 createdTime,
- 13: optional i64 updatedTime
-}
-
-/**
-* <p>Object for creating client defined permission type</p>
-* <li><b>permissionTypeId</b> : Permission type id provided by the client</li>
-* <li><b>domainId</b> : Domain id</li>
-* <li><b>name</b> : Single word name for the permission</li>
-* <li>description : Short description for the permission type</li>
-* <li>createdTime : Will be set by the system</li>
-* <li>updatedTime : Will be set by the system</li>
-**/
-struct PermissionType {
- 1: optional string permissionTypeId,
- 2: optional string domainId,
- 3: optional string name,
- 4: optional string description,
- 5: optional i64 createdTime,
- 6: optional i64 updatedTime
-}
-
-/**
-* <p>This is an internal enum type for managing sharings</p>
-**/
-enum SharingType {
- DIRECT_NON_CASCADING,
- DIRECT_CASCADING,
- INDIRECT_CASCADING
- }
-
-/**
-* <p>This is an internal enum type for managing sharings</p>
-**/
-struct Sharing {
- 1: optional string permissionTypeId,
- 2: optional string entityId,
- 3: optional string groupId,
- 4: optional SharingType sharingType,
- 5: optional string domainId,
- 6: optional string inheritedParentId,
- 7: optional i64 createdTime,
- 8: optional i64 updatedTime
-}
-
-/**
-* <p>Exception model used in the sharing registry service</p>
-**/
-exception SharingRegistryException {
- 1: required string message
-}
-
-/**
-* This exception is thrown when you try to save a duplicate entity that already exists
-* in the database.
-*
-* message: contains the associated error message
-**/
-exception DuplicateEntryException {
- 1: required string message
-}
\ No newline at end of file