[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436261#comment-16436261 ] ASF subversion and git services commented on AIRAVATA-2619: --- Commit e52034785268b329433a84f189b336d5051b6fd9 in airavata's branch refs/heads/group-based-auth from [~marcuschristie] [ https://gitbox.apache.org/repos/asf?p=airavata.git;h=e520347 ] Merge pull request #182 from sachinkariyattin/registry-refactoring [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource > Refactoring App Catalog implementation > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436108#comment-16436108 ] ASF subversion and git services commented on AIRAVATA-2619: --- Commit e52034785268b329433a84f189b336d5051b6fd9 in airavata's branch refs/heads/registry-refactoring from [~marcuschristie] [ https://gitbox.apache.org/repos/asf?p=airavata.git;h=e520347 ] Merge pull request #182 from sachinkariyattin/registry-refactoring [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource > Refactoring App Catalog implementation > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436106#comment-16436106 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-380902375 Looks good @sachinkariyattin . I'll go ahead and merge into the registry-refactoring branch and then merge it into the group-based-auth branch. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436107#comment-16436107 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie closed pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/storageresource/StorageResourceDescription.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/storageresource/StorageResourceDescription.java index 600819f025..689ca9d17c 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/storageresource/StorageResourceDescription.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/storageresource/StorageResourceDescription.java @@ -50,6 +50,8 @@ private static final org.apache.thrift.protocol.TField STORAGE_RESOURCE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("storageResourceDescription", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("enabled", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField DATA_MOVEMENT_INTERFACES_FIELD_DESC = new org.apache.thrift.protocol.TField("dataMovementInterfaces", org.apache.thrift.protocol.TType.LIST, (short)5); + private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)6); + private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.I64, (short)7); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new StorageResourceDescriptionStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new StorageResourceDescriptionTupleSchemeFactory(); @@ -59,6 +61,8 @@ private java.lang.String storageResourceDescription; // optional private boolean enabled; // optional private java.util.List dataMovementInterfaces; // optional + private long creationTime; // optional + private long updateTime; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -66,7 +70,9 @@ HOST_NAME((short)2, "hostName"), STORAGE_RESOURCE_DESCRIPTION((short)3, "storageResourceDescription"), ENABLED((short)4, "enabled"), -DATA_MOVEMENT_INTERFACES((short)5, "dataMovementInterfaces"); +DATA_MOVEMENT_INTERFACES((short)5, "dataMovementInterfaces"), +CREATION_TIME((short)6, "creationTime"), +UPDATE_TIME((short)7, "updateTime"); private static final java.util.Map byName = new java.util.HashMap(); @@ -91,6 +97,10 @@ public static _Fields findByThriftId(int fieldId) { return ENABLED; case 5: // DATA_MOVEMENT_INTERFACES return DATA_MOVEMENT_INTERFACES; +case 6: // CREATION_TIME + return CREATION_TIME; +case 7: // UPDATE_TIME + return UPDATE_TIME; default: return null; } @@ -132,8 +142,10 @@ public short getThriftFieldId() { // isset id assignments private static final int __ENABLED_ISSET_ID = 0; + private static final int __CREATIONTIME_ISSET_ID = 1; + private static final int __UPDATETIME_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.STORAGE_RESOURCE_DESCRIPTION,_Fields.ENABLED,_Fields.DATA_MOVEMENT_INTERFACES}; + private static final _Fields optionals[] = {_Fields.STORAGE_RESOURCE_DESCRIPTION,_Fields.ENABLED,_Fields.DATA_MOVEMENT_INTERFACES,_Fields.CREATION_TIME,_Fields.UPDATE_TIME}; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -148,6 +160,10 @@ public short getThriftFieldId() { tmpMap.put(_Fields.DATA_MOVEMENT_INTERFACES, new org.apache.thrift.meta_data.FieldMetaData("dataMovementInterfaces", org.apache.thrift.TFieldRequirementType.O
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435002#comment-16435002 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-380693007 @machristie I guess there will be merge conflicts if I try to merge it o group-based-auth as sneha has already pushed her changes there 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434973#comment-16434973 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-380683999 @machristie @DImuthuUpe Thanks for the review. I have implemented the suggested 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434972#comment-16434972 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180969151 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -1626,8 +1627,7 @@ public boolean deleteComputeResource(String computeResourceId) throws RegistrySe @Override public StorageResourceDescription getStorageResource(String storageResourceId) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); -StorageResourceDescription storageResource = appCatalog.getStorageResource().getStorageResource(storageResourceId); +StorageResourceDescription storageResource = new StorageResourceRepository().getStorageResource(storageResourceId); Review comment: Done!. I have to do this for other repository classes as well (GatewayRepository, ComputeRepository etc.) I will make these changes in another 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434970#comment-16434970 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180968963 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java ## @@ -329,8 +329,11 @@ public String addDataMovementProtocol(String resourceId, DMType dmType, DataMove return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); } else if (dmType.equals(DMType.STORAGE_RESOURCE)){ -//TODO - COMPLETE this after StorageResourceRepo implementation -return null; +Mapper mapper = ObjectMapperSingleton.getInstance(); Review comment: Moved this to DataMovementRepository 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434967#comment-16434967 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180968936 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java ## @@ -20,26 +20,29 @@ */ 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; import java.sql.Timestamp; /** * The persistent class for the storage_interface database table. */ @Entity -@Table(name = "storage_interface") +@Table(name = "STORAGE_INTERFACE") +@IdClass(StorageInterfacePK.class) public class StorageInterfaceEntity implements Serializable { private static final long serialVersionUID = 1L; -@EmbeddedId -private StorageInterfacePK id; +@Id +@Column(name="STORAGE_RESOURCE_ID") +private String storageResourceId; + +@Id +@Column(name="DATA_MOVEMENT_INTERFACE_ID") +private String dataMovementInterfaceId; @Column(name = "CREATION_TIME") -private Timestamp creationTime; +private long creationTime; Review comment: @machristie I have added a custom dozer converter to map from long to TIMESTAMP. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434969#comment-16434969 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180968963 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java ## @@ -329,8 +329,11 @@ public String addDataMovementProtocol(String resourceId, DMType dmType, DataMove return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); } else if (dmType.equals(DMType.STORAGE_RESOURCE)){ -//TODO - COMPLETE this after StorageResourceRepo implementation -return null; +Mapper mapper = ObjectMapperSingleton.getInstance(); Review comment: Moved this to DataMovementRepository 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434182#comment-16434182 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-380516485 @sachinkariyattin When printing log lines and re throw custom exceptions, try to print as much as data so that we can easily investigate the isssue 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434174#comment-16434174 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180819055 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java ## @@ -0,0 +1,148 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.data.movement.*; +import org.apache.airavata.registry.core.repositories.util.Initialize; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +/** + * Created by skariyat on 3/13/18. + */ +public class StorageResourceRepositoryTest { + +private static Initialize initialize; +private StorageResourceRepository storageResourceRepository; +private static final Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + +@Before +public void setUp() { +try { +initialize = new Initialize("appcatalog-derby.sql"); +initialize.initializeDB(); +storageResourceRepository = new StorageResourceRepository(); +} catch (Exception e) { +logger.error(e.getMessage(), e); +} +} + +@After +public void tearDown() throws Exception { +System.out.println("** TEAR DOWN "); +initialize.stopDerbyServer(); +} + +@Test +public void StorageResourceRepositoryTest() throws AppCatalogException { + +StorageResourceDescription description = new StorageResourceDescription(); + +description.setHostName("localhost"); +description.setEnabled(true); +description.setStorageResourceDescription("testDescription"); + + +String scpDataMoveId = addSCPDataMovement(); +System.out.println(" SCP DataMoveId** :" + scpDataMoveId); +String gridFTPDataMoveId = addGridFTPDataMovement(); +System.out.println(" grid FTP DataMoveId** :" + gridFTPDataMoveId); + +List dataMovementInterfaces = new ArrayList(); +DataMovementInterface scpInterface = new DataMovementInterface(); +scpInterface.setDataMovementInterfaceId(scpDataMoveId); +scpInterface.setDataMovementProtocol(DataMovementProtocol.SCP); +scpInterface.setPriorityOrder(1); + +DataMovementInterface gridFTPMv = new DataMovementInterface(); +gridFTPMv.setDataMovementInterfaceId(gridFTPDataMoveId); +gridFTPMv.setDataMovementProtocol(DataMovementProtocol.GridFTP); +gridFTPMv.setPriorityOrder(2); + +dataMovementInterfaces.add(scpInterface); +dataMovementInterfaces.add(gridFTPMv); +description.setDataMovementInterfaces(dataMovementInterfaces); + +String resourceId = storageResourceRepository.addStorageResource(description); +StorageResourceDescription storageResourceDescription = null; + +if (storageResourceRepository.isExists(resourceId)) { +storageResourceDescription = storageResourceRepository.getStorageResource(resourceId); + assertTrue(storageResourceDescription.getHostName().equals("localhost")); + assertTrue(storageResourceDescription.getStorageResourceDescription().equals("testDescription")); +List movementInterfaces = storageResourceDescription.getDataMovementInterfaces(); +if (movementInterfaces != null && !movementInterfaces.isEmpty()){ +for (DataMovementInterface dataMo
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434175#comment-16434175 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180819101 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java ## @@ -0,0 +1,148 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.data.movement.*; +import org.apache.airavata.registry.core.repositories.util.Initialize; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +/** + * Created by skariyat on 3/13/18. + */ +public class StorageResourceRepositoryTest { + +private static Initialize initialize; +private StorageResourceRepository storageResourceRepository; +private static final Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + +@Before +public void setUp() { +try { +initialize = new Initialize("appcatalog-derby.sql"); +initialize.initializeDB(); +storageResourceRepository = new StorageResourceRepository(); +} catch (Exception e) { +logger.error(e.getMessage(), e); +} +} + +@After +public void tearDown() throws Exception { +System.out.println("** TEAR DOWN "); +initialize.stopDerbyServer(); +} + +@Test +public void StorageResourceRepositoryTest() throws AppCatalogException { + +StorageResourceDescription description = new StorageResourceDescription(); + +description.setHostName("localhost"); +description.setEnabled(true); +description.setStorageResourceDescription("testDescription"); + + +String scpDataMoveId = addSCPDataMovement(); +System.out.println(" SCP DataMoveId** :" + scpDataMoveId); +String gridFTPDataMoveId = addGridFTPDataMovement(); +System.out.println(" grid FTP DataMoveId** :" + gridFTPDataMoveId); + +List dataMovementInterfaces = new ArrayList(); +DataMovementInterface scpInterface = new DataMovementInterface(); +scpInterface.setDataMovementInterfaceId(scpDataMoveId); +scpInterface.setDataMovementProtocol(DataMovementProtocol.SCP); +scpInterface.setPriorityOrder(1); + +DataMovementInterface gridFTPMv = new DataMovementInterface(); +gridFTPMv.setDataMovementInterfaceId(gridFTPDataMoveId); +gridFTPMv.setDataMovementProtocol(DataMovementProtocol.GridFTP); +gridFTPMv.setPriorityOrder(2); + +dataMovementInterfaces.add(scpInterface); +dataMovementInterfaces.add(gridFTPMv); +description.setDataMovementInterfaces(dataMovementInterfaces); + +String resourceId = storageResourceRepository.addStorageResource(description); +StorageResourceDescription storageResourceDescription = null; + +if (storageResourceRepository.isExists(resourceId)) { +storageResourceDescription = storageResourceRepository.getStorageResource(resourceId); + assertTrue(storageResourceDescription.getHostName().equals("localhost")); + assertTrue(storageResourceDescription.getStorageResourceDescription().equals("testDescription")); +List movementInterfaces = storageResourceDescription.getDataMovementInterfaces(); +if (movementInterfaces != null && !movementInterfaces.isEmpty()){ +for (DataMovementInterface dataMo
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434173#comment-16434173 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180818898 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434172#comment-16434172 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180818762 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434171#comment-16434171 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180818705 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434170#comment-16434170 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180818612 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434154#comment-16434154 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180818443 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434150#comment-16434150 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180817916 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); Review comment: Same as above comments --
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434151#comment-16434151 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180818018 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434146#comment-16434146 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180817800 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); Review comment: Same as above comments 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 >
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434142#comment-16434142 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180817247 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); Review comment: Add a message to exception. Probably the same one that you have put in the log message 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog an
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434123#comment-16434123 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180812346 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); Review comment: Add storage resource id and other required data to this log line in order to make it unique and useful. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods f
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16434122#comment-16434122 ] ASF GitHub Bot commented on AIRAVATA-2619: -- DImuthuUpe commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180811838 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { Review comment: Use "".equals(description.getStorageResourceDescription()) and airavata_commonsConstants.DEFAULT_ID.equals(description.getStorageResourceId()) to avoid possible NPE 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16433461#comment-16433461 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r180645874 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { Review comment: Since StorageResourceRepository implements the StorageResource CPI (https://github.com/apache/airavata/blob/master/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/StorageResource.java), I just had to implement these methods. Otherwise as you have mentioned there is no need of two similar methods like these 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16420616#comment-16420616 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-377348250 @smarru ~either way I think is ultimately fine. registry-refactoring and group-based-auth are pretty close to each other and if we want to take both of them to develop at the same time then it doesn't matter much. However, perhaps this should go to group-based-auth since that's where Sneha's PRs have been merging into.~ On second thought, let's put this to group-based-auth since that's where Sneha's recent PRs have been landing. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16419638#comment-16419638 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-377348250 @smarru either way I think is ultimately fine. registry-refactoring and group-based-auth are pretty close to each other and if we want to take both of them to develop at the same time then it doesn't matter much. However, perhaps this should go to group-based-auth since that's where Sneha's PRs have been merging into. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16419628#comment-16419628 ] ASF GitHub Bot commented on AIRAVATA-2619: -- smarru commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-377344316 @sachinkariyattin @machristie should this directly go to group-based-auth branch instead of registry-refactoring? I am wondering what is the quick way to get this to develop? 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413918#comment-16413918 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177097295 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java ## @@ -329,8 +329,11 @@ public String addDataMovementProtocol(String resourceId, DMType dmType, DataMove return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); } else if (dmType.equals(DMType.STORAGE_RESOURCE)){ -//TODO - COMPLETE this after StorageResourceRepo implementation -return null; +Mapper mapper = ObjectMapperSingleton.getInstance(); +StorageInterfaceEntity storageInterfaceEntity = mapper.map(dataMovementInterface, StorageInterfaceEntity.class); +storageInterfaceEntity.setStorageResourceId(resourceId); +execute(entityManager -> entityManager.merge(storageInterfaceEntity)); +return storageInterfaceEntity.getStorageResourceId(); Review comment: The existing implementation returns the dataMovementInterfaceId, not the storageResourceId. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413925#comment-16413925 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177104225 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { +description.setStorageResourceId(storageResourceId); +} +description.setCreationTime(System.currentTimeMillis()); +if (description.getDataMovementInterfaces() != null) { +description.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(description.getStorageResourceId())); +} +StorageResourceDescription storageResourceDescription = create(description); +return storageResourceDescription.getStorageResourceId(); +} catch (Exception e) { +logger.error("Error while saving storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public void updateStorageResource(String storageResourceId, StorageResourceDescription updatedStorageResource) throws AppCatalogException { +try { +updatedStorageResource.setUpdateTime(System.currentTimeMillis()); +if (updatedStorageResource.getDataMovementInterfaces() != null) { + updatedStorageResource.getDataMovementInterfaces().stream().forEach(dm -> dm.setStorageResourceId(updatedStorageResource.getStorageResourceId())); +} +update(updatedStorageResource); +} catch (Exception e) { +logger.error("Error while updating storage resource...", e); +throw new AppCatalogException(e); +} +} + +@Override +public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { +try { +return get(resourceId); +} catch (Exception e) { +logger.error("Error while retrieving storage resource...", e); +throw new AppCatalogException(e); +} +}
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413924#comment-16413924 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177107256 ## File path: modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java ## @@ -1626,8 +1627,7 @@ public boolean deleteComputeResource(String computeResourceId) throws RegistrySe @Override public StorageResourceDescription getStorageResource(String storageResourceId) throws RegistryServiceException, TException { try { -appCatalog = RegistryFactory.getAppCatalog(); -StorageResourceDescription storageResource = appCatalog.getStorageResource().getStorageResource(storageResourceId); +StorageResourceDescription storageResource = new StorageResourceRepository().getStorageResource(storageResourceId); Review comment: Can you create the StorageResourceRepository once for the RegistryServerHandler? Something like this: https://github.com/apache/airavata/pull/185/commits/9292821d004de823222e0edebd8b485160ab2667#diff-930789311194ec4c5b61df3b5d247c59R87 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413923#comment-16413923 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177106132 ## File path: modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java ## @@ -0,0 +1,148 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.data.movement.*; +import org.apache.airavata.registry.core.repositories.util.Initialize; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertTrue; + +/** + * Created by skariyat on 3/13/18. + */ +public class StorageResourceRepositoryTest { + +private static Initialize initialize; +private StorageResourceRepository storageResourceRepository; +private static final Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + +@Before +public void setUp() { +try { +initialize = new Initialize("appcatalog-derby.sql"); +initialize.initializeDB(); +storageResourceRepository = new StorageResourceRepository(); +} catch (Exception e) { +logger.error(e.getMessage(), e); +} +} + +@After +public void tearDown() throws Exception { +System.out.println("** TEAR DOWN "); +initialize.stopDerbyServer(); +} + +@Test +public void StorageResourceRepositoryTest() throws AppCatalogException { + +StorageResourceDescription description = new StorageResourceDescription(); + +description.setHostName("localhost"); +description.setEnabled(true); +description.setStorageResourceDescription("testDescription"); + + +String scpDataMoveId = addSCPDataMovement(); +System.out.println(" SCP DataMoveId** :" + scpDataMoveId); +String gridFTPDataMoveId = addGridFTPDataMovement(); +System.out.println(" grid FTP DataMoveId** :" + gridFTPDataMoveId); + +List dataMovementInterfaces = new ArrayList(); +DataMovementInterface scpInterface = new DataMovementInterface(); +scpInterface.setDataMovementInterfaceId(scpDataMoveId); +scpInterface.setDataMovementProtocol(DataMovementProtocol.SCP); +scpInterface.setPriorityOrder(1); + +DataMovementInterface gridFTPMv = new DataMovementInterface(); +gridFTPMv.setDataMovementInterfaceId(gridFTPDataMoveId); +gridFTPMv.setDataMovementProtocol(DataMovementProtocol.GridFTP); +gridFTPMv.setPriorityOrder(2); + +dataMovementInterfaces.add(scpInterface); +dataMovementInterfaces.add(gridFTPMv); +description.setDataMovementInterfaces(dataMovementInterfaces); + +String resourceId = storageResourceRepository.addStorageResource(description); +StorageResourceDescription storageResourceDescription = null; + +if (storageResourceRepository.isExists(resourceId)) { +storageResourceDescription = storageResourceRepository.getStorageResource(resourceId); + assertTrue(storageResourceDescription.getHostName().equals("localhost")); + assertTrue(storageResourceDescription.getStorageResourceDescription().equals("testDescription")); +List movementInterfaces = storageResourceDescription.getDataMovementInterfaces(); +if (movementInterfaces != null && !movementInterfaces.isEmpty()){ +for (DataMovementInterface dataMo
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413917#comment-16413917 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177091070 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageResourceEntity.java ## @@ -40,17 +38,23 @@ private String storageResourceId; @Column(name = "CREATION_TIME") -private Timestamp creationTime; +private long creationTime; Review comment: Same comment here about long vs Timestamp. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413914#comment-16413914 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177098350 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { +try { +final String storageResourceId = AppCatalogUtils.getID(description.getHostName()); +if (description.getStorageResourceDescription().equals("") || description.getStorageResourceId().equals(airavata_commonsConstants.DEFAULT_ID)) { Review comment: Surely the logic here should be if `description.getStorageResourceId().equals("")`, not the description. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413915#comment-16413915 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177090924 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java ## @@ -20,26 +20,29 @@ */ 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; import java.sql.Timestamp; /** * The persistent class for the storage_interface database table. */ @Entity -@Table(name = "storage_interface") +@Table(name = "STORAGE_INTERFACE") +@IdClass(StorageInterfacePK.class) public class StorageInterfaceEntity implements Serializable { private static final long serialVersionUID = 1L; -@EmbeddedId -private StorageInterfacePK id; +@Id +@Column(name="STORAGE_RESOURCE_ID") +private String storageResourceId; + +@Id +@Column(name="DATA_MOVEMENT_INTERFACE_ID") +private String dataMovementInterfaceId; @Column(name = "CREATION_TIME") -private Timestamp creationTime; +private long creationTime; Review comment: The database type is TIMESTAMP, will this map with the existing schema? It would be good if we could have the entity mapping to handle long to timestamp mapping. This is also related to this bug: https://issues.apache.org/jira/browse/AIRAVATA-2428 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413922#comment-16413922 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177102211 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java ## @@ -0,0 +1,197 @@ +/* + * 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.storageresource.StorageResourceDescription; +import org.apache.airavata.model.commons.airavata_commonsConstants; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity; +import org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK; +import org.apache.airavata.registry.core.entities.appcatalog.StorageResourceEntity; +import org.apache.airavata.registry.core.utils.AppCatalogUtils; +import org.apache.airavata.registry.core.utils.DBConstants; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by skariyat on 3/12/18. + */ +public class StorageResourceRepository extends AppCatAbstractRepository implements StorageResource { + +private final static Logger logger = LoggerFactory.getLogger(StorageResourceRepository.class); + + +public StorageResourceRepository() { +super(StorageResourceDescription.class, StorageResourceEntity.class); +} + + +@Override +public String addStorageResource(StorageResourceDescription description) throws AppCatalogException { Review comment: I think it is a little confusing that StorageResourceRepository has `create(StorageResourceDescription)` method and a `addStorageResource(StorageResourceDescription)` method, likewise with `update` and `updateStorageResource`, etc. Maybe the methods on the AppCatAbstractRepository should be protected? Then subclasses can expose publicly either the method from AppCatAbstractRepository or some more specific method. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413916#comment-16413916 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177105334 ## File path: modules/registry-refactoring/src/main/resources/appcatalog-mysql.sql ## @@ -431,8 +431,8 @@ CREATE TABLE STORAGE_RESOURCE HOST_NAME VARCHAR (255) NOT NULL, DESCRIPTION VARCHAR (255), ENABLED SMALLINT, -CREATION_TIME TIMESTAMP DEFAULT NOW(), -UPDATE_TIME TIMESTAMP DEFAULT '-00-00 00:00:00', +CREATION_TIME BIGINT NOT NULL, Review comment: See comment above, I'd like to keep these as TIMESTAMPs. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413919#comment-16413919 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177107763 ## File path: thrift-interface-descriptions/data-models/resource-catalog-models/storage_resource_model.thrift ## @@ -48,5 +48,7 @@ struct StorageResourceDescription { 2: required string hostName, 3: optional string storageResourceDescription, 4: optional bool enabled, -5: optional list dataMovementInterfaces, +5: optional i64 creationTime, +6: optional i64 updateTime, +7: optional list dataMovementInterfaces, Review comment: Can we leave this in position 5 and put creationTime and updateTime in 6 and 7? 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413926#comment-16413926 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177104941 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java ## @@ -37,4 +37,8 @@ "WHERE BQ.groupResourceProfileId LIKE : " + DBConstants.GroupResourceProfile.GROUP_RESOURCE_PROFILE_ID; String FIND_ALL_GROUP_COMPUTE_RESOURCE_POLICY = "SELECT CR FROM "+ ComputeResourcePolicyEntity.class.getSimpleName() + " CR " + "WHERE CR.groupResourceProfileId LIKE : " + DBConstants.GroupResourceProfile.GROUP_RESOURCE_PROFILE_ID; + +String FIND_STORAGE_RESOURCE = "SELECT DISTINCT SR FROM " + StorageResourceEntity.class.getSimpleName() + " SR " + +"WHERE SR.hostName LIKE : " + DBConstants.StorageResource.HOST_NAME; Review comment: remove space after colon 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413921#comment-16413921 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177097078 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java ## @@ -329,8 +329,11 @@ public String addDataMovementProtocol(String resourceId, DMType dmType, DataMove return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); } else if (dmType.equals(DMType.STORAGE_RESOURCE)){ -//TODO - COMPLETE this after StorageResourceRepo implementation -return null; +Mapper mapper = ObjectMapperSingleton.getInstance(); Review comment: This mapping logic should be in a repository, seems like DataMovementRepository would be the best place. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413920#comment-16413920 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#discussion_r177089054 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java ## @@ -22,21 +22,23 @@ import javax.persistence.Column; import javax.persistence.Embeddable; +import javax.persistence.Id; import java.io.Serializable; /** * The primary key class for the storage_interface database table. * */ -@Embeddable public class StorageInterfacePK implements Serializable { //default serial version id, required for serializable classes. private static final long serialVersionUID = 1L; @Column(name="STORAGE_RESOURCE_ID", insertable=false, updatable=false) + @Id Review comment: Don't need `@Column` or `@Id`. Non-embedded composite keys don't need any JPA annotations. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16406513#comment-16406513 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on issue #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182#issuecomment-374642170 @smarru can you review this 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16397401#comment-16397401 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin opened a new pull request #182: [AIRAVATA-2619] Refactoring App Catalog implementation - StorageResource URL: https://github.com/apache/airavata/pull/182 The pull request contains the registry refactoring changes for the _AppCatalog->StorageResourceRepository_. `StorageResourceRepository` has been implemented instead of the existing Impl implementation and the changes have been done to the RegistryServiceHandler to call this repository class instead of the StorageResourceImpl. **Changes**: - Added `StorageResourceRepository` class.(_app_catalog/StorageResourceRepository.java_) and implemented all the required CPI methods. - Added tests for the StorageResourceRepository (_StorageResourceRepositoryTest_) - Changes to _RegistryServerHandler_. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. > * Implemented StorageResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16343591#comment-16343591 ] ASF subversion and git services commented on AIRAVATA-2619: --- Commit e4b0b2cfe93b17169efa9cdb1754172f7dd77c5e in airavata's branch refs/heads/registry-refactoring from [~marcuschristie] [ https://gitbox.apache.org/repos/asf?p=airavata.git;h=e4b0b2c ] Merge pull request #159 from sachinkariyattin/registry-refactoring [AIRAVATA-2619] Refactoring App Catalog implementation - ComputeResource > Refactoring App Catalog implementation > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341474#comment-16341474 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on a change in pull request #159: [AIRAVATA-2619] Refactoring App Catalog implementation - ComputeResource URL: https://github.com/apache/airavata/pull/159#discussion_r164201314 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourceFileSystemEntity.java ## @@ -33,11 +30,21 @@ */ @Entity @Table(name="compute_resource_file_system") Review comment: @machristie Thanks for the review. Made the change 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341251#comment-16341251 ] ASF GitHub Bot commented on AIRAVATA-2619: -- machristie commented on a change in pull request #159: [AIRAVATA-2619] Refactoring App Catalog implementation - ComputeResource URL: https://github.com/apache/airavata/pull/159#discussion_r164156036 ## File path: modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourceFileSystemEntity.java ## @@ -33,11 +30,21 @@ */ @Entity @Table(name="compute_resource_file_system") Review comment: Maybe upper case the table name here too, for consistency? 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16327539#comment-16327539 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin opened a new pull request #159: [AIRAVATA-2619] Refactoring App Catalog implementation - ComputeResource URL: https://github.com/apache/airavata/pull/159 The pull request contains the registry refactoring changes for the _AppCatalog->ComputeResourceRepository_. `ComputeResourceRepository `has been implemented instead of the existing Impl implementation and the changes have been done to the RegistryServiceHandler to call this repository class instead of the `ComputeResourceImpl`. **Changes:** - Added `ComputeResourceRepository `class .(_app_catalog/ComputeResourceRepository .java_) and implemented all the required CPI methods. - Added tests for the ComputeResourceRepository (`ComputeResourceRepositoryTest`) - Made required changes to `GatewayResourceProfileRepository ` and tests after this implementation. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin >Priority: Major > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl > {quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. > *Progress*: > * Implemeted GatewayResourceProfileRepository. > * Implemented ComputeResourceRepository. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16301781#comment-16301781 ] ASF GitHub Bot commented on AIRAVATA-2619: -- smarru closed pull request #156: [AIRAVATA-2619] Refactoring App Catalog implementation - GatewayResourceProfile URL: https://github.com/apache/airavata/pull/156 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/modules/registry-refactoring/pom.xml b/modules/registry-refactoring/pom.xml index b794349f33..ab95f616f3 100644 --- a/modules/registry-refactoring/pom.xml +++ b/modules/registry-refactoring/pom.xml @@ -69,6 +69,21 @@ 4.12 test + +org.apache.airavata +airavata-commons +0.17-SNAPSHOT + + +org.apache.airavata +airavata-server-configuration +test + + +org.apache.airavata +airavata-registry-cpi +0.17-SNAPSHOT + diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferenceEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferenceEntity.java index 8b005c606b..682981add2 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferenceEntity.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferenceEntity.java @@ -32,7 +32,7 @@ * The persistent class for the compute_resource_preference database table. */ @Entity -@Table(name = "compute_resource_preference") +@Table(name = "COMPUTE_RESOURCE_PREFERENCE") public class ComputeResourcePreferenceEntity implements Serializable { private static final long serialVersionUID = 1L; diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java index 7cfba0ce72..f94cd65499 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java @@ -36,7 +36,7 @@ private String gatewayId; @Column(name = "RESOURCE_ID", insertable = false, updatable = false) -private String resourceId; +private String computeResourceId; public ComputeResourcePreferencePK() { } @@ -49,12 +49,12 @@ public void setGatewayId(String gatewayId) { this.gatewayId = gatewayId; } -public String getResourceId() { -return resourceId; +public String getComputeResourceId() { +return computeResourceId; } -public void setResourceId(String resourceId) { -this.resourceId = resourceId; +public void setComputeResourceId(String computeResourceId) { +this.computeResourceId = computeResourceId; } public boolean equals(Object other) { @@ -67,14 +67,14 @@ public boolean equals(Object other) { ComputeResourcePreferencePK castOther = (ComputeResourcePreferencePK) other; return this.gatewayId.equals(castOther.gatewayId) -&& this.resourceId.equals(castOther.resourceId); +&& this.computeResourceId.equals(castOther.computeResourceId); } public int hashCode() { final int prime = 31; int hash = 17; hash = hash * prime + this.gatewayId.hashCode(); -hash = hash * prime + this.resourceId.hashCode(); +hash = hash * prime + this.computeResourceId.hashCode(); return hash; } diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GatewayProfileEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GatewayProfileEntity.java index ea92602b75..71fcd71cb7 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GatewayProfileEntity.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GatewayProfileEntity.java @@ -32,7 +32,7 @@ * The persistent class for the gateway_profile database table. */ @Entity -@Table(name = "gate
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300901#comment-16300901 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin commented on issue #156: [AIRAVATA-2619] Refactoring App Catalog implementation - GatewayResourceProfile URL: https://github.com/apache/airavata/pull/156#issuecomment-353509535 @smarru No. I have used the same DB script (appcatalog-derby.sql) that currently exists in develop branch. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl{quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300889#comment-16300889 ] ASF GitHub Bot commented on AIRAVATA-2619: -- smarru commented on issue #156: [AIRAVATA-2619] Refactoring App Catalog implementation - GatewayResourceProfile URL: https://github.com/apache/airavata/pull/156#issuecomment-353508413 @sachinkariyattin are there any DB changes compared to gateway resource profile in develop branch? 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl{quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (AIRAVATA-2619) Refactoring App Catalog implementation
[ https://issues.apache.org/jira/browse/AIRAVATA-2619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300883#comment-16300883 ] ASF GitHub Bot commented on AIRAVATA-2619: -- sachinkariyattin opened a new pull request #156: [AIRAVATA-2619] Refactoring App Catalog implementation - GatewayResourceProfile URL: https://github.com/apache/airavata/pull/156 The pull request contains the registry refactoring changes for the _AppCatalog->GatewayResourceProfile_. Basically a start to the registry refactoring task. _GatewayResourceProfileRepository_ has been implemented instead of the existing _Impl_ implementation and the changes have been done to the _RegistryServiceHandler_ to call this repository instead of the Impl. **Changes:** - Added a directory for app_catalog in the existing registry-refactoring module. - Added `GatewayResourceProfileRepository` class .(_app_catalog/GatewayResourceProfileRepository.java_). - Added `StoragePrefRepository` and `ComputePrefRepository` classes. Note that these classes still need to be implemented and currently have been added just to support the GatewayResourceProfile methods. - Added `AppCatalogJpaUtils ` for the app catalog entity manager (_JpaUtil/AppCatalogJpaUtils_). - Added tests for the repository methods `GatewayResourceProfileRepositoryTest`. **Next Steps:** Implement `ComputePrefRepository` and `StoragePrefRepository` methods. 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 > -- > > Key: AIRAVATA-2619 > URL: https://issues.apache.org/jira/browse/AIRAVATA-2619 > Project: Airavata > Issue Type: Sub-task >Reporter: Sachin Kariyattin >Assignee: Sachin Kariyattin > > The app catalog module contains the following Impl classes. > {quote}ApplicationDeploymentImpl > ApplicationInterfaceImpl > ComputeResourceImpl > GwyResourceProfileImpl > StorageResourceImpl > UsrResourceProfileImpl{quote} > This task involves creating a repository class for app catalog and include > all the methods from the Impl classes mentioned above. As a modular approach > is being followed, to start of, only methods GwyResourceProfileImpl will be > considered. So the RegistryServiceHandler methods only with respect to > GwyResourceProfileImpl will be modified. Subsequently all methods related to > app catalog will be refactored. -- This message was sent by Atlassian JIRA (v6.4.14#64029)