fixing merge issues
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/81b54855 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/81b54855 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/81b54855 Branch: refs/heads/master Commit: 81b54855d7cbd3386984780e0b0e27f6a9a4ffe0 Parents: 15d8293 Author: scnakandala <[email protected]> Authored: Tue Dec 15 22:49:33 2015 -0500 Committer: scnakandala <[email protected]> Committed: Tue Dec 15 22:49:33 2015 -0500 ---------------------------------------------------------------------- .../server/handler/AiravataServerHandler.java | 1 + .../airavata/compute_resource_model_types.cpp | 10 + .../lib/airavata/compute_resource_model_types.h | 9 + .../model/appcatalog/computeresource/ttypes.py | 14 + .../appcatalog/computeresource/DMType.java | 62 + .../gatewayprofile/GatewayResourceProfile.java | 152 +- .../model/data/resource/DataResourceModel.java | 907 +++++- .../model/data/resource/DataResourceType.java | 62 + .../gfac/impl/task/SCPDataStageTask.java | 11 - modules/registry/logs/airavata.log | 2929 ------------------ .../app/catalog/impl/ComputeResourceImpl.java | 1 + .../airavata/registry/cpi/ComputeResource.java | 1 + pom.xml | 1 - 13 files changed, 1065 insertions(+), 3095 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java index 5183172..52bfa80 100644 --- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java +++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java @@ -47,6 +47,7 @@ import org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescr import org.apache.airavata.model.application.io.InputDataObjectType; import org.apache.airavata.model.application.io.OutputDataObjectType; import org.apache.airavata.model.data.movement.*; +import org.apache.airavata.model.data.movement.DMType; import org.apache.airavata.model.data.resource.DataResourceModel; import org.apache.airavata.model.error.*; import org.apache.airavata.model.experiment.*; http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp index ff9e355..1f575ad 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.cpp @@ -116,6 +116,16 @@ const char* _kMonitorModeNames[] = { }; const std::map<int, const char*> _MonitorMode_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(4, _kMonitorModeValues, _kMonitorModeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); +int _kDMTypeValues[] = { + DMType::COMPUTE_RESOURCE, + DMType::STORAGE_RESOURCE +}; +const char* _kDMTypeNames[] = { + "COMPUTE_RESOURCE", + "STORAGE_RESOURCE" +}; +const std::map<int, const char*> _DMType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kDMTypeValues, _kDMTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + int _kProviderNameValues[] = { ProviderName::EC2, ProviderName::AWSEC2, http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h index 63be4f8..e6553ac 100644 --- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h +++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/compute_resource_model_types.h @@ -101,6 +101,15 @@ struct MonitorMode { extern const std::map<int, const char*> _MonitorMode_VALUES_TO_NAMES; +struct DMType { + enum type { + COMPUTE_RESOURCE = 0, + STORAGE_RESOURCE = 1 + }; +}; + +extern const std::map<int, const char*> _DMType_VALUES_TO_NAMES; + struct ProviderName { enum type { EC2 = 0, http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py index 343ad6d..b32867b 100644 --- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py +++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/appcatalog/computeresource/ttypes.py @@ -227,6 +227,20 @@ class MonitorMode: "FORK": 3, } +class DMType: + COMPUTE_RESOURCE = 0 + STORAGE_RESOURCE = 1 + + _VALUES_TO_NAMES = { + 0: "COMPUTE_RESOURCE", + 1: "STORAGE_RESOURCE", + } + + _NAMES_TO_VALUES = { + "COMPUTE_RESOURCE": 0, + "STORAGE_RESOURCE": 1, + } + class ProviderName: """ Provider name http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/DMType.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/DMType.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/DMType.java new file mode 100644 index 0000000..4cb727e --- /dev/null +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/computeresource/DMType.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.airavata.model.appcatalog.computeresource; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum DMType implements org.apache.thrift.TEnum { + COMPUTE_RESOURCE(0), + STORAGE_RESOURCE(1); + + private final int value; + + private DMType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static DMType findByValue(int value) { + switch (value) { + case 0: + return COMPUTE_RESOURCE; + case 1: + return STORAGE_RESOURCE; + default: + return null; + } + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/GatewayResourceProfile.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/GatewayResourceProfile.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/GatewayResourceProfile.java index 0da0114..24af2a2 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/GatewayResourceProfile.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/appcatalog/gatewayprofile/GatewayResourceProfile.java @@ -71,7 +71,7 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayID", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField CREDENTIAL_STORE_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("credentialStoreToken", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField COMPUTE_RESOURCE_PREFERENCES_FIELD_DESC = new org.apache.thrift.protocol.TField("computeResourcePreferences", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField DATA_STORAGE_PREFERENCES_FIELD_DESC = new org.apache.thrift.protocol.TField("dataStoragePreferences", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField STORAGE_PREFERENCES_FIELD_DESC = new org.apache.thrift.protocol.TField("storagePreferences", org.apache.thrift.protocol.TType.LIST, (short)4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -82,14 +82,14 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe private String gatewayID; // required private String credentialStoreToken; // optional private List<ComputeResourcePreference> computeResourcePreferences; // optional - private List<DataStoragePreference> dataStoragePreferences; // optional + private List<StoragePreference> storagePreferences; // 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 { GATEWAY_ID((short)1, "gatewayID"), CREDENTIAL_STORE_TOKEN((short)2, "credentialStoreToken"), COMPUTE_RESOURCE_PREFERENCES((short)3, "computeResourcePreferences"), - DATA_STORAGE_PREFERENCES((short)4, "dataStoragePreferences"); + STORAGE_PREFERENCES((short)4, "storagePreferences"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -110,8 +110,8 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe return CREDENTIAL_STORE_TOKEN; case 3: // COMPUTE_RESOURCE_PREFERENCES return COMPUTE_RESOURCE_PREFERENCES; - case 4: // DATA_STORAGE_PREFERENCES - return DATA_STORAGE_PREFERENCES; + case 4: // STORAGE_PREFERENCES + return STORAGE_PREFERENCES; default: return null; } @@ -152,7 +152,7 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe } // isset id assignments - private static final _Fields optionals[] = {_Fields.CREDENTIAL_STORE_TOKEN,_Fields.COMPUTE_RESOURCE_PREFERENCES,_Fields.DATA_STORAGE_PREFERENCES}; + private static final _Fields optionals[] = {_Fields.CREDENTIAL_STORE_TOKEN,_Fields.COMPUTE_RESOURCE_PREFERENCES,_Fields.STORAGE_PREFERENCES}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -163,9 +163,9 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe tmpMap.put(_Fields.COMPUTE_RESOURCE_PREFERENCES, new org.apache.thrift.meta_data.FieldMetaData("computeResourcePreferences", 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, ComputeResourcePreference.class)))); - tmpMap.put(_Fields.DATA_STORAGE_PREFERENCES, new org.apache.thrift.meta_data.FieldMetaData("dataStoragePreferences", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.STORAGE_PREFERENCES, new org.apache.thrift.meta_data.FieldMetaData("storagePreferences", 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, DataStoragePreference.class)))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, StoragePreference.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GatewayResourceProfile.class, metaDataMap); } @@ -197,12 +197,12 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe } this.computeResourcePreferences = __this__computeResourcePreferences; } - if (other.isSetDataStoragePreferences()) { - List<DataStoragePreference> __this__dataStoragePreferences = new ArrayList<DataStoragePreference>(other.dataStoragePreferences.size()); - for (DataStoragePreference other_element : other.dataStoragePreferences) { - __this__dataStoragePreferences.add(new DataStoragePreference(other_element)); + if (other.isSetStoragePreferences()) { + List<StoragePreference> __this__storagePreferences = new ArrayList<StoragePreference>(other.storagePreferences.size()); + for (StoragePreference other_element : other.storagePreferences) { + __this__storagePreferences.add(new StoragePreference(other_element)); } - this.dataStoragePreferences = __this__dataStoragePreferences; + this.storagePreferences = __this__storagePreferences; } } @@ -215,7 +215,7 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe this.gatewayID = null; this.credentialStoreToken = null; this.computeResourcePreferences = null; - this.dataStoragePreferences = null; + this.storagePreferences = null; } public String getGatewayID() { @@ -302,41 +302,41 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe } } - public int getDataStoragePreferencesSize() { - return (this.dataStoragePreferences == null) ? 0 : this.dataStoragePreferences.size(); + public int getStoragePreferencesSize() { + return (this.storagePreferences == null) ? 0 : this.storagePreferences.size(); } - public java.util.Iterator<DataStoragePreference> getDataStoragePreferencesIterator() { - return (this.dataStoragePreferences == null) ? null : this.dataStoragePreferences.iterator(); + public java.util.Iterator<StoragePreference> getStoragePreferencesIterator() { + return (this.storagePreferences == null) ? null : this.storagePreferences.iterator(); } - public void addToDataStoragePreferences(DataStoragePreference elem) { - if (this.dataStoragePreferences == null) { - this.dataStoragePreferences = new ArrayList<DataStoragePreference>(); + public void addToStoragePreferences(StoragePreference elem) { + if (this.storagePreferences == null) { + this.storagePreferences = new ArrayList<StoragePreference>(); } - this.dataStoragePreferences.add(elem); + this.storagePreferences.add(elem); } - public List<DataStoragePreference> getDataStoragePreferences() { - return this.dataStoragePreferences; + public List<StoragePreference> getStoragePreferences() { + return this.storagePreferences; } - public void setDataStoragePreferences(List<DataStoragePreference> dataStoragePreferences) { - this.dataStoragePreferences = dataStoragePreferences; + public void setStoragePreferences(List<StoragePreference> storagePreferences) { + this.storagePreferences = storagePreferences; } - public void unsetDataStoragePreferences() { - this.dataStoragePreferences = null; + public void unsetStoragePreferences() { + this.storagePreferences = null; } - /** Returns true if field dataStoragePreferences is set (has been assigned a value) and false otherwise */ - public boolean isSetDataStoragePreferences() { - return this.dataStoragePreferences != null; + /** Returns true if field storagePreferences is set (has been assigned a value) and false otherwise */ + public boolean isSetStoragePreferences() { + return this.storagePreferences != null; } - public void setDataStoragePreferencesIsSet(boolean value) { + public void setStoragePreferencesIsSet(boolean value) { if (!value) { - this.dataStoragePreferences = null; + this.storagePreferences = null; } } @@ -366,11 +366,11 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe } break; - case DATA_STORAGE_PREFERENCES: + case STORAGE_PREFERENCES: if (value == null) { - unsetDataStoragePreferences(); + unsetStoragePreferences(); } else { - setDataStoragePreferences((List<DataStoragePreference>)value); + setStoragePreferences((List<StoragePreference>)value); } break; @@ -388,8 +388,8 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe case COMPUTE_RESOURCE_PREFERENCES: return getComputeResourcePreferences(); - case DATA_STORAGE_PREFERENCES: - return getDataStoragePreferences(); + case STORAGE_PREFERENCES: + return getStoragePreferences(); } throw new IllegalStateException(); @@ -408,8 +408,8 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe return isSetCredentialStoreToken(); case COMPUTE_RESOURCE_PREFERENCES: return isSetComputeResourcePreferences(); - case DATA_STORAGE_PREFERENCES: - return isSetDataStoragePreferences(); + case STORAGE_PREFERENCES: + return isSetStoragePreferences(); } throw new IllegalStateException(); } @@ -454,12 +454,12 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe return false; } - boolean this_present_dataStoragePreferences = true && this.isSetDataStoragePreferences(); - boolean that_present_dataStoragePreferences = true && that.isSetDataStoragePreferences(); - if (this_present_dataStoragePreferences || that_present_dataStoragePreferences) { - if (!(this_present_dataStoragePreferences && that_present_dataStoragePreferences)) + boolean this_present_storagePreferences = true && this.isSetStoragePreferences(); + boolean that_present_storagePreferences = true && that.isSetStoragePreferences(); + if (this_present_storagePreferences || that_present_storagePreferences) { + if (!(this_present_storagePreferences && that_present_storagePreferences)) return false; - if (!this.dataStoragePreferences.equals(that.dataStoragePreferences)) + if (!this.storagePreferences.equals(that.storagePreferences)) return false; } @@ -485,10 +485,10 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe if (present_computeResourcePreferences) list.add(computeResourcePreferences); - boolean present_dataStoragePreferences = true && (isSetDataStoragePreferences()); - list.add(present_dataStoragePreferences); - if (present_dataStoragePreferences) - list.add(dataStoragePreferences); + boolean present_storagePreferences = true && (isSetStoragePreferences()); + list.add(present_storagePreferences); + if (present_storagePreferences) + list.add(storagePreferences); return list.hashCode(); } @@ -531,12 +531,12 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDataStoragePreferences()).compareTo(other.isSetDataStoragePreferences()); + lastComparison = Boolean.valueOf(isSetStoragePreferences()).compareTo(other.isSetStoragePreferences()); if (lastComparison != 0) { return lastComparison; } - if (isSetDataStoragePreferences()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataStoragePreferences, other.dataStoragePreferences); + if (isSetStoragePreferences()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storagePreferences, other.storagePreferences); if (lastComparison != 0) { return lastComparison; } @@ -588,13 +588,13 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe } first = false; } - if (isSetDataStoragePreferences()) { + if (isSetStoragePreferences()) { if (!first) sb.append(", "); - sb.append("dataStoragePreferences:"); - if (this.dataStoragePreferences == null) { + sb.append("storagePreferences:"); + if (this.storagePreferences == null) { sb.append("null"); } else { - sb.append(this.dataStoragePreferences); + sb.append(this.storagePreferences); } first = false; } @@ -680,21 +680,21 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // DATA_STORAGE_PREFERENCES + case 4: // STORAGE_PREFERENCES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); - struct.dataStoragePreferences = new ArrayList<DataStoragePreference>(_list3.size); - DataStoragePreference _elem4; + struct.storagePreferences = new ArrayList<StoragePreference>(_list3.size); + StoragePreference _elem4; for (int _i5 = 0; _i5 < _list3.size; ++_i5) { - _elem4 = new DataStoragePreference(); + _elem4 = new StoragePreference(); _elem4.read(iprot); - struct.dataStoragePreferences.add(_elem4); + struct.storagePreferences.add(_elem4); } iprot.readListEnd(); } - struct.setDataStoragePreferencesIsSet(true); + struct.setStoragePreferencesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -738,12 +738,12 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe oprot.writeFieldEnd(); } } - if (struct.dataStoragePreferences != null) { - if (struct.isSetDataStoragePreferences()) { - oprot.writeFieldBegin(DATA_STORAGE_PREFERENCES_FIELD_DESC); + if (struct.storagePreferences != null) { + if (struct.isSetStoragePreferences()) { + oprot.writeFieldBegin(STORAGE_PREFERENCES_FIELD_DESC); { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.dataStoragePreferences.size())); - for (DataStoragePreference _iter7 : struct.dataStoragePreferences) + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.storagePreferences.size())); + for (StoragePreference _iter7 : struct.storagePreferences) { _iter7.write(oprot); } @@ -777,7 +777,7 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe if (struct.isSetComputeResourcePreferences()) { optionals.set(1); } - if (struct.isSetDataStoragePreferences()) { + if (struct.isSetStoragePreferences()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); @@ -793,10 +793,10 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe } } } - if (struct.isSetDataStoragePreferences()) { + if (struct.isSetStoragePreferences()) { { - oprot.writeI32(struct.dataStoragePreferences.size()); - for (DataStoragePreference _iter9 : struct.dataStoragePreferences) + oprot.writeI32(struct.storagePreferences.size()); + for (StoragePreference _iter9 : struct.storagePreferences) { _iter9.write(oprot); } @@ -831,16 +831,16 @@ public class GatewayResourceProfile implements org.apache.thrift.TBase<GatewayRe if (incoming.get(2)) { { org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.dataStoragePreferences = new ArrayList<DataStoragePreference>(_list13.size); - DataStoragePreference _elem14; + struct.storagePreferences = new ArrayList<StoragePreference>(_list13.size); + StoragePreference _elem14; for (int _i15 = 0; _i15 < _list13.size; ++_i15) { - _elem14 = new DataStoragePreference(); + _elem14 = new StoragePreference(); _elem14.read(iprot); - struct.dataStoragePreferences.add(_elem14); + struct.storagePreferences.add(_elem14); } } - struct.setDataStoragePreferencesIsSet(true); + struct.setStoragePreferencesIsSet(true); } } } http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceModel.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceModel.java index 86bd878..561efe8 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceModel.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceModel.java @@ -51,17 +51,23 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-12-2") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-12-15") public class DataResourceModel implements org.apache.thrift.TBase<DataResourceModel, DataResourceModel._Fields>, java.io.Serializable, Cloneable, Comparable<DataResourceModel> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DataResourceModel"); private static final org.apache.thrift.protocol.TField RESOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField RESOURCE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField RESOURCE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceDescription", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField RESOURCE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceSize", org.apache.thrift.protocol.TType.I32, (short)4); - 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)5); - private static final org.apache.thrift.protocol.TField LAST_MODIFIED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastModifiedTime", org.apache.thrift.protocol.TType.I64, (short)6); - private static final org.apache.thrift.protocol.TField REPLICA_LOCATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("replicaLocations", org.apache.thrift.protocol.TType.LIST, (short)7); + private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PARENT_RESOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentResourceId", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField RESOURCE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField RESOURCE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceDescription", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField OWNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerName", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField DATA_RESOURCE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataResourceType", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField RESOURCE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceSize", org.apache.thrift.protocol.TType.I32, (short)8); + 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)9); + private static final org.apache.thrift.protocol.TField LAST_MODIFIED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastModifiedTime", org.apache.thrift.protocol.TType.I64, (short)10); + private static final org.apache.thrift.protocol.TField RESOURCE_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceMetadata", org.apache.thrift.protocol.TType.MAP, (short)11); + private static final org.apache.thrift.protocol.TField REPLICA_LOCATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("replicaLocations", org.apache.thrift.protocol.TType.LIST, (short)12); + private static final org.apache.thrift.protocol.TField CHILD_RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("childResources", org.apache.thrift.protocol.TType.LIST, (short)13); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -70,22 +76,38 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } private String resourceId; // optional + private String gatewayId; // optional + private String parentResourceId; // optional private String resourceName; // optional private String resourceDescription; // optional + private String ownerName; // optional + private DataResourceType dataResourceType; // optional private int resourceSize; // optional private long creationTime; // optional private long lastModifiedTime; // optional - private List<DataReplicaLocationModel> replicaLocations; // required + private Map<String,String> resourceMetadata; // optional + private List<DataReplicaLocationModel> replicaLocations; // optional + private List<DataResourceModel> childResources; // 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 { RESOURCE_ID((short)1, "resourceId"), - RESOURCE_NAME((short)2, "resourceName"), - RESOURCE_DESCRIPTION((short)3, "resourceDescription"), - RESOURCE_SIZE((short)4, "resourceSize"), - CREATION_TIME((short)5, "creationTime"), - LAST_MODIFIED_TIME((short)6, "lastModifiedTime"), - REPLICA_LOCATIONS((short)7, "replicaLocations"); + GATEWAY_ID((short)2, "gatewayId"), + PARENT_RESOURCE_ID((short)3, "parentResourceId"), + RESOURCE_NAME((short)4, "resourceName"), + RESOURCE_DESCRIPTION((short)5, "resourceDescription"), + OWNER_NAME((short)6, "ownerName"), + /** + * + * @see DataResourceType + */ + DATA_RESOURCE_TYPE((short)7, "dataResourceType"), + RESOURCE_SIZE((short)8, "resourceSize"), + CREATION_TIME((short)9, "creationTime"), + LAST_MODIFIED_TIME((short)10, "lastModifiedTime"), + RESOURCE_METADATA((short)11, "resourceMetadata"), + REPLICA_LOCATIONS((short)12, "replicaLocations"), + CHILD_RESOURCES((short)13, "childResources"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -102,18 +124,30 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo switch(fieldId) { case 1: // RESOURCE_ID return RESOURCE_ID; - case 2: // RESOURCE_NAME + case 2: // GATEWAY_ID + return GATEWAY_ID; + case 3: // PARENT_RESOURCE_ID + return PARENT_RESOURCE_ID; + case 4: // RESOURCE_NAME return RESOURCE_NAME; - case 3: // RESOURCE_DESCRIPTION + case 5: // RESOURCE_DESCRIPTION return RESOURCE_DESCRIPTION; - case 4: // RESOURCE_SIZE + case 6: // OWNER_NAME + return OWNER_NAME; + case 7: // DATA_RESOURCE_TYPE + return DATA_RESOURCE_TYPE; + case 8: // RESOURCE_SIZE return RESOURCE_SIZE; - case 5: // CREATION_TIME + case 9: // CREATION_TIME return CREATION_TIME; - case 6: // LAST_MODIFIED_TIME + case 10: // LAST_MODIFIED_TIME return LAST_MODIFIED_TIME; - case 7: // REPLICA_LOCATIONS + case 11: // RESOURCE_METADATA + return RESOURCE_METADATA; + case 12: // REPLICA_LOCATIONS return REPLICA_LOCATIONS; + case 13: // CHILD_RESOURCES + return CHILD_RESOURCES; default: return null; } @@ -158,25 +192,40 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo private static final int __CREATIONTIME_ISSET_ID = 1; private static final int __LASTMODIFIEDTIME_ISSET_ID = 2; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.RESOURCE_ID,_Fields.RESOURCE_NAME,_Fields.RESOURCE_DESCRIPTION,_Fields.RESOURCE_SIZE,_Fields.CREATION_TIME,_Fields.LAST_MODIFIED_TIME}; + private static final _Fields optionals[] = {_Fields.RESOURCE_ID,_Fields.GATEWAY_ID,_Fields.PARENT_RESOURCE_ID,_Fields.RESOURCE_NAME,_Fields.RESOURCE_DESCRIPTION,_Fields.OWNER_NAME,_Fields.DATA_RESOURCE_TYPE,_Fields.RESOURCE_SIZE,_Fields.CREATION_TIME,_Fields.LAST_MODIFIED_TIME,_Fields.RESOURCE_METADATA,_Fields.REPLICA_LOCATIONS,_Fields.CHILD_RESOURCES}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RESOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("resourceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARENT_RESOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("parentResourceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RESOURCE_NAME, new org.apache.thrift.meta_data.FieldMetaData("resourceName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RESOURCE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("resourceDescription", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OWNER_NAME, new org.apache.thrift.meta_data.FieldMetaData("ownerName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DATA_RESOURCE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataResourceType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DataResourceType.class))); tmpMap.put(_Fields.RESOURCE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("resourceSize", org.apache.thrift.TFieldRequirementType.OPTIONAL, 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.LAST_MODIFIED_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastModifiedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.REPLICA_LOCATIONS, new org.apache.thrift.meta_data.FieldMetaData("replicaLocations", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.RESOURCE_METADATA, new org.apache.thrift.meta_data.FieldMetaData("resourceMetadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.REPLICA_LOCATIONS, new org.apache.thrift.meta_data.FieldMetaData("replicaLocations", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "DataReplicaLocationModel")))); + tmpMap.put(_Fields.CHILD_RESOURCES, new org.apache.thrift.meta_data.FieldMetaData("childResources", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "DataResourceModel")))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DataResourceModel.class, metaDataMap); } @@ -184,13 +233,6 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo public DataResourceModel() { } - public DataResourceModel( - List<DataReplicaLocationModel> replicaLocations) - { - this(); - this.replicaLocations = replicaLocations; - } - /** * Performs a deep copy on <i>other</i>. */ @@ -199,15 +241,31 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo if (other.isSetResourceId()) { this.resourceId = other.resourceId; } + if (other.isSetGatewayId()) { + this.gatewayId = other.gatewayId; + } + if (other.isSetParentResourceId()) { + this.parentResourceId = other.parentResourceId; + } if (other.isSetResourceName()) { this.resourceName = other.resourceName; } if (other.isSetResourceDescription()) { this.resourceDescription = other.resourceDescription; } + if (other.isSetOwnerName()) { + this.ownerName = other.ownerName; + } + if (other.isSetDataResourceType()) { + this.dataResourceType = other.dataResourceType; + } this.resourceSize = other.resourceSize; this.creationTime = other.creationTime; this.lastModifiedTime = other.lastModifiedTime; + if (other.isSetResourceMetadata()) { + Map<String,String> __this__resourceMetadata = new HashMap<String,String>(other.resourceMetadata); + this.resourceMetadata = __this__resourceMetadata; + } if (other.isSetReplicaLocations()) { List<DataReplicaLocationModel> __this__replicaLocations = new ArrayList<DataReplicaLocationModel>(other.replicaLocations.size()); for (DataReplicaLocationModel other_element : other.replicaLocations) { @@ -215,6 +273,13 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } this.replicaLocations = __this__replicaLocations; } + if (other.isSetChildResources()) { + List<DataResourceModel> __this__childResources = new ArrayList<DataResourceModel>(other.childResources.size()); + for (DataResourceModel other_element : other.childResources) { + __this__childResources.add(other_element); + } + this.childResources = __this__childResources; + } } public DataResourceModel deepCopy() { @@ -224,15 +289,21 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo @Override public void clear() { this.resourceId = null; + this.gatewayId = null; + this.parentResourceId = null; this.resourceName = null; this.resourceDescription = null; + this.ownerName = null; + this.dataResourceType = null; setResourceSizeIsSet(false); this.resourceSize = 0; setCreationTimeIsSet(false); this.creationTime = 0; setLastModifiedTimeIsSet(false); this.lastModifiedTime = 0; + this.resourceMetadata = null; this.replicaLocations = null; + this.childResources = null; } public String getResourceId() { @@ -258,6 +329,52 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } } + public String getGatewayId() { + return this.gatewayId; + } + + public void setGatewayId(String gatewayId) { + this.gatewayId = gatewayId; + } + + public void unsetGatewayId() { + this.gatewayId = null; + } + + /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */ + public boolean isSetGatewayId() { + return this.gatewayId != null; + } + + public void setGatewayIdIsSet(boolean value) { + if (!value) { + this.gatewayId = null; + } + } + + public String getParentResourceId() { + return this.parentResourceId; + } + + public void setParentResourceId(String parentResourceId) { + this.parentResourceId = parentResourceId; + } + + public void unsetParentResourceId() { + this.parentResourceId = null; + } + + /** Returns true if field parentResourceId is set (has been assigned a value) and false otherwise */ + public boolean isSetParentResourceId() { + return this.parentResourceId != null; + } + + public void setParentResourceIdIsSet(boolean value) { + if (!value) { + this.parentResourceId = null; + } + } + public String getResourceName() { return this.resourceName; } @@ -304,6 +421,60 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } } + public String getOwnerName() { + return this.ownerName; + } + + public void setOwnerName(String ownerName) { + this.ownerName = ownerName; + } + + public void unsetOwnerName() { + this.ownerName = null; + } + + /** Returns true if field ownerName is set (has been assigned a value) and false otherwise */ + public boolean isSetOwnerName() { + return this.ownerName != null; + } + + public void setOwnerNameIsSet(boolean value) { + if (!value) { + this.ownerName = null; + } + } + + /** + * + * @see DataResourceType + */ + public DataResourceType getDataResourceType() { + return this.dataResourceType; + } + + /** + * + * @see DataResourceType + */ + public void setDataResourceType(DataResourceType dataResourceType) { + this.dataResourceType = dataResourceType; + } + + public void unsetDataResourceType() { + this.dataResourceType = null; + } + + /** Returns true if field dataResourceType is set (has been assigned a value) and false otherwise */ + public boolean isSetDataResourceType() { + return this.dataResourceType != null; + } + + public void setDataResourceTypeIsSet(boolean value) { + if (!value) { + this.dataResourceType = null; + } + } + public int getResourceSize() { return this.resourceSize; } @@ -370,6 +541,40 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTMODIFIEDTIME_ISSET_ID, value); } + public int getResourceMetadataSize() { + return (this.resourceMetadata == null) ? 0 : this.resourceMetadata.size(); + } + + public void putToResourceMetadata(String key, String val) { + if (this.resourceMetadata == null) { + this.resourceMetadata = new HashMap<String,String>(); + } + this.resourceMetadata.put(key, val); + } + + public Map<String,String> getResourceMetadata() { + return this.resourceMetadata; + } + + public void setResourceMetadata(Map<String,String> resourceMetadata) { + this.resourceMetadata = resourceMetadata; + } + + public void unsetResourceMetadata() { + this.resourceMetadata = null; + } + + /** Returns true if field resourceMetadata is set (has been assigned a value) and false otherwise */ + public boolean isSetResourceMetadata() { + return this.resourceMetadata != null; + } + + public void setResourceMetadataIsSet(boolean value) { + if (!value) { + this.resourceMetadata = null; + } + } + public int getReplicaLocationsSize() { return (this.replicaLocations == null) ? 0 : this.replicaLocations.size(); } @@ -408,6 +613,44 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } } + public int getChildResourcesSize() { + return (this.childResources == null) ? 0 : this.childResources.size(); + } + + public java.util.Iterator<DataResourceModel> getChildResourcesIterator() { + return (this.childResources == null) ? null : this.childResources.iterator(); + } + + public void addToChildResources(DataResourceModel elem) { + if (this.childResources == null) { + this.childResources = new ArrayList<DataResourceModel>(); + } + this.childResources.add(elem); + } + + public List<DataResourceModel> getChildResources() { + return this.childResources; + } + + public void setChildResources(List<DataResourceModel> childResources) { + this.childResources = childResources; + } + + public void unsetChildResources() { + this.childResources = null; + } + + /** Returns true if field childResources is set (has been assigned a value) and false otherwise */ + public boolean isSetChildResources() { + return this.childResources != null; + } + + public void setChildResourcesIsSet(boolean value) { + if (!value) { + this.childResources = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case RESOURCE_ID: @@ -418,6 +661,22 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } break; + case GATEWAY_ID: + if (value == null) { + unsetGatewayId(); + } else { + setGatewayId((String)value); + } + break; + + case PARENT_RESOURCE_ID: + if (value == null) { + unsetParentResourceId(); + } else { + setParentResourceId((String)value); + } + break; + case RESOURCE_NAME: if (value == null) { unsetResourceName(); @@ -434,6 +693,22 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } break; + case OWNER_NAME: + if (value == null) { + unsetOwnerName(); + } else { + setOwnerName((String)value); + } + break; + + case DATA_RESOURCE_TYPE: + if (value == null) { + unsetDataResourceType(); + } else { + setDataResourceType((DataResourceType)value); + } + break; + case RESOURCE_SIZE: if (value == null) { unsetResourceSize(); @@ -458,6 +733,14 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } break; + case RESOURCE_METADATA: + if (value == null) { + unsetResourceMetadata(); + } else { + setResourceMetadata((Map<String,String>)value); + } + break; + case REPLICA_LOCATIONS: if (value == null) { unsetReplicaLocations(); @@ -466,6 +749,14 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } break; + case CHILD_RESOURCES: + if (value == null) { + unsetChildResources(); + } else { + setChildResources((List<DataResourceModel>)value); + } + break; + } } @@ -474,12 +765,24 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo case RESOURCE_ID: return getResourceId(); + case GATEWAY_ID: + return getGatewayId(); + + case PARENT_RESOURCE_ID: + return getParentResourceId(); + case RESOURCE_NAME: return getResourceName(); case RESOURCE_DESCRIPTION: return getResourceDescription(); + case OWNER_NAME: + return getOwnerName(); + + case DATA_RESOURCE_TYPE: + return getDataResourceType(); + case RESOURCE_SIZE: return Integer.valueOf(getResourceSize()); @@ -489,9 +792,15 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo case LAST_MODIFIED_TIME: return Long.valueOf(getLastModifiedTime()); + case RESOURCE_METADATA: + return getResourceMetadata(); + case REPLICA_LOCATIONS: return getReplicaLocations(); + case CHILD_RESOURCES: + return getChildResources(); + } throw new IllegalStateException(); } @@ -505,18 +814,30 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo switch (field) { case RESOURCE_ID: return isSetResourceId(); + case GATEWAY_ID: + return isSetGatewayId(); + case PARENT_RESOURCE_ID: + return isSetParentResourceId(); case RESOURCE_NAME: return isSetResourceName(); case RESOURCE_DESCRIPTION: return isSetResourceDescription(); + case OWNER_NAME: + return isSetOwnerName(); + case DATA_RESOURCE_TYPE: + return isSetDataResourceType(); case RESOURCE_SIZE: return isSetResourceSize(); case CREATION_TIME: return isSetCreationTime(); case LAST_MODIFIED_TIME: return isSetLastModifiedTime(); + case RESOURCE_METADATA: + return isSetResourceMetadata(); case REPLICA_LOCATIONS: return isSetReplicaLocations(); + case CHILD_RESOURCES: + return isSetChildResources(); } throw new IllegalStateException(); } @@ -543,6 +864,24 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return false; } + boolean this_present_gatewayId = true && this.isSetGatewayId(); + boolean that_present_gatewayId = true && that.isSetGatewayId(); + if (this_present_gatewayId || that_present_gatewayId) { + if (!(this_present_gatewayId && that_present_gatewayId)) + return false; + if (!this.gatewayId.equals(that.gatewayId)) + return false; + } + + boolean this_present_parentResourceId = true && this.isSetParentResourceId(); + boolean that_present_parentResourceId = true && that.isSetParentResourceId(); + if (this_present_parentResourceId || that_present_parentResourceId) { + if (!(this_present_parentResourceId && that_present_parentResourceId)) + return false; + if (!this.parentResourceId.equals(that.parentResourceId)) + return false; + } + boolean this_present_resourceName = true && this.isSetResourceName(); boolean that_present_resourceName = true && that.isSetResourceName(); if (this_present_resourceName || that_present_resourceName) { @@ -561,6 +900,24 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return false; } + boolean this_present_ownerName = true && this.isSetOwnerName(); + boolean that_present_ownerName = true && that.isSetOwnerName(); + if (this_present_ownerName || that_present_ownerName) { + if (!(this_present_ownerName && that_present_ownerName)) + return false; + if (!this.ownerName.equals(that.ownerName)) + return false; + } + + boolean this_present_dataResourceType = true && this.isSetDataResourceType(); + boolean that_present_dataResourceType = true && that.isSetDataResourceType(); + if (this_present_dataResourceType || that_present_dataResourceType) { + if (!(this_present_dataResourceType && that_present_dataResourceType)) + return false; + if (!this.dataResourceType.equals(that.dataResourceType)) + return false; + } + boolean this_present_resourceSize = true && this.isSetResourceSize(); boolean that_present_resourceSize = true && that.isSetResourceSize(); if (this_present_resourceSize || that_present_resourceSize) { @@ -588,6 +945,15 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return false; } + boolean this_present_resourceMetadata = true && this.isSetResourceMetadata(); + boolean that_present_resourceMetadata = true && that.isSetResourceMetadata(); + if (this_present_resourceMetadata || that_present_resourceMetadata) { + if (!(this_present_resourceMetadata && that_present_resourceMetadata)) + return false; + if (!this.resourceMetadata.equals(that.resourceMetadata)) + return false; + } + boolean this_present_replicaLocations = true && this.isSetReplicaLocations(); boolean that_present_replicaLocations = true && that.isSetReplicaLocations(); if (this_present_replicaLocations || that_present_replicaLocations) { @@ -597,6 +963,15 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return false; } + boolean this_present_childResources = true && this.isSetChildResources(); + boolean that_present_childResources = true && that.isSetChildResources(); + if (this_present_childResources || that_present_childResources) { + if (!(this_present_childResources && that_present_childResources)) + return false; + if (!this.childResources.equals(that.childResources)) + return false; + } + return true; } @@ -609,6 +984,16 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo if (present_resourceId) list.add(resourceId); + boolean present_gatewayId = true && (isSetGatewayId()); + list.add(present_gatewayId); + if (present_gatewayId) + list.add(gatewayId); + + boolean present_parentResourceId = true && (isSetParentResourceId()); + list.add(present_parentResourceId); + if (present_parentResourceId) + list.add(parentResourceId); + boolean present_resourceName = true && (isSetResourceName()); list.add(present_resourceName); if (present_resourceName) @@ -619,6 +1004,16 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo if (present_resourceDescription) list.add(resourceDescription); + boolean present_ownerName = true && (isSetOwnerName()); + list.add(present_ownerName); + if (present_ownerName) + list.add(ownerName); + + boolean present_dataResourceType = true && (isSetDataResourceType()); + list.add(present_dataResourceType); + if (present_dataResourceType) + list.add(dataResourceType.getValue()); + boolean present_resourceSize = true && (isSetResourceSize()); list.add(present_resourceSize); if (present_resourceSize) @@ -634,11 +1029,21 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo if (present_lastModifiedTime) list.add(lastModifiedTime); + boolean present_resourceMetadata = true && (isSetResourceMetadata()); + list.add(present_resourceMetadata); + if (present_resourceMetadata) + list.add(resourceMetadata); + boolean present_replicaLocations = true && (isSetReplicaLocations()); list.add(present_replicaLocations); if (present_replicaLocations) list.add(replicaLocations); + boolean present_childResources = true && (isSetChildResources()); + list.add(present_childResources); + if (present_childResources) + list.add(childResources); + return list.hashCode(); } @@ -660,6 +1065,26 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return lastComparison; } } + lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGatewayId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentResourceId()).compareTo(other.isSetParentResourceId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentResourceId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentResourceId, other.parentResourceId); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetResourceName()).compareTo(other.isSetResourceName()); if (lastComparison != 0) { return lastComparison; @@ -680,6 +1105,26 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return lastComparison; } } + lastComparison = Boolean.valueOf(isSetOwnerName()).compareTo(other.isSetOwnerName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOwnerName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerName, other.ownerName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDataResourceType()).compareTo(other.isSetDataResourceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataResourceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataResourceType, other.dataResourceType); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetResourceSize()).compareTo(other.isSetResourceSize()); if (lastComparison != 0) { return lastComparison; @@ -710,6 +1155,16 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return lastComparison; } } + lastComparison = Boolean.valueOf(isSetResourceMetadata()).compareTo(other.isSetResourceMetadata()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResourceMetadata()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceMetadata, other.resourceMetadata); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetReplicaLocations()).compareTo(other.isSetReplicaLocations()); if (lastComparison != 0) { return lastComparison; @@ -720,6 +1175,16 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo return lastComparison; } } + lastComparison = Boolean.valueOf(isSetChildResources()).compareTo(other.isSetChildResources()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildResources()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childResources, other.childResources); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -749,6 +1214,26 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } first = false; } + if (isSetGatewayId()) { + if (!first) sb.append(", "); + sb.append("gatewayId:"); + if (this.gatewayId == null) { + sb.append("null"); + } else { + sb.append(this.gatewayId); + } + first = false; + } + if (isSetParentResourceId()) { + if (!first) sb.append(", "); + sb.append("parentResourceId:"); + if (this.parentResourceId == null) { + sb.append("null"); + } else { + sb.append(this.parentResourceId); + } + first = false; + } if (isSetResourceName()) { if (!first) sb.append(", "); sb.append("resourceName:"); @@ -769,6 +1254,26 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo } first = false; } + if (isSetOwnerName()) { + if (!first) sb.append(", "); + sb.append("ownerName:"); + if (this.ownerName == null) { + sb.append("null"); + } else { + sb.append(this.ownerName); + } + first = false; + } + if (isSetDataResourceType()) { + if (!first) sb.append(", "); + sb.append("dataResourceType:"); + if (this.dataResourceType == null) { + sb.append("null"); + } else { + sb.append(this.dataResourceType); + } + first = false; + } if (isSetResourceSize()) { if (!first) sb.append(", "); sb.append("resourceSize:"); @@ -787,14 +1292,36 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo sb.append(this.lastModifiedTime); first = false; } - if (!first) sb.append(", "); - sb.append("replicaLocations:"); - if (this.replicaLocations == null) { - sb.append("null"); - } else { - sb.append(this.replicaLocations); + if (isSetResourceMetadata()) { + if (!first) sb.append(", "); + sb.append("resourceMetadata:"); + if (this.resourceMetadata == null) { + sb.append("null"); + } else { + sb.append(this.resourceMetadata); + } + first = false; + } + if (isSetReplicaLocations()) { + if (!first) sb.append(", "); + sb.append("replicaLocations:"); + if (this.replicaLocations == null) { + sb.append("null"); + } else { + sb.append(this.replicaLocations); + } + first = false; + } + if (isSetChildResources()) { + if (!first) sb.append(", "); + sb.append("childResources:"); + if (this.childResources == null) { + sb.append("null"); + } else { + sb.append(this.childResources); + } + first = false; } - first = false; sb.append(")"); return sb.toString(); } @@ -848,7 +1375,23 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // RESOURCE_NAME + case 2: // GATEWAY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.gatewayId = iprot.readString(); + struct.setGatewayIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PARENT_RESOURCE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentResourceId = iprot.readString(); + struct.setParentResourceIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // RESOURCE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.resourceName = iprot.readString(); struct.setResourceNameIsSet(true); @@ -856,7 +1399,7 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // RESOURCE_DESCRIPTION + case 5: // RESOURCE_DESCRIPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.resourceDescription = iprot.readString(); struct.setResourceDescriptionIsSet(true); @@ -864,7 +1407,23 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // RESOURCE_SIZE + case 6: // OWNER_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.ownerName = iprot.readString(); + struct.setOwnerNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // DATA_RESOURCE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dataResourceType = org.apache.airavata.model.data.resource.DataResourceType.findByValue(iprot.readI32()); + struct.setDataResourceTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // RESOURCE_SIZE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.resourceSize = iprot.readI32(); struct.setResourceSizeIsSet(true); @@ -872,7 +1431,7 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // CREATION_TIME + case 9: // CREATION_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.creationTime = iprot.readI64(); struct.setCreationTimeIsSet(true); @@ -880,7 +1439,7 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 6: // LAST_MODIFIED_TIME + case 10: // LAST_MODIFIED_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.lastModifiedTime = iprot.readI64(); struct.setLastModifiedTimeIsSet(true); @@ -888,17 +1447,37 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 7: // REPLICA_LOCATIONS + case 11: // RESOURCE_METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); + struct.resourceMetadata = new HashMap<String,String>(2*_map0.size); + String _key1; + String _val2; + for (int _i3 = 0; _i3 < _map0.size; ++_i3) + { + _key1 = iprot.readString(); + _val2 = iprot.readString(); + struct.resourceMetadata.put(_key1, _val2); + } + iprot.readMapEnd(); + } + struct.setResourceMetadataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // REPLICA_LOCATIONS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.replicaLocations = new ArrayList<DataReplicaLocationModel>(_list0.size); - DataReplicaLocationModel _elem1; - for (int _i2 = 0; _i2 < _list0.size; ++_i2) + org.apache.thrift.protocol.TList _list4 = iprot.readListBegin(); + struct.replicaLocations = new ArrayList<DataReplicaLocationModel>(_list4.size); + DataReplicaLocationModel _elem5; + for (int _i6 = 0; _i6 < _list4.size; ++_i6) { - _elem1 = new DataReplicaLocationModel(); - _elem1.read(iprot); - struct.replicaLocations.add(_elem1); + _elem5 = new DataReplicaLocationModel(); + _elem5.read(iprot); + struct.replicaLocations.add(_elem5); } iprot.readListEnd(); } @@ -907,6 +1486,25 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 13: // CHILD_RESOURCES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7 = iprot.readListBegin(); + struct.childResources = new ArrayList<DataResourceModel>(_list7.size); + DataResourceModel _elem8; + for (int _i9 = 0; _i9 < _list7.size; ++_i9) + { + _elem8 = new DataResourceModel(); + _elem8.read(iprot); + struct.childResources.add(_elem8); + } + iprot.readListEnd(); + } + struct.setChildResourcesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -927,6 +1525,20 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo oprot.writeFieldEnd(); } } + if (struct.gatewayId != null) { + if (struct.isSetGatewayId()) { + oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC); + oprot.writeString(struct.gatewayId); + oprot.writeFieldEnd(); + } + } + if (struct.parentResourceId != null) { + if (struct.isSetParentResourceId()) { + oprot.writeFieldBegin(PARENT_RESOURCE_ID_FIELD_DESC); + oprot.writeString(struct.parentResourceId); + oprot.writeFieldEnd(); + } + } if (struct.resourceName != null) { if (struct.isSetResourceName()) { oprot.writeFieldBegin(RESOURCE_NAME_FIELD_DESC); @@ -941,6 +1553,20 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo oprot.writeFieldEnd(); } } + if (struct.ownerName != null) { + if (struct.isSetOwnerName()) { + oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC); + oprot.writeString(struct.ownerName); + oprot.writeFieldEnd(); + } + } + if (struct.dataResourceType != null) { + if (struct.isSetDataResourceType()) { + oprot.writeFieldBegin(DATA_RESOURCE_TYPE_FIELD_DESC); + oprot.writeI32(struct.dataResourceType.getValue()); + oprot.writeFieldEnd(); + } + } if (struct.isSetResourceSize()) { oprot.writeFieldBegin(RESOURCE_SIZE_FIELD_DESC); oprot.writeI32(struct.resourceSize); @@ -956,17 +1582,48 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo oprot.writeI64(struct.lastModifiedTime); oprot.writeFieldEnd(); } + if (struct.resourceMetadata != null) { + if (struct.isSetResourceMetadata()) { + oprot.writeFieldBegin(RESOURCE_METADATA_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.resourceMetadata.size())); + for (Map.Entry<String, String> _iter10 : struct.resourceMetadata.entrySet()) + { + oprot.writeString(_iter10.getKey()); + oprot.writeString(_iter10.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } if (struct.replicaLocations != null) { - oprot.writeFieldBegin(REPLICA_LOCATIONS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.replicaLocations.size())); - for (DataReplicaLocationModel _iter3 : struct.replicaLocations) + if (struct.isSetReplicaLocations()) { + oprot.writeFieldBegin(REPLICA_LOCATIONS_FIELD_DESC); { - _iter3.write(oprot); + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.replicaLocations.size())); + for (DataReplicaLocationModel _iter11 : struct.replicaLocations) + { + _iter11.write(oprot); + } + oprot.writeListEnd(); } - oprot.writeListEnd(); + oprot.writeFieldEnd(); + } + } + if (struct.childResources != null) { + if (struct.isSetChildResources()) { + oprot.writeFieldBegin(CHILD_RESOURCES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.childResources.size())); + for (DataResourceModel _iter12 : struct.childResources) + { + _iter12.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); } - oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); @@ -989,34 +1646,64 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo if (struct.isSetResourceId()) { optionals.set(0); } - if (struct.isSetResourceName()) { + if (struct.isSetGatewayId()) { optionals.set(1); } - if (struct.isSetResourceDescription()) { + if (struct.isSetParentResourceId()) { optionals.set(2); } - if (struct.isSetResourceSize()) { + if (struct.isSetResourceName()) { optionals.set(3); } - if (struct.isSetCreationTime()) { + if (struct.isSetResourceDescription()) { optionals.set(4); } - if (struct.isSetLastModifiedTime()) { + if (struct.isSetOwnerName()) { optionals.set(5); } - if (struct.isSetReplicaLocations()) { + if (struct.isSetDataResourceType()) { optionals.set(6); } - oprot.writeBitSet(optionals, 7); + if (struct.isSetResourceSize()) { + optionals.set(7); + } + if (struct.isSetCreationTime()) { + optionals.set(8); + } + if (struct.isSetLastModifiedTime()) { + optionals.set(9); + } + if (struct.isSetResourceMetadata()) { + optionals.set(10); + } + if (struct.isSetReplicaLocations()) { + optionals.set(11); + } + if (struct.isSetChildResources()) { + optionals.set(12); + } + oprot.writeBitSet(optionals, 13); if (struct.isSetResourceId()) { oprot.writeString(struct.resourceId); } + if (struct.isSetGatewayId()) { + oprot.writeString(struct.gatewayId); + } + if (struct.isSetParentResourceId()) { + oprot.writeString(struct.parentResourceId); + } if (struct.isSetResourceName()) { oprot.writeString(struct.resourceName); } if (struct.isSetResourceDescription()) { oprot.writeString(struct.resourceDescription); } + if (struct.isSetOwnerName()) { + oprot.writeString(struct.ownerName); + } + if (struct.isSetDataResourceType()) { + oprot.writeI32(struct.dataResourceType.getValue()); + } if (struct.isSetResourceSize()) { oprot.writeI32(struct.resourceSize); } @@ -1026,12 +1713,31 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo if (struct.isSetLastModifiedTime()) { oprot.writeI64(struct.lastModifiedTime); } + if (struct.isSetResourceMetadata()) { + { + oprot.writeI32(struct.resourceMetadata.size()); + for (Map.Entry<String, String> _iter13 : struct.resourceMetadata.entrySet()) + { + oprot.writeString(_iter13.getKey()); + oprot.writeString(_iter13.getValue()); + } + } + } if (struct.isSetReplicaLocations()) { { oprot.writeI32(struct.replicaLocations.size()); - for (DataReplicaLocationModel _iter4 : struct.replicaLocations) + for (DataReplicaLocationModel _iter14 : struct.replicaLocations) { - _iter4.write(oprot); + _iter14.write(oprot); + } + } + } + if (struct.isSetChildResources()) { + { + oprot.writeI32(struct.childResources.size()); + for (DataResourceModel _iter15 : struct.childResources) + { + _iter15.write(oprot); } } } @@ -1040,45 +1746,90 @@ public class DataResourceModel implements org.apache.thrift.TBase<DataResourceMo @Override public void read(org.apache.thrift.protocol.TProtocol prot, DataResourceModel struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); + BitSet incoming = iprot.readBitSet(13); if (incoming.get(0)) { struct.resourceId = iprot.readString(); struct.setResourceIdIsSet(true); } if (incoming.get(1)) { + struct.gatewayId = iprot.readString(); + struct.setGatewayIdIsSet(true); + } + if (incoming.get(2)) { + struct.parentResourceId = iprot.readString(); + struct.setParentResourceIdIsSet(true); + } + if (incoming.get(3)) { struct.resourceName = iprot.readString(); struct.setResourceNameIsSet(true); } - if (incoming.get(2)) { + if (incoming.get(4)) { struct.resourceDescription = iprot.readString(); struct.setResourceDescriptionIsSet(true); } - if (incoming.get(3)) { + if (incoming.get(5)) { + struct.ownerName = iprot.readString(); + struct.setOwnerNameIsSet(true); + } + if (incoming.get(6)) { + struct.dataResourceType = org.apache.airavata.model.data.resource.DataResourceType.findByValue(iprot.readI32()); + struct.setDataResourceTypeIsSet(true); + } + if (incoming.get(7)) { struct.resourceSize = iprot.readI32(); struct.setResourceSizeIsSet(true); } - if (incoming.get(4)) { + if (incoming.get(8)) { struct.creationTime = iprot.readI64(); struct.setCreationTimeIsSet(true); } - if (incoming.get(5)) { + if (incoming.get(9)) { struct.lastModifiedTime = iprot.readI64(); struct.setLastModifiedTimeIsSet(true); } - if (incoming.get(6)) { + if (incoming.get(10)) { + { + org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.resourceMetadata = new HashMap<String,String>(2*_map16.size); + String _key17; + String _val18; + for (int _i19 = 0; _i19 < _map16.size; ++_i19) + { + _key17 = iprot.readString(); + _val18 = iprot.readString(); + struct.resourceMetadata.put(_key17, _val18); + } + } + struct.setResourceMetadataIsSet(true); + } + if (incoming.get(11)) { { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.replicaLocations = new ArrayList<DataReplicaLocationModel>(_list5.size); - DataReplicaLocationModel _elem6; - for (int _i7 = 0; _i7 < _list5.size; ++_i7) + org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.replicaLocations = new ArrayList<DataReplicaLocationModel>(_list20.size); + DataReplicaLocationModel _elem21; + for (int _i22 = 0; _i22 < _list20.size; ++_i22) { - _elem6 = new DataReplicaLocationModel(); - _elem6.read(iprot); - struct.replicaLocations.add(_elem6); + _elem21 = new DataReplicaLocationModel(); + _elem21.read(iprot); + struct.replicaLocations.add(_elem21); } } struct.setReplicaLocationsIsSet(true); } + if (incoming.get(12)) { + { + org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.childResources = new ArrayList<DataResourceModel>(_list23.size); + DataResourceModel _elem24; + for (int _i25 = 0; _i25 < _list23.size; ++_i25) + { + _elem24 = new DataResourceModel(); + _elem24.read(iprot); + struct.childResources.add(_elem24); + } + } + struct.setChildResourcesIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceType.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceType.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceType.java new file mode 100644 index 0000000..09d3656 --- /dev/null +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/resource/DataResourceType.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.airavata.model.data.resource; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum DataResourceType implements org.apache.thrift.TEnum { + COLLECTION(0), + FILE(1); + + private final int value; + + private DataResourceType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static DataResourceType findByValue(int value) { + switch (value) { + case 0: + return COLLECTION; + case 1: + return FILE; + default: + return null; + } + } +} http://git-wip-us.apache.org/repos/asf/airavata/blob/81b54855/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java index ef34be2..5437717 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SCPDataStageTask.java @@ -164,17 +164,6 @@ public class SCPDataStageTask implements Task { inputPath = storagePreference.getFileSystemRootLocation(); } - StorageResourceDescription storageResource = taskContext.getParentProcessContext().getStorageResource(); - StoragePreference storagePreference = taskContext.getParentProcessContext().getStoragePreference(); - if (storageResource != null){ - hostName = storageResource.getHostName(); - } - - if (storagePreference != null){ - userName = storagePreference.getLoginUserName(); - inputPath = storagePreference.getFileSystemRootLocation(); - } - ServerInfo serverInfo = new ServerInfo(userName, hostName, DEFAULT_SSH_PORT); Session sshSession = Factory.getSSHSession(authenticationInfo, serverInfo); if (processState == ProcessState.INPUT_DATA_STAGING) {
