Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 161DC18F8A for ; Tue, 22 Mar 2016 16:37:17 +0000 (UTC) Received: (qmail 228 invoked by uid 500); 22 Mar 2016 16:37:16 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 99933 invoked by uid 500); 22 Mar 2016 16:37:16 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 99594 invoked by uid 99); 22 Mar 2016 16:37:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2016 16:37:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 54FCAE03C7; Tue, 22 Mar 2016 16:37:16 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: scnakandala@apache.org To: commits@airavata.apache.org Date: Tue, 22 Mar 2016 16:37:22 -0000 Message-Id: <0a2d7ea062a74e2c8e0eb10090b85723@git.apache.org> In-Reply-To: <9fbaefd596b34b6da7266a49bd9d64ab@git.apache.org> References: <9fbaefd596b34b6da7266a49bd9d64ab@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/16] airavata git commit: refactoring the datacatalog code http://git-wip-us.apache.org/repos/asf/airavata/blob/a963d3f0/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductModel.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductModel.java new file mode 100644 index 0000000..c16e639 --- /dev/null +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductModel.java @@ -0,0 +1,1837 @@ +/** + * 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.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.airavata.model.data.product; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-03-22") +public class DataProductModel implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DataProductModel"); + + private static final org.apache.thrift.protocol.TField PRODUCT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("productId", org.apache.thrift.protocol.TType.STRING, (short)1); + 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_PRODUCT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentProductId", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("productName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField PRODUCT_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("productDescription", 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_PRODUCT_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataProductType", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField PRODUCT_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("productSize", 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 PRODUCT_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("productMetadata", 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_PRODUCTS_FIELD_DESC = new org.apache.thrift.protocol.TField("childProducts", org.apache.thrift.protocol.TType.LIST, (short)13); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DataProductModelStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DataProductModelTupleSchemeFactory()); + } + + private String productId; // optional + private String gatewayId; // optional + private String parentProductId; // optional + private String productName; // optional + private String productDescription; // optional + private String ownerName; // optional + private DataProductType dataProductType; // optional + private int productSize; // optional + private long creationTime; // optional + private long lastModifiedTime; // optional + private Map productMetadata; // optional + private List replicaLocations; // optional + private List childProducts; // 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 { + PRODUCT_ID((short)1, "productId"), + GATEWAY_ID((short)2, "gatewayId"), + PARENT_PRODUCT_ID((short)3, "parentProductId"), + PRODUCT_NAME((short)4, "productName"), + PRODUCT_DESCRIPTION((short)5, "productDescription"), + OWNER_NAME((short)6, "ownerName"), + /** + * + * @see DataProductType + */ + DATA_PRODUCT_TYPE((short)7, "dataProductType"), + PRODUCT_SIZE((short)8, "productSize"), + CREATION_TIME((short)9, "creationTime"), + LAST_MODIFIED_TIME((short)10, "lastModifiedTime"), + PRODUCT_METADATA((short)11, "productMetadata"), + REPLICA_LOCATIONS((short)12, "replicaLocations"), + CHILD_PRODUCTS((short)13, "childProducts"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PRODUCT_ID + return PRODUCT_ID; + case 2: // GATEWAY_ID + return GATEWAY_ID; + case 3: // PARENT_PRODUCT_ID + return PARENT_PRODUCT_ID; + case 4: // PRODUCT_NAME + return PRODUCT_NAME; + case 5: // PRODUCT_DESCRIPTION + return PRODUCT_DESCRIPTION; + case 6: // OWNER_NAME + return OWNER_NAME; + case 7: // DATA_PRODUCT_TYPE + return DATA_PRODUCT_TYPE; + case 8: // PRODUCT_SIZE + return PRODUCT_SIZE; + case 9: // CREATION_TIME + return CREATION_TIME; + case 10: // LAST_MODIFIED_TIME + return LAST_MODIFIED_TIME; + case 11: // PRODUCT_METADATA + return PRODUCT_METADATA; + case 12: // REPLICA_LOCATIONS + return REPLICA_LOCATIONS; + case 13: // CHILD_PRODUCTS + return CHILD_PRODUCTS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __PRODUCTSIZE_ISSET_ID = 0; + 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.PRODUCT_ID,_Fields.GATEWAY_ID,_Fields.PARENT_PRODUCT_ID,_Fields.PRODUCT_NAME,_Fields.PRODUCT_DESCRIPTION,_Fields.OWNER_NAME,_Fields.DATA_PRODUCT_TYPE,_Fields.PRODUCT_SIZE,_Fields.CREATION_TIME,_Fields.LAST_MODIFIED_TIME,_Fields.PRODUCT_METADATA,_Fields.REPLICA_LOCATIONS,_Fields.CHILD_PRODUCTS}; + 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.PRODUCT_ID, new org.apache.thrift.meta_data.FieldMetaData("productId", 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_PRODUCT_ID, new org.apache.thrift.meta_data.FieldMetaData("parentProductId", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PRODUCT_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("productDescription", 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_PRODUCT_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataProductType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DataProductType.class))); + tmpMap.put(_Fields.PRODUCT_SIZE, new org.apache.thrift.meta_data.FieldMetaData("productSize", 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.PRODUCT_METADATA, new org.apache.thrift.meta_data.FieldMetaData("productMetadata", 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_PRODUCTS, new org.apache.thrift.meta_data.FieldMetaData("childProducts", 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 , "DataProductModel")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DataProductModel.class, metaDataMap); + } + + public DataProductModel() { + } + + /** + * Performs a deep copy on other. + */ + public DataProductModel(DataProductModel other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetProductId()) { + this.productId = other.productId; + } + if (other.isSetGatewayId()) { + this.gatewayId = other.gatewayId; + } + if (other.isSetParentProductId()) { + this.parentProductId = other.parentProductId; + } + if (other.isSetProductName()) { + this.productName = other.productName; + } + if (other.isSetProductDescription()) { + this.productDescription = other.productDescription; + } + if (other.isSetOwnerName()) { + this.ownerName = other.ownerName; + } + if (other.isSetDataProductType()) { + this.dataProductType = other.dataProductType; + } + this.productSize = other.productSize; + this.creationTime = other.creationTime; + this.lastModifiedTime = other.lastModifiedTime; + if (other.isSetProductMetadata()) { + Map __this__productMetadata = new HashMap(other.productMetadata); + this.productMetadata = __this__productMetadata; + } + if (other.isSetReplicaLocations()) { + List __this__replicaLocations = new ArrayList(other.replicaLocations.size()); + for (DataReplicaLocationModel other_element : other.replicaLocations) { + __this__replicaLocations.add(other_element); + } + this.replicaLocations = __this__replicaLocations; + } + if (other.isSetChildProducts()) { + List __this__childProducts = new ArrayList(other.childProducts.size()); + for (DataProductModel other_element : other.childProducts) { + __this__childProducts.add(other_element); + } + this.childProducts = __this__childProducts; + } + } + + public DataProductModel deepCopy() { + return new DataProductModel(this); + } + + @Override + public void clear() { + this.productId = null; + this.gatewayId = null; + this.parentProductId = null; + this.productName = null; + this.productDescription = null; + this.ownerName = null; + this.dataProductType = null; + setProductSizeIsSet(false); + this.productSize = 0; + setCreationTimeIsSet(false); + this.creationTime = 0; + setLastModifiedTimeIsSet(false); + this.lastModifiedTime = 0; + this.productMetadata = null; + this.replicaLocations = null; + this.childProducts = null; + } + + public String getProductId() { + return this.productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public void unsetProductId() { + this.productId = null; + } + + /** Returns true if field productId is set (has been assigned a value) and false otherwise */ + public boolean isSetProductId() { + return this.productId != null; + } + + public void setProductIdIsSet(boolean value) { + if (!value) { + this.productId = null; + } + } + + 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 getParentProductId() { + return this.parentProductId; + } + + public void setParentProductId(String parentProductId) { + this.parentProductId = parentProductId; + } + + public void unsetParentProductId() { + this.parentProductId = null; + } + + /** Returns true if field parentProductId is set (has been assigned a value) and false otherwise */ + public boolean isSetParentProductId() { + return this.parentProductId != null; + } + + public void setParentProductIdIsSet(boolean value) { + if (!value) { + this.parentProductId = null; + } + } + + public String getProductName() { + return this.productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public void unsetProductName() { + this.productName = null; + } + + /** Returns true if field productName is set (has been assigned a value) and false otherwise */ + public boolean isSetProductName() { + return this.productName != null; + } + + public void setProductNameIsSet(boolean value) { + if (!value) { + this.productName = null; + } + } + + public String getProductDescription() { + return this.productDescription; + } + + public void setProductDescription(String productDescription) { + this.productDescription = productDescription; + } + + public void unsetProductDescription() { + this.productDescription = null; + } + + /** Returns true if field productDescription is set (has been assigned a value) and false otherwise */ + public boolean isSetProductDescription() { + return this.productDescription != null; + } + + public void setProductDescriptionIsSet(boolean value) { + if (!value) { + this.productDescription = null; + } + } + + 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 DataProductType + */ + public DataProductType getDataProductType() { + return this.dataProductType; + } + + /** + * + * @see DataProductType + */ + public void setDataProductType(DataProductType dataProductType) { + this.dataProductType = dataProductType; + } + + public void unsetDataProductType() { + this.dataProductType = null; + } + + /** Returns true if field dataProductType is set (has been assigned a value) and false otherwise */ + public boolean isSetDataProductType() { + return this.dataProductType != null; + } + + public void setDataProductTypeIsSet(boolean value) { + if (!value) { + this.dataProductType = null; + } + } + + public int getProductSize() { + return this.productSize; + } + + public void setProductSize(int productSize) { + this.productSize = productSize; + setProductSizeIsSet(true); + } + + public void unsetProductSize() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PRODUCTSIZE_ISSET_ID); + } + + /** Returns true if field productSize is set (has been assigned a value) and false otherwise */ + public boolean isSetProductSize() { + return EncodingUtils.testBit(__isset_bitfield, __PRODUCTSIZE_ISSET_ID); + } + + public void setProductSizeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PRODUCTSIZE_ISSET_ID, value); + } + + public long getCreationTime() { + return this.creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + setCreationTimeIsSet(true); + } + + public void unsetCreationTime() { + __isset_bitfield = 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 EncodingUtils.testBit(__isset_bitfield, __CREATIONTIME_ISSET_ID); + } + + public void setCreationTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATIONTIME_ISSET_ID, value); + } + + public long getLastModifiedTime() { + return this.lastModifiedTime; + } + + public void setLastModifiedTime(long lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + setLastModifiedTimeIsSet(true); + } + + public void unsetLastModifiedTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTMODIFIEDTIME_ISSET_ID); + } + + /** Returns true if field lastModifiedTime is set (has been assigned a value) and false otherwise */ + public boolean isSetLastModifiedTime() { + return EncodingUtils.testBit(__isset_bitfield, __LASTMODIFIEDTIME_ISSET_ID); + } + + public void setLastModifiedTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTMODIFIEDTIME_ISSET_ID, value); + } + + public int getProductMetadataSize() { + return (this.productMetadata == null) ? 0 : this.productMetadata.size(); + } + + public void putToProductMetadata(String key, String val) { + if (this.productMetadata == null) { + this.productMetadata = new HashMap(); + } + this.productMetadata.put(key, val); + } + + public Map getProductMetadata() { + return this.productMetadata; + } + + public void setProductMetadata(Map productMetadata) { + this.productMetadata = productMetadata; + } + + public void unsetProductMetadata() { + this.productMetadata = null; + } + + /** Returns true if field productMetadata is set (has been assigned a value) and false otherwise */ + public boolean isSetProductMetadata() { + return this.productMetadata != null; + } + + public void setProductMetadataIsSet(boolean value) { + if (!value) { + this.productMetadata = null; + } + } + + public int getReplicaLocationsSize() { + return (this.replicaLocations == null) ? 0 : this.replicaLocations.size(); + } + + public java.util.Iterator getReplicaLocationsIterator() { + return (this.replicaLocations == null) ? null : this.replicaLocations.iterator(); + } + + public void addToReplicaLocations(DataReplicaLocationModel elem) { + if (this.replicaLocations == null) { + this.replicaLocations = new ArrayList(); + } + this.replicaLocations.add(elem); + } + + public List getReplicaLocations() { + return this.replicaLocations; + } + + public void setReplicaLocations(List replicaLocations) { + this.replicaLocations = replicaLocations; + } + + public void unsetReplicaLocations() { + this.replicaLocations = null; + } + + /** Returns true if field replicaLocations is set (has been assigned a value) and false otherwise */ + public boolean isSetReplicaLocations() { + return this.replicaLocations != null; + } + + public void setReplicaLocationsIsSet(boolean value) { + if (!value) { + this.replicaLocations = null; + } + } + + public int getChildProductsSize() { + return (this.childProducts == null) ? 0 : this.childProducts.size(); + } + + public java.util.Iterator getChildProductsIterator() { + return (this.childProducts == null) ? null : this.childProducts.iterator(); + } + + public void addToChildProducts(DataProductModel elem) { + if (this.childProducts == null) { + this.childProducts = new ArrayList(); + } + this.childProducts.add(elem); + } + + public List getChildProducts() { + return this.childProducts; + } + + public void setChildProducts(List childProducts) { + this.childProducts = childProducts; + } + + public void unsetChildProducts() { + this.childProducts = null; + } + + /** Returns true if field childProducts is set (has been assigned a value) and false otherwise */ + public boolean isSetChildProducts() { + return this.childProducts != null; + } + + public void setChildProductsIsSet(boolean value) { + if (!value) { + this.childProducts = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PRODUCT_ID: + if (value == null) { + unsetProductId(); + } else { + setProductId((String)value); + } + break; + + case GATEWAY_ID: + if (value == null) { + unsetGatewayId(); + } else { + setGatewayId((String)value); + } + break; + + case PARENT_PRODUCT_ID: + if (value == null) { + unsetParentProductId(); + } else { + setParentProductId((String)value); + } + break; + + case PRODUCT_NAME: + if (value == null) { + unsetProductName(); + } else { + setProductName((String)value); + } + break; + + case PRODUCT_DESCRIPTION: + if (value == null) { + unsetProductDescription(); + } else { + setProductDescription((String)value); + } + break; + + case OWNER_NAME: + if (value == null) { + unsetOwnerName(); + } else { + setOwnerName((String)value); + } + break; + + case DATA_PRODUCT_TYPE: + if (value == null) { + unsetDataProductType(); + } else { + setDataProductType((DataProductType)value); + } + break; + + case PRODUCT_SIZE: + if (value == null) { + unsetProductSize(); + } else { + setProductSize((Integer)value); + } + break; + + case CREATION_TIME: + if (value == null) { + unsetCreationTime(); + } else { + setCreationTime((Long)value); + } + break; + + case LAST_MODIFIED_TIME: + if (value == null) { + unsetLastModifiedTime(); + } else { + setLastModifiedTime((Long)value); + } + break; + + case PRODUCT_METADATA: + if (value == null) { + unsetProductMetadata(); + } else { + setProductMetadata((Map)value); + } + break; + + case REPLICA_LOCATIONS: + if (value == null) { + unsetReplicaLocations(); + } else { + setReplicaLocations((List)value); + } + break; + + case CHILD_PRODUCTS: + if (value == null) { + unsetChildProducts(); + } else { + setChildProducts((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PRODUCT_ID: + return getProductId(); + + case GATEWAY_ID: + return getGatewayId(); + + case PARENT_PRODUCT_ID: + return getParentProductId(); + + case PRODUCT_NAME: + return getProductName(); + + case PRODUCT_DESCRIPTION: + return getProductDescription(); + + case OWNER_NAME: + return getOwnerName(); + + case DATA_PRODUCT_TYPE: + return getDataProductType(); + + case PRODUCT_SIZE: + return getProductSize(); + + case CREATION_TIME: + return getCreationTime(); + + case LAST_MODIFIED_TIME: + return getLastModifiedTime(); + + case PRODUCT_METADATA: + return getProductMetadata(); + + case REPLICA_LOCATIONS: + return getReplicaLocations(); + + case CHILD_PRODUCTS: + return getChildProducts(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case PRODUCT_ID: + return isSetProductId(); + case GATEWAY_ID: + return isSetGatewayId(); + case PARENT_PRODUCT_ID: + return isSetParentProductId(); + case PRODUCT_NAME: + return isSetProductName(); + case PRODUCT_DESCRIPTION: + return isSetProductDescription(); + case OWNER_NAME: + return isSetOwnerName(); + case DATA_PRODUCT_TYPE: + return isSetDataProductType(); + case PRODUCT_SIZE: + return isSetProductSize(); + case CREATION_TIME: + return isSetCreationTime(); + case LAST_MODIFIED_TIME: + return isSetLastModifiedTime(); + case PRODUCT_METADATA: + return isSetProductMetadata(); + case REPLICA_LOCATIONS: + return isSetReplicaLocations(); + case CHILD_PRODUCTS: + return isSetChildProducts(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DataProductModel) + return this.equals((DataProductModel)that); + return false; + } + + public boolean equals(DataProductModel that) { + if (that == null) + return false; + + boolean this_present_productId = true && this.isSetProductId(); + boolean that_present_productId = true && that.isSetProductId(); + if (this_present_productId || that_present_productId) { + if (!(this_present_productId && that_present_productId)) + return false; + if (!this.productId.equals(that.productId)) + 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_parentProductId = true && this.isSetParentProductId(); + boolean that_present_parentProductId = true && that.isSetParentProductId(); + if (this_present_parentProductId || that_present_parentProductId) { + if (!(this_present_parentProductId && that_present_parentProductId)) + return false; + if (!this.parentProductId.equals(that.parentProductId)) + return false; + } + + boolean this_present_productName = true && this.isSetProductName(); + boolean that_present_productName = true && that.isSetProductName(); + if (this_present_productName || that_present_productName) { + if (!(this_present_productName && that_present_productName)) + return false; + if (!this.productName.equals(that.productName)) + return false; + } + + boolean this_present_productDescription = true && this.isSetProductDescription(); + boolean that_present_productDescription = true && that.isSetProductDescription(); + if (this_present_productDescription || that_present_productDescription) { + if (!(this_present_productDescription && that_present_productDescription)) + return false; + if (!this.productDescription.equals(that.productDescription)) + 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_dataProductType = true && this.isSetDataProductType(); + boolean that_present_dataProductType = true && that.isSetDataProductType(); + if (this_present_dataProductType || that_present_dataProductType) { + if (!(this_present_dataProductType && that_present_dataProductType)) + return false; + if (!this.dataProductType.equals(that.dataProductType)) + return false; + } + + boolean this_present_productSize = true && this.isSetProductSize(); + boolean that_present_productSize = true && that.isSetProductSize(); + if (this_present_productSize || that_present_productSize) { + if (!(this_present_productSize && that_present_productSize)) + return false; + if (this.productSize != that.productSize) + 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_lastModifiedTime = true && this.isSetLastModifiedTime(); + boolean that_present_lastModifiedTime = true && that.isSetLastModifiedTime(); + if (this_present_lastModifiedTime || that_present_lastModifiedTime) { + if (!(this_present_lastModifiedTime && that_present_lastModifiedTime)) + return false; + if (this.lastModifiedTime != that.lastModifiedTime) + return false; + } + + boolean this_present_productMetadata = true && this.isSetProductMetadata(); + boolean that_present_productMetadata = true && that.isSetProductMetadata(); + if (this_present_productMetadata || that_present_productMetadata) { + if (!(this_present_productMetadata && that_present_productMetadata)) + return false; + if (!this.productMetadata.equals(that.productMetadata)) + return false; + } + + boolean this_present_replicaLocations = true && this.isSetReplicaLocations(); + boolean that_present_replicaLocations = true && that.isSetReplicaLocations(); + if (this_present_replicaLocations || that_present_replicaLocations) { + if (!(this_present_replicaLocations && that_present_replicaLocations)) + return false; + if (!this.replicaLocations.equals(that.replicaLocations)) + return false; + } + + boolean this_present_childProducts = true && this.isSetChildProducts(); + boolean that_present_childProducts = true && that.isSetChildProducts(); + if (this_present_childProducts || that_present_childProducts) { + if (!(this_present_childProducts && that_present_childProducts)) + return false; + if (!this.childProducts.equals(that.childProducts)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_productId = true && (isSetProductId()); + list.add(present_productId); + if (present_productId) + list.add(productId); + + boolean present_gatewayId = true && (isSetGatewayId()); + list.add(present_gatewayId); + if (present_gatewayId) + list.add(gatewayId); + + boolean present_parentProductId = true && (isSetParentProductId()); + list.add(present_parentProductId); + if (present_parentProductId) + list.add(parentProductId); + + boolean present_productName = true && (isSetProductName()); + list.add(present_productName); + if (present_productName) + list.add(productName); + + boolean present_productDescription = true && (isSetProductDescription()); + list.add(present_productDescription); + if (present_productDescription) + list.add(productDescription); + + boolean present_ownerName = true && (isSetOwnerName()); + list.add(present_ownerName); + if (present_ownerName) + list.add(ownerName); + + boolean present_dataProductType = true && (isSetDataProductType()); + list.add(present_dataProductType); + if (present_dataProductType) + list.add(dataProductType.getValue()); + + boolean present_productSize = true && (isSetProductSize()); + list.add(present_productSize); + if (present_productSize) + list.add(productSize); + + boolean present_creationTime = true && (isSetCreationTime()); + list.add(present_creationTime); + if (present_creationTime) + list.add(creationTime); + + boolean present_lastModifiedTime = true && (isSetLastModifiedTime()); + list.add(present_lastModifiedTime); + if (present_lastModifiedTime) + list.add(lastModifiedTime); + + boolean present_productMetadata = true && (isSetProductMetadata()); + list.add(present_productMetadata); + if (present_productMetadata) + list.add(productMetadata); + + boolean present_replicaLocations = true && (isSetReplicaLocations()); + list.add(present_replicaLocations); + if (present_replicaLocations) + list.add(replicaLocations); + + boolean present_childProducts = true && (isSetChildProducts()); + list.add(present_childProducts); + if (present_childProducts) + list.add(childProducts); + + return list.hashCode(); + } + + @Override + public int compareTo(DataProductModel other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetProductId()).compareTo(other.isSetProductId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProductId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productId, other.productId); + if (lastComparison != 0) { + 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(isSetParentProductId()).compareTo(other.isSetParentProductId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentProductId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentProductId, other.parentProductId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProductName()).compareTo(other.isSetProductName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProductName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productName, other.productName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProductDescription()).compareTo(other.isSetProductDescription()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProductDescription()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productDescription, other.productDescription); + if (lastComparison != 0) { + 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(isSetDataProductType()).compareTo(other.isSetDataProductType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDataProductType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataProductType, other.dataProductType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProductSize()).compareTo(other.isSetProductSize()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProductSize()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productSize, other.productSize); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = 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 = Boolean.valueOf(isSetLastModifiedTime()).compareTo(other.isSetLastModifiedTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastModifiedTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastModifiedTime, other.lastModifiedTime); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProductMetadata()).compareTo(other.isSetProductMetadata()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProductMetadata()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productMetadata, other.productMetadata); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetReplicaLocations()).compareTo(other.isSetReplicaLocations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReplicaLocations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replicaLocations, other.replicaLocations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetChildProducts()).compareTo(other.isSetChildProducts()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildProducts()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childProducts, other.childProducts); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DataProductModel("); + boolean first = true; + + if (isSetProductId()) { + sb.append("productId:"); + if (this.productId == null) { + sb.append("null"); + } else { + sb.append(this.productId); + } + 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 (isSetParentProductId()) { + if (!first) sb.append(", "); + sb.append("parentProductId:"); + if (this.parentProductId == null) { + sb.append("null"); + } else { + sb.append(this.parentProductId); + } + first = false; + } + if (isSetProductName()) { + if (!first) sb.append(", "); + sb.append("productName:"); + if (this.productName == null) { + sb.append("null"); + } else { + sb.append(this.productName); + } + first = false; + } + if (isSetProductDescription()) { + if (!first) sb.append(", "); + sb.append("productDescription:"); + if (this.productDescription == null) { + sb.append("null"); + } else { + sb.append(this.productDescription); + } + 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 (isSetDataProductType()) { + if (!first) sb.append(", "); + sb.append("dataProductType:"); + if (this.dataProductType == null) { + sb.append("null"); + } else { + sb.append(this.dataProductType); + } + first = false; + } + if (isSetProductSize()) { + if (!first) sb.append(", "); + sb.append("productSize:"); + sb.append(this.productSize); + first = false; + } + if (isSetCreationTime()) { + if (!first) sb.append(", "); + sb.append("creationTime:"); + sb.append(this.creationTime); + first = false; + } + if (isSetLastModifiedTime()) { + if (!first) sb.append(", "); + sb.append("lastModifiedTime:"); + sb.append(this.lastModifiedTime); + first = false; + } + if (isSetProductMetadata()) { + if (!first) sb.append(", "); + sb.append("productMetadata:"); + if (this.productMetadata == null) { + sb.append("null"); + } else { + sb.append(this.productMetadata); + } + 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 (isSetChildProducts()) { + if (!first) sb.append(", "); + sb.append("childProducts:"); + if (this.childProducts == null) { + sb.append("null"); + } else { + sb.append(this.childProducts); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class DataProductModelStandardSchemeFactory implements SchemeFactory { + public DataProductModelStandardScheme getScheme() { + return new DataProductModelStandardScheme(); + } + } + + private static class DataProductModelStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DataProductModel struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PRODUCT_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.productId = iprot.readString(); + struct.setProductIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + 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_PRODUCT_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentProductId = iprot.readString(); + struct.setParentProductIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PRODUCT_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.productName = iprot.readString(); + struct.setProductNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // PRODUCT_DESCRIPTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.productDescription = iprot.readString(); + struct.setProductDescriptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + 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_PRODUCT_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dataProductType = org.apache.airavata.model.data.product.DataProductType.findByValue(iprot.readI32()); + struct.setDataProductTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // PRODUCT_SIZE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.productSize = iprot.readI32(); + struct.setProductSizeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // 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 10: // LAST_MODIFIED_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.lastModifiedTime = iprot.readI64(); + struct.setLastModifiedTimeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // PRODUCT_METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); + struct.productMetadata = new HashMap(2*_map0.size); + String _key1; + String _val2; + for (int _i3 = 0; _i3 < _map0.size; ++_i3) + { + _key1 = iprot.readString(); + _val2 = iprot.readString(); + struct.productMetadata.put(_key1, _val2); + } + iprot.readMapEnd(); + } + struct.setProductMetadataIsSet(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 _list4 = iprot.readListBegin(); + struct.replicaLocations = new ArrayList(_list4.size); + DataReplicaLocationModel _elem5; + for (int _i6 = 0; _i6 < _list4.size; ++_i6) + { + _elem5 = new DataReplicaLocationModel(); + _elem5.read(iprot); + struct.replicaLocations.add(_elem5); + } + iprot.readListEnd(); + } + struct.setReplicaLocationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // CHILD_PRODUCTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7 = iprot.readListBegin(); + struct.childProducts = new ArrayList(_list7.size); + DataProductModel _elem8; + for (int _i9 = 0; _i9 < _list7.size; ++_i9) + { + _elem8 = new DataProductModel(); + _elem8.read(iprot); + struct.childProducts.add(_elem8); + } + iprot.readListEnd(); + } + struct.setChildProductsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, DataProductModel struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.productId != null) { + if (struct.isSetProductId()) { + oprot.writeFieldBegin(PRODUCT_ID_FIELD_DESC); + oprot.writeString(struct.productId); + oprot.writeFieldEnd(); + } + } + if (struct.gatewayId != null) { + if (struct.isSetGatewayId()) { + oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC); + oprot.writeString(struct.gatewayId); + oprot.writeFieldEnd(); + } + } + if (struct.parentProductId != null) { + if (struct.isSetParentProductId()) { + oprot.writeFieldBegin(PARENT_PRODUCT_ID_FIELD_DESC); + oprot.writeString(struct.parentProductId); + oprot.writeFieldEnd(); + } + } + if (struct.productName != null) { + if (struct.isSetProductName()) { + oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC); + oprot.writeString(struct.productName); + oprot.writeFieldEnd(); + } + } + if (struct.productDescription != null) { + if (struct.isSetProductDescription()) { + oprot.writeFieldBegin(PRODUCT_DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.productDescription); + oprot.writeFieldEnd(); + } + } + if (struct.ownerName != null) { + if (struct.isSetOwnerName()) { + oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC); + oprot.writeString(struct.ownerName); + oprot.writeFieldEnd(); + } + } + if (struct.dataProductType != null) { + if (struct.isSetDataProductType()) { + oprot.writeFieldBegin(DATA_PRODUCT_TYPE_FIELD_DESC); + oprot.writeI32(struct.dataProductType.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.isSetProductSize()) { + oprot.writeFieldBegin(PRODUCT_SIZE_FIELD_DESC); + oprot.writeI32(struct.productSize); + oprot.writeFieldEnd(); + } + if (struct.isSetCreationTime()) { + oprot.writeFieldBegin(CREATION_TIME_FIELD_DESC); + oprot.writeI64(struct.creationTime); + oprot.writeFieldEnd(); + } + if (struct.isSetLastModifiedTime()) { + oprot.writeFieldBegin(LAST_MODIFIED_TIME_FIELD_DESC); + oprot.writeI64(struct.lastModifiedTime); + oprot.writeFieldEnd(); + } + if (struct.productMetadata != null) { + if (struct.isSetProductMetadata()) { + oprot.writeFieldBegin(PRODUCT_METADATA_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.productMetadata.size())); + for (Map.Entry _iter10 : struct.productMetadata.entrySet()) + { + oprot.writeString(_iter10.getKey()); + oprot.writeString(_iter10.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.replicaLocations != null) { + if (struct.isSetReplicaLocations()) { + 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 _iter11 : struct.replicaLocations) + { + _iter11.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.childProducts != null) { + if (struct.isSetChildProducts()) { + oprot.writeFieldBegin(CHILD_PRODUCTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.childProducts.size())); + for (DataProductModel _iter12 : struct.childProducts) + { + _iter12.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DataProductModelTupleSchemeFactory implements SchemeFactory { + public DataProductModelTupleScheme getScheme() { + return new DataProductModelTupleScheme(); + } + } + + private static class DataProductModelTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DataProductModel struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetProductId()) { + optionals.set(0); + } + if (struct.isSetGatewayId()) { + optionals.set(1); + } + if (struct.isSetParentProductId()) { + optionals.set(2); + } + if (struct.isSetProductName()) { + optionals.set(3); + } + if (struct.isSetProductDescription()) { + optionals.set(4); + } + if (struct.isSetOwnerName()) { + optionals.set(5); + } + if (struct.isSetDataProductType()) { + optionals.set(6); + } + if (struct.isSetProductSize()) { + optionals.set(7); + } + if (struct.isSetCreationTime()) { + optionals.set(8); + } + if (struct.isSetLastModifiedTime()) { + optionals.set(9); + } + if (struct.isSetProductMetadata()) { + optionals.set(10); + } + if (struct.isSetReplicaLocations()) { + optionals.set(11); + } + if (struct.isSetChildProducts()) { + optionals.set(12); + } + oprot.writeBitSet(optionals, 13); + if (struct.isSetProductId()) { + oprot.writeString(struct.productId); + } + if (struct.isSetGatewayId()) { + oprot.writeString(struct.gatewayId); + } + if (struct.isSetParentProductId()) { + oprot.writeString(struct.parentProductId); + } + if (struct.isSetProductName()) { + oprot.writeString(struct.productName); + } + if (struct.isSetProductDescription()) { + oprot.writeString(struct.productDescription); + } + if (struct.isSetOwnerName()) { + oprot.writeString(struct.ownerName); + } + if (struct.isSetDataProductType()) { + oprot.writeI32(struct.dataProductType.getValue()); + } + if (struct.isSetProductSize()) { + oprot.writeI32(struct.productSize); + } + if (struct.isSetCreationTime()) { + oprot.writeI64(struct.creationTime); + } + if (struct.isSetLastModifiedTime()) { + oprot.writeI64(struct.lastModifiedTime); + } + if (struct.isSetProductMetadata()) { + { + oprot.writeI32(struct.productMetadata.size()); + for (Map.Entry _iter13 : struct.productMetadata.entrySet()) + { + oprot.writeString(_iter13.getKey()); + oprot.writeString(_iter13.getValue()); + } + } + } + if (struct.isSetReplicaLocations()) { + { + oprot.writeI32(struct.replicaLocations.size()); + for (DataReplicaLocationModel _iter14 : struct.replicaLocations) + { + _iter14.write(oprot); + } + } + } + if (struct.isSetChildProducts()) { + { + oprot.writeI32(struct.childProducts.size()); + for (DataProductModel _iter15 : struct.childProducts) + { + _iter15.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, DataProductModel struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(13); + if (incoming.get(0)) { + struct.productId = iprot.readString(); + struct.setProductIdIsSet(true); + } + if (incoming.get(1)) { + struct.gatewayId = iprot.readString(); + struct.setGatewayIdIsSet(true); + } + if (incoming.get(2)) { + struct.parentProductId = iprot.readString(); + struct.setParentProductIdIsSet(true); + } + if (incoming.get(3)) { + struct.productName = iprot.readString(); + struct.setProductNameIsSet(true); + } + if (incoming.get(4)) { + struct.productDescription = iprot.readString(); + struct.setProductDescriptionIsSet(true); + } + if (incoming.get(5)) { + struct.ownerName = iprot.readString(); + struct.setOwnerNameIsSet(true); + } + if (incoming.get(6)) { + struct.dataProductType = org.apache.airavata.model.data.product.DataProductType.findByValue(iprot.readI32()); + struct.setDataProductTypeIsSet(true); + } + if (incoming.get(7)) { + struct.productSize = iprot.readI32(); + struct.setProductSizeIsSet(true); + } + if (incoming.get(8)) { + struct.creationTime = iprot.readI64(); + struct.setCreationTimeIsSet(true); + } + if (incoming.get(9)) { + struct.lastModifiedTime = iprot.readI64(); + struct.setLastModifiedTimeIsSet(true); + } + 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.productMetadata = new HashMap(2*_map16.size); + String _key17; + String _val18; + for (int _i19 = 0; _i19 < _map16.size; ++_i19) + { + _key17 = iprot.readString(); + _val18 = iprot.readString(); + struct.productMetadata.put(_key17, _val18); + } + } + struct.setProductMetadataIsSet(true); + } + if (incoming.get(11)) { + { + org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.replicaLocations = new ArrayList(_list20.size); + DataReplicaLocationModel _elem21; + for (int _i22 = 0; _i22 < _list20.size; ++_i22) + { + _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.childProducts = new ArrayList(_list23.size); + DataProductModel _elem24; + for (int _i25 = 0; _i25 < _list23.size; ++_i25) + { + _elem24 = new DataProductModel(); + _elem24.read(iprot); + struct.childProducts.add(_elem24); + } + } + struct.setChildProductsIsSet(true); + } + } + } + +} + http://git-wip-us.apache.org/repos/asf/airavata/blob/a963d3f0/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductType.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductType.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductType.java new file mode 100644 index 0000000..88fc186 --- /dev/null +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/data/product/DataProductType.java @@ -0,0 +1,65 @@ +/** + * 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.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.airavata.model.data.product; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum DataProductType implements org.apache.thrift.TEnum { + DIR(0), + FILE(1), + COLLECTION(2); + + private final int value; + + private DataProductType(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 DataProductType findByValue(int value) { + switch (value) { + case 0: + return DIR; + case 1: + return FILE; + case 2: + return COLLECTION; + default: + return null; + } + } +}