Repository: airavata Updated Branches: refs/heads/airavata-gov-registry [created] 920f55b12
http://git-wip-us.apache.org/repos/asf/airavata/blob/920f55b1/airavata-gov-registry/pom.xml ---------------------------------------------------------------------- diff --git a/airavata-gov-registry/pom.xml b/airavata-gov-registry/pom.xml new file mode 100644 index 0000000..fb65085 --- /dev/null +++ b/airavata-gov-registry/pom.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.airavata</groupId> + <artifactId>gov-registry</artifactId> + <packaging>pom</packaging> + <version>${global.version}</version> + + <properties> + <global.version>0.17-SNAPSHOT</global.version> + </properties> + + <modules> + <module>airavata-gov-registry-stubs</module> + <module>airavata-gov-registry-core</module> + </modules> + +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/920f55b1/airavata-gov-registry/thrift_models/gov_reg_cpi.thrift ---------------------------------------------------------------------- diff --git a/airavata-gov-registry/thrift_models/gov_reg_cpi.thrift b/airavata-gov-registry/thrift_models/gov_reg_cpi.thrift new file mode 100644 index 0000000..f7289e2 --- /dev/null +++ b/airavata-gov-registry/thrift_models/gov_reg_cpi.thrift @@ -0,0 +1,85 @@ +/* + * 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.airavata.gov.registry.service.cpi + +include "./gov_reg_models.thrift" + +service GovRegistryService { + + /** + * Domain Operations + **/ + bool createDomain(1: required gov_reg_models.Domain domain) throws (1: gov_reg_models.GovRegistryException gre) + bool updateDomain(1: required gov_reg_models.Domain domain) throws (1: gov_reg_models.GovRegistryException gre) + bool deleteDomain(1: required string domainId) throws (1: gov_reg_models.GovRegistryException gre) + gov_reg_models.Domain getDomain(1: required string domainId) throws (1: gov_reg_models.GovRegistryException gre) + list<gov_reg_models.Domain> getDomains(1: required i32 offset, 2: required i32 limit) + + /** + * User Operations + **/ + bool registerUser(1: required gov_reg_models.User user) throws (1: gov_reg_models.GovRegistryException gre) + bool updatedUser(1: required gov_reg_models.User user) throws (1: gov_reg_models.GovRegistryException gre) + bool deleteUser(1: required string userId) throws (1: gov_reg_models.GovRegistryException gre) + gov_reg_models.User getUser(1: required string userId) throws (1: gov_reg_models.GovRegistryException gre) + list<gov_reg_models.User> getUsers(1: required string domain, 2: required i32 offset, 3: required i32 limit) + + /** + * Group Operations + **/ + bool createGroup(1: required gov_reg_models.Group group) throws (1: gov_reg_models.GovRegistryException gre) + bool updateGroup(1: required gov_reg_models.Group group) throws (1: gov_reg_models.GovRegistryException gre) + bool deleteGroup(1: required string groupId) throws (1: gov_reg_models.GovRegistryException gre) + gov_reg_models.Group getGroup(1: required string groupId) throws (1: gov_reg_models.GovRegistryException gre) + list<gov_reg_models.Group> getGroups(1: required string domain, 2: required i32 offset, 3: required i32 limit) + + bool addUsersToGroup(1: required list<string> userIds, 2: required string groupId) throws (1: gov_reg_models.GovRegistryException gre); + bool removeUsersFromGroup(1: required list<string> userIds, 2: required string groupId) throws (1: gov_reg_models.GovRegistryException gre); + map<string, gov_reg_models.GroupType> getGroupMembers(1: required string groupId) + + /** + * EntityType Operations + **/ + bool createEntityType(1: required gov_reg_models.EntityType entityType) throws (1: gov_reg_models.GovRegistryException gre) + bool updateEntityType(1: required gov_reg_models.EntityType entityType) throws (1: gov_reg_models.GovRegistryException gre) + bool deleteEntityType(1: required string entityTypeId) throws (1: gov_reg_models.GovRegistryException gre) + gov_reg_models.EntityType getEntityType(1: required string entityTypeId) throws (1: gov_reg_models.GovRegistryException gre) + list<gov_reg_models.EntityType> getEntityTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) + + /** + * Entity Operations + **/ + bool registerEntity(1: required gov_reg_models.Entity entity) throws (1: gov_reg_models.GovRegistryException gre) + bool updateEntity(1: required gov_reg_models.Entity entity) throws (1: gov_reg_models.GovRegistryException gre) + bool deleteEntity(1: required string entityId) throws (1: gov_reg_models.GovRegistryException gre) + gov_reg_models.Entity getEntity(1: required string entityId) throws (1: gov_reg_models.GovRegistryException gre) + list<gov_reg_models.Entity> searchEntities(1: required string domain, 2: required string entityType, + 3: required map<string, string> filters, 4: required i32 offset, 5: required i32 limit) throws (1: gov_reg_models.GovRegistryException gre) + + /** + * EntityType Operations + **/ + bool createPermissionType(1: required gov_reg_models.PermissionType permisionType) throws (1: gov_reg_models.GovRegistryException gre) + bool updatePermissionType(1: required gov_reg_models.PermissionType permisionType) throws (1: gov_reg_models.GovRegistryException gre) + bool deletePermissionType(1: required string entityTypeId) throws (1: gov_reg_models.GovRegistryException gre) + gov_reg_models.PermissionType getPermissionType(1: required string permisionTypeId) throws (1: gov_reg_models.GovRegistryException gre) + list<gov_reg_models.PermissionType> getPermissionTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: gov_reg_models.GovRegistryException gre) +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/920f55b1/airavata-gov-registry/thrift_models/gov_reg_models.thrift ---------------------------------------------------------------------- diff --git a/airavata-gov-registry/thrift_models/gov_reg_models.thrift b/airavata-gov-registry/thrift_models/gov_reg_models.thrift new file mode 100644 index 0000000..ef4acb9 --- /dev/null +++ b/airavata-gov-registry/thrift_models/gov_reg_models.thrift @@ -0,0 +1,91 @@ +/* + * 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.airavata.gov.registry.models + +const string DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID" + +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 +} + + struct User { + 1: optional string userId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string userName, + 4: optional i64 createdTime, + 5: optional i64 updatedTime + } + +enum GroupType { + SINGLE_USER, + MULTI_USER +} + + struct Group { + 1: optional string groupId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string name, + 6: optional string description, + 7: optional string ownerId, + 8: optional i64 createdTime, + 9: optional i64 updatedTime, + 10: optional GroupType groupType + } + + +struct EntityType { + 1: optional string entityTypeId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string name, + 4: optional string description, + 5: optional i64 createdTime, + 6: optional i64 updatedTime +} + + +struct Entity { + 1: optional string entityId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string entityTypeId, + 4: optional string ownerId, + 5: optional string name, + 6: optional string description, + 7: optional map<string,string> metadata, + 8: optional string fullText, + 9: optional i64 createdTime, + 10: optional i64 updatedTime +} + +struct PermissionType { + 1: optional string permissionId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string name, + 4: optional i64 createdTime, + 5: optional i64 updatedTime +} + +exception GovRegistryException { + 1: required string message +} http://git-wip-us.apache.org/repos/asf/airavata/blob/920f55b1/airavata-gov-registry/thrift_models/thrift-gen.sh ---------------------------------------------------------------------- diff --git a/airavata-gov-registry/thrift_models/thrift-gen.sh b/airavata-gov-registry/thrift_models/thrift-gen.sh new file mode 100755 index 0000000..839359c --- /dev/null +++ b/airavata-gov-registry/thrift_models/thrift-gen.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +thrift --gen java gov_reg_models.thrift +cd gen-java +rm -r ../../airavata-gov-registry-stubs/src/main/java/org/apache/airavata/gov/registry/models/* +cp -r org/apache/airavata/gov/registry/models/ ../../airavata-gov-registry-stubs/src/main/java/org/apache/airavata/gov/registry/models/ + +cd .. +thrift --gen java gov_reg_cpi.thrift +cd gen-java +rm -r ../../airavata-gov-registry-stubs/src/main/java/org/apache/airavata/gov/registry/service/cpi/* +cp -r org/apache/airavata/gov/registry/service/cpi/ ../../airavata-gov-registry-stubs/src/main/java/org/apache/airavata/gov/registry/service/cpi/ + +cd .. + +rm -r gen-java \ No newline at end of file