adding docs
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/87564d2b Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/87564d2b Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/87564d2b Branch: refs/heads/airavata-gov-registry Commit: 87564d2be2c0a118213443e2938df511cef356f9 Parents: d521922 Author: scnakandala <supun.nakand...@gmail.com> Authored: Fri Oct 14 17:26:41 2016 -0400 Committer: scnakandala <supun.nakand...@gmail.com> Committed: Fri Oct 14 17:26:41 2016 -0400 ---------------------------------------------------------------------- .../server/handler/AiravataServerHandler.java | 8 +- modules/sharing-registry/api-docs/index.html | 10 +- .../sharing-registry/api-docs/sharing_cpi.html | 174 +- .../api-docs/sharing_models.html | 160 +- .../migrator/airavata/AiravataDataMigrator.java | 6 +- .../registry/db/entities/SharingUserEntity.java | 11 + .../registry/db/entities/UserGroupEntity.java | 11 + .../db/repositories/UserGroupRepository.java | 4 +- .../sharing/registry/db/utils/DBConstants.java | 1 + .../server/SharingRegistryServerHandler.java | 57 +- .../main/resources/sharing-registry-derby.sql | 2 + .../main/resources/sharing-registry-mysql.sql | 2 + .../SharingRegistryServerHandlerTest.java | 26 +- .../sharing/registry/models/Domain.java | 13 +- .../sharing/registry/models/Entity.java | 22 +- .../registry/models/EntitySearchField.java | 10 + .../sharing/registry/models/EntityType.java | 12 +- .../sharing/registry/models/GroupChildType.java | 4 + .../registry/models/GroupMembership.java | 6 +- .../sharing/registry/models/GroupType.java | 12 +- .../sharing/registry/models/PermissionType.java | 12 +- .../registry/models/SearchCondition.java | 18 +- .../sharing/registry/models/SearchCriteria.java | 9 +- .../sharing/registry/models/Sharing.java | 6 +- .../models/SharingRegistryException.java | 6 +- .../sharing/registry/models/SharingType.java | 4 + .../airavata/sharing/registry/models/User.java | 168 +- .../sharing/registry/models/UserGroup.java | 394 +- .../service/cpi/SharingRegistryService.java | 10311 ++++++++++------- .../thrift_models/sharing_cpi.thrift | 226 +- .../thrift_models/sharing_models.thrift | 183 +- .../thrift_models/thrift-gen.sh | 1 - 32 files changed, 7065 insertions(+), 4824 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java index 45ddc3f..7690ca2 100644 --- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java +++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java @@ -123,7 +123,7 @@ public class AiravataServerHandler implements Airavata.Iface { user.setDomainId(domain.domainId); user.setUserId(ServerSettings.getDefaultUser()+"@"+ServerSettings.getDefaultUserGateway()); user.setUserName(ServerSettings.getDefaultUser()); - sharingRegistryServerHandler.createUser(user); + sharingRegistryServerHandler.registerUser(user); //Creating Entity Types for each domain EntityType entityType = new EntityType(); @@ -671,7 +671,7 @@ public class AiravataServerHandler implements Airavata.Iface { entity.setName(project.getName()); entity.setDescription(project.getDescription()); - sharingRegistryServerHandler.createEntity(entity); + sharingRegistryServerHandler.registerEntity(entity); } logger.debug("Airavata created project with project Id : " + projectId + " for gateway Id : " + gatewayId); @@ -1046,7 +1046,7 @@ public class AiravataServerHandler implements Airavata.Iface { entity.setName(experiment.getExperimentName()); entity.setDescription(experiment.getDescription()); - sharingRegistryServerHandler.createEntity(entity); + sharingRegistryServerHandler.registerEntity(entity); } ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.CREATED, @@ -1586,7 +1586,7 @@ public class AiravataServerHandler implements Airavata.Iface { entity.setName(existingExperiment.getExperimentName()); entity.setDescription(existingExperiment.getDescription()); - sharingRegistryServerHandler.createEntity(entity); + sharingRegistryServerHandler.registerEntity(entity); } return expId; http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/api-docs/index.html ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/api-docs/index.html b/modules/sharing-registry/api-docs/index.html index ead6c2f..6663a9d 100644 --- a/modules/sharing-registry/api-docs/index.html +++ b/modules/sharing-registry/api-docs/index.html @@ -7,14 +7,12 @@ <tr> <td>sharing_cpi</td><td><a href="sharing_cpi.html#Svc_SharingRegistryService">SharingRegistryService</a><br/> <ul> -<li><a href="sharing_cpi.html#Fn_SharingRegistryService_addChildGroupToParentGroup">addChildGroupToParentGroup</a></li> +<li><a href="sharing_cpi.html#Fn_SharingRegistryService_addChildGroupsToParentGroup">addChildGroupsToParentGroup</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_addUsersToGroup">addUsersToGroup</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createDomain">createDomain</a></li> -<li><a href="sharing_cpi.html#Fn_SharingRegistryService_createEntity">createEntity</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createEntityType">createEntityType</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createGroup">createGroup</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_createPermissionType">createPermissionType</a></li> -<li><a href="sharing_cpi.html#Fn_SharingRegistryService_createUser">createUser</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_deleteDomain">deleteDomain</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_deleteEntity">deleteEntity</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_deleteEntityType">deleteEntityType</a></li> @@ -27,7 +25,8 @@ <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getEntityType">getEntityType</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getEntityTypes">getEntityTypes</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getGroup">getGroup</a></li> -<li><a href="sharing_cpi.html#Fn_SharingRegistryService_getGroupMembers">getGroupMembers</a></li> +<li><a href="sharing_cpi.html#Fn_SharingRegistryService_getGroupMembersOfTypeGroup">getGroupMembersOfTypeGroup</a></li> +<li><a href="sharing_cpi.html#Fn_SharingRegistryService_getGroupMembersOfTypeUser">getGroupMembersOfTypeUser</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getGroups">getGroups</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getListOfSharedGroups">getListOfSharedGroups</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getListOfSharedUsers">getListOfSharedUsers</a></li> @@ -35,6 +34,8 @@ <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getPermissionTypes">getPermissionTypes</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getUser">getUser</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_getUsers">getUsers</a></li> +<li><a href="sharing_cpi.html#Fn_SharingRegistryService_registerEntity">registerEntity</a></li> +<li><a href="sharing_cpi.html#Fn_SharingRegistryService_registerUser">registerUser</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_removeChildGroupFromParentGroup">removeChildGroupFromParentGroup</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_removeUsersFromGroup">removeUsersFromGroup</a></li> <li><a href="sharing_cpi.html#Fn_SharingRegistryService_revokeEntitySharingFromGroups">revokeEntitySharingFromGroups</a></li> @@ -59,6 +60,7 @@ <a href="sharing_models.html#Struct_Entity">Entity</a><br/> <a href="sharing_models.html#Enum_EntitySearchField">EntitySearchField</a><br/> <a href="sharing_models.html#Struct_EntityType">EntityType</a><br/> +<a href="sharing_models.html#Enum_GroupCardinality">GroupCardinality</a><br/> <a href="sharing_models.html#Enum_GroupChildType">GroupChildType</a><br/> <a href="sharing_models.html#Struct_GroupMembership">GroupMembership</a><br/> <a href="sharing_models.html#Enum_GroupType">GroupType</a><br/> http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/api-docs/sharing_cpi.html ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/api-docs/sharing_cpi.html b/modules/sharing-registry/api-docs/sharing_cpi.html index b510ecc..fa1edc1 100644 --- a/modules/sharing-registry/api-docs/sharing_cpi.html +++ b/modules/sharing-registry/api-docs/sharing_cpi.html @@ -11,14 +11,12 @@ <tr> <td>sharing_cpi</td><td><a href="#Svc_SharingRegistryService">SharingRegistryService</a><br/> <ul> -<li><a href="#Fn_SharingRegistryService_addChildGroupToParentGroup">addChildGroupToParentGroup</a></li> +<li><a href="#Fn_SharingRegistryService_addChildGroupsToParentGroup">addChildGroupsToParentGroup</a></li> <li><a href="#Fn_SharingRegistryService_addUsersToGroup">addUsersToGroup</a></li> <li><a href="#Fn_SharingRegistryService_createDomain">createDomain</a></li> -<li><a href="#Fn_SharingRegistryService_createEntity">createEntity</a></li> <li><a href="#Fn_SharingRegistryService_createEntityType">createEntityType</a></li> <li><a href="#Fn_SharingRegistryService_createGroup">createGroup</a></li> <li><a href="#Fn_SharingRegistryService_createPermissionType">createPermissionType</a></li> -<li><a href="#Fn_SharingRegistryService_createUser">createUser</a></li> <li><a href="#Fn_SharingRegistryService_deleteDomain">deleteDomain</a></li> <li><a href="#Fn_SharingRegistryService_deleteEntity">deleteEntity</a></li> <li><a href="#Fn_SharingRegistryService_deleteEntityType">deleteEntityType</a></li> @@ -31,7 +29,8 @@ <li><a href="#Fn_SharingRegistryService_getEntityType">getEntityType</a></li> <li><a href="#Fn_SharingRegistryService_getEntityTypes">getEntityTypes</a></li> <li><a href="#Fn_SharingRegistryService_getGroup">getGroup</a></li> -<li><a href="#Fn_SharingRegistryService_getGroupMembers">getGroupMembers</a></li> +<li><a href="#Fn_SharingRegistryService_getGroupMembersOfTypeGroup">getGroupMembersOfTypeGroup</a></li> +<li><a href="#Fn_SharingRegistryService_getGroupMembersOfTypeUser">getGroupMembersOfTypeUser</a></li> <li><a href="#Fn_SharingRegistryService_getGroups">getGroups</a></li> <li><a href="#Fn_SharingRegistryService_getListOfSharedGroups">getListOfSharedGroups</a></li> <li><a href="#Fn_SharingRegistryService_getListOfSharedUsers">getListOfSharedUsers</a></li> @@ -39,6 +38,8 @@ <li><a href="#Fn_SharingRegistryService_getPermissionTypes">getPermissionTypes</a></li> <li><a href="#Fn_SharingRegistryService_getUser">getUser</a></li> <li><a href="#Fn_SharingRegistryService_getUsers">getUsers</a></li> +<li><a href="#Fn_SharingRegistryService_registerEntity">registerEntity</a></li> +<li><a href="#Fn_SharingRegistryService_registerUser">registerUser</a></li> <li><a href="#Fn_SharingRegistryService_removeChildGroupFromParentGroup">removeChildGroupFromParentGroup</a></li> <li><a href="#Fn_SharingRegistryService_removeUsersFromGroup">removeUsersFromGroup</a></li> <li><a href="#Fn_SharingRegistryService_revokeEntitySharingFromGroups">revokeEntitySharingFromGroups</a></li> @@ -61,180 +62,217 @@ <hr/><h2 id="Services">Services</h2> <h3 id="Svc_SharingRegistryService">Service: SharingRegistryService</h3> <div class="definition"><h4 id="Fn_SharingRegistryService_createDomain">Function: SharingRegistryService.createDomain</h4> -<pre><code>string</code> createDomain(<code><a href="sharing_models.html#Struct_Domain">sharing_models.Domain</a></code> domain) +<pre><code>string</code> createDomain(<code><a href="sharing_models.html#Struct_Domain">sharing_models.Domain</a></code> domainId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * Domain Operations -* +</pre><p>API method to create a new domainId.</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updateDomain">Function: SharingRegistryService.updateDomain</h4> -<pre><code>bool</code> updateDomain(<code><a href="sharing_models.html#Struct_Domain">sharing_models.Domain</a></code> domain) +<pre><code>bool</code> updateDomain(<code><a href="sharing_models.html#Struct_Domain">sharing_models.Domain</a></code> domainId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteDomain">Function: SharingRegistryService.deleteDomain</h4> +</pre><p>API method to update a domainId.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteDomain">Function: SharingRegistryService.deleteDomain</h4> <pre><code>bool</code> deleteDomain(<code>string</code> domainId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getDomain">Function: SharingRegistryService.getDomain</h4> +</pre><p>API method to delete domainId.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getDomain">Function: SharingRegistryService.getDomain</h4> <pre><code><a href="sharing_models.html#Struct_Domain">sharing_models.Domain</a></code> getDomain(<code>string</code> domainId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getDomains">Function: SharingRegistryService.getDomains</h4> +</pre><p>API method to retrieve a domainId.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getDomains">Function: SharingRegistryService.getDomains</h4> <pre><code>list<<code><a href="sharing_models.html#Struct_Domain">sharing_models.Domain</a></code>></code> getDomains(<code>i32</code> offset, <code>i32</code> limit) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_createUser">Function: SharingRegistryService.createUser</h4> -<pre><code>string</code> createUser(<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code> user) +</pre><p>API method to get all domainIds.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_registerUser">Function: SharingRegistryService.registerUser</h4> +<pre><code>string</code> registerUser(<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code> user) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * User Operations -* +</pre><p>API method to register a user in the system</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updatedUser">Function: SharingRegistryService.updatedUser</h4> <pre><code>bool</code> updatedUser(<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code> user) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteUser">Function: SharingRegistryService.deleteUser</h4> +</pre><p>API method to update existing user</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteUser">Function: SharingRegistryService.deleteUser</h4> <pre><code>bool</code> deleteUser(<code>string</code> userId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getUser">Function: SharingRegistryService.getUser</h4> +</pre><p>API method to delete user</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getUser">Function: SharingRegistryService.getUser</h4> <pre><code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code> getUser(<code>string</code> userId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getUsers">Function: SharingRegistryService.getUsers</h4> -<pre><code>list<<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code>></code> getUsers(<code>string</code> domain, +</pre><p>API method to get a user</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getUsers">Function: SharingRegistryService.getUsers</h4> +<pre><code>list<<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code>></code> getUsers(<code>string</code> domainId, <code>i32</code> offset, <code>i32</code> limit) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_createGroup">Function: SharingRegistryService.createGroup</h4> +</pre><p>API method to get a list of users in a specific domainId. Users will be reverse sorted based on the created time.</p> +<li>domainId : Domain id</li> +<li>offset : Starting result number</li> +<li>limit : Number of max results to be sent</li> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_createGroup">Function: SharingRegistryService.createGroup</h4> <pre><code>string</code> createGroup(<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code> group) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * Group Operations -* +</pre><p>API method to create a new group</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updateGroup">Function: SharingRegistryService.updateGroup</h4> <pre><code>bool</code> updateGroup(<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code> group) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteGroup">Function: SharingRegistryService.deleteGroup</h4> +</pre><p>API method to update a group</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteGroup">Function: SharingRegistryService.deleteGroup</h4> <pre><code>bool</code> deleteGroup(<code>string</code> groupId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroup">Function: SharingRegistryService.getGroup</h4> +</pre><p>API method to delete a group</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroup">Function: SharingRegistryService.getGroup</h4> <pre><code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code> getGroup(<code>string</code> groupId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroups">Function: SharingRegistryService.getGroups</h4> -<pre><code>list<<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code>></code> getGroups(<code>string</code> domain, +</pre><p>API method to get a group</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroups">Function: SharingRegistryService.getGroups</h4> +<pre><code>list<<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code>></code> getGroups(<code>string</code> domainId, <code>i32</code> offset, <code>i32</code> limit) -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_addUsersToGroup">Function: SharingRegistryService.addUsersToGroup</h4> +</pre><p>API method to get groups in a domainId. Results are reverse sorted based on created time.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_addUsersToGroup">Function: SharingRegistryService.addUsersToGroup</h4> <pre><code>bool</code> addUsersToGroup(<code>list<<code>string</code>></code> userIds, <code>string</code> groupId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_removeUsersFromGroup">Function: SharingRegistryService.removeUsersFromGroup</h4> +</pre><p>API method to add list of users to a group</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_removeUsersFromGroup">Function: SharingRegistryService.removeUsersFromGroup</h4> <pre><code>bool</code> removeUsersFromGroup(<code>list<<code>string</code>></code> userIds, <code>string</code> groupId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroupMembers">Function: SharingRegistryService.getGroupMembers</h4> -<pre><code>map<<code>string</code>, <code><a href="sharing_models.html#Enum_GroupChildType">sharing_models.GroupChildType</a></code>></code> getGroupMembers(<code>string</code> groupId, - <code>i32</code> offset, - <code>i32</code> limit) - throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_addChildGroupToParentGroup">Function: SharingRegistryService.addChildGroupToParentGroup</h4> -<pre><code>bool</code> addChildGroupToParentGroup(<code>string</code> childId, - <code>string</code> groupId) - throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_removeChildGroupFromParentGroup">Function: SharingRegistryService.removeChildGroupFromParentGroup</h4> +</pre><p>API method to remove users from a group</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroupMembersOfTypeUser">Function: SharingRegistryService.getGroupMembersOfTypeUser</h4> +<pre><code>list<<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code>></code> getGroupMembersOfTypeUser(<code>string</code> groupId, + <code>i32</code> offset, + <code>i32</code> limit) + throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> +</pre><p>API method to get list of child users in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getGroupMembersOfTypeGroup">Function: SharingRegistryService.getGroupMembersOfTypeGroup</h4> +<pre><code>list<<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code>></code> getGroupMembersOfTypeGroup(<code>string</code> groupId, + <code>i32</code> offset, + <code>i32</code> limit) + throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> +</pre><p>API method to get list of child groups in a group. Only the direct members will be returned. Results are reverse time sorted based on creation time</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_addChildGroupsToParentGroup">Function: SharingRegistryService.addChildGroupsToParentGroup</h4> +<pre><code>bool</code> addChildGroupsToParentGroup(<code>list<<code>string</code>></code> childIds, + <code>string</code> groupId) + throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> +</pre><p>API method to add a child group to a parent group.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_removeChildGroupFromParentGroup">Function: SharingRegistryService.removeChildGroupFromParentGroup</h4> <pre><code>bool</code> removeChildGroupFromParentGroup(<code>string</code> childId, <code>string</code> groupId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_createEntityType">Function: SharingRegistryService.createEntityType</h4> +</pre><p>API method to remove a child group from parent group.</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_createEntityType">Function: SharingRegistryService.createEntityType</h4> <pre><code>string</code> createEntityType(<code><a href="sharing_models.html#Struct_EntityType">sharing_models.EntityType</a></code> entityType) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * EntityType Operations -* +</pre><p>API method to create a new entity type</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updateEntityType">Function: SharingRegistryService.updateEntityType</h4> <pre><code>bool</code> updateEntityType(<code><a href="sharing_models.html#Struct_EntityType">sharing_models.EntityType</a></code> entityType) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteEntityType">Function: SharingRegistryService.deleteEntityType</h4> +</pre><p>API method to update entity type</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteEntityType">Function: SharingRegistryService.deleteEntityType</h4> <pre><code>bool</code> deleteEntityType(<code>string</code> entityTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getEntityType">Function: SharingRegistryService.getEntityType</h4> +</pre><p>API method to delete entity type</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getEntityType">Function: SharingRegistryService.getEntityType</h4> <pre><code><a href="sharing_models.html#Struct_EntityType">sharing_models.EntityType</a></code> getEntityType(<code>string</code> entityTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getEntityTypes">Function: SharingRegistryService.getEntityTypes</h4> -<pre><code>list<<code><a href="sharing_models.html#Struct_EntityType">sharing_models.EntityType</a></code>></code> getEntityTypes(<code>string</code> domain, +</pre><p>API method to get an entity type</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getEntityTypes">Function: SharingRegistryService.getEntityTypes</h4> +<pre><code>list<<code><a href="sharing_models.html#Struct_EntityType">sharing_models.EntityType</a></code>></code> getEntityTypes(<code>string</code> domainId, <code>i32</code> offset, <code>i32</code> limit) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_createEntity">Function: SharingRegistryService.createEntity</h4> -<pre><code>string</code> createEntity(<code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code> entity) +</pre><p>API method to get entity types in a domainId. Results are reverse time sorted based on creation time</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_registerEntity">Function: SharingRegistryService.registerEntity</h4> +<pre><code>string</code> registerEntity(<code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code> entity) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * Entity Operations -* +</pre><p>API method to register new entity</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updateEntity">Function: SharingRegistryService.updateEntity</h4> <pre><code>bool</code> updateEntity(<code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code> entity) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteEntity">Function: SharingRegistryService.deleteEntity</h4> +</pre><p>API method to update entity</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_deleteEntity">Function: SharingRegistryService.deleteEntity</h4> <pre><code>bool</code> deleteEntity(<code>string</code> entityId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getEntity">Function: SharingRegistryService.getEntity</h4> +</pre><p>API method to delete entity</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getEntity">Function: SharingRegistryService.getEntity</h4> <pre><code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code> getEntity(<code>string</code> entityId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_searchEntities">Function: SharingRegistryService.searchEntities</h4> +</pre><p>API method to get entity</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_searchEntities">Function: SharingRegistryService.searchEntities</h4> <pre><code>list<<code><a href="sharing_models.html#Struct_Entity">sharing_models.Entity</a></code>></code> searchEntities(<code>string</code> userId, <code>string</code> entityTypeId, <code>list<<code><a href="sharing_models.html#Struct_SearchCriteria">sharing_models.SearchCriteria</a></code>></code> filters, <code>i32</code> offset, <code>i32</code> limit) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getListOfSharedUsers">Function: SharingRegistryService.getListOfSharedUsers</h4> +</pre><p>API method to search entities</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getListOfSharedUsers">Function: SharingRegistryService.getListOfSharedUsers</h4> <pre><code>list<<code><a href="sharing_models.html#Struct_User">sharing_models.User</a></code>></code> getListOfSharedUsers(<code>string</code> entityId, <code>string</code> permissionTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getListOfSharedGroups">Function: SharingRegistryService.getListOfSharedGroups</h4> +</pre><p>API method to get a list of shared users given the entity id</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getListOfSharedGroups">Function: SharingRegistryService.getListOfSharedGroups</h4> <pre><code>list<<code><a href="sharing_models.html#Struct_UserGroup">sharing_models.UserGroup</a></code>></code> getListOfSharedGroups(<code>string</code> entityId, <code>string</code> permissionTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_createPermissionType">Function: SharingRegistryService.createPermissionType</h4> +</pre><p>API method to get a list of shared groups given the entity id</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_createPermissionType">Function: SharingRegistryService.createPermissionType</h4> <pre><code>string</code> createPermissionType(<code><a href="sharing_models.html#Struct_PermissionType">sharing_models.PermissionType</a></code> permissionType) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * Permission Operations -* +</pre><p>API method to create permission type</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_updatePermissionType">Function: SharingRegistryService.updatePermissionType</h4> <pre><code>bool</code> updatePermissionType(<code><a href="sharing_models.html#Struct_PermissionType">sharing_models.PermissionType</a></code> permissionType) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_deletePermissionType">Function: SharingRegistryService.deletePermissionType</h4> +</pre><p>API method to update permission type</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_deletePermissionType">Function: SharingRegistryService.deletePermissionType</h4> <pre><code>bool</code> deletePermissionType(<code>string</code> entityTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getPermissionType">Function: SharingRegistryService.getPermissionType</h4> +</pre><p>API method to delete permission type</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getPermissionType">Function: SharingRegistryService.getPermissionType</h4> <pre><code><a href="sharing_models.html#Struct_PermissionType">sharing_models.PermissionType</a></code> getPermissionType(<code>string</code> permissionTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_getPermissionTypes">Function: SharingRegistryService.getPermissionTypes</h4> -<pre><code>list<<code><a href="sharing_models.html#Struct_PermissionType">sharing_models.PermissionType</a></code>></code> getPermissionTypes(<code>string</code> domain, +</pre><p>API method to get permission type</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_getPermissionTypes">Function: SharingRegistryService.getPermissionTypes</h4> +<pre><code>list<<code><a href="sharing_models.html#Struct_PermissionType">sharing_models.PermissionType</a></code>></code> getPermissionTypes(<code>string</code> domainId, <code>i32</code> offset, <code>i32</code> limit) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_shareEntityWithUsers">Function: SharingRegistryService.shareEntityWithUsers</h4> +</pre><p>API method to get list of permission types in a given domainId. Results are reverse time sorted based on creation time</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_shareEntityWithUsers">Function: SharingRegistryService.shareEntityWithUsers</h4> <pre><code>bool</code> shareEntityWithUsers(<code>string</code> domainId, <code>string</code> entityId, <code>list<<code>string</code>></code> userList, <code>string</code> perssionTypeId, <code>bool</code> cascadePermission) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre> * Sharing Entity with Users and Groups -* +</pre><p>API method to share an entity with users</p> <br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_revokeEntitySharingFromUsers">Function: SharingRegistryService.revokeEntitySharingFromUsers</h4> <pre><code>bool</code> revokeEntitySharingFromUsers(<code>string</code> domainId, <code>string</code> entityId, <code>list<<code>string</code>></code> userList, <code>string</code> perssionTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_shareEntityWithGroups">Function: SharingRegistryService.shareEntityWithGroups</h4> +</pre><p>API method to revoke sharing from a list of users</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_shareEntityWithGroups">Function: SharingRegistryService.shareEntityWithGroups</h4> <pre><code>bool</code> shareEntityWithGroups(<code>string</code> domainId, <code>string</code> entityId, <code>list<<code>string</code>></code> groupList, <code>string</code> perssionTypeId, <code>bool</code> cascadePermission) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_revokeEntitySharingFromGroups">Function: SharingRegistryService.revokeEntitySharingFromGroups</h4> +</pre><p>API method to share an entity with list of groups</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_revokeEntitySharingFromGroups">Function: SharingRegistryService.revokeEntitySharingFromGroups</h4> <pre><code>bool</code> revokeEntitySharingFromGroups(<code>string</code> domainId, <code>string</code> entityId, <code>list<<code>string</code>></code> groupList, <code>string</code> perssionTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div><div class="definition"><h4 id="Fn_SharingRegistryService_userHasAccess">Function: SharingRegistryService.userHasAccess</h4> +</pre><p>API method to revoke sharing from list of users</p> +<br/></div><div class="definition"><h4 id="Fn_SharingRegistryService_userHasAccess">Function: SharingRegistryService.userHasAccess</h4> <pre><code>bool</code> userHasAccess(<code>string</code> domainId, <code>string</code> userId, <code>string</code> entityId, <code>string</code> permissionTypeId) throws <code><a href="sharing_models.html#Struct_SharingRegistryException">sharing_models.SharingRegistryException</a></code> -</pre></div></div></body></html> +</pre><p>API method to check whether a user has access to a specific entity</p> +<br/></div></div></body></html> http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/api-docs/sharing_models.html ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/api-docs/sharing_models.html b/modules/sharing-registry/api-docs/sharing_models.html index be6bd17..1d4dff8 100644 --- a/modules/sharing-registry/api-docs/sharing_models.html +++ b/modules/sharing-registry/api-docs/sharing_models.html @@ -14,6 +14,7 @@ <a href="#Struct_Entity">Entity</a><br/> <a href="#Enum_EntitySearchField">EntitySearchField</a><br/> <a href="#Struct_EntityType">EntityType</a><br/> +<a href="#Enum_GroupCardinality">GroupCardinality</a><br/> <a href="#Enum_GroupChildType">GroupChildType</a><br/> <a href="#Struct_GroupMembership">GroupMembership</a><br/> <a href="#Enum_GroupType">GroupType</a><br/> @@ -32,22 +33,44 @@ <hr/><h2 id="Constants">Constants</h2> <table class="table-bordered table-striped table-condensed"><thead><th>Constant</th><th>Type</th><th>Value</th></thead> <tr id="Const_DO_NOT_SET_AT_CLIENTS_ID"><td><code>DO_NOT_SET_AT_CLIENTS_ID</code></td><td><code>string</code></td><td><code>"DO_NOT_SET_AT_CLIENTS_ID"</code></td></tr></table><hr/><h2 id="Enumerations">Enumerations</h2> -<div class="definition"><h3 id="Enum_GroupType">Enumeration: GroupType</h3> -<br/><table class="table-bordered table-striped table-condensed"> +<div class="definition"><h3 id="Enum_GroupCardinality">Enumeration: GroupCardinality</h3> +<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> + +<br/><br/><table class="table-bordered table-striped table-condensed"> <tr><td><code>SINGLE_USER</code></td><td><code>0</code></td><td> </td></tr> <tr><td><code>MULTI_USER</code></td><td><code>1</code></td><td> </td></tr> </table></div> +<div class="definition"><h3 id="Enum_GroupType">Enumeration: GroupType</h3> +<p>Group types can be either user level or domain level groups.</p> + +<br/><br/><table class="table-bordered table-striped table-condensed"> +<tr><td><code>DOMAIN_LEVEL_GROUP</code></td><td><code>0</code></td><td> +</td></tr> +<tr><td><code>USER_LEVEL_GROUP</code></td><td><code>1</code></td><td> +</td></tr> +</table></div> <div class="definition"><h3 id="Enum_GroupChildType">Enumeration: GroupChildType</h3> -<br/><table class="table-bordered table-striped table-condensed"> +<p>System internal data type to match group child types</p> + +<br/><br/><table class="table-bordered table-striped table-condensed"> <tr><td><code>USER</code></td><td><code>0</code></td><td> </td></tr> <tr><td><code>GROUP</code></td><td><code>1</code></td><td> </td></tr> </table></div> <div class="definition"><h3 id="Enum_EntitySearchField">Enumeration: EntitySearchField</h3> -<br/><table class="table-bordered table-striped table-condensed"> +<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>CREATED_TIME : Created time of the entity</li> +<li>UPDATED_TIME : Updated time of the entity</li> + +<br/><br/><table class="table-bordered table-striped table-condensed"> <tr><td><code>NAME</code></td><td><code>0</code></td><td> </td></tr> <tr><td><code>DESCRIPTION</code></td><td><code>1</code></td><td> @@ -62,18 +85,29 @@ </td></tr> </table></div> <div class="definition"><h3 id="Enum_SearchCondition">Enumeration: SearchCondition</h3> -<br/><table class="table-bordered table-striped table-condensed"> +<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 and updated time.</li> +<li>LTE : Less than or equal. Only applicable for created time and updated time.</li> + +<br/><br/><table class="table-bordered table-striped table-condensed"> <tr><td><code>EQUAL</code></td><td><code>0</code></td><td> </td></tr> <tr><td><code>LIKE</code></td><td><code>1</code></td><td> </td></tr> -<tr><td><code>GTE</code></td><td><code>2</code></td><td> +<tr><td><code>FULL_TEXT</code></td><td><code>2</code></td><td> +</td></tr> +<tr><td><code>GTE</code></td><td><code>3</code></td><td> </td></tr> -<tr><td><code>LTE</code></td><td><code>3</code></td><td> +<tr><td><code>LTE</code></td><td><code>4</code></td><td> </td></tr> </table></div> <div class="definition"><h3 id="Enum_SharingType">Enumeration: SharingType</h3> -<br/><table class="table-bordered table-striped table-condensed"> +<p>This is an internal enum type for managing sharings</p> + +<br/><br/><table class="table-bordered table-striped table-condensed"> <tr><td><code>DIRECT_NON_CASCADING</code></td><td><code>0</code></td><td> </td></tr> <tr><td><code>DIRECT_CASCADING</code></td><td><code>1</code></td><td> @@ -89,34 +123,70 @@ <tr><td>3</td><td>description</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>4</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>5</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_User">Struct: User</h3> +</table><br/><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> + +<br/></div><div class="definition"><h3 id="Struct_User">Struct: User</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> -<tr><td>1</td><td>userId</td><td><code>string</code></td><td></td><td>optional</td><td><code>"DO_NOT_SET_AT_CLIENTS_ID"</code></td></tr> +<tr><td>1</td><td>userId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>2</td><td>domainId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>3</td><td>userName</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>4</td><td>firstName</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>5</td><td>lastName</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> -<tr><td>6</td><td>icon</td><td><code>binary</code></td><td></td><td>optional</td><td></td></tr> -<tr><td>7</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -<tr><td>8</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_UserGroup">Struct: UserGroup</h3> +<tr><td>6</td><td>email</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> +<tr><td>7</td><td>icon</td><td><code>binary</code></td><td></td><td>optional</td><td></td></tr> +<tr><td>8</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> +<tr><td>9</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> +</table><br/><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> : Client provided user id. (The id is not system generated and it is a must to provide this id)</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> + +<br/></div><div class="definition"><h3 id="Struct_UserGroup">Struct: UserGroup</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>groupId</td><td><code>string</code></td><td></td><td>optional</td><td><code>"DO_NOT_SET_AT_CLIENTS_ID"</code></td></tr> <tr><td>2</td><td>domainId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>3</td><td>name</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> -<tr><td>6</td><td>description</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> -<tr><td>7</td><td>ownerId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> +<tr><td>4</td><td>description</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> +<tr><td>5</td><td>ownerId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> +<tr><td>6</td><td>groupType</td><td><code><a href="#Enum_GroupType">GroupType</a></code></td><td></td><td>optional</td><td></td></tr> +<tr><td>7</td><td>groupCardinality</td><td><code><a href="#Enum_GroupCardinality">GroupCardinality</a></code></td><td></td><td>optional</td><td></td></tr> <tr><td>8</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>9</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -<tr><td>10</td><td>groupType</td><td><code><a href="#Enum_GroupType">GroupType</a></code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_GroupMembership">Struct: GroupMembership</h3> +</table><br/><p>User group is a collection of users.</p> + <li>groupId : System generated grouo id. In the current implementation this is of the form domainId:name</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> + +<br/></div><div class="definition"><h3 id="Struct_GroupMembership">Struct: GroupMembership</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>parentId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>2</td><td>childId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>3</td><td>childType</td><td><code><a href="#Enum_GroupChildType">GroupChildType</a></code></td><td></td><td>optional</td><td></td></tr> <tr><td>4</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>5</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_EntityType">Struct: EntityType</h3> +</table><br/><p>System internal data type to map group memberships</p> + +<br/></div><div class="definition"><h3 id="Struct_EntityType">Struct: EntityType</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>entityTypeId</td><td><code>string</code></td><td></td><td>optional</td><td><code>"DO_NOT_SET_AT_CLIENTS_ID"</code></td></tr> <tr><td>2</td><td>domainId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> @@ -124,14 +194,27 @@ <tr><td>4</td><td>description</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>5</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>6</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_SearchCriteria">Struct: SearchCriteria</h3> +</table><br/><p>client defined entity types</p> +<li>entityTypeId : System generated entity type id. In the current implementation it will of the form domainId:name</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> + +<br/></div><div class="definition"><h3 id="Struct_SearchCriteria">Struct: SearchCriteria</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>searchField</td><td><code><a href="#Enum_EntitySearchField">EntitySearchField</a></code></td><td></td><td>optional</td><td></td></tr> <tr><td>2</td><td>value</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>3</td><td>searchCondition</td><td><code><a href="#Enum_SearchCondition">SearchCondition</a></code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_Entity">Struct: Entity</h3> +</table><br/><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> + +<br/></div><div class="definition"><h3 id="Struct_Entity">Struct: Entity</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> -<tr><td>1</td><td>entityId</td><td><code>string</code></td><td></td><td>optional</td><td><code>"DO_NOT_SET_AT_CLIENTS_ID"</code></td></tr> +<tr><td>1</td><td>entityId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>2</td><td>domainId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>3</td><td>entityTypeId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>4</td><td>ownerId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> @@ -142,7 +225,20 @@ <tr><td>9</td><td>fullText</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>10</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>11</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_PermissionType">Struct: PermissionType</h3> +</table><br/><p>Entity object which is used to register an entity in the system.</p> +<li><b>entityId</b> : Client 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>metadata : Map of optional metadata</li> +<li>fullText : A string which will be considered for full text search</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> + +<br/></div><div class="definition"><h3 id="Struct_PermissionType">Struct: PermissionType</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>permissionTypeId</td><td><code>string</code></td><td></td><td>optional</td><td><code>"DO_NOT_SET_AT_CLIENTS_ID"</code></td></tr> <tr><td>2</td><td>domainId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> @@ -150,7 +246,15 @@ <tr><td>4</td><td>description</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>5</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>6</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_Sharing">Struct: Sharing</h3> +</table><br/><p>Object for creating client defined permission type</p> +<li>permissionTypeId : System generated permission type id. In the current implementation it will of the form domainId:name</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> + +<br/></div><div class="definition"><h3 id="Struct_Sharing">Struct: Sharing</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>permissionTypeId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>2</td><td>entityId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> @@ -159,7 +263,11 @@ <tr><td>5</td><td>inheritedParentId</td><td><code>string</code></td><td></td><td>optional</td><td></td></tr> <tr><td>6</td><td>createdTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> <tr><td>7</td><td>updatedTime</td><td><code>i64</code></td><td></td><td>optional</td><td></td></tr> -</table><br/></div><div class="definition"><h3 id="Struct_SharingRegistryException">Exception: SharingRegistryException</h3> +</table><br/><p>This is an internal enum type for managing sharings</p> + +<br/></div><div class="definition"><h3 id="Struct_SharingRegistryException">Exception: SharingRegistryException</h3> <table class="table-bordered table-striped table-condensed"><thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></thead> <tr><td>1</td><td>message</td><td><code>string</code></td><td></td><td>required</td><td></td></tr> -</table><br/></div></div></body></html> +</table><br/><p>Exception model used in the sharing registry service</p> + +<br/></div></div></body></html> http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java index a8ec19f..e38a760 100644 --- a/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java +++ b/modules/sharing-registry/sharing-data-migrator/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java @@ -106,7 +106,7 @@ public class AiravataDataMigrator { user.setDomainId(rs.getString("GATEWAY_ID")); user.setUserName(rs.getString("USER_NAME")); - govRegistryServerHandler.createUser(user); + govRegistryServerHandler.registerUser(user); } //Creating project entries @@ -128,7 +128,7 @@ public class AiravataDataMigrator { Map<String, String> metadata = new HashMap<>(); metadata.put("CREATION_TIME", rs.getDate("CREATION_TIME").toString()); - govRegistryServerHandler.createEntity(entity); + govRegistryServerHandler.registerEntity(entity); } //Creating experiment entries @@ -158,7 +158,7 @@ public class AiravataDataMigrator { metadata.put("GATEWAY_INSTANCE_ID", rs.getString("GATEWAY_INSTANCE_ID")); metadata.put("ARCHIVE", rs.getString("ARCHIVE")); - govRegistryServerHandler.createEntity(entity); + govRegistryServerHandler.registerEntity(entity); } expCatConnection.close(); http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingUserEntity.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingUserEntity.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingUserEntity.java index 0d17279..1482ce9 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingUserEntity.java +++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/SharingUserEntity.java @@ -35,6 +35,7 @@ public class SharingUserEntity { private String userName; private String firstName; private String lastName; + private String email; private ByteBuffer icon; private Long createdTime; private Long updatedTime; @@ -89,6 +90,16 @@ public class SharingUserEntity { this.lastName = lastName; } + @Basic + @Column(name = "EMAIL") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + @Lob @Column(name = "ICON") public ByteBuffer getIcon() { http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java index 10d901a..09fd8d8 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java +++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/entities/UserGroupEntity.java @@ -35,6 +35,7 @@ public class UserGroupEntity { private String description; private String ownerId; private String groupType; + private String groupCardinality; private Long createdTime; private Long updatedTime; @@ -89,6 +90,16 @@ public class UserGroupEntity { } @Basic + @Column(name = "GROUP_CARDINALITY") + public String getGroupCardinality() { + return groupCardinality; + } + + public void setGroupCardinality(String groupCardinality) { + this.groupCardinality = groupCardinality; + } + + @Basic @Column(name = "GROUP_TYPE") public String getGroupType() { return groupType; http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java index ed49c94..1ed1f06 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java +++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/repositories/UserGroupRepository.java @@ -23,7 +23,7 @@ package org.apache.airavata.sharing.registry.db.repositories; import org.apache.airavata.sharing.registry.db.entities.SharingEntity; import org.apache.airavata.sharing.registry.db.entities.UserGroupEntity; import org.apache.airavata.sharing.registry.db.utils.DBConstants; -import org.apache.airavata.sharing.registry.models.GroupType; +import org.apache.airavata.sharing.registry.models.GroupCardinality; import org.apache.airavata.sharing.registry.models.SharingRegistryException; import org.apache.airavata.sharing.registry.models.UserGroup; import org.slf4j.Logger; @@ -44,7 +44,7 @@ public class UserGroupRepository extends AbstractRepository<UserGroup, UserGroup query += "g." + DBConstants.UserGroupTable.GROUP_ID + " = s." + DBConstants.SharingTable.GROUP_ID + " AND "; query += "s." + DBConstants.SharingTable.ENTITY_ID + " = '" + entityId + "' AND "; query += "s." + DBConstants.SharingTable.PERMISSION_TYPE_ID + " = '" + permissionTypeId + "' AND "; - query += "g." + DBConstants.UserGroupTable.GROUP_TYPE + " = '" + GroupType.MULTI_USER.toString() + "'"; + query += "g." + DBConstants.UserGroupTable.GROUP_CARDINALITY + " = '" + GroupCardinality.MULTI_USER.toString() + "'"; query += " ORDER BY s.createdTime DESC"; return select(query, 0, -1); } http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java index 387e0e5..e444c43 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java +++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/db/utils/DBConstants.java @@ -51,6 +51,7 @@ public class DBConstants { public static String DESCRIPTION = "description"; public static String OWNER_ID = "ownerId"; public static String GROUP_TYPE = "groupType"; + public static String GROUP_CARDINALITY = "groupCardinality"; public static final String CREATED_TIME = "createdTime"; public static final String UPDATED_TIME = "updatedTime"; } http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java index a123975..5757f61 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java +++ b/modules/sharing-registry/sharing-registry-server/src/main/java/org/apache/airavata/sharing/registry/server/SharingRegistryServerHandler.java @@ -119,7 +119,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac * * */ @Override - public String createUser(User user) throws SharingRegistryException, TException { + public String registerUser(User user) throws SharingRegistryException, TException { if(userRepository.get(user.userId) != null) throw new SharingRegistryException("There exist user with given user id"); @@ -133,7 +133,8 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac userGroup.setName(user.userName); userGroup.setDescription("user " + user.userName + " group"); userGroup.setOwnerId(user.userId); - userGroup.setGroupType(GroupType.SINGLE_USER); + userGroup.setGroupType(GroupType.USER_LEVEL_GROUP); + userGroup.setGroupCardinality(GroupCardinality.SINGLE_USER); createGroup(userGroup); return user.userId; @@ -242,25 +243,29 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac } @Override - public Map<String, GroupChildType> getGroupMembers(String groupId, int offset, int limit) throws SharingRegistryException, TException { - HashMap<String, GroupChildType> groupMembers = new HashMap<>(); - HashMap<String, String> filters = new HashMap<>(); - filters.put(DBConstants.GroupMembershipTable.PARENT_ID, groupId); - List<GroupMembership> groupMembershipList = groupMembershipRepository.select(filters, 0, -1); - groupMembershipList.stream().forEach(gm->{groupMembers.put(gm.getChildId(), gm.getChildType());}); - return groupMembers; - } - - @Override - public boolean addChildGroupToParentGroup(String childId, String groupId) throws SharingRegistryException, TException { - //Todo check for cyclic dependencies - GroupMembership groupMembership = new GroupMembership(); - groupMembership.setParentId(groupId); - groupMembership.setChildId(childId); - groupMembership.setChildType(GroupChildType.GROUP); - groupMembership.setCreatedTime(System.currentTimeMillis()); - groupMembership.setUpdatedTime(System.currentTimeMillis()); - groupMembershipRepository.create(groupMembership); + public List<User> getGroupMembersOfTypeUser(String groupId, int offset, int limit) throws SharingRegistryException, TException { + List<User> groupMemberUsers = groupMembershipRepository.getAllChildUsers(groupId); + return groupMemberUsers; + } + + @Override + public List<UserGroup> getGroupMembersOfTypeGroup(String groupId, int offset, int limit) throws SharingRegistryException, TException { + List<UserGroup> groupMemberGroups = groupMembershipRepository.getAllChildGroups(groupId); + return groupMemberGroups; + } + + @Override + public boolean addChildGroupsToParentGroup(List<String> childIds, String groupId) throws SharingRegistryException, TException { + for(String childId : childIds) { + //Todo check for cyclic dependencies + GroupMembership groupMembership = new GroupMembership(); + groupMembership.setParentId(groupId); + groupMembership.setChildId(childId); + groupMembership.setChildType(GroupChildType.GROUP); + groupMembership.setCreatedTime(System.currentTimeMillis()); + groupMembership.setUpdatedTime(System.currentTimeMillis()); + groupMembershipRepository.create(groupMembership); + } return true; } @@ -362,7 +367,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac * * */ @Override - public String createEntity(Entity entity) throws SharingRegistryException, TException { + public String registerEntity(Entity entity) throws SharingRegistryException, TException { if(entityRepository.get(entity.entityId) != null) throw new SharingRegistryException("There exist Entity with given Entity id"); @@ -372,7 +377,7 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac user.setDomainId(entity.domainId); user.setUserName(user.userId.split("@")[0]); - createUser(user); + registerUser(user); } entity.setCreatedTime(System.currentTimeMillis()); @@ -463,15 +468,15 @@ public class SharingRegistryServerHandler implements SharingRegistryService.Ifac */ @Override public boolean shareEntityWithUsers(String domainId, String entityId, List<String> userList, String permissionTypeId, boolean cascadePermission) throws SharingRegistryException, TException { - return shareEntity(domainId, entityId, userList, permissionTypeId, GroupType.SINGLE_USER, cascadePermission); + return shareEntity(domainId, entityId, userList, permissionTypeId, cascadePermission); } @Override public boolean shareEntityWithGroups(String domainId, String entityId, List<String> groupList, String permissionTypeId, boolean cascadePermission) throws SharingRegistryException, TException { - return shareEntity(domainId, entityId, groupList, permissionTypeId, GroupType.MULTI_USER, cascadePermission); + return shareEntity(domainId, entityId, groupList, permissionTypeId, cascadePermission); } - private boolean shareEntity(String domainId, String entityId, List<String> groupOrUserList, String permissionTypeId, GroupType groupType, boolean cascadePermission) throws SharingRegistryException, TException { + private boolean shareEntity(String domainId, String entityId, List<String> groupOrUserList, String permissionTypeId, boolean cascadePermission) throws SharingRegistryException, TException { if(permissionTypeId.equals(permissionTypeRepository.getGlobalPermissionTypeIdForDomain(domainId))){ throw new SharingRegistryException(OWNER_PERMISSION_NAME + " permission cannot be assigned"); } http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql index 0e58356..e1937fd 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql +++ b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-derby.sql @@ -34,6 +34,7 @@ CREATE TABLE SHARING_USER ( 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, @@ -48,6 +49,7 @@ CREATE TABLE USER_GROUP ( 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), http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql index 78d5d78..675fad3 100644 --- a/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql +++ b/modules/sharing-registry/sharing-registry-server/src/main/resources/sharing-registry-mysql.sql @@ -34,6 +34,7 @@ CREATE TABLE SHARING_USER ( 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, @@ -48,6 +49,7 @@ CREATE TABLE USER_GROUP ( 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), http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java index 8a9bcb2..df0dcba 100644 --- a/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java +++ b/modules/sharing-registry/sharing-registry-server/src/test/java/org/apache/airavata/sharing/registry/SharingRegistryServerHandlerTest.java @@ -73,7 +73,7 @@ public class SharingRegistryServerHandlerTest { user1.setCreatedTime(System.currentTimeMillis()); user1.setUpdatedTime(System.currentTimeMillis()); - Assert.assertNotNull(sharingRegistryServerHandler.createUser(user1)); + Assert.assertNotNull(sharingRegistryServerHandler.registerUser(user1)); User user2 = new User(); String userName2 = "test-user-2." + System.currentTimeMillis(); @@ -84,7 +84,7 @@ public class SharingRegistryServerHandlerTest { user2.setCreatedTime(System.currentTimeMillis()); user2.setUpdatedTime(System.currentTimeMillis()); - Assert.assertNotNull(sharingRegistryServerHandler.createUser(user2)); + Assert.assertNotNull(sharingRegistryServerHandler.registerUser(user2)); User user3 = new User(); String userName3 = "test-user-3." + System.currentTimeMillis(); @@ -95,7 +95,7 @@ public class SharingRegistryServerHandlerTest { user3.setCreatedTime(System.currentTimeMillis()); user3.setUpdatedTime(System.currentTimeMillis()); - Assert.assertNotNull(sharingRegistryServerHandler.createUser(user3)); + Assert.assertNotNull(sharingRegistryServerHandler.registerUser(user3)); Assert.assertTrue(sharingRegistryServerHandler.getUsers(domainId, 0, 10).size() > 0); @@ -108,7 +108,8 @@ public class SharingRegistryServerHandlerTest { userGroup1.setName(groupName1); userGroup1.setDescription("test group description"); userGroup1.setOwnerId(userId1); - userGroup1.setGroupType(GroupType.MULTI_USER); + userGroup1.setGroupType(GroupType.USER_LEVEL_GROUP); + userGroup1.setGroupCardinality(GroupCardinality.MULTI_USER); userGroup1.setCreatedTime(System.currentTimeMillis()); userGroup1.setUpdatedTime(System.currentTimeMillis()); @@ -122,7 +123,8 @@ public class SharingRegistryServerHandlerTest { userGroup2.setName(groupName2); userGroup2.setDescription("test group description"); userGroup2.setOwnerId(userId2); - userGroup2.setGroupType(GroupType.MULTI_USER); + userGroup2.setGroupType(GroupType.USER_LEVEL_GROUP); + userGroup2.setGroupCardinality(GroupCardinality.MULTI_USER); userGroup2.setCreatedTime(System.currentTimeMillis()); userGroup2.setUpdatedTime(System.currentTimeMillis()); @@ -130,10 +132,10 @@ public class SharingRegistryServerHandlerTest { sharingRegistryServerHandler.addUsersToGroup(Arrays.asList(userId1), groupId1); sharingRegistryServerHandler.addUsersToGroup(Arrays.asList(userId2, userId3), groupId2); - sharingRegistryServerHandler.addChildGroupToParentGroup(groupId2, groupId1); + sharingRegistryServerHandler.addChildGroupsToParentGroup(Arrays.asList(groupId2), groupId1); - Assert.assertTrue(sharingRegistryServerHandler.getGroupMembers(groupId1, 0, 10).size() == 2); - Assert.assertTrue(sharingRegistryServerHandler.getGroupMembers(groupId2, 0, 10).size() == 2); + Assert.assertTrue(sharingRegistryServerHandler.getGroupMembersOfTypeGroup(groupId1, 0, 10).size() == 1); + Assert.assertTrue(sharingRegistryServerHandler.getGroupMembersOfTypeUser(groupId2, 0, 10).size() == 2); //Creating permission types @@ -208,7 +210,7 @@ public class SharingRegistryServerHandlerTest { entity1.setCreatedTime(System.currentTimeMillis()); entity1.setUpdatedTime(System.currentTimeMillis()); - String entityId1 = sharingRegistryServerHandler.createEntity(entity1); + String entityId1 = sharingRegistryServerHandler.registerEntity(entity1); Assert.assertNotNull(entityId1); Entity entity2 = new Entity(); @@ -226,7 +228,7 @@ public class SharingRegistryServerHandlerTest { entity2.setCreatedTime(System.currentTimeMillis()); entity2.setUpdatedTime(System.currentTimeMillis()); - String entityId2 = sharingRegistryServerHandler.createEntity(entity2); + String entityId2 = sharingRegistryServerHandler.registerEntity(entity2); Assert.assertNotNull(entityId2); Entity entity3 = new Entity(); @@ -244,7 +246,7 @@ public class SharingRegistryServerHandlerTest { entity3.setCreatedTime(System.currentTimeMillis()); entity3.setUpdatedTime(System.currentTimeMillis()); - String entityId3 = sharingRegistryServerHandler.createEntity(entity3); + String entityId3 = sharingRegistryServerHandler.registerEntity(entity3); Assert.assertNotNull(entityId3); sharingRegistryServerHandler.shareEntityWithUsers(domainId, entityId1, Arrays.asList(userId2), permissionTypeId1, true); @@ -265,7 +267,7 @@ public class SharingRegistryServerHandlerTest { entity4.setCreatedTime(System.currentTimeMillis()); entity4.setUpdatedTime(System.currentTimeMillis()); - String entityId4 = sharingRegistryServerHandler.createEntity(entity4); + String entityId4 = sharingRegistryServerHandler.registerEntity(entity4); Assert.assertNotNull(entityId4); Assert.assertTrue(sharingRegistryServerHandler.userHasAccess(domainId, userId3, entityId4, permissionTypeId1)); http://git-wip-us.apache.org/repos/asf/airavata/blob/87564d2b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java index 7d8270f..a0e89a5 100644 --- a/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java +++ b/modules/sharing-registry/sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/Domain.java @@ -34,7 +34,18 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-14") +/** + * <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> + * + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class Domain implements org.apache.thrift.TBase<Domain, Domain._Fields>, java.io.Serializable, Cloneable, Comparable<Domain> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Domain");