Repository: airavata Updated Branches: refs/heads/airavata-gov-registry d07017a38 -> ac819e516
http://git-wip-us.apache.org/repos/asf/airavata/blob/ac819e51/modules/airavata-sharing-registry/pom.xml ---------------------------------------------------------------------- diff --git a/modules/airavata-sharing-registry/pom.xml b/modules/airavata-sharing-registry/pom.xml new file mode 100644 index 0000000..f69b0d1 --- /dev/null +++ b/modules/airavata-sharing-registry/pom.xml @@ -0,0 +1,27 @@ +<?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> + + <parent> + <artifactId>airavata</artifactId> + <groupId>org.apache.airavata</groupId> + <relativePath>../pom.xml</relativePath> + <version>0.17-SNAPSHOT</version> + </parent> + + <groupId>org.apache.airavata</groupId> + <artifactId>airavata-sharing-registry</artifactId> + <packaging>pom</packaging> + <version>${global.version}</version> + + <properties> + <global.version>0.17-SNAPSHOT</global.version> + </properties> + + <modules> + <module>airavata-sharing-registry-stubs</module> + <module>airavata-sharing-registry-core</module> + </modules> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ac819e51/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift ---------------------------------------------------------------------- diff --git a/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift b/modules/airavata-sharing-registry/thrift_models/sharing_cpi.thrift new file mode 100644 index 0000000..2f8e255 --- /dev/null +++ b/modules/airavata-sharing-registry/thrift_models/sharing_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.sharing.registry.service.cpi + +include "./sharing_models.thrift" + +service GovRegistryService { + + /** + * Domain Operations + **/ + bool createDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.GovRegistryException gre) + bool updateDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.GovRegistryException gre) + bool deleteDomain(1: required string domainId) throws (1: sharing_models.GovRegistryException gre) + sharing_models.Domain getDomain(1: required string domainId) throws (1: sharing_models.GovRegistryException gre) + list<sharing_models.Domain> getDomains(1: required i32 offset, 2: required i32 limit) + + /** + * User Operations + **/ + bool registerUser(1: required sharing_models.User user) throws (1: sharing_models.GovRegistryException gre) + bool updatedUser(1: required sharing_models.User user) throws (1: sharing_models.GovRegistryException gre) + bool deleteUser(1: required string userId) throws (1: sharing_models.GovRegistryException gre) + sharing_models.User getUser(1: required string userId) throws (1: sharing_models.GovRegistryException gre) + list<sharing_models.User> getUsers(1: required string domain, 2: required i32 offset, 3: required i32 limit) + + /** + * Group Operations + **/ + bool createGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.GovRegistryException gre) + bool updateGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.GovRegistryException gre) + bool deleteGroup(1: required string groupId) throws (1: sharing_models.GovRegistryException gre) + sharing_models.UserGroup getGroup(1: required string groupId) throws (1: sharing_models.GovRegistryException gre) + list<sharing_models.UserGroup> 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: sharing_models.GovRegistryException gre); + bool removeUsersFromGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.GovRegistryException gre); + map<string, sharing_models.GroupType> getGroupMembers(1: required string groupId) + + /** + * EntityType Operations + **/ + bool createEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.GovRegistryException gre) + bool updateEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.GovRegistryException gre) + bool deleteEntityType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre) + sharing_models.EntityType getEntityType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre) + list<sharing_models.EntityType> getEntityTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) + + /** + * Entity Operations + **/ + bool registerEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.GovRegistryException gre) + bool updateEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.GovRegistryException gre) + bool deleteEntity(1: required string entityId) throws (1: sharing_models.GovRegistryException gre) + sharing_models.Entity getEntity(1: required string entityId) throws (1: sharing_models.GovRegistryException gre) + list<sharing_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: sharing_models.GovRegistryException gre) + + /** + * EntityType Operations + **/ + bool createPermissionType(1: required sharing_models.PermissionType permisionType) throws (1: sharing_models.GovRegistryException gre) + bool updatePermissionType(1: required sharing_models.PermissionType permisionType) throws (1: sharing_models.GovRegistryException gre) + bool deletePermissionType(1: required string entityTypeId) throws (1: sharing_models.GovRegistryException gre) + sharing_models.PermissionType getPermissionType(1: required string permisionTypeId) throws (1: sharing_models.GovRegistryException gre) + list<sharing_models.PermissionType> getPermissionTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.GovRegistryException gre) +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ac819e51/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift ---------------------------------------------------------------------- diff --git a/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift b/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift new file mode 100644 index 0000000..554d74d --- /dev/null +++ b/modules/airavata-sharing-registry/thrift_models/sharing_models.thrift @@ -0,0 +1,115 @@ +/* + * 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.sharing.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 UserGroup { + 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 + } + + enum GroupChildType { + USER, + GROUP + } + + struct GroupMembership { + 1: optional string parentId, + 2: optional string childId, + 3: optional GroupChildType childType + 4: optional i64 createdTime, + 5: optional i64 updatedTime + } + + + +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 parentEntityId, + 6: optional string name, + 7: optional string description, + 8: optional map<string,string> metadata, + 9: optional string fullText, + 10: optional i64 createdTime, + 11: optional i64 updatedTime +} + +struct PermissionType { + 1: optional string permissionTypeId = 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 Sharing { + 1: optional string permissionTypeId, + 2: optional string entityId, + 3: optional string groupId, + 4: optional i64 createdTime, + 5: optional i64 updatedTime +} + +exception GovRegistryException { + 1: required string message +} http://git-wip-us.apache.org/repos/asf/airavata/blob/ac819e51/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh ---------------------------------------------------------------------- diff --git a/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh b/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh new file mode 100755 index 0000000..295be80 --- /dev/null +++ b/modules/airavata-sharing-registry/thrift_models/thrift-gen.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +thrift --gen java sharing_models.thrift +cd gen-java +rm -r ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/* +cp -r org/apache/airavata/sharing/registry/models/ ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/ + +cd .. +thrift --gen java sharing_cpi.thrift +cd gen-java +rm -r ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/* +cp -r org/apache/airavata/sharing/registry/service/cpi/ ../../airavata-sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/ + +cd .. + +rm -r gen-java \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/ac819e51/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml deleted file mode 100644 index 4833874..0000000 --- a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.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. - * -* --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"> - <persistence-unit name="appcatalog_data"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - <class>org.apache.airavata.registry.core.app.catalog.model.ComputeResource</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GlobusJobSubmission</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GlobusGKEndpoint</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GSISSHSubmission</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GSISSHExport</class> - <class>org.apache.airavata.registry.core.app.catalog.model.PreJobCommand</class> - <class>org.apache.airavata.registry.core.app.catalog.model.PostJobCommand</class> - <class>org.apache.airavata.registry.core.app.catalog.model.UnicoreJobSubmission</class> - <class>org.apache.airavata.registry.core.app.catalog.model.UnicoreDataMovement</class> - <class>org.apache.airavata.registry.core.app.catalog.model.HostAlias</class> - <class>org.apache.airavata.registry.core.app.catalog.model.HostIPAddress</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ScpDataMovement</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GridftpDataMovement</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GridftpEndpoint</class> - <class>org.apache.airavata.registry.core.app.catalog.model.SshJobSubmission</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ApplicationModule</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ApplicationDeployment</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ModuleLoadCmd</class> - <class>org.apache.airavata.registry.core.app.catalog.model.LibraryPrepandPath</class> - <class>org.apache.airavata.registry.core.app.catalog.model.LibraryApendPath</class> - <class>org.apache.airavata.registry.core.app.catalog.model.AppEnvironment</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ApplicationInterface</class> - <class>org.apache.airavata.registry.core.app.catalog.model.AppModuleMapping</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ApplicationIntInput</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ApplicationIntOutput</class> - <class>org.apache.airavata.registry.core.app.catalog.model.GatewayProfile</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ComputeResourcePreference</class> - <class>org.apache.airavata.registry.core.app.catalog.model.BatchQueue</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ComputeResourceFileSystem</class> - <class>org.apache.airavata.registry.core.app.catalog.model.JobSubmissionInterface</class> - <class>org.apache.airavata.registry.core.app.catalog.model.DataMovementInterface</class> - <class>org.apache.airavata.registry.core.app.catalog.model.StoragePreference</class> - <class>org.apache.airavata.registry.core.app.catalog.model.StorageResource</class> - <class>org.apache.airavata.registry.core.app.catalog.model.StorageInterface</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ResourceJobManager</class> - <class>org.apache.airavata.registry.core.app.catalog.model.JobManagerCommand</class> - <class>org.apache.airavata.registry.core.app.catalog.model.ParallelismPrefixCommand</class> - <class>org.apache.airavata.registry.core.app.catalog.model.LocalSubmission</class> - <class>org.apache.airavata.registry.core.app.catalog.model.LocalDataMovement</class> - <class>org.apache.airavata.registry.core.app.catalog.model.Configuration</class> - <exclude-unlisted-classes>true</exclude-unlisted-classes> - </persistence-unit> - <persistence-unit name="experiment_data"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Experiment</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentError</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentInput</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentOutput</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentStatus</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ExperimentSummary</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Gateway</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.GatewayWorker</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Process</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessError</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessInput</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessOutput</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessResourceSchedule</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ProcessStatus</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Project</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.ProjectUser</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Task</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.TaskError</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.TaskStatus</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Users</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.UserConfigurationData</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Job</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.JobStatus</class> - <class>org.apache.airavata.registry.core.experiment.catalog.model.Notification</class> - <exclude-unlisted-classes>true</exclude-unlisted-classes> - </persistence-unit> - <persistence-unit name="replicacatalog_data"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - <class>org.apache.airavata.registry.core.replica.catalog.model.Configuration</class> - <class>org.apache.airavata.registry.core.replica.catalog.model.DataProduct</class> - <class>org.apache.airavata.registry.core.replica.catalog.model.DataReplicaLocation</class> - <class>org.apache.airavata.registry.core.replica.catalog.model.DataProductMetaData</class> - <class>org.apache.airavata.registry.core.replica.catalog.model.DataReplicaMetaData</class> - <class>org.apache.airavata.registry.core.replica.catalog.model.Configuration</class> - <exclude-unlisted-classes>true</exclude-unlisted-classes> - </persistence-unit> - <persistence-unit name="workflowcatalog_data"> - <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> - <class>org.apache.airavata.registry.core.workflow.catalog.model.Workflow</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.WorkflowInput</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.WorkflowOutput</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.Edge</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.Node</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.Port</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.ComponentStatus</class> - <class>org.apache.airavata.registry.core.workflow.catalog.model.WorkflowStatus</class> - <exclude-unlisted-classes>true</exclude-unlisted-classes> - </persistence-unit> -</persistence> http://git-wip-us.apache.org/repos/asf/airavata/blob/ac819e51/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 3988fd0..f925004 100644 --- a/pom.xml +++ b/pom.xml @@ -564,6 +564,7 @@ <module>modules/workflow</module> <module>modules/test-suite</module> <module>modules/group-manager</module> + <module>modules/airavata-sharing-registry</module> <!-- Deprecated Modules--> <!--<module>modules/integration-tests</module>--> <!--<module>modules/workflow-model</module>-->
