[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16420595#comment-16420595 ] ASF subversion and git services commented on AIRAVATA-2657: --- Commit 11efe8a64baf365dc96f4193f57977a7a76e635d in airavata's branch refs/heads/group-based-auth from [~marcuschristie] [ https://gitbox.apache.org/repos/asf?p=airavata.git;h=11efe8a ] Merge pull request #167 from tilaks26/registry-refactoring [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16418194#comment-16418194 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-377055235 @DImuthuUpe Yes, I have included tests for the new methods that I have included. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16418102#comment-16418102 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-377035909 +1 @tilaks26 Code looks good to me. Did you add enough test cases to verify the functionality of the changes that you have done? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16418057#comment-16418057 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r177879417 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -3589,8 +3586,7 @@ public String registerApplicationDeployment(String gatewayId, ApplicationDeploym @Override public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getApplicationInterface().updateApplicationModule(appModuleId, applicationModule); +new ApplicationInterfaceRepository().updateApplicationModule(appModuleId, applicationModule); Review comment: @sachinkariyattin yeah, I don't know. I don't see any reason why they couldn't be instantiated just once since they have no state. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16413184#comment-16413184 ] ASF GitHub Bot commented on AIRAVATA-2657: -- sachinkariyattin commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176953397 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -3589,8 +3586,7 @@ public String registerApplicationDeployment(String gatewayId, ApplicationDeploym @Override public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getApplicationInterface().updateApplicationModule(appModuleId, applicationModule); +new ApplicationInterfaceRepository().updateApplicationModule(appModuleId, applicationModule); Review comment: @machristie @DImuthuUpe Same thing has been followed in here in the SharingRegistryServerHandler https://git.io/vx0vX. Wonder what the reason could be This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16412044#comment-16412044 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-375794359 @DImuthuUpe @machristie Thank you for the review. I've made the requested changes. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411995#comment-16411995 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-375786828 @DImuthuUpe I can't find any documentation about it. The description here is pretty succinct: https://issues.apache.org/jira/browse/AIRAVATA-2618. Let me know if you have any questions. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411984#comment-16411984 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176851411 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -3589,8 +3586,7 @@ public String registerApplicationDeployment(String gatewayId, ApplicationDeploym @Override public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getApplicationInterface().updateApplicationModule(appModuleId, applicationModule); +new ApplicationInterfaceRepository().updateApplicationModule(appModuleId, applicationModule); Review comment: My understanding is that we can reuse them since they are stateless and hence threadsafe. +1 for just instantiating these once in RegistryServerHandler and reusing them. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411786#comment-16411786 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176816330 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: Just print the message mentioning why that block is executing This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411722#comment-16411722 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176800876 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: Sure @DImuthuUpe Do you want me to just add a message or include the object as well? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411632#comment-16411632 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-375716872 @tilaks26 Code looks good. There are few areas that need improvements Add more debug or info level logs in the complex if conditions. This will benefit when we are doing debugging. Improve the readability of the code. One option is to add new lines logically when there are too much lines together. Do null checks and the availability to the items in the lists before accessing them. Handle them properly and always try to avoid NullPointerExceptions. @machristie @sachinkariyattin @tilaks26 I do not have a in depth idea of what is going inside the registry refactoring. Do we have any resource that we can refer in order to have an idea of the proposed changes? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411616#comment-16411616 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176782440 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) +applicationInterfaceEntity.setGatewayId(gatewayId); +if (applicationInterfaceEntity.getApplicationInputs() != null) { + applicationInterfaceEntity.getApplicationInputs().forEach(applicationInputEntity -> applicationInputEntity.setInterfaceId(applicationInterfaceId)); +} +if (applicationInterfaceEntity.getApplicationOutputs() != null) { + applicationInterfaceEntity.getApplicationOutputs().forEach(applicationOutputEntity -> applicationOutputEntity.setInterfaceId(applicationInterfaceId)); +} +if (!isApplicationInterfaceExists(applicationInterfaceId)) +applicationInterfaceEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationInterfaceEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +return execute(entityManager -> entityManager.merge(applicationInterfaceEntity)); +} + +protected String saveApplicationModuleData( +ApplicationModule applicationModule, String gatewayId) throws AppCatalogException { +ApplicationModuleEntity applicationModuleEntity =
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411612#comment-16411612 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176781978 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) +applicationInterfaceEntity.setGatewayId(gatewayId); +if (applicationInterfaceEntity.getApplicationInputs() != null) { + applicationInterfaceEntity.getApplicationInputs().forEach(applicationInputEntity -> applicationInputEntity.setInterfaceId(applicationInterfaceId)); +} +if (applicationInterfaceEntity.getApplicationOutputs() != null) { + applicationInterfaceEntity.getApplicationOutputs().forEach(applicationOutputEntity -> applicationOutputEntity.setInterfaceId(applicationInterfaceId)); +} +if (!isApplicationInterfaceExists(applicationInterfaceId)) +applicationInterfaceEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationInterfaceEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +return execute(entityManager -> entityManager.merge(applicationInterfaceEntity)); +} + +protected String saveApplicationModuleData( +ApplicationModule applicationModule, String gatewayId) throws AppCatalogException { +ApplicationModuleEntity applicationModuleEntity =
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411610#comment-16411610 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176781653 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) Review comment: Debug logs This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411504#comment-16411504 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176758465 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPreJobCommands() != null) { + applicationDeploymentEntity.getPreJobCommands().forEach(prejobCommandEntity -> prejobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPostJobCommands() != null) { + applicationDeploymentEntity.getPostJobCommands().forEach(postjobCommandEntity -> postjobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibPrependPaths() != null) { + applicationDeploymentEntity.getLibPrependPaths().forEach(libraryPrependPathEntity -> libraryPrependPathEntity.setDeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibAppendPaths() != null) { + applicationDeploymentEntity.getLibAppendPaths().forEach(libraryApendPathEntity -> libraryApendPathEntity.setDeploymentId(applicationDeploymentId)); +} +if
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411500#comment-16411500 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176758088 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} Review comment: Add a new line after each if block. It will improve the readability This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411496#comment-16411496 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176757385 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,159 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: Add debug logs in each if block. Then we can easily track issues without remote debugging This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411489#comment-16411489 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755943 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -122,15 +130,15 @@ public ApplicationModule getApplicationModule(String moduleId) throws AppCatalog ApplicationModuleRepository applicationModuleRepository = new ApplicationModuleRepository(); MapqueryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationModule.APPLICATION_MODULE_ID, moduleId); -ApplicationModule applicationModule = (ApplicationModule) applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters); +ApplicationModule applicationModule = applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters).get(0); return applicationModule; } @Override public ApplicationInterfaceDescription getApplicationInterface(String interfaceId) throws AppCatalogException { Map queryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationInterface.APPLICATION_INTERFACE_ID, interfaceId); -ApplicationInterfaceDescription applicationInterfaceDescription = (ApplicationInterfaceDescription) select(QueryConstants.FIND_APPLICATION_INTERFACE, -1, 0, queryParameters); +ApplicationInterfaceDescription applicationInterfaceDescription = select(QueryConstants.FIND_APPLICATION_INTERFACE, -1, 0, queryParameters).get(0); Review comment: Same here get(0) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411488#comment-16411488 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755873 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -122,15 +130,15 @@ public ApplicationModule getApplicationModule(String moduleId) throws AppCatalog ApplicationModuleRepository applicationModuleRepository = new ApplicationModuleRepository(); MapqueryParameters = new HashMap<>(); queryParameters.put(DBConstants.ApplicationModule.APPLICATION_MODULE_ID, moduleId); -ApplicationModule applicationModule = (ApplicationModule) applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters); +ApplicationModule applicationModule = applicationModuleRepository.select(QueryConstants.FIND_APPLICATION_MODULE, -1, 0, queryParameters).get(0); Review comment: Is it guaranteed this to return at least one value? Otherwise it is risky to directly call get(0) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411480#comment-16411480 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755232 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -67,17 +71,21 @@ protected ApplicationInterfaceEntity saveApplicationInterface( protected String saveApplicationModuleData( ApplicationModule applicationModule) throws AppCatalogException { ApplicationModuleEntity applicationModuleEntity = saveApplicationModule(applicationModule); -return applicationModuleEntity.getModuleId(); +return applicationModuleEntity.getAppModuleId(); } protected ApplicationModuleEntity saveApplicationModule( ApplicationModule applicationModule) throws AppCatalogException { +String applicationModuleId = applicationModule.getAppModuleId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationModuleEntity applicationModuleEntity = mapper.map(applicationModule, ApplicationModuleEntity.class); -if (!applicationModuleEntity.getModuleId().equals("") && !applicationModule.getAppModuleId().equals(application_interface_modelConstants.DEFAULT_ID)) { - applicationModuleEntity.setModuleId(applicationModule.getAppModuleId()); +if (!isApplicationModuleExists(applicationModuleId)) Review comment: Same here {} This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411483#comment-16411483 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755369 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -67,17 +71,21 @@ protected ApplicationInterfaceEntity saveApplicationInterface( protected String saveApplicationModuleData( ApplicationModule applicationModule) throws AppCatalogException { ApplicationModuleEntity applicationModuleEntity = saveApplicationModule(applicationModule); -return applicationModuleEntity.getModuleId(); +return applicationModuleEntity.getAppModuleId(); } protected ApplicationModuleEntity saveApplicationModule( ApplicationModule applicationModule) throws AppCatalogException { +String applicationModuleId = applicationModule.getAppModuleId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationModuleEntity applicationModuleEntity = mapper.map(applicationModule, ApplicationModuleEntity.class); -if (!applicationModuleEntity.getModuleId().equals("") && !applicationModule.getAppModuleId().equals(application_interface_modelConstants.DEFAULT_ID)) { - applicationModuleEntity.setModuleId(applicationModule.getAppModuleId()); +if (!isApplicationModuleExists(applicationModuleId)) +applicationModuleEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationModuleEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +if (!applicationModuleEntity.getAppModuleId().equals("") && !applicationModule.getAppModuleId().equals(application_interface_modelConstants.DEFAULT_ID)) { Review comment: Add debug logs in if else block This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411479#comment-16411479 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176755093 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -55,6 +56,9 @@ protected ApplicationInterfaceEntity saveApplicationInterface( String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (!isApplicationInterfaceExists(applicationInterfaceId)) Review comment: It is good to have curly braces {} even though you have one line if statement. That improves the readability of the code This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411477#comment-16411477 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176754498 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -43,16 +44,24 @@ public ApplicationDeploymentRepository() { } protected String saveApplicationDeploymentDescriptorData( -ApplicationDeploymentDescription applicationDeploymentDescription) throws AppCatalogException { -ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription); -return applicationDeploymentEntity.getDeploymentId(); +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); } protected ApplicationDeploymentEntity saveApplicationDeployment( -ApplicationDeploymentDescription applicationDeploymentDescription) throws AppCatalogException { +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); Mapper mapper = ObjectMapperSingleton.getInstance(); ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) Review comment: This logic is bit complex. Better if you can add debug logs in each if block. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411474#comment-16411474 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176753900 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,160 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPreJobCommands() != null) { + applicationDeploymentEntity.getPreJobCommands().forEach(prejobCommandEntity -> prejobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPostJobCommands() != null) { + applicationDeploymentEntity.getPostJobCommands().forEach(postjobCommandEntity -> postjobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibPrependPaths() != null) { + applicationDeploymentEntity.getLibPrependPaths().forEach(libraryPrependPathEntity -> libraryPrependPathEntity.setDeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibAppendPaths() != null) { + applicationDeploymentEntity.getLibAppendPaths().forEach(libraryApendPathEntity -> libraryApendPathEntity.setDeploymentId(applicationDeploymentId)); +} +if
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411462#comment-16411462 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176752715 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -3589,8 +3586,7 @@ public String registerApplicationDeployment(String gatewayId, ApplicationDeploym @Override public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getApplicationInterface().updateApplicationModule(appModuleId, applicationModule); +new ApplicationInterfaceRepository().updateApplicationModule(appModuleId, applicationModule); Review comment: @machristie @tilaks26, Just for my knowledge, is this the new way to do database operations? Is it required to create a new object of ApplicationInterfaceRepository for each call? Can't we re use them? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411451#comment-16411451 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176748684 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java ## @@ -161,23 +161,29 @@ public void ApplicationDeploymentRepositoryTest() throws AppCatalogException { applicationDeploymentRepository.updateApplicationDeployment(appDeploymentId , applicationDeploymentDescription); assertTrue(applicationDeploymentRepository.getApplicationDeployement(appDeploymentId).getDefaultQueueName().equals("queue3")); - applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); +String deploymentId1 = applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); List appDeploymentList = applicationDeploymentRepository.getAllApplicationDeployements(gatewayId); List appDeploymentIds = applicationDeploymentRepository.getAllApplicationDeployementIds(); assertTrue(appDeploymentList.size() == 2); assertTrue(appDeploymentIds.size() == 2); - applicationDeploymentRepository.removeAppDeployment(applicationDeploymentDescription1.getAppDeploymentId()); - assertFalse(applicationDeploymentRepository.isExists(applicationDeploymentDescription1.getAppDeploymentId())); - Mapfilters = new HashMap<>(); filters.put(DBConstants.ApplicationDeployment.APPLICATION_MODULE_ID, applicationModule.getAppModuleId()); filters.put(DBConstants.ApplicationDeployment.COMPUTE_HOST_ID, computeResourceDescription.getComputeResourceId()); appDeploymentList = applicationDeploymentRepository.getApplicationDeployements(filters); assertEquals(computeResourceDescription.getComputeResourceId(), appDeploymentList.get(0).getComputeHostId()); Review comment: Is it safe to call appDeploymentList.get(0) ? You might have to check the size of the appDeploymentList first and a potential null check of appDeploymentList This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16411450#comment-16411450 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r176747997 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java ## @@ -161,23 +161,29 @@ public void ApplicationDeploymentRepositoryTest() throws AppCatalogException { applicationDeploymentRepository.updateApplicationDeployment(appDeploymentId , applicationDeploymentDescription); assertTrue(applicationDeploymentRepository.getApplicationDeployement(appDeploymentId).getDefaultQueueName().equals("queue3")); - applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); +String deploymentId1 = applicationDeploymentRepository.addApplicationDeployment(applicationDeploymentDescription1, gatewayId); Review comment: Shall we rename deploymentId1 into a more user friendly one? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16406516#comment-16406516 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-374643372 @DImuthuUpe can you review the Sneha's more recent changes? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393544#comment-16393544 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173566445 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInterfaceEntity.java ## @@ -60,6 +60,10 @@ @Column(name="HAS_OPTIONAL_FILE_INPUTS") private boolean hasOptionalFileInputs; + @ElementCollection + @CollectionTable(name="APPLICATION_MODULE", joinColumns = @JoinColumn(name="MODULE_ID")) + private List applicationModules; Review comment: This way was just a suggestion by Sachin. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393543#comment-16393543 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173566354 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInterfaceEntity.java ## @@ -60,6 +60,10 @@ @Column(name="HAS_OPTIONAL_FILE_INPUTS") private boolean hasOptionalFileInputs; + @ElementCollection + @CollectionTable(name="APPLICATION_MODULE", joinColumns = @JoinColumn(name="MODULE_ID")) + private List applicationModules; Review comment: applicationModules is in the Thrift module but not in the APPLICATION_INTERFACE table. So when we update the ApplicationInterfaceEntity, this field won't get persisted in the database. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16393509#comment-16393509 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173561249 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInterfaceEntity.java ## @@ -60,6 +60,10 @@ @Column(name="HAS_OPTIONAL_FILE_INPUTS") private boolean hasOptionalFileInputs; + @ElementCollection + @CollectionTable(name="APPLICATION_MODULE", joinColumns = @JoinColumn(name="MODULE_ID")) + private List applicationModules; Review comment: I'm not sure, where did this even come from? You could do something like this but you would need to use the APP_MODULE_MAPPING table. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390771#comment-16390771 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173065990 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInterfaceEntity.java ## @@ -60,6 +60,10 @@ @Column(name="HAS_OPTIONAL_FILE_INPUTS") private boolean hasOptionalFileInputs; + @ElementCollection + @CollectionTable(name="APPLICATION_MODULE", joinColumns = @JoinColumn(name="MODULE_ID")) + private List applicationModules; Review comment: @machristie There is no corresponding column for this attribute in the APPLICATION_INTERFACE table. Also, it is of `List` type. Can you please verify if the `@ElementCollection` annotation required here? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390770#comment-16390770 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173065990 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInterfaceEntity.java ## @@ -60,6 +60,10 @@ @Column(name="HAS_OPTIONAL_FILE_INPUTS") private boolean hasOptionalFileInputs; + @ElementCollection + @CollectionTable(name="APPLICATION_MODULE", joinColumns = @JoinColumn(name="MODULE_ID")) + private List applicationModules; Review comment: @machristie There is no corresponding column for this attribute in the APPLICATION_INTERFACE table. Also, it is of List type. Can you please verify if the `@ElementCollection` annotation required here? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390755#comment-16390755 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on issue #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#issuecomment-371378771 @machristie Thank you for the review. I have modified the getAccessible methods as requested and updated the PR. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390749#comment-16390749 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173063477 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java ## @@ -0,0 +1,168 @@ +package org.apache.airavata.registry.core.repositories.appcatalog; Review comment: @DImuthuUpe thank you for the review. I have added the license header for all the files. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390750#comment-16390750 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173063493 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepositoryTest.java ## @@ -0,0 +1,107 @@ +package org.apache.airavata.registry.core.repositories.appcatalog; Review comment: @DImuthuUpe thank you for the review. I have added the license header. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390701#comment-16390701 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173058307 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepositoryTest.java ## @@ -0,0 +1,107 @@ +package org.apache.airavata.registry.core.repositories.appcatalog; Review comment: License header This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390700#comment-16390700 ] ASF GitHub Bot commented on AIRAVATA-2657: -- DImuthuUpe commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173058250 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java ## @@ -0,0 +1,168 @@ +package org.apache.airavata.registry.core.repositories.appcatalog; Review comment: License header This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390693#comment-16390693 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173057150 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputEntity.java ## @@ -20,123 +20,140 @@ */ package org.apache.airavata.registry.core.entities.appcatalog; -import javax.persistence.Column; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Table; +import javax.persistence.*; import java.io.Serializable; /** * The persistent class for the application_output database table. */ @Entity -@Table(name = "application_output") +@Table(name = "APPLICATION_OUTPUT") +@IdClass(ApplicationOutputPK.class) public class ApplicationOutputEntity implements Serializable { private static final long serialVersionUID = 1L; -@EmbeddedId -private ApplicationOutputPK id; +@Id +@Column(name="INTERFACE_ID") +private String interfaceId; + +@Id +@Column(name="OUTPUT_KEY") +private String name; @Column(name = "APP_ARGUMENT") -private String appArgument; +private String applicationArgument; @Column(name = "DATA_MOVEMENT") -private short dataMovement; +private boolean dataMovement; @Column(name = "DATA_NAME_LOCATION") -private String dataNameLocation; +private String location; @Column(name = "DATA_TYPE") -private String dataType; +private String type; @Column(name = "IS_REQUIRED") -private short isRequired; +private boolean isRequired; @Column(name = "OUTPUT_STREAMING") -private short outputStreaming; +private boolean outputStreaming; @Column(name = "OUTPUT_VALUE") -private String outputValue; +private String value; @Column(name = "REQUIRED_TO_COMMANDLINE") -private short requiredToCommandline; +private boolean requiredToAddedToCommandLine; @Column(name = "SEARCH_QUERY") private String searchQuery; +private String storageResourceId; Review comment: I didn't include a @Column annotation for this because there is no corresponding column in the APPLICATION_OUTPUT table for this attribute. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390696#comment-16390696 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173057150 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputEntity.java ## @@ -20,123 +20,140 @@ */ package org.apache.airavata.registry.core.entities.appcatalog; -import javax.persistence.Column; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Table; +import javax.persistence.*; import java.io.Serializable; /** * The persistent class for the application_output database table. */ @Entity -@Table(name = "application_output") +@Table(name = "APPLICATION_OUTPUT") +@IdClass(ApplicationOutputPK.class) public class ApplicationOutputEntity implements Serializable { private static final long serialVersionUID = 1L; -@EmbeddedId -private ApplicationOutputPK id; +@Id +@Column(name="INTERFACE_ID") +private String interfaceId; + +@Id +@Column(name="OUTPUT_KEY") +private String name; @Column(name = "APP_ARGUMENT") -private String appArgument; +private String applicationArgument; @Column(name = "DATA_MOVEMENT") -private short dataMovement; +private boolean dataMovement; @Column(name = "DATA_NAME_LOCATION") -private String dataNameLocation; +private String location; @Column(name = "DATA_TYPE") -private String dataType; +private String type; @Column(name = "IS_REQUIRED") -private short isRequired; +private boolean isRequired; @Column(name = "OUTPUT_STREAMING") -private short outputStreaming; +private boolean outputStreaming; @Column(name = "OUTPUT_VALUE") -private String outputValue; +private String value; @Column(name = "REQUIRED_TO_COMMANDLINE") -private short requiredToCommandline; +private boolean requiredToAddedToCommandLine; @Column(name = "SEARCH_QUERY") private String searchQuery; +private String storageResourceId; Review comment: I didn't include a `@Column` annotation for this because there is no corresponding column in the APPLICATION_OUTPUT table for this attribute. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390692#comment-16390692 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173056737 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/ReplicaCatalogRepositoryTest.java ## @@ -61,70 +61,70 @@ public void setupRepository() { @Test public void dataProductRepositoryTest() { -DataProductRepository dataProductRepository = new DataProductRepository(DataProductModel.class, DataProductEntity.class); +//DataProductRepository dataProductRepository = new DataProductRepository(DataProductModel.class, DataProductEntity.class); /* * Creating Gateway required for UserProfile & Project creation */ -Gateway gateway = new Gateway(); -gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); -gateway.setGatewayId(gatewayId); -gateway.setDomain(GATEWAY_DOMAIN); -gateway = gatewayRepository.create(gateway); -Assert.assertTrue(!gateway.getGatewayId().isEmpty()); +//Gateway gateway = new Gateway(); Review comment: Right now, we've only been working on the application catalog. We haven't verified or modified the experiment catalog entities and repositories. So, the test cases were failing. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390691#comment-16390691 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173056716 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/ExperimentRepositoryTest.java ## @@ -76,80 +76,80 @@ public void experimentRepositoryTest() { /* * Creating Gateway required for UserProfile & Project creation */ -Gateway gateway = new Gateway(); -gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); -gateway.setGatewayId(gatewayId); -gateway.setDomain(GATEWAY_DOMAIN); -gateway = gatewayRepository.create(gateway); -Assert.assertTrue(!gateway.getGatewayId().isEmpty()); +//Gateway gateway = new Gateway(); Review comment: Right now, we've only been working on the application catalog. We haven't verified or modified the experiment catalog entities and repositories. So, the test cases were failing. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390638#comment-16390638 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173050021 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepository.java ## @@ -0,0 +1,256 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule; +import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription; +import org.apache.airavata.model.appcatalog.appinterface.application_interface_modelConstants; +import org.apache.airavata.model.application.io.InputDataObjectType; +import org.apache.airavata.model.application.io.OutputDataObjectType; +import org.apache.airavata.registry.core.utils.*; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationInterface; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationInterfaceRepository extends AppCatAbstractRepositoryimplements ApplicationInterface { +private final static Logger logger = LoggerFactory.getLogger(ApplicationInterfaceRepository.class); + +public ApplicationInterfaceRepository () { +super(ApplicationInterfaceDescription.class, ApplicationInterfaceEntity.class); +} + +protected String saveApplicationInterfaceDescriptorData( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +ApplicationInterfaceEntity applicationInterfaceEntity = saveApplicationInterface(applicationInterfaceDescription, gatewayId); +return applicationInterfaceEntity.getApplicationInterfaceId(); +} + +protected ApplicationInterfaceEntity saveApplicationInterface( +ApplicationInterfaceDescription applicationInterfaceDescription, String gatewayId) throws AppCatalogException { +String applicationInterfaceId = applicationInterfaceDescription.getApplicationInterfaceId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationInterfaceEntity applicationInterfaceEntity = mapper.map(applicationInterfaceDescription, ApplicationInterfaceEntity.class); +if (gatewayId != null) +applicationInterfaceEntity.setGatewayId(gatewayId); +if (applicationInterfaceEntity.getApplicationInputs() != null) { + applicationInterfaceEntity.getApplicationInputs().forEach(applicationInputEntity -> applicationInputEntity.setInterfaceId(applicationInterfaceId)); +} +if (applicationInterfaceEntity.getApplicationOutputs() != null) { + applicationInterfaceEntity.getApplicationOutputs().forEach(applicationOutputEntity -> applicationOutputEntity.setInterfaceId(applicationInterfaceId)); +} +if (!isApplicationInterfaceExists(applicationInterfaceId)) +applicationInterfaceEntity.setCreationTime(new Timestamp(System.currentTimeMillis())); +applicationInterfaceEntity.setUpdateTime(new Timestamp(System.currentTimeMillis())); +return execute(entityManager -> entityManager.merge(applicationInterfaceEntity)); +} + +protected String saveApplicationModuleData( +ApplicationModule applicationModule, String gatewayId) throws AppCatalogException { +ApplicationModuleEntity applicationModuleEntity =
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390635#comment-16390635 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173050297 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/ReplicaCatalogRepositoryTest.java ## @@ -61,70 +61,70 @@ public void setupRepository() { @Test public void dataProductRepositoryTest() { -DataProductRepository dataProductRepository = new DataProductRepository(DataProductModel.class, DataProductEntity.class); +//DataProductRepository dataProductRepository = new DataProductRepository(DataProductModel.class, DataProductEntity.class); /* * Creating Gateway required for UserProfile & Project creation */ -Gateway gateway = new Gateway(); -gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); -gateway.setGatewayId(gatewayId); -gateway.setDomain(GATEWAY_DOMAIN); -gateway = gatewayRepository.create(gateway); -Assert.assertTrue(!gateway.getGatewayId().isEmpty()); +//Gateway gateway = new Gateway(); Review comment: Why are these all commented out? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390639#comment-16390639 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173049764 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepository.java ## @@ -0,0 +1,160 @@ +/** + * + * 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.registry.core.repositories.appcatalog; + +import org.apache.airavata.model.appcatalog.appdeployment.*; +import org.apache.airavata.registry.core.entities.appcatalog.*; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.ApplicationDeployment; +import org.dozer.Mapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ApplicationDeploymentRepository extends AppCatAbstractRepositoryimplements ApplicationDeployment { +private final static Logger logger = LoggerFactory.getLogger(ApplicationDeploymentRepository.class); + +public ApplicationDeploymentRepository() { +super(ApplicationDeploymentDescription.class, ApplicationDeploymentEntity.class); +} + +protected String saveApplicationDeploymentDescriptorData( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +ApplicationDeploymentEntity applicationDeploymentEntity = saveApplicationDeployment(applicationDeploymentDescription, gatewayId); +return applicationDeploymentEntity.getAppDeploymentId(); +} + +protected ApplicationDeploymentEntity saveApplicationDeployment( +ApplicationDeploymentDescription applicationDeploymentDescription, String gatewayId) throws AppCatalogException { +String applicationDeploymentId = applicationDeploymentDescription.getAppDeploymentId(); +Mapper mapper = ObjectMapperSingleton.getInstance(); +ApplicationDeploymentEntity applicationDeploymentEntity = mapper.map(applicationDeploymentDescription, ApplicationDeploymentEntity.class); +if (gatewayId != null) +applicationDeploymentEntity.setGatewayId(gatewayId); +if (applicationDeploymentEntity.getModuleLoadCmds() != null) { + applicationDeploymentEntity.getModuleLoadCmds().forEach(moduleLoadCmdEntity -> moduleLoadCmdEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPreJobCommands() != null) { + applicationDeploymentEntity.getPreJobCommands().forEach(prejobCommandEntity -> prejobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getPostJobCommands() != null) { + applicationDeploymentEntity.getPostJobCommands().forEach(postjobCommandEntity -> postjobCommandEntity.setAppdeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibPrependPaths() != null) { + applicationDeploymentEntity.getLibPrependPaths().forEach(libraryPrependPathEntity -> libraryPrependPathEntity.setDeploymentId(applicationDeploymentId)); +} +if (applicationDeploymentEntity.getLibAppendPaths() != null) { + applicationDeploymentEntity.getLibAppendPaths().forEach(libraryApendPathEntity -> libraryApendPathEntity.setDeploymentId(applicationDeploymentId)); +} +if
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390637#comment-16390637 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173048843 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputEntity.java ## @@ -20,123 +20,140 @@ */ package org.apache.airavata.registry.core.entities.appcatalog; -import javax.persistence.Column; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.Table; +import javax.persistence.*; import java.io.Serializable; /** * The persistent class for the application_output database table. */ @Entity -@Table(name = "application_output") +@Table(name = "APPLICATION_OUTPUT") +@IdClass(ApplicationOutputPK.class) public class ApplicationOutputEntity implements Serializable { private static final long serialVersionUID = 1L; -@EmbeddedId -private ApplicationOutputPK id; +@Id +@Column(name="INTERFACE_ID") +private String interfaceId; + +@Id +@Column(name="OUTPUT_KEY") +private String name; @Column(name = "APP_ARGUMENT") -private String appArgument; +private String applicationArgument; @Column(name = "DATA_MOVEMENT") -private short dataMovement; +private boolean dataMovement; @Column(name = "DATA_NAME_LOCATION") -private String dataNameLocation; +private String location; @Column(name = "DATA_TYPE") -private String dataType; +private String type; @Column(name = "IS_REQUIRED") -private short isRequired; +private boolean isRequired; @Column(name = "OUTPUT_STREAMING") -private short outputStreaming; +private boolean outputStreaming; @Column(name = "OUTPUT_VALUE") -private String outputValue; +private String value; @Column(name = "REQUIRED_TO_COMMANDLINE") -private short requiredToCommandline; +private boolean requiredToAddedToCommandLine; @Column(name = "SEARCH_QUERY") private String searchQuery; +private String storageResourceId; Review comment: Is there a reason this field doesn't have a `@Column` annotation? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16390636#comment-16390636 ] ASF GitHub Bot commented on AIRAVATA-2657: -- machristie commented on a change in pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167#discussion_r173050259 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/ExperimentRepositoryTest.java ## @@ -76,80 +76,80 @@ public void experimentRepositoryTest() { /* * Creating Gateway required for UserProfile & Project creation */ -Gateway gateway = new Gateway(); -gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); -gateway.setGatewayId(gatewayId); -gateway.setDomain(GATEWAY_DOMAIN); -gateway = gatewayRepository.create(gateway); -Assert.assertTrue(!gateway.getGatewayId().isEmpty()); +//Gateway gateway = new Gateway(); Review comment: Why are these commented out? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2657) Refactoring App Catalog implementation - ApplicationDeployment and ApplicationInterface
[ https://issues.apache.org/jira/browse/AIRAVATA-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16345565#comment-16345565 ] ASF GitHub Bot commented on AIRAVATA-2657: -- tilaks26 opened a new pull request #167: [AIRAVATA-2657] Refactoring App Catalog Implementation - ApplicationDeployment and ApplicationInterface Modules URL: https://github.com/apache/airavata/pull/167 Implementation of ApplicationDeploymentRepository.java and ApplicationInterfaceRepository.java instead of the existing Implementation class dependency. Changes made - - Modification of the necessary entity classes. TODO - - Override all the methods for the 2 repository classes. - Write tests. - Make necessary changes to the RegistryServerHandler.java class. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Refactoring App Catalog implementation - ApplicationDeployment and > ApplicationInterface > --- > > Key: AIRAVATA-2657 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2657 > Project: Airavata > Issue Type: Task > Components: Application Catalog >Reporter: Sneha Tilak >Assignee: Sneha Tilak >Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)