This is an automated email from the ASF dual-hosted git repository.

yasith pushed a commit to branch merge-svcs
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 0012f6b847a0e781a3d278ede803e6f0f0c9253a
Author: yasithdev <[email protected]>
AuthorDate: Tue Aug 19 01:36:58 2025 -0400

    reorganize client server structure in airavata-api
---
 .devcontainer/docker-compose.yml                   |   6 +-
 .../src/main/java/org/apache/airavata/Main.java    |   2 +-
 .../accountprovisioning/SSHAccountManager.java     | 100 +++--------
 .../org/apache/airavata/agents/api/AgentUtils.java |  54 ------
 .../airavata/{ => api}/server/ThriftAPIServer.java |  12 +-
 .../api/server/handler/AiravataServerHandler.java  |   2 +-
 .../airavata/helix/adaptor/SSHJAgentAdaptor.java   |   7 +-
 .../airavata/helix/adaptor/SSHJStorageAdaptor.java |   8 +-
 .../airavata/helix/agent/ssh/SshAgentAdaptor.java  |   5 +-
 .../agent/storage/StorageResourceAdaptorImpl.java  |   6 +-
 .../airavata/helix/impl/task/AiravataTask.java     |   2 +-
 .../airavata/helix/impl/task/TaskContext.java      |   4 +-
 .../helix/impl/task/aws/AWSJobSubmissionTask.java  |   5 +-
 .../impl/task/aws/AWSProcessContextManager.java    |   8 +-
 .../helix/impl/task/aws/CreateEC2InstanceTask.java |   5 +-
 .../helix/impl/task/aws/utils/AWSTaskUtil.java     |   7 +-
 .../client/ProfileServiceClientFactory.java        |   2 +-
 .../commons/repositories/AbstractRepository.java   |   7 +-
 .../commons/tenant/entities/GatewayEntity.java     |   2 +-
 .../user/entities/CustomizedDashboardEntity.java   |   2 +-
 .../user/entities/NSFDemographicsEntity.java       |   2 +-
 .../commons/user/entities/UserProfileEntity.java   |   2 +-
 .../profile/commons/utils/Committer.java           |   2 +-
 .../profile/commons/utils/JPAConstants.java        |   2 +-
 .../profile/commons/utils/JPAUtils.java            |   2 +-
 .../commons/utils/ObjectMapperSingleton.java       |   2 +-
 .../commons/utils/ProfileServiceJDBCConfig.java    |   2 +-
 .../profile/commons/utils/QueryConstants.java      |   2 +-
 .../{service => }/profile/commons/utils/Utils.java |   2 +-
 .../handlers/GroupManagerServiceHandler.java       |   4 +-
 .../profile/handlers/IamAdminServicesHandler.java  |   6 +-
 .../handlers/TenantProfileServiceHandler.java      |   6 +-
 .../handlers/UserProfileServiceHandler.java        |  12 +-
 .../core/impl/TenantManagementKeycloakImpl.java    |   4 +-
 .../core/interfaces/TenantManagementInterface.java |   2 +-
 .../profile/server/ProfileServiceServer.java       |  12 +-
 .../core/repositories/TenantProfileRepository.java |   8 +-
 .../exceptions/UserProfileRegistryException.java   |   2 +-
 .../core/repositories/UserProfileRepository.java   |  12 +-
 .../core/utils/UserProfileCatalogDBInitConfig.java |   2 +-
 .../core/utils/UserProfileCatalogJDBCConfig.java   |   4 +-
 .../security/AiravataSecurityManager.java          |   3 +-
 .../security/GatewayGroupsInitializer.java         |   2 +-
 .../{service => }/security/IdentityContext.java    |   2 +-
 .../security/KeyCloakSecurityManager.java          |   3 +-
 .../security/SecurityManagerFactory.java           |   3 +-
 .../airavata/{service => }/security/UserInfo.java  |   2 +-
 .../security/authzcache/AuthzCache.java            |   0
 .../security/authzcache/AuthzCacheEntry.java       |   0
 .../security/authzcache/AuthzCacheIndex.java       |   0
 .../security/authzcache/AuthzCacheManager.java     |   0
 .../authzcache/AuthzCacheManagerFactory.java       |   0
 .../security/authzcache/AuthzCachedStatus.java     |   0
 .../authzcache/DefaultAuthzCacheManager.java       |   0
 .../security/interceptor/SecurityCheck.java        |   0
 .../security/interceptor/SecurityInterceptor.java  |   6 +-
 .../security/interceptor/SecurityModule.java       |   0
 .../org/apache/airavata/server/ServerMain.java     | 198 ---------------------
 ...atalogDBInitConfig.java => ServiceFactory.java} |  25 ++-
 .../migrator/airavata/AiravataDataMigrator.java    |   8 +-
 .../bin/{email-monitor.sh => airavata.sh}          |   5 +-
 .../main/resources/distribution/bin/controller.sh  |  26 ---
 .../resources/distribution/bin/orchestrator.sh     |  54 ------
 .../main/resources/distribution/bin/parser-wm.sh   |  26 ---
 .../main/resources/distribution/bin/participant.sh |  26 ---
 .../src/main/resources/distribution/bin/post-wm.sh |  26 ---
 .../src/main/resources/distribution/bin/pre-wm.sh  |  26 ---
 .../resources/distribution/bin/realtime-monitor.sh |  26 ---
 .../src/main/resources/distribution/bin/setenv.sh  | 146 ---------------
 .../resources/distribution/bin/sharing-registry.sh |  26 ---
 .../admin/services/core/tests/SetupNewGateway.java |   2 +-
 .../security/GatewayGroupsInitializerTest.java     |   1 +
 .../security/KeyCloakSecurityManagerTest.java      |   1 +
 .../file/server/service/ProcessDataManager.java    |  23 ++-
 .../airavata/research/service/AiravataService.java |   2 +-
 75 files changed, 171 insertions(+), 835 deletions(-)

diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
index ec91fabdf5..a2433ae024 100644
--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -30,15 +30,11 @@ services:
     extra_hosts:
       - "airavata.host:192.168.100.1"
     ports:
-      - "7878:7878"   # sharing registry service
       - "8000:8000"   # tunnel service
-      - "17000:17000" # tunnel service (ingress)
       - "8050:8050"   # file service
       - "8082:8082"   # rest proxy
       - "8930:8930"   # api service
-      - "8960:8960"   # cred store service
-      - "8962:8962"   # profile service
-      - "8970:8970"   # registry service
+      - "17000:17000" # tunnel service (ingress)
       - "18800:18800" # agent service (http)
       - "19900:19900" # agent service (gRPC)
       - "18889:18889" # research service (http)
diff --git a/airavata-api/src/main/java/org/apache/airavata/Main.java 
b/airavata-api/src/main/java/org/apache/airavata/Main.java
index d60f122ed1..f6e1dad781 100644
--- a/airavata-api/src/main/java/org/apache/airavata/Main.java
+++ b/airavata-api/src/main/java/org/apache/airavata/Main.java
@@ -19,13 +19,13 @@
 */
 package org.apache.airavata;
 
+import org.apache.airavata.api.server.ThriftAPIServer;
 import org.apache.airavata.db.event.manager.DBEventManagerRunner;
 import org.apache.airavata.helix.impl.controller.HelixController;
 import org.apache.airavata.helix.impl.participant.GlobalParticipant;
 import org.apache.airavata.helix.impl.workflow.PostWorkflowManager;
 import org.apache.airavata.helix.impl.workflow.PreWorkflowManager;
 import org.apache.airavata.monitor.email.EmailBasedMonitor;
