[ 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<org.apache.airavata.model.data.movement.DataMovementInterface> 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<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); @@ -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.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.data.movement.DataMovementInterface.class)))); + tmpMap.put(_Fields.CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("creationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StorageResourceDescription.class, metaDataMap); } @@ -188,6 +204,8 @@ public StorageResourceDescription(StorageResourceDescription other) { } this.dataMovementInterfaces = __this__dataMovementInterfaces; } + this.creationTime = other.creationTime; + this.updateTime = other.updateTime; } public StorageResourceDescription deepCopy() { @@ -203,6 +221,10 @@ public void clear() { setEnabledIsSet(false); this.enabled = false; this.dataMovementInterfaces = null; + setCreationTimeIsSet(false); + this.creationTime = 0; + setUpdateTimeIsSet(false); + this.updateTime = 0; } public java.lang.String getStorageResourceId() { @@ -334,6 +356,50 @@ public void setDataMovementInterfacesIsSet(boolean value) { } } + public long getCreationTime() { + return this.creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + setCreationTimeIsSet(true); + } + + public void unsetCreationTime() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATIONTIME_ISSET_ID); + } + + /** Returns true if field creationTime is set (has been assigned a value) and false otherwise */ + public boolean isSetCreationTime() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATIONTIME_ISSET_ID); + } + + public void setCreationTimeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATIONTIME_ISSET_ID, value); + } + + public long getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(long updateTime) { + this.updateTime = updateTime; + setUpdateTimeIsSet(true); + } + + public void unsetUpdateTime() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATETIME_ISSET_ID); + } + + /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */ + public boolean isSetUpdateTime() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATETIME_ISSET_ID); + } + + public void setUpdateTimeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATETIME_ISSET_ID, value); + } + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case STORAGE_RESOURCE_ID: @@ -376,6 +442,22 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } break; + case CREATION_TIME: + if (value == null) { + unsetCreationTime(); + } else { + setCreationTime((java.lang.Long)value); + } + break; + + case UPDATE_TIME: + if (value == null) { + unsetUpdateTime(); + } else { + setUpdateTime((java.lang.Long)value); + } + break; + } } @@ -396,6 +478,12 @@ public void setFieldValue(_Fields field, java.lang.Object value) { case DATA_MOVEMENT_INTERFACES: return getDataMovementInterfaces(); + case CREATION_TIME: + return getCreationTime(); + + case UPDATE_TIME: + return getUpdateTime(); + } throw new java.lang.IllegalStateException(); } @@ -417,6 +505,10 @@ public boolean isSet(_Fields field) { return isSetEnabled(); case DATA_MOVEMENT_INTERFACES: return isSetDataMovementInterfaces(); + case CREATION_TIME: + return isSetCreationTime(); + case UPDATE_TIME: + return isSetUpdateTime(); } throw new java.lang.IllegalStateException(); } @@ -481,6 +573,24 @@ public boolean equals(StorageResourceDescription that) { return false; } + boolean this_present_creationTime = true && this.isSetCreationTime(); + boolean that_present_creationTime = true && that.isSetCreationTime(); + if (this_present_creationTime || that_present_creationTime) { + if (!(this_present_creationTime && that_present_creationTime)) + return false; + if (this.creationTime != that.creationTime) + return false; + } + + boolean this_present_updateTime = true && this.isSetUpdateTime(); + boolean that_present_updateTime = true && that.isSetUpdateTime(); + if (this_present_updateTime || that_present_updateTime) { + if (!(this_present_updateTime && that_present_updateTime)) + return false; + if (this.updateTime != that.updateTime) + return false; + } + return true; } @@ -508,6 +618,14 @@ public int hashCode() { if (isSetDataMovementInterfaces()) hashCode = hashCode * 8191 + dataMovementInterfaces.hashCode(); + hashCode = hashCode * 8191 + ((isSetCreationTime()) ? 131071 : 524287); + if (isSetCreationTime()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(creationTime); + + hashCode = hashCode * 8191 + ((isSetUpdateTime()) ? 131071 : 524287); + if (isSetUpdateTime()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(updateTime); + return hashCode; } @@ -569,6 +687,26 @@ public int compareTo(StorageResourceDescription other) { return lastComparison; } } + lastComparison = java.lang.Boolean.valueOf(isSetCreationTime()).compareTo(other.isSetCreationTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreationTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creationTime, other.creationTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUpdateTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -630,6 +768,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. } first = false; } + if (isSetCreationTime()) { + if (!first) sb.append(", "); + sb.append("creationTime:"); + sb.append(this.creationTime); + first = false; + } + if (isSetUpdateTime()) { + if (!first) sb.append(", "); + sb.append("updateTime:"); + sb.append(this.updateTime); + first = false; + } sb.append(")"); return sb.toString(); } @@ -734,6 +884,22 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, StorageResourceDesc org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // CREATION_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.creationTime = iprot.readI64(); + struct.setCreationTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // UPDATE_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.updateTime = iprot.readI64(); + struct.setUpdateTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -783,6 +949,16 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, StorageResourceDes oprot.writeFieldEnd(); } } + if (struct.isSetCreationTime()) { + oprot.writeFieldBegin(CREATION_TIME_FIELD_DESC); + oprot.writeI64(struct.creationTime); + oprot.writeFieldEnd(); + } + if (struct.isSetUpdateTime()) { + oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); + oprot.writeI64(struct.updateTime); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -812,7 +988,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, StorageResourceDesc if (struct.isSetDataMovementInterfaces()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetCreationTime()) { + optionals.set(3); + } + if (struct.isSetUpdateTime()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetStorageResourceDescription()) { oprot.writeString(struct.storageResourceDescription); } @@ -828,6 +1010,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, StorageResourceDesc } } } + if (struct.isSetCreationTime()) { + oprot.writeI64(struct.creationTime); + } + if (struct.isSetUpdateTime()) { + oprot.writeI64(struct.updateTime); + } } @Override @@ -837,7 +1025,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, StorageResourceDescr struct.setStorageResourceIdIsSet(true); struct.hostName = iprot.readString(); struct.setHostNameIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.storageResourceDescription = iprot.readString(); struct.setStorageResourceDescriptionIsSet(true); @@ -860,6 +1048,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, StorageResourceDescr } struct.setDataMovementInterfacesIsSet(true); } + if (incoming.get(3)) { + struct.creationTime = iprot.readI64(); + struct.setCreationTimeIsSet(true); + } + if (incoming.get(4)) { + struct.updateTime = iprot.readI64(); + struct.setUpdateTimeIsSet(true); + } } } diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/movement/DataMovementInterface.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/movement/DataMovementInterface.java index 3c50586dfc..0a4bc9d4ce 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/movement/DataMovementInterface.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/movement/DataMovementInterface.java @@ -41,6 +41,9 @@ private static final org.apache.thrift.protocol.TField DATA_MOVEMENT_INTERFACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dataMovementInterfaceId", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField DATA_MOVEMENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("dataMovementProtocol", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField PRIORITY_ORDER_FIELD_DESC = new org.apache.thrift.protocol.TField("priorityOrder", org.apache.thrift.protocol.TType.I32, (short)3); + 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)4); + 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)5); + private static final org.apache.thrift.protocol.TField STORAGE_RESOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("storageResourceId", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new DataMovementInterfaceStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new DataMovementInterfaceTupleSchemeFactory(); @@ -48,6 +51,9 @@ private java.lang.String dataMovementInterfaceId; // required private DataMovementProtocol dataMovementProtocol; // required private int priorityOrder; // required + private long creationTime; // optional + private long updateTime; // optional + private java.lang.String storageResourceId; // 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 { @@ -57,7 +63,10 @@ * @see DataMovementProtocol */ DATA_MOVEMENT_PROTOCOL((short)2, "dataMovementProtocol"), - PRIORITY_ORDER((short)3, "priorityOrder"); + PRIORITY_ORDER((short)3, "priorityOrder"), + CREATION_TIME((short)4, "creationTime"), + UPDATE_TIME((short)5, "updateTime"), + STORAGE_RESOURCE_ID((short)6, "storageResourceId"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); @@ -78,6 +87,12 @@ public static _Fields findByThriftId(int fieldId) { return DATA_MOVEMENT_PROTOCOL; case 3: // PRIORITY_ORDER return PRIORITY_ORDER; + case 4: // CREATION_TIME + return CREATION_TIME; + case 5: // UPDATE_TIME + return UPDATE_TIME; + case 6: // STORAGE_RESOURCE_ID + return STORAGE_RESOURCE_ID; default: return null; } @@ -119,7 +134,10 @@ public short getThriftFieldId() { // isset id assignments private static final int __PRIORITYORDER_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.CREATION_TIME,_Fields.UPDATE_TIME,_Fields.STORAGE_RESOURCE_ID}; 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); @@ -129,6 +147,12 @@ public short getThriftFieldId() { new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DataMovementProtocol.class))); tmpMap.put(_Fields.PRIORITY_ORDER, new org.apache.thrift.meta_data.FieldMetaData("priorityOrder", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("creationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.STORAGE_RESOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("storageResourceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DataMovementInterface.class, metaDataMap); } @@ -162,6 +186,11 @@ public DataMovementInterface(DataMovementInterface other) { this.dataMovementProtocol = other.dataMovementProtocol; } this.priorityOrder = other.priorityOrder; + this.creationTime = other.creationTime; + this.updateTime = other.updateTime; + if (other.isSetStorageResourceId()) { + this.storageResourceId = other.storageResourceId; + } } public DataMovementInterface deepCopy() { @@ -174,6 +203,11 @@ public void clear() { this.dataMovementProtocol = null; this.priorityOrder = 0; + setCreationTimeIsSet(false); + this.creationTime = 0; + setUpdateTimeIsSet(false); + this.updateTime = 0; + this.storageResourceId = null; } public java.lang.String getDataMovementInterfaceId() { @@ -252,6 +286,73 @@ public void setPriorityOrderIsSet(boolean value) { __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PRIORITYORDER_ISSET_ID, value); } + public long getCreationTime() { + return this.creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + setCreationTimeIsSet(true); + } + + public void unsetCreationTime() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATIONTIME_ISSET_ID); + } + + /** Returns true if field creationTime is set (has been assigned a value) and false otherwise */ + public boolean isSetCreationTime() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATIONTIME_ISSET_ID); + } + + public void setCreationTimeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATIONTIME_ISSET_ID, value); + } + + public long getUpdateTime() { + return this.updateTime; + } + + public void setUpdateTime(long updateTime) { + this.updateTime = updateTime; + setUpdateTimeIsSet(true); + } + + public void unsetUpdateTime() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __UPDATETIME_ISSET_ID); + } + + /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */ + public boolean isSetUpdateTime() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __UPDATETIME_ISSET_ID); + } + + public void setUpdateTimeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __UPDATETIME_ISSET_ID, value); + } + + public java.lang.String getStorageResourceId() { + return this.storageResourceId; + } + + public void setStorageResourceId(java.lang.String storageResourceId) { + this.storageResourceId = storageResourceId; + } + + public void unsetStorageResourceId() { + this.storageResourceId = null; + } + + /** Returns true if field storageResourceId is set (has been assigned a value) and false otherwise */ + public boolean isSetStorageResourceId() { + return this.storageResourceId != null; + } + + public void setStorageResourceIdIsSet(boolean value) { + if (!value) { + this.storageResourceId = null; + } + } + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case DATA_MOVEMENT_INTERFACE_ID: @@ -278,6 +379,30 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } break; + case CREATION_TIME: + if (value == null) { + unsetCreationTime(); + } else { + setCreationTime((java.lang.Long)value); + } + break; + + case UPDATE_TIME: + if (value == null) { + unsetUpdateTime(); + } else { + setUpdateTime((java.lang.Long)value); + } + break; + + case STORAGE_RESOURCE_ID: + if (value == null) { + unsetStorageResourceId(); + } else { + setStorageResourceId((java.lang.String)value); + } + break; + } } @@ -292,6 +417,15 @@ public void setFieldValue(_Fields field, java.lang.Object value) { case PRIORITY_ORDER: return getPriorityOrder(); + case CREATION_TIME: + return getCreationTime(); + + case UPDATE_TIME: + return getUpdateTime(); + + case STORAGE_RESOURCE_ID: + return getStorageResourceId(); + } throw new java.lang.IllegalStateException(); } @@ -309,6 +443,12 @@ public boolean isSet(_Fields field) { return isSetDataMovementProtocol(); case PRIORITY_ORDER: return isSetPriorityOrder(); + case CREATION_TIME: + return isSetCreationTime(); + case UPDATE_TIME: + return isSetUpdateTime(); + case STORAGE_RESOURCE_ID: + return isSetStorageResourceId(); } throw new java.lang.IllegalStateException(); } @@ -355,6 +495,33 @@ public boolean equals(DataMovementInterface that) { return false; } + boolean this_present_creationTime = true && this.isSetCreationTime(); + boolean that_present_creationTime = true && that.isSetCreationTime(); + if (this_present_creationTime || that_present_creationTime) { + if (!(this_present_creationTime && that_present_creationTime)) + return false; + if (this.creationTime != that.creationTime) + return false; + } + + boolean this_present_updateTime = true && this.isSetUpdateTime(); + boolean that_present_updateTime = true && that.isSetUpdateTime(); + if (this_present_updateTime || that_present_updateTime) { + if (!(this_present_updateTime && that_present_updateTime)) + return false; + if (this.updateTime != that.updateTime) + return false; + } + + boolean this_present_storageResourceId = true && this.isSetStorageResourceId(); + boolean that_present_storageResourceId = true && that.isSetStorageResourceId(); + if (this_present_storageResourceId || that_present_storageResourceId) { + if (!(this_present_storageResourceId && that_present_storageResourceId)) + return false; + if (!this.storageResourceId.equals(that.storageResourceId)) + return false; + } + return true; } @@ -372,6 +539,18 @@ public int hashCode() { hashCode = hashCode * 8191 + priorityOrder; + hashCode = hashCode * 8191 + ((isSetCreationTime()) ? 131071 : 524287); + if (isSetCreationTime()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(creationTime); + + hashCode = hashCode * 8191 + ((isSetUpdateTime()) ? 131071 : 524287); + if (isSetUpdateTime()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(updateTime); + + hashCode = hashCode * 8191 + ((isSetStorageResourceId()) ? 131071 : 524287); + if (isSetStorageResourceId()) + hashCode = hashCode * 8191 + storageResourceId.hashCode(); + return hashCode; } @@ -413,6 +592,36 @@ public int compareTo(DataMovementInterface other) { return lastComparison; } } + lastComparison = java.lang.Boolean.valueOf(isSetCreationTime()).compareTo(other.isSetCreationTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreationTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creationTime, other.creationTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUpdateTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetStorageResourceId()).compareTo(other.isSetStorageResourceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStorageResourceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storageResourceId, other.storageResourceId); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -452,6 +661,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. sb.append("priorityOrder:"); sb.append(this.priorityOrder); first = false; + if (isSetCreationTime()) { + if (!first) sb.append(", "); + sb.append("creationTime:"); + sb.append(this.creationTime); + first = false; + } + if (isSetUpdateTime()) { + if (!first) sb.append(", "); + sb.append("updateTime:"); + sb.append(this.updateTime); + first = false; + } + if (isSetStorageResourceId()) { + if (!first) sb.append(", "); + sb.append("storageResourceId:"); + if (this.storageResourceId == null) { + sb.append("null"); + } else { + sb.append(this.storageResourceId); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -533,6 +764,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, DataMovementInterfa org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // CREATION_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.creationTime = iprot.readI64(); + struct.setCreationTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // UPDATE_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.updateTime = iprot.readI64(); + struct.setUpdateTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // STORAGE_RESOURCE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.storageResourceId = iprot.readString(); + struct.setStorageResourceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -559,6 +814,23 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, DataMovementInterf oprot.writeFieldBegin(PRIORITY_ORDER_FIELD_DESC); oprot.writeI32(struct.priorityOrder); oprot.writeFieldEnd(); + if (struct.isSetCreationTime()) { + oprot.writeFieldBegin(CREATION_TIME_FIELD_DESC); + oprot.writeI64(struct.creationTime); + oprot.writeFieldEnd(); + } + if (struct.isSetUpdateTime()) { + oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); + oprot.writeI64(struct.updateTime); + oprot.writeFieldEnd(); + } + if (struct.storageResourceId != null) { + if (struct.isSetStorageResourceId()) { + oprot.writeFieldBegin(STORAGE_RESOURCE_ID_FIELD_DESC); + oprot.writeString(struct.storageResourceId); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -579,6 +851,26 @@ public void write(org.apache.thrift.protocol.TProtocol prot, DataMovementInterfa oprot.writeString(struct.dataMovementInterfaceId); oprot.writeI32(struct.dataMovementProtocol.getValue()); oprot.writeI32(struct.priorityOrder); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetCreationTime()) { + optionals.set(0); + } + if (struct.isSetUpdateTime()) { + optionals.set(1); + } + if (struct.isSetStorageResourceId()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetCreationTime()) { + oprot.writeI64(struct.creationTime); + } + if (struct.isSetUpdateTime()) { + oprot.writeI64(struct.updateTime); + } + if (struct.isSetStorageResourceId()) { + oprot.writeString(struct.storageResourceId); + } } @Override @@ -590,6 +882,19 @@ public void read(org.apache.thrift.protocol.TProtocol prot, DataMovementInterfac struct.setDataMovementProtocolIsSet(true); struct.priorityOrder = iprot.readI32(); struct.setPriorityOrderIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.creationTime = iprot.readI64(); + struct.setCreationTimeIsSet(true); + } + if (incoming.get(1)) { + struct.updateTime = iprot.readI64(); + struct.setUpdateTimeIsSet(true); + } + if (incoming.get(2)) { + struct.storageResourceId = iprot.readString(); + struct.setStorageResourceIdIsSet(true); + } } } diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java index ba296cc4c5..607094ee8f 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java @@ -20,10 +20,7 @@ */ 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; @@ -31,12 +28,18 @@ * 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; @@ -50,23 +53,35 @@ @Column(name = "UPDATE_TIME") private Timestamp updateTime; + @ManyToOne(targetEntity = StorageResourceEntity.class, cascade = CascadeType.MERGE) + @JoinColumn(name = "STORAGE_RESOURCE_ID") + private StorageResourceEntity storageResource; + public StorageInterfaceEntity() { } - public StorageInterfacePK getId() { - return id; + public String getStorageResourceId() { + return storageResourceId; } - public void setId(StorageInterfacePK id) { - this.id = id; + public void setStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; } - public Timestamp getCreationTime() { - return creationTime; + public String getDataMovementInterfaceId() { + return dataMovementInterfaceId; } - public void setCreationTime(Timestamp creationTime) { - this.creationTime = creationTime; + public void setDataMovementInterfaceId(String dataMovementInterfaceId) { + this.dataMovementInterfaceId = dataMovementInterfaceId; + } + + public StorageResourceEntity getStorageResource() { + return storageResource; + } + + public void setStorageResource(StorageResourceEntity storageResource) { + this.storageResource = storageResource; } public String getDataMovementProtocol() { @@ -85,6 +100,14 @@ public void setPriorityOrder(int priorityOrder) { this.priorityOrder = priorityOrder; } + public Timestamp getCreationTime() { + return creationTime; + } + + public void setCreationTime(Timestamp creationTime) { + this.creationTime = creationTime; + } + public Timestamp getUpdateTime() { return updateTime; } diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java index 1a5aa14e2d..d17ec4b8e2 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java @@ -22,21 +22,19 @@ 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) private String storageResourceId; - @Column(name="DATA_MOVEMENT_INTERFACE_ID") private String dataMovementInterfaceId; public StorageInterfacePK() { diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageResourceEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageResourceEntity.java index a99679b706..c097fa3324 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageResourceEntity.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageResourceEntity.java @@ -20,18 +20,16 @@ */ package org.apache.airavata.registry.core.entities.appcatalog; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; import java.io.Serializable; import java.sql.Timestamp; +import java.util.List; /** * The persistent class for the storage_resource database table. */ @Entity -@Table(name = "storage_resource") +@Table(name = "STORAGE_RESOURCE") public class StorageResourceEntity implements Serializable { private static final long serialVersionUID = 1L; @@ -42,9 +40,11 @@ @Column(name = "CREATION_TIME") private Timestamp creationTime; - private String description; + @Column(name = "DESCRIPTION") + private String storageResourceDescription; - private short enabled; + @Column(name = "ENABLED") + private boolean enabled; @Column(name = "HOST_NAME") private String hostName; @@ -52,6 +52,10 @@ @Column(name = "UPDATE_TIME") private Timestamp updateTime; + @OneToMany(targetEntity = StorageInterfaceEntity.class, cascade = CascadeType.ALL, + mappedBy = "storageResource", fetch = FetchType.EAGER) + private List<StorageInterfaceEntity> dataMovementInterfaces; + public StorageResourceEntity() { } @@ -63,27 +67,19 @@ public void setStorageResourceId(String storageResourceId) { this.storageResourceId = storageResourceId; } - public Timestamp getCreationTime() { - return creationTime; + public String getStorageResourceDescription() { + return storageResourceDescription; } - public void setCreationTime(Timestamp creationTime) { - this.creationTime = creationTime; + public void setStorageResourceDescription(String storageResourceDescription) { + this.storageResourceDescription = storageResourceDescription; } - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public short getEnabled() { + public boolean isEnabled() { return enabled; } - public void setEnabled(short enabled) { + public void setEnabled(boolean enabled) { this.enabled = enabled; } @@ -95,6 +91,14 @@ public void setHostName(String hostName) { this.hostName = hostName; } + public Timestamp getCreationTime() { + return creationTime; + } + + public void setCreationTime(Timestamp creationTime) { + this.creationTime = creationTime; + } + public Timestamp getUpdateTime() { return updateTime; } @@ -102,4 +106,12 @@ public Timestamp getUpdateTime() { public void setUpdateTime(Timestamp updateTime) { this.updateTime = updateTime; } + + public List<StorageInterfaceEntity> getDataMovementInterfaces() { + return dataMovementInterfaces; + } + + public void setDataMovementInterfaces(List<StorageInterfaceEntity> dataMovementInterfaces) { + this.dataMovementInterfaces = dataMovementInterfaces; + } } \ No newline at end of file diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java index 9b70c49417..b5bd022ef3 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java @@ -325,14 +325,8 @@ public String addUnicoreDataMovement(UnicoreDataMovement unicoreDataMovement) th @Override public String addDataMovementProtocol(String resourceId, DMType dmType, DataMovementInterface dataMovementInterface) throws AppCatalogException { - if (dmType.equals(DMType.COMPUTE_RESOURCE)){ - return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); - } - else if (dmType.equals(DMType.STORAGE_RESOURCE)){ - //TODO - COMPLETE this after StorageResourceRepo implementation - return null; - } - return null; + return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); + } @Override diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java new file mode 100644 index 0000000000..46d0b556a7 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepository.java @@ -0,0 +1,210 @@ +/* + * 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.model.data.movement.DataMovementInterface; +import org.apache.airavata.registry.core.entities.appcatalog.DataMovementInterfaceEntity; +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.ObjectMapperSingleton; +import org.apache.airavata.registry.core.utils.QueryConstants; +import org.apache.airavata.registry.cpi.AppCatalogException; +import org.apache.airavata.registry.cpi.StorageResource; +import org.dozer.Mapper; +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<StorageResourceDescription, StorageResourceEntity, String> 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 ("".equals(description.getStorageResourceId()) || airavata_commonsConstants.DEFAULT_ID.equals(description.getStorageResourceId())) { + 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. StorageResourceId : " + description.getStorageResourceId() + "" + + " HostName : " + description.getHostName(), e); + throw new AppCatalogException("Error while saving storage resource. StorageResourceId : " + description.getStorageResourceId() + "" + + " HostName : " + description.getHostName(), 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. StorageResourceId : " + updatedStorageResource.getStorageResourceId() + "" + + " HostName : " + updatedStorageResource.getHostName(), e); + throw new AppCatalogException("Error while updating storage resource. StorageResourceId : " + updatedStorageResource.getStorageResourceId() + "" + + " HostName : " + updatedStorageResource.getHostName(), e); + } + } + + @Override + public StorageResourceDescription getStorageResource(String resourceId) throws AppCatalogException { + try { + return get(resourceId); + } catch (Exception e) { + logger.error("Error while retrieving storage resource. Resource Id: " + resourceId , e); + throw new AppCatalogException("Error while retrieving storage resource. Resource Id: " + resourceId, e); + } + } + + @Override + public List<StorageResourceDescription> getStorageResourceList(Map<String, String> filters) throws AppCatalogException { + try { + if (filters.containsKey(DBConstants.StorageResource.HOST_NAME)) { + Map<String,Object> queryParameters = new HashMap<>(); + queryParameters.put(DBConstants.ComputeResource.HOST_NAME, filters.get(DBConstants.StorageResource.HOST_NAME)); + List<StorageResourceDescription> storageResourceDescriptionList = select(QueryConstants.FIND_STORAGE_RESOURCE, -1, 0, queryParameters); + return storageResourceDescriptionList; + } else { + logger.error("Unsupported field name for compute resource. " + filters.get(DBConstants.StorageResource.HOST_NAME)); + throw new IllegalArgumentException("Unsupported field name for compute resource. " + filters.get(DBConstants.StorageResource.HOST_NAME)); + } + } catch (Exception e) { + logger.error("Error while retrieving storage resource list", e); + throw new AppCatalogException("Error while retrieving storage resource list", e); + } + } + + @Override + public List<StorageResourceDescription> getAllStorageResourceList() throws AppCatalogException { + try { + return select(QueryConstants.FIND_ALL_STORAGE_RESOURCES, 0); + } catch (Exception e) { + logger.error("Error while retrieving storage resource list", e); + throw new AppCatalogException("Error while retrieving storage resource list", e); + } + } + + @Override + public Map<String, String> getAllStorageResourceIdList() throws AppCatalogException { + try { + Map<String, String> storageResourceMap = new HashMap<String, String>(); + List<StorageResourceDescription> storageResourceDescriptionList = select(QueryConstants.FIND_ALL_STORAGE_RESOURCES, 0); + return getStorageResourceMap(storageResourceDescriptionList); + } catch (Exception e) { + logger.error("Error while retrieving storage resource ID map", e); + throw new AppCatalogException("Error while retrieving storage resource ID map", e); + } + } + + @Override + public Map<String, String> getAvailableStorageResourceIdList() throws AppCatalogException { + try { + Map<String, String> storageResourceMap = new HashMap<String, String>(); + List<StorageResourceDescription> storageResourceDescriptionList = select(QueryConstants.FIND_ALL_AVAILABLE_STORAGE_RESOURCES, 0); + return getStorageResourceMap(storageResourceDescriptionList); + } catch (Exception e) { + logger.error("Error while retrieving available storage resource ID map", e); + throw new AppCatalogException("Error while retrieving available storage resource ID map", e); + } + } + + @Override + public boolean isStorageResourceExists(String resourceId) throws AppCatalogException { + try { + return isExists(resourceId); + } catch (Exception e) { + logger.error("Error while retrieving storage resource. Resource ID: "+ resourceId, e); + throw new AppCatalogException("Error while retrieving storage resource. Resource ID: "+ resourceId, e); + } + } + + @Override + public void removeStorageResource(String resourceId) throws AppCatalogException { + try { + delete(resourceId); + } catch (Exception e) { + logger.error("Error while removing storage resource Resource ID: "+ resourceId, e); + throw new AppCatalogException("Error while removing storage resource Resource ID: "+ resourceId, e); + } + } + + public String addDataMovementInterface(DataMovementInterface dataMovementInterface) { + Mapper mapper = ObjectMapperSingleton.getInstance(); + StorageInterfaceEntity storageInterfaceEntity = mapper.map(dataMovementInterface, StorageInterfaceEntity.class); + execute(entityManager -> entityManager.merge(storageInterfaceEntity)); + return dataMovementInterface.getDataMovementInterfaceId(); + } + + @Override + public void removeDataMovementInterface(String storageResourceId, String dataMovementInterfaceId) throws AppCatalogException { + try { + StorageInterfacePK storageInterfacePK = new StorageInterfacePK(); + storageInterfacePK.setDataMovementInterfaceId(dataMovementInterfaceId); + storageInterfacePK.setStorageResourceId(storageResourceId); + execute(entityManager -> { + StorageInterfaceEntity entity = entityManager.find(StorageInterfaceEntity.class, storageInterfacePK); + entityManager.remove(entity); + return entity; + }); + } catch (Exception e) { + logger.error("Error removing storage data movement interface. StorageResourceId: "+ storageResourceId + "" + + " DataMovementInterfaceId: "+ dataMovementInterfaceId, e); + throw new AppCatalogException("Error removing storage data movement interface. StorageResourceId: "+ storageResourceId + "" + + " DataMovementInterfaceId: "+ dataMovementInterfaceId, e); + } + } + + private Map<String, String> getStorageResourceMap(List<StorageResourceDescription> storageResourceDescriptionList) { + Map<String, String> storageResourceMap = new HashMap<String, String>(); + if (storageResourceDescriptionList != null) { + for (StorageResourceDescription storageResourceDescription: storageResourceDescriptionList) { + storageResourceMap.put(storageResourceDescription.getStorageResourceId(), storageResourceDescription.getHostName()); + } + } + return storageResourceMap; + } +} diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java index b79e8db62c..2837e6b115 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java @@ -17,6 +17,10 @@ public static final String COMPUTE_RESOURCE_ID = "computeResourceId"; } + public static class StorageResource { + public static final String HOST_NAME = "hostName"; + } + public static class ResourceJobManager { public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId"; } diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java new file mode 100644 index 0000000000..9d571cc5f0 --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DozerConverter/StorageDateConverter.java @@ -0,0 +1,34 @@ +package org.apache.airavata.registry.core.utils.DozerConverter; + +import org.dozer.DozerConverter; + +import java.sql.Timestamp; + +/** + * Created by skariyat on 4/11/18. + */ +public class StorageDateConverter extends DozerConverter { + + public StorageDateConverter(Class prototypeA, Class prototypeB) { + super(prototypeA, prototypeB); + } + + @Override + public Object convertTo(Object source, Object dest) { + + if (source != null) { + if (source instanceof Long) { + return new Timestamp((long) source); + } else if (source instanceof Timestamp) { + return ((Timestamp)source).getTime(); + } + } + return null; + } + + @Override + public Object convertFrom(Object source, Object dest) { + return convertTo(source, dest); + } + +} diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java index 918946075b..337684bcbe 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/ObjectMapperSingleton.java @@ -24,6 +24,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; + public class ObjectMapperSingleton extends DozerBeanMapper{ private final static Logger logger = LoggerFactory.getLogger(ObjectMapperSingleton.class); @@ -32,8 +34,13 @@ private ObjectMapperSingleton(){} public static ObjectMapperSingleton getInstance(){ - if(instance == null) + if(instance == null) { instance = new ObjectMapperSingleton(); + instance.setMappingFiles( + new ArrayList<String>(){{ + add("dozer_mapping.xml"); + }}); + } return instance; } } \ No newline at end of file diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java index 73ab4d6932..e7fc469e44 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java @@ -37,4 +37,10 @@ "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; + String FIND_ALL_STORAGE_RESOURCES = "SELECT SR FROM " + StorageResourceEntity.class.getSimpleName() + " SR"; + String FIND_ALL_AVAILABLE_STORAGE_RESOURCES = "SELECT SR FROM " + StorageResourceEntity.class.getSimpleName() + " SR " + + "WHERE SR.enabled = TRUE"; } diff --git a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml index a7edb6d3d0..fbdee65423 100644 --- a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml +++ b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml @@ -119,7 +119,6 @@ <class>org.apache.airavata.registry.core.entities.appcatalog.AppModuleMappingPK</class> <class>org.apache.airavata.registry.core.entities.appcatalog.ApplicationInputPK</class> <class>org.apache.airavata.registry.core.entities.appcatalog.ApplicationOutputPK</class> - <class>org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK</class> <class>org.apache.airavata.registry.core.entities.appcatalog.JobManagerCommandPK</class> <class>org.apache.airavata.registry.core.entities.appcatalog.ParallelismCommandPK</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> diff --git a/modules/registry-refactoring/src/main/resources/dozer_mapping.xml b/modules/registry-refactoring/src/main/resources/dozer_mapping.xml new file mode 100644 index 0000000000..0f3a72868d --- /dev/null +++ b/modules/registry-refactoring/src/main/resources/dozer_mapping.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mappings xmlns="http://dozer.sourceforge.net" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://dozer.sourceforge.net + http://dozer.sourceforge.net/schema/beanmapping.xsd"> + <mapping> + <class-a>org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription</class-a> + <class-b>org.apache.airavata.registry.core.entities.appcatalog.StorageInterfaceEntity</class-b> + <field custom-converter="org.apache.airavata.registry.core.utils.DozerConverter.StorageDateConverter"> + <a>creationTime</a> + <b>creationTime</b> + </field> + <field custom-converter="org.apache.airavata.registry.core.utils.DozerConverter.StorageDateConverter"> + <a>updateTime</a> + <b>updateTime</b> + </field> + </mapping> +</mappings> \ No newline at end of file diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java new file mode 100644 index 0000000000..a0c5be75b4 --- /dev/null +++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/StorageResourceRepositoryTest.java @@ -0,0 +1,151 @@ +/* + * 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; +import static org.junit.Assert.fail; + +/** + * 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<DataMovementInterface> dataMovementInterfaces = new ArrayList<DataMovementInterface>(); + 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<DataMovementInterface> movementInterfaces = storageResourceDescription.getDataMovementInterfaces(); + if (movementInterfaces != null && !movementInterfaces.isEmpty()){ + for (DataMovementInterface dataMovementInterface : movementInterfaces){ + System.out.println("Data Movement Interface Id :" + dataMovementInterface.getDataMovementInterfaceId()); + System.out.println("Data Movement Protocol :" + dataMovementInterface.getDataMovementProtocol().toString()); + } + } + } else { + fail("Created Storage Resource not found"); + } + + description.setHostName("localhost2"); + storageResourceRepository.updateStorageResource(resourceId, description); + if (storageResourceRepository.isStorageResourceExists(resourceId)) { + storageResourceDescription = storageResourceRepository.getStorageResource(resourceId); + System.out.println("**********Updated Resource name ************* : " + storageResourceDescription.getHostName()); + assertTrue(storageResourceDescription.getHostName().equals("localhost2")); + } + assertTrue("Storage resource save successfully", storageResourceDescription != null); + + + } + + public String addSCPDataMovement (){ + try { + SCPDataMovement dataMovement = new SCPDataMovement(); + dataMovement.setSshPort(22); + dataMovement.setSecurityProtocol(SecurityProtocol.SSH_KEYS); + return new ComputeResourceRepository().addScpDataMovement(dataMovement); + } catch (AppCatalogException e) { + logger.error(e.getMessage(), e); + } + return null; + } + + public String addGridFTPDataMovement (){ + try { + GridFTPDataMovement dataMovement = new GridFTPDataMovement(); + dataMovement.setSecurityProtocol(SecurityProtocol.SSH_KEYS); + List<String> endPoints = new ArrayList<String>(); + endPoints.add("222.33.43.444"); + endPoints.add("23.344.44.454"); + dataMovement.setGridFTPEndPoints(endPoints); + return new ComputeResourceRepository().addGridFTPDataMovement(dataMovement); + } catch (AppCatalogException e) { + logger.error(e.getMessage(), e); + } + return null; + } + +} diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java index b7d9a47ba5..e100445405 100644 --- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java +++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java @@ -68,6 +68,7 @@ import org.apache.airavata.registry.core.repositories.appcatalog.ComputeResourceRepository; import org.apache.airavata.registry.core.repositories.appcatalog.GroupResourceProfileRepository; import org.apache.airavata.registry.core.repositories.appcatalog.GwyResourceProfileRepository; +import org.apache.airavata.registry.core.repositories.appcatalog.StorageResourceRepository; import org.apache.airavata.registry.cpi.*; import org.apache.airavata.registry.cpi.utils.Constants; import org.apache.thrift.TException; @@ -83,6 +84,7 @@ private AppCatalog appCatalog; private ReplicaCatalog dataCatalog; private WorkflowCatalog workflowCatalog; + StorageResourceRepository storageResourceRepository = new StorageResourceRepository(); /** * Fetch Apache Registry API version @@ -1626,8 +1628,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 = storageResourceRepository.getStorageResource(storageResourceId); logger.debug("Airavata retrieved storage resource with storage resource Id : " + storageResourceId); return storageResource; } catch (AppCatalogException e) { @@ -1647,8 +1648,7 @@ public StorageResourceDescription getStorageResource(String storageResourceId) t @Override public Map<String, String> getAllStorageResourceNames() throws RegistryServiceException, TException { try { - appCatalog = RegistryFactory.getAppCatalog(); - Map<String, String> resourceIdList = appCatalog.getStorageResource().getAllStorageResourceIdList(); + Map<String, String> resourceIdList = storageResourceRepository.getAllStorageResourceIdList(); logger.debug("Airavata retrieved storage resources list..."); return resourceIdList; } catch (AppCatalogException e) { @@ -1669,8 +1669,7 @@ public StorageResourceDescription getStorageResource(String storageResourceId) t @Override public boolean deleteStorageResource(String storageResourceId) throws RegistryServiceException, TException { try { - appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getStorageResource().removeStorageResource(storageResourceId); + storageResourceRepository.removeStorageResource(storageResourceId); logger.debug("Airavata deleted storage resource with storage resource Id : " + storageResourceId); return true; } catch (AppCatalogException e) { @@ -2928,7 +2927,7 @@ public boolean deleteDataMovementInterface(String resourceId, String dataMovemen logger.debug("Airavata deleted data movement interface with interface id : " + dataMovementInterfaceId); return true; case STORAGE_RESOURCE: - appCatalog.getStorageResource().removeDataMovementInterface(resourceId, dataMovementInterfaceId); + storageResourceRepository.removeDataMovementInterface(resourceId, dataMovementInterfaceId); logger.debug("Airavata deleted data movement interface with interface id : " + dataMovementInterfaceId); return true; default: @@ -3401,8 +3400,7 @@ public String addLocalSubmissionDetails(String computeResourceId, int priorityOr @Override public boolean updateStorageResource(String storageResourceId, StorageResourceDescription storageResourceDescription) throws RegistryServiceException, TException { try { - appCatalog = RegistryFactory.getAppCatalog(); - appCatalog.getStorageResource().updateStorageResource(storageResourceId, storageResourceDescription); + storageResourceRepository.updateStorageResource(storageResourceId, storageResourceDescription); logger.debug("Airavata updated storage resource with storage resource Id : " + storageResourceId); return true; } catch (AppCatalogException e) { @@ -3423,8 +3421,7 @@ public boolean updateStorageResource(String storageResourceId, StorageResourceDe @Override public String registerStorageResource(StorageResourceDescription storageResourceDescription) throws RegistryServiceException, TException { try { - appCatalog = RegistryFactory.getAppCatalog(); - String storageResource = appCatalog.getStorageResource().addStorageResource(storageResourceDescription); + String storageResource = storageResourceRepository.addStorageResource(storageResourceDescription); logger.debug("Airavata registered storage resource with storage resource Id : " + storageResource); return storageResource; } catch (AppCatalogException e) { @@ -4309,7 +4306,14 @@ private String addDataMovementInterface(ComputeResource computeResource, dataMovementInterface.setDataMovementInterfaceId(dataMovementInterfaceId); dataMovementInterface.setPriorityOrder(priorityOrder); dataMovementInterface.setDataMovementProtocol(protocolType); - return computeResource.addDataMovementProtocol(computeResourceId, dmType, dataMovementInterface); + if (dmType.equals(DMType.COMPUTE_RESOURCE)) { + return computeResource.addDataMovementProtocol(computeResourceId, dmType, dataMovementInterface); + } + else if (dmType.equals(DMType.STORAGE_RESOURCE)) { + dataMovementInterface.setStorageResourceId(computeResourceId); + return storageResourceRepository.addDataMovementInterface(dataMovementInterface); + } + return null; } private WorkflowCatalog getWorkflowCatalog() { diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/data_movement_models.thrift b/thrift-interface-descriptions/data-models/resource-catalog-models/data_movement_models.thrift index 3a7ca8dc05..5687dfb232 100644 --- a/thrift-interface-descriptions/data-models/resource-catalog-models/data_movement_models.thrift +++ b/thrift-interface-descriptions/data-models/resource-catalog-models/data_movement_models.thrift @@ -148,6 +148,9 @@ struct DataMovementInterface { 1: required string dataMovementInterfaceId, 2: required DataMovementProtocol dataMovementProtocol, 3: required i32 priorityOrder = 0, + 4: optional i64 creationTime, + 5: optional i64 updateTime, + 6: optional string storageResourceId } diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/storage_resource_model.thrift b/thrift-interface-descriptions/data-models/resource-catalog-models/storage_resource_model.thrift index 54370ffb54..2c94c8db4a 100644 --- a/thrift-interface-descriptions/data-models/resource-catalog-models/storage_resource_model.thrift +++ b/thrift-interface-descriptions/data-models/resource-catalog-models/storage_resource_model.thrift @@ -49,4 +49,6 @@ struct StorageResourceDescription { 3: optional string storageResourceDescription, 4: optional bool enabled, 5: optional list<data_movement_models.DataMovementInterface> dataMovementInterfaces, + 6: optional i64 creationTime, + 7: optional i64 updateTime, } ---------------------------------------------------------------- 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)