blob: d8471f407b9fd80b3bb0a9b56a9233f0d739ca6a [file] [log] [blame]
Apache Airavata Profile Service
------------------------------------
AIRAVATA_DEVELOP
+-- airavata-api
+-- airavata-services
¦ +-- profile-service
¦ ¦ +-- profile-service-client-sdks
¦ ¦ ¦ +-- java-client-samples
¦ ¦ +-- profile-service-commons
¦ ¦ ¦ +-- repositories
¦ ¦ ¦ +-- tenant-entities
¦ ¦ ¦ +-- user-entities
¦ ¦ ¦ +-- utils-and-JPA-utils
¦ ¦ +-- profile-service-server
¦ ¦ ¦ +-- user-profile-service-handler
¦ ¦ ¦ +-- profile-service-server
¦ ¦ ¦ +-- profile-service-utils
¦ ¦ +-- profile-service-stubs
¦ ¦ ¦ +-- profile-service-client
¦ ¦ ¦ +-- user-cpi
¦ ¦ +-- profile-user-core
¦ ¦ ¦ +-- user-profile-repository
¦ ¦ ¦ +-- resources (user_profile_catalog)
¦ ¦ ¦
¦ ¦ ¦
+-- thrift-interface-descriptions
¦ +-- data-models
¦ ¦ +-- user-tenant-group-models
¦ ¦ ¦ +-- user-profile-model.thrift
¦ +-- service-cpi
¦ ¦ +-- profile-service
¦ ¦ ¦ +-- profile-user
¦ ¦ ¦ ¦ +-- profile-user-cpi.thrift
## profile-service-client-sdks
The folder contains java client samples, which can be used to test all the profile service methods (add user, get user, delete user etc.).
## profile-service-commons
All the OpenJPA entities related to user profile (UserProfile, CustomDashboard, NSFDemographics) exist in this module. The utilities required for the OpenJPA connection exist in the 'utils' subdirectory. OpenJPA requires the use of a XML file called the 'persistence.xml' that describes how to access the data. Here the persistence.xml is created in the 'resources' sub folder. In the case of adding a new entity to profile service, the class of thew new entity should be added here profile service persistant unit.
Descriptions for the entities used:
UserProfileEntity - Corresponds to USER_PROFILE table. Contains all the details of the user as defined in the user-profile-model.thrift file.
NSFDemographicsEntity - Corresponds to NSF_DEMOGRAPHICS table. Holds the NSF Demographic information
CustomDashboardEntity - Corresponds to CUSTOMIZED_DASHBOARD table. It holds the customized attributes of the administrator dashboard.
## profile-service-server
This folder contains the thrift generated server code for the profile service methods based on the methods specified in the thrift idl. The profile service handler instantiates the UserProfileRepository to execute all of the service methods.
Service methods:
String addUserProfile(AuthzToken authzToken, UserProfile userProfile)
boolean updateUserProfile(AuthzToken authzToken, UserProfile userProfile)
UserProfile getUserProfileById(AuthzToken authzToken, String userId, String gatewayId)
boolean deleteUserProfile(AuthzToken authzToken, String userId, String gatewayId)
List<UserProfile> getAllUserProfilesInGateway(AuthzToken authzToken, String gatewayId, int offset, int limit)
boolean doesUserExist(AuthzToken authzToken, String userId, String gatewayId)
## profile-service-stubs
The generated thrift stubs are copied in this folder. It conatins the thrift generated client code
## profile-user-core
This folder contains the repository class. The UserProfileRepository class conatins all the methods that access the database and returns the result to the handler. This module also contains the user_profile_catalog.sql file which contains all the CREATE TABLE statements for all the entities of the profile-service. Note that, the development version of airavata does not use this sql file as the entities are created in the derbey database as defined in the persistence.xml. However, the production version of airavata uses this file to create tables in the MySQL database server.
## thrift-interface-descriptions
user-profile-model.thrift file contains all the data models required by the profile-service. It contains structures for the UserProfile, CustomDashboard and NSFDemographics written using thrift IDL. A struct has to be defined for any new entity that gets added and the thrift stubs have to be generated again.
profile-user-cpi.thrift file contains the Component Programming Interface definitions for the user profile service written in thrift idl.
Service CPI stubs can be generated by running the 'generate-service-cpi-stubs.sh' script and the data model stubs can be generated by running the 'generate-thrift-stubs.sh' script which generates the thrift stub for Java, PHP, python, Java or CPP based on the parameter.