-import org.apache.airavata.server.ThriftAPIServer;
 
 public class Main {
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
 
b/airavata-api/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
index d47d485537..1c61199e28 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/accountprovisioning/SSHAccountManager.java
@@ -40,6 +40,7 @@ import 
org.apache.airavata.model.credential.store.SSHCredential;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
 import org.apache.airavata.registry.api.exception.RegistryServiceException;
+import org.apache.airavata.registry.api.service.handler.RegistryServerHandler;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,23 +74,16 @@ public class SSHAccountManager {
     private static SSHAccountProvisioner getSshAccountProvisioner(String 
gatewayId, String computeResourceId)
             throws InvalidSetupException {
         // get compute resource preferences for the gateway and hostname
-        RegistryService.Client registryServiceClient = 
getRegistryServiceClient();
+        RegistryService.Iface registry = getRegistry();
         ComputeResourcePreference computeResourcePreference = null;
         try {
             computeResourcePreference =
-                    
registryServiceClient.getGatewayComputeResourcePreference(gatewayId, 
computeResourceId);
+                    registry.getGatewayComputeResourcePreference(gatewayId, 
computeResourceId);
         } catch (TException e) {
             throw new RuntimeException(
                     "Failed to get ComputeResourcePreference for [" + 
gatewayId + "] and [" + computeResourceId + "]: "
                             + e.getMessage(),
                     e);
-        } finally {
-            if 
(registryServiceClient.getInputProtocol().getTransport().isOpen()) {
-                
registryServiceClient.getInputProtocol().getTransport().close();
-            }
-            if 
(registryServiceClient.getOutputProtocol().getTransport().isOpen()) {
-                
registryServiceClient.getOutputProtocol().getTransport().close();
-            }
         }
 
         // get the account provisioner and config values for the preferences
@@ -122,19 +116,19 @@ public class SSHAccountManager {
             throws InvalidSetupException, InvalidUsernameException {
 
         // get compute resource preferences for the gateway and hostname
-        RegistryService.Client registryServiceClient = 
getRegistryServiceClient();
+        RegistryService.Iface registry = getRegistry();
         ComputeResourcePreference computeResourcePreference = null;
         ComputeResourceDescription computeResourceDescription = null;
         SSHJobSubmission sshJobSubmission = null;
         try {
             computeResourcePreference =
-                    
registryServiceClient.getGatewayComputeResourcePreference(gatewayId, 
computeResourceId);
-            computeResourceDescription = 
registryServiceClient.getComputeResource(computeResourceId);
+                    registry.getGatewayComputeResourcePreference(gatewayId, 
computeResourceId);
+            computeResourceDescription = 
registry.getComputeResource(computeResourceId);
             // Find the SSHJobSubmission
             for (JobSubmissionInterface jobSubmissionInterface :
                     computeResourceDescription.getJobSubmissionInterfaces()) {
                 if (jobSubmissionInterface.getJobSubmissionProtocol() == 
JobSubmissionProtocol.SSH) {
-                    sshJobSubmission = 
registryServiceClient.getSSHJobSubmission(
+                    sshJobSubmission = registry.getSSHJobSubmission(
                             
jobSubmissionInterface.getJobSubmissionInterfaceId());
                     break;
                 }
@@ -144,13 +138,6 @@ public class SSHAccountManager {
                     "Failed to retrieve compute resource information for [" + 
gatewayId + "] and " + "["
                             + computeResourceId + "]: " + e.getMessage(),
                     e);
-        } finally {
-            if 
(registryServiceClient.getInputProtocol().getTransport().isOpen()) {
-                
registryServiceClient.getInputProtocol().getTransport().close();
-            }
-            if 
(registryServiceClient.getOutputProtocol().getTransport().isOpen()) {
-                
registryServiceClient.getOutputProtocol().getTransport().close();
-            }
         }
 
         if (sshJobSubmission == null) {
@@ -258,52 +245,28 @@ public class SSHAccountManager {
     private static Map<ConfigParam, String> resolveProvisionerConfig(
             String gatewayId, String provisionerName, Map<ConfigParam, String> 
provisionerConfig)
             throws InvalidSetupException {
-        CredentialStoreService.Client credentialStoreServiceClient = null;
-        try {
-            credentialStoreServiceClient = getCredentialStoreClient();
-            // Resolve any CRED_STORE_PASSWORD_TOKEN config parameters to 
passwords
-            Map<ConfigParam, String> resolvedConfig = new HashMap<>();
-            for (Map.Entry<ConfigParam, String> configEntry : 
provisionerConfig.entrySet()) {
-                if (configEntry.getKey().getType() == 
ConfigParam.ConfigParamType.CRED_STORE_PASSWORD_TOKEN) {
-                    try {
-                        PasswordCredential password =
-                                
credentialStoreServiceClient.getPasswordCredential(configEntry.getValue(), 
gatewayId);
-                        if (password == null) {
-                            throw new InvalidSetupException("Password 
credential doesn't exist for config param ["
-                                    + configEntry.getKey().getName() + "] for 
token [" + configEntry.getValue()
-                                    + "] for provisioner [" + provisionerName 
+ "].");
-                        }
-                        resolvedConfig.put(configEntry.getKey(), 
password.getPassword());
-                    } catch (TException e) {
-                        throw new RuntimeException("Failed to get password 
needed to configure " + provisionerName, e);
+        CredentialStoreService.Iface credentialStore = getCredentialStore();
+        // Resolve any CRED_STORE_PASSWORD_TOKEN config parameters to passwords
+        Map<ConfigParam, String> resolvedConfig = new HashMap<>();
+        for (Map.Entry<ConfigParam, String> configEntry : 
provisionerConfig.entrySet()) {
+            if (configEntry.getKey().getType() == 
ConfigParam.ConfigParamType.CRED_STORE_PASSWORD_TOKEN) {
+                try {
+                    PasswordCredential password =
+                            
credentialStore.getPasswordCredential(configEntry.getValue(), gatewayId);
+                    if (password == null) {
+                        throw new InvalidSetupException("Password credential 
doesn't exist for config param ["
+                                + configEntry.getKey().getName() + "] for 
token [" + configEntry.getValue()
+                                + "] for provisioner [" + provisionerName + 
"].");
                     }
-                } else {
-                    resolvedConfig.put(configEntry.getKey(), 
configEntry.getValue());
-                }
-            }
-            return resolvedConfig;
-        } finally {
-            if (credentialStoreServiceClient != null) {
-                if (credentialStoreServiceClient
-                        .getInputProtocol()
-                        .getTransport()
-                        .isOpen()) {
-                    credentialStoreServiceClient
-                            .getInputProtocol()
-                            .getTransport()
-                            .close();
-                }
-                if (credentialStoreServiceClient
-                        .getOutputProtocol()
-                        .getTransport()
-                        .isOpen()) {
-                    credentialStoreServiceClient
-                            .getOutputProtocol()
-                            .getTransport()
-                            .close();
+                    resolvedConfig.put(configEntry.getKey(), 
password.getPassword());
+                } catch (TException e) {
+                    throw new RuntimeException("Failed to get password needed 
to configure " + provisionerName, e);
                 }
+            } else {
+                resolvedConfig.put(configEntry.getKey(), 
configEntry.getValue());
             }
         }
+        return resolvedConfig;
     }
 
     private static Map<ConfigParam, String> convertConfigParams(
@@ -324,18 +287,11 @@ public class SSHAccountManager {
         return result;
     }
 
-    private static RegistryService.Client getRegistryServiceClient() {
-
-        try {
-            String registryServerHost = ServerSettings.getRegistryServerHost();
-            int registryServerPort = 
Integer.valueOf(ServerSettings.getRegistryServerPort());
-            return 
RegistryServiceClientFactory.createRegistryClient(registryServerHost, 
registryServerPort);
-        } catch (ApplicationSettingsException | RegistryServiceException e) {
-            throw new RuntimeException("Failed to create registry service 
client", e);
-        }
+    private static RegistryService.Iface getRegistry() {
+        return new RegistryServerHandler();
     }
 
-    private static CredentialStoreService.Client getCredentialStoreClient() {
+    private static CredentialStoreService.Iface getCredentialStore() {
 
         try {
             String credServerHost = 
ServerSettings.getCredentialStoreServerHost();
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/agents/api/AgentUtils.java 
b/airavata-api/src/main/java/org/apache/airavata/agents/api/AgentUtils.java
deleted file mode 100644
index 088033c20a..0000000000
--- a/airavata-api/src/main/java/org/apache/airavata/agents/api/AgentUtils.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-package org.apache.airavata.agents.api;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import 
org.apache.airavata.credential.store.client.CredentialStoreClientFactory;
-import org.apache.airavata.credential.store.cpi.CredentialStoreService;
-import org.apache.airavata.credential.store.exception.CredentialStoreException;
-import org.apache.airavata.registry.api.RegistryService;
-import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
-import org.apache.airavata.registry.api.exception.RegistryServiceException;
-
-public class AgentUtils {
-
-    // TODO this is inefficient. Try to use a connection pool
-    public static RegistryService.Client getRegistryServiceClient() throws 
AgentException {
-        try {
-            final int serverPort = 
Integer.parseInt(ServerSettings.getRegistryServerPort());
-            final String serverHost = ServerSettings.getRegistryServerHost();
-
-            return 
RegistryServiceClientFactory.createRegistryClient(serverHost, serverPort);
-        } catch (RegistryServiceException | ApplicationSettingsException e) {
-            throw new AgentException("Unable to create registry client...", e);
-        }
-    }
-
-    public static CredentialStoreService.Client getCredentialClient() throws 
AgentException {
-        try {
-            final int serverPort = 
Integer.parseInt(ServerSettings.getCredentialStoreServerPort());
-            final String serverHost = 
ServerSettings.getCredentialStoreServerHost();
-            return 
CredentialStoreClientFactory.createAiravataCSClient(serverHost, serverPort);
-        } catch (CredentialStoreException | ApplicationSettingsException e) {
-            throw new AgentException("Unable to create credential client...", 
e);
-        }
-    }
-}
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/server/ThriftAPIServer.java 
b/airavata-api/src/main/java/org/apache/airavata/api/server/ThriftAPIServer.java
similarity index 95%
rename from 
airavata-api/src/main/java/org/apache/airavata/server/ThriftAPIServer.java
rename to 
airavata-api/src/main/java/org/apache/airavata/api/server/ThriftAPIServer.java
index ca81c852e7..a415d2995b 100644
--- a/airavata-api/src/main/java/org/apache/airavata/server/ThriftAPIServer.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/api/server/ThriftAPIServer.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.server;
+package org.apache.airavata.api.server;
 
 import java.net.InetSocketAddress;
 import java.util.Arrays;
@@ -33,20 +33,20 @@ import 
org.apache.airavata.credential.store.cpi.CredentialStoreService;
 import 
org.apache.airavata.credential.store.server.CredentialStoreServerHandler;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService;
 import org.apache.airavata.orchestrator.server.OrchestratorServerHandler;
+import org.apache.airavata.profile.handlers.GroupManagerServiceHandler;
+import org.apache.airavata.profile.handlers.IamAdminServicesHandler;
+import org.apache.airavata.profile.handlers.TenantProfileServiceHandler;
+import org.apache.airavata.profile.handlers.UserProfileServiceHandler;
+import 
org.apache.airavata.profile.user.core.utils.UserProfileCatalogDBInitConfig;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.service.handler.RegistryServerHandler;
 import org.apache.airavata.registry.core.utils.AppCatalogDBInitConfig;
 import org.apache.airavata.registry.core.utils.ExpCatalogDBInitConfig;
 import org.apache.airavata.registry.core.utils.ReplicaCatalogDBInitConfig;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.GroupManagerService;
-import org.apache.airavata.service.profile.handlers.GroupManagerServiceHandler;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.IamAdminServices;
-import org.apache.airavata.service.profile.handlers.IamAdminServicesHandler;
 import org.apache.airavata.service.profile.tenant.cpi.TenantProfileService;
-import 
org.apache.airavata.service.profile.handlers.TenantProfileServiceHandler;
 import org.apache.airavata.service.profile.user.cpi.UserProfileService;
-import org.apache.airavata.service.profile.handlers.UserProfileServiceHandler;
-import 
org.apache.airavata.service.profile.user.core.utils.UserProfileCatalogDBInitConfig;
 import org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService;
 import 
org.apache.airavata.sharing.registry.server.SharingRegistryServerHandler;
 import 
org.apache.airavata.sharing.registry.db.utils.SharingRegistryDBInitConfig;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
 
b/airavata-api/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index 4be740eebd..fe6ef5d2e5 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -93,7 +93,7 @@ import org.apache.airavata.model.workspace.Notification;
 import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.exception.RegistryServiceException;
-import org.apache.airavata.service.security.GatewayGroupsInitializer;
+import org.apache.airavata.security.GatewayGroupsInitializer;
 import org.apache.airavata.service.security.interceptor.SecurityCheck;
 import org.apache.airavata.sharing.registry.models.*;
 import org.apache.airavata.sharing.registry.service.cpi.SharingRegistryService;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJAgentAdaptor.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJAgentAdaptor.java
index 7b715f4cd3..0524f9a0b3 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJAgentAdaptor.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJAgentAdaptor.java
@@ -52,6 +52,7 @@ import 
org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterfa
 import 
org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
 import org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission;
 import org.apache.airavata.model.credential.store.SSHCredential;
+import org.apache.airavata.service.ServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -137,7 +138,7 @@ public class SSHJAgentAdaptor implements AgentAdaptor {
                     + ", gateway : " + gatewayId + ", user " + userId + ", 
token : " + token);
 
             ComputeResourceDescription computeResourceDescription =
-                    
AgentUtils.getRegistryServiceClient().getComputeResource(computeResource);
+                    
ServiceFactory.getRegistry().getComputeResource(computeResource);
 
             logger.info("Fetching job submission interfaces for compute 
resource " + computeResource);
 
@@ -149,12 +150,12 @@ public class SSHJAgentAdaptor implements AgentAdaptor {
             JobSubmissionInterface sshInterface = 
jobSubmissionInterfaceOp.orElseThrow(
                     () -> new AgentException("Could not find a SSH interface 
for compute resource " + computeResource));
 
-            SSHJobSubmission sshJobSubmission = 
AgentUtils.getRegistryServiceClient()
+            SSHJobSubmission sshJobSubmission = ServiceFactory.getRegistry()
                     
.getSSHJobSubmission(sshInterface.getJobSubmissionInterfaceId());
 
             logger.info("Fetching credentials for cred store token " + token);
 
-            SSHCredential sshCredential = 
AgentUtils.getCredentialClient().getSSHCredential(token, gatewayId);
+            SSHCredential sshCredential = 
ServiceFactory.getCredentialStore().getSSHCredential(token, gatewayId);
 
             if (sshCredential == null) {
                 throw new AgentException("Null credential for token " + token);
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJStorageAdaptor.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJStorageAdaptor.java
index f9a0751b79..1806e15ab3 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJStorageAdaptor.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/adaptor/SSHJStorageAdaptor.java
@@ -21,7 +21,6 @@ package org.apache.airavata.helix.adaptor;
 
 import java.util.Optional;
 import org.apache.airavata.agents.api.AgentException;
-import org.apache.airavata.agents.api.AgentUtils;
 import org.apache.airavata.agents.api.CommandOutput;
 import org.apache.airavata.agents.api.StorageResourceAdaptor;
 import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
@@ -29,6 +28,7 @@ import 
org.apache.airavata.model.credential.store.SSHCredential;
 import org.apache.airavata.model.data.movement.DataMovementInterface;
 import org.apache.airavata.model.data.movement.DataMovementProtocol;
 import org.apache.airavata.model.data.movement.SCPDataMovement;
+import org.apache.airavata.service.ServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,7 +43,7 @@ public class SSHJStorageAdaptor extends SSHJAgentAdaptor 
implements StorageResou
                     + ", gateway : " + gatewayId + ", user " + loginUser + ", 
token : " + token);
 
             StorageResourceDescription storageResourceDescription =
-                    
AgentUtils.getRegistryServiceClient().getStorageResource(storageResourceId);
+                    
ServiceFactory.getRegistry().getStorageResource(storageResourceId);
 
             logger.info("Fetching data movement interfaces for storage 
resource " + storageResourceId);
 
@@ -56,11 +56,11 @@ public class SSHJStorageAdaptor extends SSHJAgentAdaptor 
implements StorageResou
                     new AgentException("Could not find a SCP interface for 
storage resource " + storageResourceId));
 
             SCPDataMovement scpDataMovement =
-                    
AgentUtils.getRegistryServiceClient().getSCPDataMovement(scpInterface.getDataMovementInterfaceId());
+                    
ServiceFactory.getRegistry().getSCPDataMovement(scpInterface.getDataMovementInterfaceId());
 
             logger.info("Fetching credentials for cred store token " + token);
 
-            SSHCredential sshCredential = 
AgentUtils.getCredentialClient().getSSHCredential(token, gatewayId);
+            SSHCredential sshCredential = 
ServiceFactory.getCredentialStore().getSSHCredential(token, gatewayId);
             if (sshCredential == null) {
                 throw new AgentException("Null credential for token " + token);
             }
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/agent/ssh/SshAgentAdaptor.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/agent/ssh/SshAgentAdaptor.java
index a59be3c5fe..a8c78c2f95 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/agent/ssh/SshAgentAdaptor.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/agent/ssh/SshAgentAdaptor.java
@@ -27,6 +27,7 @@ import java.util.UUID;
 import org.apache.airavata.agents.api.*;
 import org.apache.airavata.model.appcatalog.computeresource.*;
 import org.apache.airavata.model.credential.store.SSHCredential;
+import org.apache.airavata.service.ServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -83,11 +84,11 @@ public class SshAgentAdaptor implements AgentAdaptor {
     public void init(String computeResourceId, String gatewayId, String 
userId, String token) throws AgentException {
         try {
             ComputeResourceDescription computeResourceDescription =
-                    
AgentUtils.getRegistryServiceClient().getComputeResource(computeResourceId);
+                    
ServiceFactory.getRegistry().getComputeResource(computeResourceId);
 
             logger.info("Fetching credentials for cred store token " + token);
 
-            SSHCredential sshCredential = 
AgentUtils.getCredentialClient().getSSHCredential(token, gatewayId);
+            SSHCredential sshCredential = 
ServiceFactory.getCredentialStore().getSSHCredential(token, gatewayId);
             if (sshCredential == null) {
                 throw new AgentException("Null credential for token " + token);
             }
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/agent/storage/StorageResourceAdaptorImpl.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/agent/storage/StorageResourceAdaptorImpl.java
index da6fe5759a..5bb7569ffb 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/agent/storage/StorageResourceAdaptorImpl.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/agent/storage/StorageResourceAdaptorImpl.java
@@ -20,13 +20,13 @@
 package org.apache.airavata.helix.agent.storage;
 
 import org.apache.airavata.agents.api.AgentException;
-import org.apache.airavata.agents.api.AgentUtils;
 import org.apache.airavata.agents.api.CommandOutput;
 import org.apache.airavata.agents.api.StorageResourceAdaptor;
 import org.apache.airavata.helix.agent.ssh.SshAdaptorParams;
 import org.apache.airavata.helix.agent.ssh.SshAgentAdaptor;
 import 
org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
 import org.apache.airavata.model.credential.store.SSHCredential;
+import org.apache.airavata.service.ServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,11 +41,11 @@ public class StorageResourceAdaptorImpl extends 
SshAgentAdaptor implements Stora
             logger.info("Initializing Storage Resource Adaptor for storage 
resource : " + storageResourceId
                     + ", gateway : " + gatewayId + ", user " + loginUser + ", 
token : " + token);
             StorageResourceDescription storageResource =
-                    
AgentUtils.getRegistryServiceClient().getStorageResource(storageResourceId);
+                    
ServiceFactory.getRegistry().getStorageResource(storageResourceId);
 
             logger.info("Fetching credentials for cred store token " + token);
 
-            SSHCredential sshCredential = 
AgentUtils.getCredentialClient().getSSHCredential(token, gatewayId);
+            SSHCredential sshCredential = 
ServiceFactory.getCredentialStore().getSSHCredential(token, gatewayId);
             if (sshCredential == null) {
                 throw new AgentException("Null credential for token " + token);
             }
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/AiravataTask.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/AiravataTask.java
index f5f06c35ac..c064d7783e 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/AiravataTask.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/AiravataTask.java
@@ -47,10 +47,10 @@ import org.apache.airavata.model.experiment.ExperimentModel;
 import org.apache.airavata.model.messaging.event.*;
 import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.model.status.*;
+import org.apache.airavata.profile.client.ProfileServiceClientFactory;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
 import org.apache.airavata.registry.api.exception.RegistryServiceException;
-import org.apache.airavata.service.profile.client.ProfileServiceClientFactory;
 import org.apache.airavata.service.profile.user.cpi.UserProfileService;
 import 
org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException;
 import org.apache.commons.io.FileUtils;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
index a5491f3f53..ba5ff53c49 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
@@ -68,9 +68,9 @@ import org.apache.airavata.model.task.TaskModel;
 import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.model.util.GroupComputeResourcePreferenceUtil;
 import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.security.AiravataSecurityManager;
+import org.apache.airavata.security.SecurityManagerFactory;
 import org.apache.airavata.service.profile.user.cpi.UserProfileService;
-import org.apache.airavata.service.security.AiravataSecurityManager;
-import org.apache.airavata.service.security.SecurityManagerFactory;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSJobSubmissionTask.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSJobSubmissionTask.java
index ccea985cb6..ca895ea5a2 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSJobSubmissionTask.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSJobSubmissionTask.java
@@ -24,7 +24,7 @@ import java.nio.charset.StandardCharsets;
 import java.security.SecureRandom;
 import java.util.Collections;
 import java.util.concurrent.TimeUnit;
-import org.apache.airavata.agents.api.AgentUtils;
+
 import org.apache.airavata.agents.api.CommandOutput;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.helix.adaptor.SSHJAgentAdaptor;
@@ -45,6 +45,7 @@ import org.apache.airavata.model.job.JobModel;
 import org.apache.airavata.model.status.JobState;
 import org.apache.airavata.model.status.JobStatus;
 import org.apache.airavata.model.status.ProcessState;
+import org.apache.airavata.service.ServiceFactory;
 import org.apache.commons.io.FileUtils;
 import org.apache.helix.task.TaskResult;
 import org.apache.thrift.TException;
@@ -325,7 +326,7 @@ public class AWSJobSubmissionTask extends JobSubmissionTask 
{
     private SSHJAgentAdaptor initSSHJAgentAdaptor(String sshCredentialToken, 
String publicIpAddress) throws Exception {
         SSHJAgentAdaptor adaptor = new SSHJAgentAdaptor();
         SSHCredential sshCredential =
-                
AgentUtils.getCredentialClient().getSSHCredential(sshCredentialToken, 
getGatewayId());
+                
ServiceFactory.getCredentialStore().getSSHCredential(sshCredentialToken, 
getGatewayId());
         adaptor.init(
                 getTaskContext().getComputeResourceLoginUserName(),
                 publicIpAddress,
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSProcessContextManager.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSProcessContextManager.java
index 6549fc9a01..888b0fdae0 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSProcessContextManager.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/AWSProcessContextManager.java
@@ -25,10 +25,10 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.airavata.agents.api.AgentException;
-import org.apache.airavata.agents.api.AgentUtils;
 import org.apache.airavata.helix.impl.task.TaskContext;
 import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.service.ServiceFactory;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,13 +48,13 @@ public class AWSProcessContextManager {
     private static final String AWS_PUBLIC_IP = "AWS_PUBLIC_IP";
     private static final String AWS_JOB_ID = "AWS_JOB_ID";
 
-    private final RegistryService.Client registryClient;
+    private final RegistryService.Iface registry;
     private final TaskContext taskContext;
     private final String processId;
 
     public AWSProcessContextManager(TaskContext taskContext) {
         try {
-            this.registryClient = AgentUtils.getRegistryServiceClient();
+            this.registry = ServiceFactory.getRegistry();
             this.taskContext = taskContext;
             this.processId = taskContext.getProcessId();
             LOGGER.info("Initialized AWSProcessContextManager for process {}", 
processId);
@@ -132,7 +132,7 @@ public class AWSProcessContextManager {
         contextMap.put(key, value);
         ProcessModel processModel = taskContext.getProcessModel();
         processModel.setProcessDetail(MAPPER.writeValueAsString(contextMap));
-        registryClient.updateProcess(processModel, processId);
+        registry.updateProcess(processModel, processId);
         LOGGER.info("Updated process detail for process {} with key '{}'", 
processId, key);
     }
 }
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/CreateEC2InstanceTask.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/CreateEC2InstanceTask.java
index 6989842286..d3b859ee86 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/CreateEC2InstanceTask.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/CreateEC2InstanceTask.java
@@ -21,7 +21,7 @@ package org.apache.airavata.helix.impl.task.aws;
 
 import java.security.Security;
 import java.util.UUID;
-import org.apache.airavata.agents.api.AgentUtils;
+
 import org.apache.airavata.helix.agent.ssh.SSHUtil;
 import org.apache.airavata.helix.impl.task.AiravataTask;
 import org.apache.airavata.helix.impl.task.TaskContext;
@@ -30,6 +30,7 @@ import org.apache.airavata.helix.task.api.TaskHelper;
 import org.apache.airavata.helix.task.api.annotation.TaskDef;
 import 
org.apache.airavata.model.appcatalog.groupresourceprofile.AwsComputeResourcePreference;
 import org.apache.airavata.model.credential.store.SSHCredential;
+import org.apache.airavata.service.ServiceFactory;
 import org.apache.helix.task.TaskResult;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.slf4j.Logger;
@@ -141,7 +142,7 @@ public class CreateEC2InstanceTask extends AiravataTask {
         credential.setPublicKey(publicKey);
         credential.setUsername(getProcessModel().getUserName());
 
-        String savedToken = 
AgentUtils.getCredentialClient().addSSHCredential(credential);
+        String savedToken = 
ServiceFactory.getCredentialStore().addSSHCredential(credential);
         LOGGER.info("Successfully saved temporary SSH credential with token 
{}", savedToken);
 
         return savedToken;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/utils/AWSTaskUtil.java
 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/utils/AWSTaskUtil.java
index 91f310aa16..82e4aa9e25 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/utils/AWSTaskUtil.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/helix/impl/task/aws/utils/AWSTaskUtil.java
@@ -20,11 +20,12 @@
 package org.apache.airavata.helix.impl.task.aws.utils;
 
 import java.util.concurrent.TimeUnit;
-import org.apache.airavata.agents.api.AgentUtils;
+
 import org.apache.airavata.helix.impl.task.TaskContext;
 import org.apache.airavata.helix.impl.task.aws.AWSProcessContextManager;
 import 
org.apache.airavata.model.appcatalog.groupresourceprofile.AwsComputeResourcePreference;
 import org.apache.airavata.model.credential.store.PasswordCredential;
+import org.apache.airavata.service.ServiceFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
@@ -44,7 +45,7 @@ public final class AWSTaskUtil {
 
     public static Ec2Client buildEc2Client(String token, String gatewayId, 
String region) throws Exception {
         LOGGER.info("Building EC2 client for token {} and gateway id {} in 
region {}", token, gatewayId, region);
-        PasswordCredential pwdCred = 
AgentUtils.getCredentialClient().getPasswordCredential(token, gatewayId);
+        PasswordCredential pwdCred = 
ServiceFactory.getCredentialStore().getPasswordCredential(token, gatewayId);
         AwsBasicCredentials awsCreds = AwsBasicCredentials.create(
                 pwdCred.getLoginUserName(), pwdCred.getPassword()); // TODO 
support using AWS Credential
         return Ec2Client.builder()
@@ -114,7 +115,7 @@ public final class AWSTaskUtil {
                     ec2Client.deleteKeyPair(req -> req.keyName(keyName));
                 }
                 if (sshCredentialToken != null) {
-                    
AgentUtils.getCredentialClient().deleteSSHCredential(sshCredentialToken, 
gatewayId);
+                    
ServiceFactory.getCredentialStore().deleteSSHCredential(sshCredentialToken, 
gatewayId);
                 }
             }
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/client/ProfileServiceClientFactory.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/client/ProfileServiceClientFactory.java
similarity index 98%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/client/ProfileServiceClientFactory.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/client/ProfileServiceClientFactory.java
index d3074ddb14..07b7b008eb 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/client/ProfileServiceClientFactory.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/client/ProfileServiceClientFactory.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.client;
+package org.apache.airavata.profile.client;
 
 import 
org.apache.airavata.service.profile.groupmanager.cpi.GroupManagerService;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/repositories/AbstractRepository.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/repositories/AbstractRepository.java
similarity index 95%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/repositories/AbstractRepository.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/repositories/AbstractRepository.java
index f7af96c783..36e0accb7a 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/repositories/AbstractRepository.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/repositories/AbstractRepository.java
@@ -17,15 +17,16 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.repositories;
+package org.apache.airavata.profile.commons.repositories;
 
 import com.github.dozermapper.core.Mapper;
 import jakarta.persistence.Query;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import org.apache.airavata.service.profile.commons.utils.JPAUtils;
-import org.apache.airavata.service.profile.commons.utils.ObjectMapperSingleton;
+
+import org.apache.airavata.profile.commons.utils.JPAUtils;
+import org.apache.airavata.profile.commons.utils.ObjectMapperSingleton;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/GatewayEntity.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/tenant/entities/GatewayEntity.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/GatewayEntity.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/tenant/entities/GatewayEntity.java
index 23bb59950d..09ef2dc440 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/tenant/entities/GatewayEntity.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/tenant/entities/GatewayEntity.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.tenant.entities;
+package org.apache.airavata.profile.commons.tenant.entities;
 
 import jakarta.persistence.*;
 import java.util.UUID;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/CustomizedDashboardEntity.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/CustomizedDashboardEntity.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/CustomizedDashboardEntity.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/CustomizedDashboardEntity.java
index 1534279537..d76df2b926 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/CustomizedDashboardEntity.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/CustomizedDashboardEntity.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.user.entities;
+package org.apache.airavata.profile.commons.user.entities;
 
 import jakarta.persistence.*;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/NSFDemographicsEntity.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/NSFDemographicsEntity.java
similarity index 98%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/NSFDemographicsEntity.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/NSFDemographicsEntity.java
index e79559ec5a..e4a339378e 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/NSFDemographicsEntity.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/NSFDemographicsEntity.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.user.entities;
+package org.apache.airavata.profile.commons.user.entities;
 
 import jakarta.persistence.*;
 import java.util.List;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/UserProfileEntity.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/UserProfileEntity.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/UserProfileEntity.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/UserProfileEntity.java
index ae4f8a364b..e9b377255c 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/user/entities/UserProfileEntity.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/user/entities/UserProfileEntity.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.user.entities;
+package org.apache.airavata.profile.commons.user.entities;
 
 import jakarta.persistence.*;
 import java.util.Date;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/Committer.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/Committer.java
similarity index 93%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/Committer.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/Committer.java
index 55087e2d7f..4aed3890ca 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/Committer.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/Committer.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 @FunctionalInterface
 public interface Committer<T, R> {
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/JPAConstants.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/JPAConstants.java
similarity index 95%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/JPAConstants.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/JPAConstants.java
index 2663b9f902..38ed76d765 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/JPAConstants.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/JPAConstants.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 public class JPAConstants {
     public static final String KEY_JDBC_URL = "profile.service.jdbc.url";
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/JPAUtils.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/JPAUtils.java
similarity index 97%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/JPAUtils.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/JPAUtils.java
index a340b5f5e1..742055ed25 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/JPAUtils.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/JPAUtils.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 import jakarta.persistence.EntityManager;
 import jakarta.persistence.EntityManagerFactory;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/ObjectMapperSingleton.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/ObjectMapperSingleton.java
similarity index 95%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/ObjectMapperSingleton.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/ObjectMapperSingleton.java
index 7559aa55b7..582821b1b4 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/ObjectMapperSingleton.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/ObjectMapperSingleton.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 import com.github.dozermapper.core.DozerBeanMapperBuilder;
 import com.github.dozermapper.core.Mapper;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/ProfileServiceJDBCConfig.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/ProfileServiceJDBCConfig.java
similarity index 95%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/ProfileServiceJDBCConfig.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/ProfileServiceJDBCConfig.java
index c4fd6f86e9..14808813b2 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/ProfileServiceJDBCConfig.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/ProfileServiceJDBCConfig.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 import org.apache.airavata.common.utils.JDBCConfig;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/QueryConstants.java
similarity index 97%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/QueryConstants.java
index 1bd7657b2b..f1e3bd26bd 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/QueryConstants.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/QueryConstants.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.model.workspace.Gateway;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/Utils.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/Utils.java
similarity index 98%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/Utils.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/Utils.java
index 6fe32a38ba..40d53ea8ab 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/commons/utils/Utils.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/commons/utils/Utils.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.commons.utils;
+package org.apache.airavata.profile.commons.utils;
 
 import java.net.URI;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/GroupManagerServiceHandler.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/handlers/GroupManagerServiceHandler.java
index 9b445aa11b..db43e483af 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/GroupManagerServiceHandler.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/GroupManagerServiceHandler.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.handlers;
+package org.apache.airavata.profile.handlers;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -30,10 +30,10 @@ import 
org.apache.airavata.model.error.AuthorizationException;
 import org.apache.airavata.model.group.GroupModel;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.user.UserProfile;
+import 
org.apache.airavata.profile.user.core.repositories.UserProfileRepository;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.GroupManagerService;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.exception.GroupManagerServiceException;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.group_manager_cpiConstants;
-import 
org.apache.airavata.service.profile.user.core.repositories.UserProfileRepository;
 import org.apache.airavata.service.security.interceptor.SecurityCheck;
 import 
org.apache.airavata.sharing.registry.client.SharingRegistryServiceClientFactory;
 import org.apache.airavata.sharing.registry.models.GroupCardinality;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/IamAdminServicesHandler.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/IamAdminServicesHandler.java
similarity index 98%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/IamAdminServicesHandler.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/handlers/IamAdminServicesHandler.java
index 2da10e50fe..6e90121d60 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/IamAdminServicesHandler.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/IamAdminServicesHandler.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.handlers;
+package org.apache.airavata.profile.handlers;
 
 import java.util.List;
 import org.apache.airavata.common.exception.AiravataException;
@@ -38,14 +38,14 @@ import 
org.apache.airavata.model.error.AuthorizationException;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.model.workspace.Gateway;
+import 
org.apache.airavata.profile.iam.admin.services.core.impl.TenantManagementKeycloakImpl;
+import 
org.apache.airavata.profile.user.core.repositories.UserProfileRepository;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
 import org.apache.airavata.registry.api.exception.RegistryServiceException;
-import 
org.apache.airavata.service.profile.iam.admin.services.core.impl.TenantManagementKeycloakImpl;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.IamAdminServices;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.iam_admin_services_cpiConstants;
-import 
org.apache.airavata.service.profile.user.core.repositories.UserProfileRepository;
 import org.apache.airavata.service.security.interceptor.SecurityCheck;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/TenantProfileServiceHandler.java
similarity index 98%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/handlers/TenantProfileServiceHandler.java
index 2f856cc07d..65388e01f6 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/TenantProfileServiceHandler.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/TenantProfileServiceHandler.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.handlers;
+package org.apache.airavata.profile.handlers;
 
 import java.util.List;
 import java.util.UUID;
@@ -36,8 +36,8 @@ import org.apache.airavata.model.error.AuthorizationException;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.GatewayApprovalStatus;
-import 
org.apache.airavata.service.profile.commons.tenant.entities.GatewayEntity;
-import 
org.apache.airavata.service.profile.tenant.core.repositories.TenantProfileRepository;
+import org.apache.airavata.profile.commons.tenant.entities.GatewayEntity;
+import 
org.apache.airavata.profile.tenant.core.repositories.TenantProfileRepository;
 import org.apache.airavata.service.profile.tenant.cpi.TenantProfileService;
 import 
org.apache.airavata.service.profile.tenant.cpi.exception.TenantProfileServiceException;
 import 
org.apache.airavata.service.profile.tenant.cpi.profile_tenant_cpiConstants;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/UserProfileServiceHandler.java
similarity index 96%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/handlers/UserProfileServiceHandler.java
index 2dec971b1b..f33b8ebf49 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/handlers/UserProfileServiceHandler.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/handlers/UserProfileServiceHandler.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.handlers;
+package org.apache.airavata.profile.handlers;
 
 import java.util.List;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
@@ -32,17 +32,17 @@ import 
org.apache.airavata.model.error.AuthorizationException;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.user.Status;
 import org.apache.airavata.model.user.UserProfile;
+import org.apache.airavata.profile.client.ProfileServiceClientFactory;
+import 
org.apache.airavata.profile.user.core.repositories.UserProfileRepository;
 import org.apache.airavata.security.AiravataSecurityException;
-import org.apache.airavata.service.profile.client.ProfileServiceClientFactory;
+import org.apache.airavata.security.AiravataSecurityManager;
+import org.apache.airavata.security.SecurityManagerFactory;
+import org.apache.airavata.security.UserInfo;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.IamAdminServices;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
-import 
org.apache.airavata.service.profile.user.core.repositories.UserProfileRepository;
 import org.apache.airavata.service.profile.user.cpi.UserProfileService;
 import 
org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException;
 import org.apache.airavata.service.profile.user.cpi.profile_user_cpiConstants;
-import org.apache.airavata.service.security.AiravataSecurityManager;
-import org.apache.airavata.service.security.SecurityManagerFactory;
-import org.apache.airavata.service.security.UserInfo;
 import org.apache.airavata.service.security.interceptor.SecurityCheck;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
index d9b4fcf1e1..260c7a7588 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/iam/admin/services/core/impl/TenantManagementKeycloakImpl.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.iam.admin.services.core.impl;
+package org.apache.airavata.profile.iam.admin.services.core.impl;
 
 import jakarta.ws.rs.client.Client;
 import jakarta.ws.rs.client.ClientBuilder;
@@ -34,8 +34,8 @@ import 
org.apache.airavata.model.credential.store.PasswordCredential;
 import org.apache.airavata.model.user.Status;
 import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.model.workspace.Gateway;
+import 
org.apache.airavata.profile.iam.admin.services.core.interfaces.TenantManagementInterface;
 import org.apache.airavata.security.AiravataSecurityException;
-import 
org.apache.airavata.service.profile.iam.admin.services.core.interfaces.TenantManagementInterface;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
 import org.keycloak.admin.client.Keycloak;
 import org.keycloak.admin.client.KeycloakBuilder;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/interfaces/TenantManagementInterface.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/iam/admin/services/core/interfaces/TenantManagementInterface.java
similarity index 98%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/interfaces/TenantManagementInterface.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/iam/admin/services/core/interfaces/TenantManagementInterface.java
index b8f8361c42..447b808e11 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/iam/admin/services/core/interfaces/TenantManagementInterface.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/iam/admin/services/core/interfaces/TenantManagementInterface.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.iam.admin.services.core.interfaces;
+package org.apache.airavata.profile.iam.admin.services.core.interfaces;
 
 import java.util.List;
 import org.apache.airavata.model.credential.store.PasswordCredential;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/server/ProfileServiceServer.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/server/ProfileServiceServer.java
similarity index 93%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/server/ProfileServiceServer.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/server/ProfileServiceServer.java
index 8419217240..1c0eb348a0 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/server/ProfileServiceServer.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/server/ProfileServiceServer.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.server;
+package org.apache.airavata.profile.server;
 
 import java.net.InetSocketAddress;
 import java.util.Arrays;
@@ -27,17 +27,17 @@ import org.apache.airavata.common.utils.DBInitConfig;
 import org.apache.airavata.common.utils.DBInitializer;
 import org.apache.airavata.common.utils.IServer;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.profile.handlers.GroupManagerServiceHandler;
+import org.apache.airavata.profile.handlers.IamAdminServicesHandler;
+import org.apache.airavata.profile.handlers.TenantProfileServiceHandler;
+import org.apache.airavata.profile.handlers.UserProfileServiceHandler;
+import 
org.apache.airavata.profile.user.core.utils.UserProfileCatalogDBInitConfig;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.GroupManagerService;
 import 
org.apache.airavata.service.profile.groupmanager.cpi.group_manager_cpiConstants;
-import org.apache.airavata.service.profile.handlers.GroupManagerServiceHandler;
-import org.apache.airavata.service.profile.handlers.IamAdminServicesHandler;
-import 
org.apache.airavata.service.profile.handlers.TenantProfileServiceHandler;
-import org.apache.airavata.service.profile.handlers.UserProfileServiceHandler;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.IamAdminServices;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.iam_admin_services_cpiConstants;
 import org.apache.airavata.service.profile.tenant.cpi.TenantProfileService;
 import 
org.apache.airavata.service.profile.tenant.cpi.profile_tenant_cpiConstants;
-import 
org.apache.airavata.service.profile.user.core.utils.UserProfileCatalogDBInitConfig;
 import org.apache.airavata.service.profile.user.cpi.UserProfileService;
 import org.apache.airavata.service.profile.user.cpi.profile_user_cpiConstants;
 import org.apache.thrift.TMultiplexedProcessor;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/tenant/core/repositories/TenantProfileRepository.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/tenant/core/repositories/TenantProfileRepository.java
similarity index 93%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/tenant/core/repositories/TenantProfileRepository.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/tenant/core/repositories/TenantProfileRepository.java
index 3ed7fb82b9..63290314fc 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/tenant/core/repositories/TenantProfileRepository.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/tenant/core/repositories/TenantProfileRepository.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.tenant.core.repositories;
+package org.apache.airavata.profile.tenant.core.repositories;
 
 import java.util.Arrays;
 import java.util.HashMap;
@@ -25,9 +25,9 @@ import java.util.List;
 import java.util.Map;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.GatewayApprovalStatus;
-import 
org.apache.airavata.service.profile.commons.repositories.AbstractRepository;
-import 
org.apache.airavata.service.profile.commons.tenant.entities.GatewayEntity;
-import org.apache.airavata.service.profile.commons.utils.QueryConstants;
+import org.apache.airavata.profile.commons.repositories.AbstractRepository;
+import org.apache.airavata.profile.commons.tenant.entities.GatewayEntity;
+import org.apache.airavata.profile.commons.utils.QueryConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/exceptions/UserProfileRegistryException.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/exceptions/UserProfileRegistryException.java
similarity index 93%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/exceptions/UserProfileRegistryException.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/user/core/exceptions/UserProfileRegistryException.java
index dc567c9fd2..15104e533b 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/exceptions/UserProfileRegistryException.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/exceptions/UserProfileRegistryException.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.user.core.exceptions;
+package org.apache.airavata.profile.user.core.exceptions;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/repositories/UserProfileRepository.java
similarity index 91%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/user/core/repositories/UserProfileRepository.java
index 5f2912d310..f375fd4a3c 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/repositories/UserProfileRepository.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/repositories/UserProfileRepository.java
@@ -17,18 +17,18 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.user.core.repositories;
+package org.apache.airavata.profile.user.core.repositories;
 
 import com.github.dozermapper.core.Mapper;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.apache.airavata.model.user.UserProfile;
-import 
org.apache.airavata.service.profile.commons.repositories.AbstractRepository;
-import 
org.apache.airavata.service.profile.commons.user.entities.UserProfileEntity;
-import org.apache.airavata.service.profile.commons.utils.JPAUtils;
-import org.apache.airavata.service.profile.commons.utils.ObjectMapperSingleton;
-import org.apache.airavata.service.profile.commons.utils.QueryConstants;
+import org.apache.airavata.profile.commons.repositories.AbstractRepository;
+import org.apache.airavata.profile.commons.user.entities.UserProfileEntity;
+import org.apache.airavata.profile.commons.utils.JPAUtils;
+import org.apache.airavata.profile.commons.utils.ObjectMapperSingleton;
+import org.apache.airavata.profile.commons.utils.QueryConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
similarity index 95%
copy from 
airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
copy to 
airavata-api/src/main/java/org/apache/airavata/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
index cdb281c5aa..2fd3efb882 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.user.core.utils;
+package org.apache.airavata.profile.user.core.utils;
 
 import org.apache.airavata.common.utils.DBInitConfig;
 import org.apache.airavata.common.utils.JDBCConfig;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogJDBCConfig.java
 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/utils/UserProfileCatalogJDBCConfig.java
similarity index 91%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogJDBCConfig.java
rename to 
airavata-api/src/main/java/org/apache/airavata/profile/user/core/utils/UserProfileCatalogJDBCConfig.java
index ad78c97084..dbf6b13385 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogJDBCConfig.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/profile/user/core/utils/UserProfileCatalogJDBCConfig.java
@@ -17,10 +17,10 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.user.core.utils;
+package org.apache.airavata.profile.user.core.utils;
 
 import org.apache.airavata.common.utils.JDBCConfig;
-import org.apache.airavata.service.profile.commons.utils.Utils;
+import org.apache.airavata.profile.commons.utils.Utils;
 
 public class UserProfileCatalogJDBCConfig implements JDBCConfig {
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/AiravataSecurityManager.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/AiravataSecurityManager.java
similarity index 94%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/AiravataSecurityManager.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/AiravataSecurityManager.java
index 065b23ec52..8c947d8b49 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/AiravataSecurityManager.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/security/AiravataSecurityManager.java
@@ -17,11 +17,10 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.security;
+package org.apache.airavata.security;
 
 import java.util.Map;
 import org.apache.airavata.model.security.AuthzToken;
-import org.apache.airavata.security.AiravataSecurityException;
 
 public interface AiravataSecurityManager {
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/GatewayGroupsInitializer.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/GatewayGroupsInitializer.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/GatewayGroupsInitializer.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/GatewayGroupsInitializer.java
index f97ad654bc..60c80a9c5b 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/GatewayGroupsInitializer.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/security/GatewayGroupsInitializer.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.security;
+package org.apache.airavata.security;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/IdentityContext.java
 b/airavata-api/src/main/java/org/apache/airavata/security/IdentityContext.java
similarity index 96%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/IdentityContext.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/IdentityContext.java
index 07999c67bc..0c5d30339d 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/IdentityContext.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/security/IdentityContext.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.security;
+package org.apache.airavata.security;
 
 import org.apache.airavata.model.security.AuthzToken;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/KeyCloakSecurityManager.java
similarity index 99%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/KeyCloakSecurityManager.java
index f368e83016..436b8577a9 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/KeyCloakSecurityManager.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/security/KeyCloakSecurityManager.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.security;
+package org.apache.airavata.security;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -42,7 +42,6 @@ import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
 import org.apache.airavata.registry.api.exception.RegistryServiceException;
-import org.apache.airavata.security.AiravataSecurityException;
 import org.apache.airavata.service.security.authzcache.*;
 import 
org.apache.airavata.sharing.registry.client.SharingRegistryServiceClientFactory;
 import org.apache.airavata.sharing.registry.models.SharingRegistryException;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/SecurityManagerFactory.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/SecurityManagerFactory.java
similarity index 95%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/SecurityManagerFactory.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/SecurityManagerFactory.java
index 4d0e46dc06..98333d26ea 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/SecurityManagerFactory.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/security/SecurityManagerFactory.java
@@ -17,11 +17,10 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.security;
+package org.apache.airavata.security;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.security.AiravataSecurityException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/UserInfo.java 
b/airavata-api/src/main/java/org/apache/airavata/security/UserInfo.java
similarity index 97%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/UserInfo.java
rename to airavata-api/src/main/java/org/apache/airavata/security/UserInfo.java
index b88c6e4acc..7f9c62504b 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/UserInfo.java
+++ b/airavata-api/src/main/java/org/apache/airavata/security/UserInfo.java
@@ -17,7 +17,7 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.security;
+package org.apache.airavata.security;
 
 public class UserInfo {
     private String sub;
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCache.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCache.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCache.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCache.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheEntry.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheEntry.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheEntry.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheEntry.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheIndex.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheIndex.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheIndex.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheIndex.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheManager.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheManager.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheManager.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheManager.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheManagerFactory.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheManagerFactory.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCacheManagerFactory.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCacheManagerFactory.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCachedStatus.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCachedStatus.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/AuthzCachedStatus.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/AuthzCachedStatus.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/DefaultAuthzCacheManager.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/authzcache/DefaultAuthzCacheManager.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/authzcache/DefaultAuthzCacheManager.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/authzcache/DefaultAuthzCacheManager.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityCheck.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityCheck.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityCheck.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityCheck.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityInterceptor.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityInterceptor.java
similarity index 94%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityInterceptor.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityInterceptor.java
index eb328c5cf1..7c96e94895 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityInterceptor.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityInterceptor.java
@@ -30,9 +30,9 @@ import org.apache.airavata.model.error.AuthorizationException;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.patform.monitoring.CountMonitor;
 import org.apache.airavata.security.AiravataSecurityException;
-import org.apache.airavata.service.security.AiravataSecurityManager;
-import org.apache.airavata.service.security.IdentityContext;
-import org.apache.airavata.service.security.SecurityManagerFactory;
+import org.apache.airavata.security.AiravataSecurityManager;
+import org.apache.airavata.security.IdentityContext;
+import org.apache.airavata.security.SecurityManagerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityModule.java
 
b/airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityModule.java
similarity index 100%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/security/interceptor/SecurityModule.java
rename to 
airavata-api/src/main/java/org/apache/airavata/security/interceptor/SecurityModule.java
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/server/ServerMain.java 
b/airavata-api/src/main/java/org/apache/airavata/server/ServerMain.java
deleted file mode 100644
index 2306c3d6a1..0000000000
--- a/airavata-api/src/main/java/org/apache/airavata/server/ServerMain.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/**
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-package org.apache.airavata.server;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.airavata.api.server.AiravataAPIServer;
-import org.apache.airavata.common.exception.AiravataException;
-import org.apache.airavata.common.utils.*;
-import org.apache.airavata.common.utils.ApplicationSettings.ShutdownStrategy;
-import org.apache.airavata.common.utils.IServer.ServerStatus;
-import org.apache.airavata.credential.store.server.CredentialStoreServer;
-import org.apache.airavata.db.event.manager.DBEventManagerRunner;
-import org.apache.airavata.helix.impl.controller.HelixController;
-import org.apache.airavata.helix.impl.participant.GlobalParticipant;
-import org.apache.airavata.helix.impl.workflow.PostWorkflowManager;
-import org.apache.airavata.helix.impl.workflow.PreWorkflowManager;
-import org.apache.airavata.monitor.email.EmailBasedMonitor;
-import org.apache.airavata.monitor.realtime.RealtimeMonitor;
-import org.apache.airavata.orchestrator.server.OrchestratorServer;
-import org.apache.airavata.patform.monitoring.MonitoringServer;
-import org.apache.airavata.registry.api.service.RegistryAPIServer;
-import org.apache.airavata.service.profile.server.ProfileServiceServer;
-import org.apache.airavata.sharing.registry.server.SharingRegistryServer;
-import org.apache.commons.cli.ParseException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ServerMain {
-    private static List<IServer> servers;
-    private static List<Class<?>> additionalServers;
-    private static final Logger logger = 
LoggerFactory.getLogger(ServerMain.class);
-    private static boolean serversLoaded = false;
-    private static boolean systemShutDown = false;
-
-    static {
-        servers = new ArrayList<>();
-        additionalServers = new ArrayList<>();
-    }
-
-    private static void loadServers() {
-        servers.clear();
-        additionalServers.clear();
-
-        servers.addAll(Arrays.asList(
-          new DBEventManagerRunner(),
-          new RegistryAPIServer(),
-          new CredentialStoreServer(),
-          new SharingRegistryServer(),
-          new AiravataAPIServer(),
-          new OrchestratorServer(),
-          new ProfileServiceServer()
-        ));
-
-        additionalServers.addAll(Arrays.asList(
-        HelixController.class, 
-          GlobalParticipant.class,
-          EmailBasedMonitor.class,
-          RealtimeMonitor.class,
-          PreWorkflowManager.class,
-          PostWorkflowManager.class
-        ));
-        serversLoaded = true;
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            public void run() {
-                setSystemShutDown();
-                stopAllServers();
-            }
-        });
-    }
-
-    public static void main(String[] args) throws IOException, 
AiravataException, ParseException {
-        ServerSettings.mergeSettingsCommandLineArgs(args);
-        if (ServerSettings.getBooleanSetting("api.server.monitoring.enabled")) 
{
-            MonitoringServer monitoringServer = new MonitoringServer(
-                    ServerSettings.getSetting("api.server.monitoring.host"),
-                    
ServerSettings.getIntSetting("api.server.monitoring.port"));
-            monitoringServer.start();
-
-            Runtime.getRuntime().addShutdownHook(new 
Thread(monitoringServer::stop));
-        }
-
-        logger.info("Airavata server instance starting...");
-        startAllServers();
-
-        // Wait until SIGTERM or KeyboardInterrupt (Ctrl+C) triggers shutdown 
hook.
-        try {
-            while (!isSystemShutDown()) {
-                Thread.sleep(2000);
-            }
-        } catch (InterruptedException e) {
-            logger.info("Interrupted, shutting down servers...");
-            setSystemShutDown();
-        }
-
-        if (isSystemShutDown()) {
-            ServerSettings.setStopAllThreads(true);
-            stopAllServers();
-            ShutdownStrategy shutdownStrategy;
-            try {
-                shutdownStrategy = ServerSettings.getShutdownStrategy();
-            } catch (Exception e) {
-                String strategies = "";
-                for (ShutdownStrategy s : ShutdownStrategy.values()) {
-                    strategies += "/" + s.toString();
-                }
-                logger.warn(e.getMessage());
-                logger.warn("Valid shutdown options are : " + 
strategies.substring(1));
-                shutdownStrategy = ShutdownStrategy.SELF_TERMINATE;
-            }
-            if (shutdownStrategy == ShutdownStrategy.SELF_TERMINATE) {
-                System.exit(0);
-            }
-        }
-    }
-
-    public static void stopAllServers() {
-        // stopping should be done in reverse order of starting the servers
-        for (int i = servers.size() - 1; i >= 0; i--) {
-            try {
-                servers.get(i).stop();
-                waitForServerToStop(servers.get(i), null);
-            } catch (Exception e) {
-                logger.error("Server Stop Error:", e);
-            }
-        }
-    }
-
-    public static void startAllServers() {
-        if (!serversLoaded) {
-            loadServers();
-        }
-        for (IServer server : servers) {
-            try {
-                server.configure();
-                server.start();
-                waitForServerToStart(server, null);
-            } catch (Exception e) {
-                logger.error("Server Start Error:", e);
-            }
-        }
-    }
-
-    private static final int SERVER_STATUS_CHANGE_WAIT_INTERVAL = 500;
-
-    private static void waitForServerToStart(IServer server, Integer maxWait) 
throws Exception {
-        int count = 0;
-        while (server.getStatus() == ServerStatus.STARTING && (maxWait == null 
|| count < maxWait)) {
-            Thread.sleep(SERVER_STATUS_CHANGE_WAIT_INTERVAL);
-            count += SERVER_STATUS_CHANGE_WAIT_INTERVAL;
-        }
-        if (server.getStatus() != ServerStatus.STARTED) {
-            logger.error("The " + server.getName() + " did not start!!!");
-        }
-    }
-
-    private static void waitForServerToStop(IServer server, Integer maxWait) 
throws Exception {
-        int count = 0;
-        if (server.getStatus() == ServerStatus.STOPING) {
-            logger.info("Waiting for " + server.getName() + " to stop...");
-        }
-        while (server.getStatus() == ServerStatus.STOPING && (maxWait == null 
|| count < maxWait)) {
-            Thread.sleep(SERVER_STATUS_CHANGE_WAIT_INTERVAL);
-            count += SERVER_STATUS_CHANGE_WAIT_INTERVAL;
-        }
-        if (server.getStatus() != ServerStatus.STOPPED) {
-            logger.error("Error stopping the " + server.getName() + "!!!");
-        }
-    }
-
-    private static boolean isSystemShutDown() {
-        return systemShutDown;
-    }
-
-    private static void setSystemShutDown() {
-        ServerMain.systemShutDown = true;
-    }
-}
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
 b/airavata-api/src/main/java/org/apache/airavata/service/ServiceFactory.java
similarity index 56%
rename from 
airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
rename to 
airavata-api/src/main/java/org/apache/airavata/service/ServiceFactory.java
index cdb281c5aa..ae2a5cb460 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/service/profile/user/core/utils/UserProfileCatalogDBInitConfig.java
+++ b/airavata-api/src/main/java/org/apache/airavata/service/ServiceFactory.java
@@ -17,25 +17,20 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-package org.apache.airavata.service.profile.user.core.utils;
+package org.apache.airavata.service;
 
-import org.apache.airavata.common.utils.DBInitConfig;
-import org.apache.airavata.common.utils.JDBCConfig;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import 
org.apache.airavata.credential.store.server.CredentialStoreServerHandler;
+import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.registry.api.service.handler.RegistryServerHandler;
 
-public class UserProfileCatalogDBInitConfig implements DBInitConfig {
+public class ServiceFactory {
 
-    @Override
-    public JDBCConfig getJDBCConfig() {
-        return new UserProfileCatalogJDBCConfig();
+    public static RegistryService.Iface getRegistry() throws Exception {
+        return new RegistryServerHandler();
     }
 
-    @Override
-    public String getDBInitScriptPrefix() {
-        return "database_scripts/user-profile-catalog";
-    }
-
-    @Override
-    public String getCheckTableName() {
-        return "CONFIGURATION";
+    public static CredentialStoreService.Iface getCredentialStore() throws 
Exception {
+        return new CredentialStoreServerHandler();
     }
 }
diff --git 
a/airavata-api/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
 
b/airavata-api/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
index e65f0368dd..b90c3db3b0 100644
--- 
a/airavata-api/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
+++ 
b/airavata-api/src/main/java/org/apache/airavata/sharing/registry/migrator/airavata/AiravataDataMigrator.java
@@ -54,16 +54,16 @@ import org.apache.airavata.model.group.ResourceType;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.user.Status;
 import org.apache.airavata.model.user.UserProfile;
+import org.apache.airavata.profile.client.ProfileServiceClientFactory;
+import 
org.apache.airavata.profile.iam.admin.services.core.impl.TenantManagementKeycloakImpl;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
 import org.apache.airavata.registry.api.exception.RegistryServiceException;
 import org.apache.airavata.security.AiravataSecurityException;
-import org.apache.airavata.service.profile.client.ProfileServiceClientFactory;
-import 
org.apache.airavata.service.profile.iam.admin.services.core.impl.TenantManagementKeycloakImpl;
+import org.apache.airavata.security.AiravataSecurityManager;
+import org.apache.airavata.security.SecurityManagerFactory;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.IamAdminServices;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
-import org.apache.airavata.service.security.AiravataSecurityManager;
-import org.apache.airavata.service.security.SecurityManagerFactory;
 import org.apache.airavata.sharing.registry.models.Domain;
 import org.apache.airavata.sharing.registry.models.Entity;
 import org.apache.airavata.sharing.registry.models.EntitySearchField;
diff --git a/airavata-api/src/main/resources/distribution/bin/email-monitor.sh 
b/airavata-api/src/main/resources/distribution/bin/airavata.sh
similarity index 91%
rename from airavata-api/src/main/resources/distribution/bin/email-monitor.sh
rename to airavata-api/src/main/resources/distribution/bin/airavata.sh
index beb11ebbad..ef6adfbf8c 100755
--- a/airavata-api/src/main/resources/distribution/bin/email-monitor.sh
+++ b/airavata-api/src/main/resources/distribution/bin/airavata.sh
@@ -19,8 +19,7 @@
 
 . $(dirname $0)/setenv.sh
 
-SERVICE_NAME="email-monitor"
-MAIN_CLASS="org.apache.airavata.monitor.email.EmailBasedMonitor"
+SERVICE_NAME="airavata-api"
+MAIN_CLASS="org.apache.airavata.Main"
 JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
 run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git a/airavata-api/src/main/resources/distribution/bin/controller.sh 
b/airavata-api/src/main/resources/distribution/bin/controller.sh
deleted file mode 100755
index 4e145cd5ee..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/controller.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="controller"
-MAIN_CLASS="org.apache.airavata.helix.impl.controller.HelixController"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git a/airavata-api/src/main/resources/distribution/bin/orchestrator.sh 
b/airavata-api/src/main/resources/distribution/bin/orchestrator.sh
deleted file mode 100755
index 5e457ac5bc..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/orchestrator.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="orchestrator"
-MAIN_CLASS="org.apache.airavata.server.ServerMain"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-SERVERS=""
-ARGS=()
-while [[ $# -gt 0 ]]; do
-  case $1 in
-  apiserver | gfac | orchestrator | credentialstore | regserver)
-    if [ -z "$SERVERS" ]; then SERVERS="$1"; else SERVERS="$SERVERS,$1"; fi
-    shift
-    ;;
-  all | api-orch | execution)
-    SERVERS="$1"
-    shift
-    ;;
-  *)
-    ARGS+=("$1")
-    shift
-    ;;
-  esac
-done
-CONSTRUCTED_ARGS=()
-if [[ " ${ARGS[*]} " =~ " start " ]]; then
-  if [ -n "$SERVERS" ]; then
-    CONSTRUCTED_ARGS+=("--servers=${SERVERS}")
-  else
-    echo "You should provide at least one server component to start the 
airavata server. Please use -h option to get more details."
-    exit 1
-  fi
-fi
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "${ARGS[@]}" 
"${CONSTRUCTED_ARGS[@]}"
diff --git a/airavata-api/src/main/resources/distribution/bin/parser-wm.sh 
b/airavata-api/src/main/resources/distribution/bin/parser-wm.sh
deleted file mode 100755
index f451c6dabb..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/parser-wm.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="parser-wm"
-MAIN_CLASS="org.apache.airavata.helix.impl.workflow.ParserWorkflowManager"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git a/airavata-api/src/main/resources/distribution/bin/participant.sh 
b/airavata-api/src/main/resources/distribution/bin/participant.sh
deleted file mode 100755
index 2f8730c743..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/participant.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="participant"
-MAIN_CLASS="org.apache.airavata.helix.impl.participant.GlobalParticipant"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git a/airavata-api/src/main/resources/distribution/bin/post-wm.sh 
b/airavata-api/src/main/resources/distribution/bin/post-wm.sh
deleted file mode 100755
index 6d867cdcba..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/post-wm.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="post-wm"
-MAIN_CLASS="org.apache.airavata.helix.impl.workflow.PostWorkflowManager"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git a/airavata-api/src/main/resources/distribution/bin/pre-wm.sh 
b/airavata-api/src/main/resources/distribution/bin/pre-wm.sh
deleted file mode 100755
index c8f1dc3bab..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/pre-wm.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="pre-wm"
-MAIN_CLASS="org.apache.airavata.helix.impl.workflow.PreWorkflowManager"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git 
a/airavata-api/src/main/resources/distribution/bin/realtime-monitor.sh 
b/airavata-api/src/main/resources/distribution/bin/realtime-monitor.sh
deleted file mode 100755
index 347fd24a21..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/realtime-monitor.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="realtime-monitor"
-MAIN_CLASS="org.apache.airavata.monitor.realtime.RealtimeMonitor"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git a/airavata-api/src/main/resources/distribution/bin/setenv.sh 
b/airavata-api/src/main/resources/distribution/bin/setenv.sh
deleted file mode 100755
index 9024de1d7b..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/setenv.sh
+++ /dev/null
@@ -1,146 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-# Resolve symlinks to get the real script location
-PRG="$0"
-while [ -L "$PRG" ]; do
-  PRG=$(readlink "$PRG")
-done
-PRGDIR=$(dirname "$PRG")
-
-# Set AIRAVATA_HOME if not already set
-[ -z "$AIRAVATA_HOME" ] && AIRAVATA_HOME=$(cd "$PRGDIR/.." && pwd)
-
-# Build CLASSPATH from all JAR files
-CLASSPATH=$(printf "%s:" "$AIRAVATA_HOME"/lib/*.jar)
-CLASSPATH=${CLASSPATH%:} # Remove trailing colon
-
-export AIRAVATA_HOME CLASSPATH
-
-# Common function to run Airavata services
-# Usage: run_service <service_name> <main_class> <java_opts>
-run_service() {
-  local SERVICE_NAME="$1" MAIN_CLASS="$2" JAVA_OPTS="$3"
-  # Export SERVICE_NAME as environment variable for log4j2 configuration
-  export SERVICE_NAME
-  local CWD="$PWD" PID_PATH_NAME="${AIRAVATA_HOME}/bin/pid-${SERVICE_NAME}"
-  local DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/${SERVICE_NAME}.log"
-  local LOG_FILE="$DEFAULT_LOG_FILE" DAEMON_MODE=false EXTRA_ARGS=""
-
-  # Help text
-  local HELP_TEXT="Usage: ${SERVICE_NAME}.sh
-
-command options:
-  -d                  Run in daemon mode
-  -xdebug             Start ${SERVICE_NAME} under JPDA debugger
-  -log <LOG_FILE>     Where to redirect stdout/stderr (defaults to 
$DEFAULT_LOG_FILE)
-  -h                  Display this help and exit
-
-Daemon mode commands (use with -d):
-  start               Start server in daemon mode
-  stop                Stop server running in daemon mode
-  restart             Restart server in daemon mode"
-
-  cd "${AIRAVATA_HOME}/bin"
-
-  # Helper function to stop daemon process
-  stop_daemon() {
-    if [[ -f "$PID_PATH_NAME" ]]; then
-      local PID=$(cat "$PID_PATH_NAME")
-      echo "$SERVICE_NAME stopping..."
-      pkill -P "$PID"
-      kill "$PID"
-
-      local retry=0
-      while kill -0 "$PID" 2>/dev/null && ((retry++ < 20)); do
-        echo "[PID: $PID] Waiting for process to stop..."
-        sleep 1
-      done
-
-      if kill -0 "$PID" 2>/dev/null; then
-        echo "[PID: $PID] Forcefully killing non-responsive process..."
-        pkill -9 -P "$PID"
-        kill -9 "$PID"
-      fi
-
-      echo "$SERVICE_NAME is now stopped."
-      rm "$PID_PATH_NAME"
-      return 0
-    else
-      echo "$SERVICE_NAME is not running."
-      return 1
-    fi
-  }
-
-  # Helper function to start daemon process
-  start_daemon() {
-    echo "Starting $SERVICE_NAME ..."
-    if [[ ! -f "$PID_PATH_NAME" ]]; then
-      nohup java $JAVA_OPTS -classpath "$CLASSPATH" "$MAIN_CLASS" "$@" 
>"$LOG_FILE" 2>&1 &
-      echo $! >"$PID_PATH_NAME"
-      echo "$SERVICE_NAME now running: PID $(cat "$PID_PATH_NAME")"
-    else
-      echo "$SERVICE_NAME already running: PID $(cat "$PID_PATH_NAME")"
-    fi
-  }
-
-  # Parse command arguments
-  while (($# > 0)); do
-    case "$1" in
-    -d) DAEMON_MODE=true ;;
-    -xdebug) JAVA_OPTS+=" -Xdebug -Xnoagent 
-Xrunjdwp:transport=dt_socket,server=y,address=*:8000" ;;
-    -log)
-      shift
-      LOG_FILE="$1"
-      [[ "$LOG_FILE" != /* ]] && LOG_FILE="${CWD}/${LOG_FILE}"
-      ;;
-    start | stop | restart)
-      if [[ "$DAEMON_MODE" == true ]]; then
-        case "$1" in
-        start) start_daemon "$@" ;;
-        stop) stop_daemon ;;
-        restart)
-          stop_daemon
-          start_daemon "$@"
-          ;;
-        esac
-        exit 0
-      else
-        EXTRA_ARGS+=" $1"
-      fi
-      ;;
-    -h)
-      echo "$HELP_TEXT"
-      exit 0
-      ;;
-    *) EXTRA_ARGS+=" $1" ;;
-    esac
-    shift
-  done
-
-  # Validate daemon mode usage
-  if [[ "$DAEMON_MODE" == true ]]; then
-    echo "Error: Daemon mode (-d) requires one of: start, stop, restart"
-    echo "Use -h for help"
-    exit 1
-  fi
-
-  # Run in foreground mode
-  java $JAVA_OPTS -classpath "$CLASSPATH" "$MAIN_CLASS" $EXTRA_ARGS
-}
diff --git 
a/airavata-api/src/main/resources/distribution/bin/sharing-registry.sh 
b/airavata-api/src/main/resources/distribution/bin/sharing-registry.sh
deleted file mode 100755
index 9ce01762ae..0000000000
--- a/airavata-api/src/main/resources/distribution/bin/sharing-registry.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-# 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.
-
-. $(dirname $0)/setenv.sh
-
-SERVICE_NAME="sharing-registry"
-MAIN_CLASS="org.apache.airavata.sharing.registry.server.ServerMain"
-JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf 
-Dairavata.home=${AIRAVATA_HOME} 
-Dlog4j.configurationFile=file:${AIRAVATA_HOME}/conf/log4j2.xml"
-
-run_service "$SERVICE_NAME" "$MAIN_CLASS" "$JAVA_OPTS" "$@"
diff --git 
a/airavata-api/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
 
b/airavata-api/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
index 5fa3a0049c..ac987522f2 100644
--- 
a/airavata-api/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
+++ 
b/airavata-api/src/test/java/org/apache/airavata/service/profile/iam/admin/services/core/tests/SetupNewGateway.java
@@ -24,7 +24,7 @@ import java.util.List;
 import org.apache.airavata.model.credential.store.PasswordCredential;
 import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.model.workspace.Gateway;
-import 
org.apache.airavata.service.profile.iam.admin.services.core.impl.TenantManagementKeycloakImpl;
+import 
org.apache.airavata.profile.iam.admin.services.core.impl.TenantManagementKeycloakImpl;
 import 
org.apache.airavata.service.profile.iam.admin.services.cpi.exception.IamAdminServicesException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
diff --git 
a/airavata-api/src/test/java/org/apache/airavata/service/security/GatewayGroupsInitializerTest.java
 
b/airavata-api/src/test/java/org/apache/airavata/service/security/GatewayGroupsInitializerTest.java
index 4d228447a0..f87c49ed24 100644
--- 
a/airavata-api/src/test/java/org/apache/airavata/service/security/GatewayGroupsInitializerTest.java
+++ 
b/airavata-api/src/test/java/org/apache/airavata/service/security/GatewayGroupsInitializerTest.java
@@ -31,6 +31,7 @@ import 
org.apache.airavata.model.appcatalog.gatewaygroups.GatewayGroups;
 import 
org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.credential.store.PasswordCredential;
 import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.security.GatewayGroupsInitializer;
 import org.apache.airavata.sharing.registry.models.GroupCardinality;
 import org.apache.airavata.sharing.registry.models.User;
 import org.apache.airavata.sharing.registry.models.UserGroup;
diff --git 
a/airavata-api/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
 
b/airavata-api/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
index 6718317258..a35a776cb9 100644
--- 
a/airavata-api/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
+++ 
b/airavata-api/src/test/java/org/apache/airavata/service/security/KeyCloakSecurityManagerTest.java
@@ -40,6 +40,7 @@ import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.registry.api.RegistryService;
 import org.apache.airavata.registry.api.client.RegistryServiceClientFactory;
 import org.apache.airavata.security.AiravataSecurityException;
+import org.apache.airavata.security.KeyCloakSecurityManager;
 import org.apache.airavata.service.security.authzcache.AuthzCacheIndex;
 import org.apache.airavata.service.security.authzcache.AuthzCacheManager;
 import 
org.apache.airavata.service.security.authzcache.AuthzCacheManagerFactory;
diff --git 
a/modules/file-server/src/main/java/org/apache/airavata/file/server/service/ProcessDataManager.java
 
b/modules/file-server/src/main/java/org/apache/airavata/file/server/service/ProcessDataManager.java
index b9623b8066..1da36c065c 100644
--- 
a/modules/file-server/src/main/java/org/apache/airavata/file/server/service/ProcessDataManager.java
+++ 
b/modules/file-server/src/main/java/org/apache/airavata/file/server/service/ProcessDataManager.java
@@ -21,8 +21,10 @@ package org.apache.airavata.file.server.service;
 
 import java.util.UUID;
 import org.apache.airavata.agents.api.AgentAdaptor;
-import org.apache.airavata.agents.api.AgentUtils;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ThriftClientPool;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
 import org.apache.airavata.helix.adaptor.SSHJAgentAdaptor;
 import org.apache.airavata.helix.impl.task.aws.AWSProcessContextManager;
 import org.apache.airavata.helix.impl.task.staging.OutputDataStagingTask;
@@ -32,6 +34,13 @@ import 
org.apache.airavata.model.credential.store.SSHCredential;
 import org.apache.airavata.model.experiment.ExperimentModel;
 import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.service.ServiceFactory;
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TMultiplexedProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -77,7 +86,7 @@ public class ProcessDataManager extends OutputDataStagingTask 
{
             logger.info("Using AWS adaptor for process {}", processId);
 
             AWSProcessContextManager awsContext = new 
AWSProcessContextManager(getTaskContext());
-            SSHCredential sshCredential = AgentUtils.getCredentialClient()
+            SSHCredential sshCredential = 
ProcessDataManager.getCredentialStoreClient()
                     .getSSHCredential(awsContext.getSSHCredentialToken(), 
getGatewayId());
 
             logger.info("Using SSHCredential {} for AWS process {}", 
sshCredential.getPublicKey(), processId);
@@ -96,6 +105,16 @@ public class ProcessDataManager extends 
OutputDataStagingTask {
 
         return getComputeResourceAdaptor(adaptorSupport);
     }
+    private static CredentialStoreService.Client getCredentialStoreClient()
+            throws TTransportException, ApplicationSettingsException {
+        TTransport transport = new TSocket(
+                ServerSettings.getCredentialStoreServerHost(),
+                
Integer.parseInt(ServerSettings.getCredentialStoreServerPort()));
+        transport.open();
+        TProtocol protocol = new TBinaryProtocol(transport);
+        protocol = new TMultiplexedProtocol(protocol, 
"CredentialStoreService");
+        return new CredentialStoreService.Client(protocol);
+    }
 
     public String getBaseDir() throws Exception {
         return getTaskContext().getWorkingDir();
diff --git 
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
 
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
index 8e81ad6b2f..9eb68a4147 100644
--- 
a/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
+++ 
b/modules/research-framework/research-service/src/main/java/org/apache/airavata/research/service/AiravataService.java
@@ -21,8 +21,8 @@ package org.apache.airavata.research.service;
 
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.user.UserProfile;
+import org.apache.airavata.profile.client.ProfileServiceClientFactory;
 import org.apache.airavata.research.service.model.UserContext;
-import org.apache.airavata.service.profile.client.ProfileServiceClientFactory;
 import org.apache.airavata.service.profile.user.cpi.UserProfileService;
 import 
org.apache.airavata.service.profile.user.cpi.exception.UserProfileServiceException;
 import org.apache.thrift.TException;

Reply via email to