http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Resource.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Resource.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Resource.java deleted file mode 100644 index 84daf55..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Resource.java +++ /dev/null @@ -1,561 +0,0 @@ -/** - * - * 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.cloud.aurora.client.sdk; - -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"}) -/** - * Describes resource value required to run a task. - */ -public class Resource extends org.apache.thrift.TUnion<Resource, Resource._Fields> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Resource"); - private static final org.apache.thrift.protocol.TField NUM_CPUS_FIELD_DESC = new org.apache.thrift.protocol.TField("numCpus", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - private static final org.apache.thrift.protocol.TField RAM_MB_FIELD_DESC = new org.apache.thrift.protocol.TField("ramMb", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField DISK_MB_FIELD_DESC = new org.apache.thrift.protocol.TField("diskMb", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField NAMED_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("namedPort", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField NUM_GPUS_FIELD_DESC = new org.apache.thrift.protocol.TField("numGpus", org.apache.thrift.protocol.TType.I64, (short)5); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NUM_CPUS((short)1, "numCpus"), - RAM_MB((short)2, "ramMb"), - DISK_MB((short)3, "diskMb"), - NAMED_PORT((short)4, "namedPort"), - NUM_GPUS((short)5, "numGpus"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - 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: // NUM_CPUS - return NUM_CPUS; - case 2: // RAM_MB - return RAM_MB; - case 3: // DISK_MB - return DISK_MB; - case 4: // NAMED_PORT - return NAMED_PORT; - case 5: // NUM_GPUS - return NUM_GPUS; - 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; - } - } - - 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.NUM_CPUS, new org.apache.thrift.meta_data.FieldMetaData("numCpus", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.RAM_MB, new org.apache.thrift.meta_data.FieldMetaData("ramMb", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.DISK_MB, new org.apache.thrift.meta_data.FieldMetaData("diskMb", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.NAMED_PORT, new org.apache.thrift.meta_data.FieldMetaData("namedPort", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NUM_GPUS, new org.apache.thrift.meta_data.FieldMetaData("numGpus", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Resource.class, metaDataMap); - } - - public Resource() { - super(); - } - - public Resource(_Fields setField, Object value) { - super(setField, value); - } - - public Resource(Resource other) { - super(other); - } - public Resource deepCopy() { - return new Resource(this); - } - - public static Resource numCpus(double value) { - Resource x = new Resource(); - x.setNumCpus(value); - return x; - } - - public static Resource ramMb(long value) { - Resource x = new Resource(); - x.setRamMb(value); - return x; - } - - public static Resource diskMb(long value) { - Resource x = new Resource(); - x.setDiskMb(value); - return x; - } - - public static Resource namedPort(String value) { - Resource x = new Resource(); - x.setNamedPort(value); - return x; - } - - public static Resource numGpus(long value) { - Resource x = new Resource(); - x.setNumGpus(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case NUM_CPUS: - if (value instanceof Double) { - break; - } - throw new ClassCastException("Was expecting value of type Double for field 'numCpus', but got " + value.getClass().getSimpleName()); - case RAM_MB: - if (value instanceof Long) { - break; - } - throw new ClassCastException("Was expecting value of type Long for field 'ramMb', but got " + value.getClass().getSimpleName()); - case DISK_MB: - if (value instanceof Long) { - break; - } - throw new ClassCastException("Was expecting value of type Long for field 'diskMb', but got " + value.getClass().getSimpleName()); - case NAMED_PORT: - if (value instanceof String) { - break; - } - throw new ClassCastException("Was expecting value of type String for field 'namedPort', but got " + value.getClass().getSimpleName()); - case NUM_GPUS: - if (value instanceof Long) { - break; - } - throw new ClassCastException("Was expecting value of type Long for field 'numGpus', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case NUM_CPUS: - if (field.type == NUM_CPUS_FIELD_DESC.type) { - Double numCpus; - numCpus = iprot.readDouble(); - return numCpus; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case RAM_MB: - if (field.type == RAM_MB_FIELD_DESC.type) { - Long ramMb; - ramMb = iprot.readI64(); - return ramMb; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DISK_MB: - if (field.type == DISK_MB_FIELD_DESC.type) { - Long diskMb; - diskMb = iprot.readI64(); - return diskMb; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case NAMED_PORT: - if (field.type == NAMED_PORT_FIELD_DESC.type) { - String namedPort; - namedPort = iprot.readString(); - return namedPort; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case NUM_GPUS: - if (field.type == NUM_GPUS_FIELD_DESC.type) { - Long numGpus; - numGpus = iprot.readI64(); - return numGpus; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case NUM_CPUS: - Double numCpus = (Double)value_; - oprot.writeDouble(numCpus); - return; - case RAM_MB: - Long ramMb = (Long)value_; - oprot.writeI64(ramMb); - return; - case DISK_MB: - Long diskMb = (Long)value_; - oprot.writeI64(diskMb); - return; - case NAMED_PORT: - String namedPort = (String)value_; - oprot.writeString(namedPort); - return; - case NUM_GPUS: - Long numGpus = (Long)value_; - oprot.writeI64(numGpus); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case NUM_CPUS: - Double numCpus; - numCpus = iprot.readDouble(); - return numCpus; - case RAM_MB: - Long ramMb; - ramMb = iprot.readI64(); - return ramMb; - case DISK_MB: - Long diskMb; - diskMb = iprot.readI64(); - return diskMb; - case NAMED_PORT: - String namedPort; - namedPort = iprot.readString(); - return namedPort; - case NUM_GPUS: - Long numGpus; - numGpus = iprot.readI64(); - return numGpus; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case NUM_CPUS: - Double numCpus = (Double)value_; - oprot.writeDouble(numCpus); - return; - case RAM_MB: - Long ramMb = (Long)value_; - oprot.writeI64(ramMb); - return; - case DISK_MB: - Long diskMb = (Long)value_; - oprot.writeI64(diskMb); - return; - case NAMED_PORT: - String namedPort = (String)value_; - oprot.writeString(namedPort); - return; - case NUM_GPUS: - Long numGpus = (Long)value_; - oprot.writeI64(numGpus); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case NUM_CPUS: - return NUM_CPUS_FIELD_DESC; - case RAM_MB: - return RAM_MB_FIELD_DESC; - case DISK_MB: - return DISK_MB_FIELD_DESC; - case NAMED_PORT: - return NAMED_PORT_FIELD_DESC; - case NUM_GPUS: - return NUM_GPUS_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public double getNumCpus() { - if (getSetField() == _Fields.NUM_CPUS) { - return (Double)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'numCpus' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setNumCpus(double value) { - setField_ = _Fields.NUM_CPUS; - value_ = value; - } - - public long getRamMb() { - if (getSetField() == _Fields.RAM_MB) { - return (Long)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'ramMb' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setRamMb(long value) { - setField_ = _Fields.RAM_MB; - value_ = value; - } - - public long getDiskMb() { - if (getSetField() == _Fields.DISK_MB) { - return (Long)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'diskMb' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDiskMb(long value) { - setField_ = _Fields.DISK_MB; - value_ = value; - } - - public String getNamedPort() { - if (getSetField() == _Fields.NAMED_PORT) { - return (String)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'namedPort' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setNamedPort(String value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.NAMED_PORT; - value_ = value; - } - - public long getNumGpus() { - if (getSetField() == _Fields.NUM_GPUS) { - return (Long)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'numGpus' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setNumGpus(long value) { - setField_ = _Fields.NUM_GPUS; - value_ = value; - } - - public boolean isSetNumCpus() { - return setField_ == _Fields.NUM_CPUS; - } - - - public boolean isSetRamMb() { - return setField_ == _Fields.RAM_MB; - } - - - public boolean isSetDiskMb() { - return setField_ == _Fields.DISK_MB; - } - - - public boolean isSetNamedPort() { - return setField_ == _Fields.NAMED_PORT; - } - - - public boolean isSetNumGpus() { - return setField_ == _Fields.NUM_GPUS; - } - - - public boolean equals(Object other) { - if (other instanceof Resource) { - return equals((Resource)other); - } else { - return false; - } - } - - public boolean equals(Resource other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(Resource other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - 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 { - 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); - } - } - - -}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResourceAggregate.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResourceAggregate.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResourceAggregate.java deleted file mode 100644 index 765f648..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResourceAggregate.java +++ /dev/null @@ -1,820 +0,0 @@ -/** - * - * 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.cloud.aurora.client.sdk; - -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-10-21") -public class ResourceAggregate implements org.apache.thrift.TBase<ResourceAggregate, ResourceAggregate._Fields>, java.io.Serializable, Cloneable, Comparable<ResourceAggregate> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ResourceAggregate"); - - private static final org.apache.thrift.protocol.TField NUM_CPUS_FIELD_DESC = new org.apache.thrift.protocol.TField("numCpus", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - private static final org.apache.thrift.protocol.TField RAM_MB_FIELD_DESC = new org.apache.thrift.protocol.TField("ramMb", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField DISK_MB_FIELD_DESC = new org.apache.thrift.protocol.TField("diskMb", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField RESOURCES_FIELD_DESC = new org.apache.thrift.protocol.TField("resources", org.apache.thrift.protocol.TType.SET, (short)4); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ResourceAggregateStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ResourceAggregateTupleSchemeFactory()); - } - - /** - * Number of CPU cores allotted. - */ - public double numCpus; // required - /** - * Megabytes of RAM allotted. - */ - public long ramMb; // required - /** - * Megabytes of disk space allotted. - */ - public long diskMb; // required - /** - * Aggregated resource values. - */ - public Set<Resource> resources; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * Number of CPU cores allotted. - */ - NUM_CPUS((short)1, "numCpus"), - /** - * Megabytes of RAM allotted. - */ - RAM_MB((short)2, "ramMb"), - /** - * Megabytes of disk space allotted. - */ - DISK_MB((short)3, "diskMb"), - /** - * Aggregated resource values. - */ - RESOURCES((short)4, "resources"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - 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: // NUM_CPUS - return NUM_CPUS; - case 2: // RAM_MB - return RAM_MB; - case 3: // DISK_MB - return DISK_MB; - case 4: // RESOURCES - return RESOURCES; - 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 __NUMCPUS_ISSET_ID = 0; - private static final int __RAMMB_ISSET_ID = 1; - private static final int __DISKMB_ISSET_ID = 2; - private byte __isset_bitfield = 0; - 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.NUM_CPUS, new org.apache.thrift.meta_data.FieldMetaData("numCpus", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.RAM_MB, new org.apache.thrift.meta_data.FieldMetaData("ramMb", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.DISK_MB, new org.apache.thrift.meta_data.FieldMetaData("diskMb", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.RESOURCES, new org.apache.thrift.meta_data.FieldMetaData("resources", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Resource.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ResourceAggregate.class, metaDataMap); - } - - public ResourceAggregate() { - } - - public ResourceAggregate( - double numCpus, - long ramMb, - long diskMb, - Set<Resource> resources) - { - this(); - this.numCpus = numCpus; - setNumCpusIsSet(true); - this.ramMb = ramMb; - setRamMbIsSet(true); - this.diskMb = diskMb; - setDiskMbIsSet(true); - this.resources = resources; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public ResourceAggregate(ResourceAggregate other) { - __isset_bitfield = other.__isset_bitfield; - this.numCpus = other.numCpus; - this.ramMb = other.ramMb; - this.diskMb = other.diskMb; - if (other.isSetResources()) { - Set<Resource> __this__resources = new HashSet<Resource>(other.resources.size()); - for (Resource other_element : other.resources) { - __this__resources.add(new Resource(other_element)); - } - this.resources = __this__resources; - } - } - - public ResourceAggregate deepCopy() { - return new ResourceAggregate(this); - } - - @Override - public void clear() { - setNumCpusIsSet(false); - this.numCpus = 0.0; - setRamMbIsSet(false); - this.ramMb = 0; - setDiskMbIsSet(false); - this.diskMb = 0; - this.resources = null; - } - - /** - * Number of CPU cores allotted. - */ - public double getNumCpus() { - return this.numCpus; - } - - /** - * Number of CPU cores allotted. - */ - public ResourceAggregate setNumCpus(double numCpus) { - this.numCpus = numCpus; - setNumCpusIsSet(true); - return this; - } - - public void unsetNumCpus() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMCPUS_ISSET_ID); - } - - /** Returns true if field numCpus is set (has been assigned a value) and false otherwise */ - public boolean isSetNumCpus() { - return EncodingUtils.testBit(__isset_bitfield, __NUMCPUS_ISSET_ID); - } - - public void setNumCpusIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMCPUS_ISSET_ID, value); - } - - /** - * Megabytes of RAM allotted. - */ - public long getRamMb() { - return this.ramMb; - } - - /** - * Megabytes of RAM allotted. - */ - public ResourceAggregate setRamMb(long ramMb) { - this.ramMb = ramMb; - setRamMbIsSet(true); - return this; - } - - public void unsetRamMb() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RAMMB_ISSET_ID); - } - - /** Returns true if field ramMb is set (has been assigned a value) and false otherwise */ - public boolean isSetRamMb() { - return EncodingUtils.testBit(__isset_bitfield, __RAMMB_ISSET_ID); - } - - public void setRamMbIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RAMMB_ISSET_ID, value); - } - - /** - * Megabytes of disk space allotted. - */ - public long getDiskMb() { - return this.diskMb; - } - - /** - * Megabytes of disk space allotted. - */ - public ResourceAggregate setDiskMb(long diskMb) { - this.diskMb = diskMb; - setDiskMbIsSet(true); - return this; - } - - public void unsetDiskMb() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISKMB_ISSET_ID); - } - - /** Returns true if field diskMb is set (has been assigned a value) and false otherwise */ - public boolean isSetDiskMb() { - return EncodingUtils.testBit(__isset_bitfield, __DISKMB_ISSET_ID); - } - - public void setDiskMbIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISKMB_ISSET_ID, value); - } - - public int getResourcesSize() { - return (this.resources == null) ? 0 : this.resources.size(); - } - - public java.util.Iterator<Resource> getResourcesIterator() { - return (this.resources == null) ? null : this.resources.iterator(); - } - - public void addToResources(Resource elem) { - if (this.resources == null) { - this.resources = new HashSet<Resource>(); - } - this.resources.add(elem); - } - - /** - * Aggregated resource values. - */ - public Set<Resource> getResources() { - return this.resources; - } - - /** - * Aggregated resource values. - */ - public ResourceAggregate setResources(Set<Resource> resources) { - this.resources = resources; - return this; - } - - public void unsetResources() { - this.resources = null; - } - - /** Returns true if field resources is set (has been assigned a value) and false otherwise */ - public boolean isSetResources() { - return this.resources != null; - } - - public void setResourcesIsSet(boolean value) { - if (!value) { - this.resources = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NUM_CPUS: - if (value == null) { - unsetNumCpus(); - } else { - setNumCpus((Double)value); - } - break; - - case RAM_MB: - if (value == null) { - unsetRamMb(); - } else { - setRamMb((Long)value); - } - break; - - case DISK_MB: - if (value == null) { - unsetDiskMb(); - } else { - setDiskMb((Long)value); - } - break; - - case RESOURCES: - if (value == null) { - unsetResources(); - } else { - setResources((Set<Resource>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NUM_CPUS: - return getNumCpus(); - - case RAM_MB: - return getRamMb(); - - case DISK_MB: - return getDiskMb(); - - case RESOURCES: - return getResources(); - - } - 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 NUM_CPUS: - return isSetNumCpus(); - case RAM_MB: - return isSetRamMb(); - case DISK_MB: - return isSetDiskMb(); - case RESOURCES: - return isSetResources(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ResourceAggregate) - return this.equals((ResourceAggregate)that); - return false; - } - - public boolean equals(ResourceAggregate that) { - if (that == null) - return false; - - boolean this_present_numCpus = true; - boolean that_present_numCpus = true; - if (this_present_numCpus || that_present_numCpus) { - if (!(this_present_numCpus && that_present_numCpus)) - return false; - if (this.numCpus != that.numCpus) - return false; - } - - boolean this_present_ramMb = true; - boolean that_present_ramMb = true; - if (this_present_ramMb || that_present_ramMb) { - if (!(this_present_ramMb && that_present_ramMb)) - return false; - if (this.ramMb != that.ramMb) - return false; - } - - boolean this_present_diskMb = true; - boolean that_present_diskMb = true; - if (this_present_diskMb || that_present_diskMb) { - if (!(this_present_diskMb && that_present_diskMb)) - return false; - if (this.diskMb != that.diskMb) - return false; - } - - boolean this_present_resources = true && this.isSetResources(); - boolean that_present_resources = true && that.isSetResources(); - if (this_present_resources || that_present_resources) { - if (!(this_present_resources && that_present_resources)) - return false; - if (!this.resources.equals(that.resources)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_numCpus = true; - list.add(present_numCpus); - if (present_numCpus) - list.add(numCpus); - - boolean present_ramMb = true; - list.add(present_ramMb); - if (present_ramMb) - list.add(ramMb); - - boolean present_diskMb = true; - list.add(present_diskMb); - if (present_diskMb) - list.add(diskMb); - - boolean present_resources = true && (isSetResources()); - list.add(present_resources); - if (present_resources) - list.add(resources); - - return list.hashCode(); - } - - @Override - public int compareTo(ResourceAggregate other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetNumCpus()).compareTo(other.isSetNumCpus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNumCpus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numCpus, other.numCpus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRamMb()).compareTo(other.isSetRamMb()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRamMb()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ramMb, other.ramMb); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDiskMb()).compareTo(other.isSetDiskMb()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDiskMb()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.diskMb, other.diskMb); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetResources()).compareTo(other.isSetResources()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetResources()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resources, other.resources); - 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("ResourceAggregate("); - boolean first = true; - - sb.append("numCpus:"); - sb.append(this.numCpus); - first = false; - if (!first) sb.append(", "); - sb.append("ramMb:"); - sb.append(this.ramMb); - first = false; - if (!first) sb.append(", "); - sb.append("diskMb:"); - sb.append(this.diskMb); - first = false; - if (!first) sb.append(", "); - sb.append("resources:"); - if (this.resources == null) { - sb.append("null"); - } else { - sb.append(this.resources); - } - 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 ResourceAggregateStandardSchemeFactory implements SchemeFactory { - public ResourceAggregateStandardScheme getScheme() { - return new ResourceAggregateStandardScheme(); - } - } - - private static class ResourceAggregateStandardScheme extends StandardScheme<ResourceAggregate> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ResourceAggregate 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: // NUM_CPUS - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.numCpus = iprot.readDouble(); - struct.setNumCpusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // RAM_MB - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.ramMb = iprot.readI64(); - struct.setRamMbIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // DISK_MB - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.diskMb = iprot.readI64(); - struct.setDiskMbIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // RESOURCES - if (schemeField.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set84 = iprot.readSetBegin(); - struct.resources = new HashSet<Resource>(2*_set84.size); - Resource _elem85; - for (int _i86 = 0; _i86 < _set84.size; ++_i86) - { - _elem85 = new Resource(); - _elem85.read(iprot); - struct.resources.add(_elem85); - } - iprot.readSetEnd(); - } - struct.setResourcesIsSet(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(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ResourceAggregate struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(NUM_CPUS_FIELD_DESC); - oprot.writeDouble(struct.numCpus); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RAM_MB_FIELD_DESC); - oprot.writeI64(struct.ramMb); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DISK_MB_FIELD_DESC); - oprot.writeI64(struct.diskMb); - oprot.writeFieldEnd(); - if (struct.resources != null) { - oprot.writeFieldBegin(RESOURCES_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.resources.size())); - for (Resource _iter87 : struct.resources) - { - _iter87.write(oprot); - } - oprot.writeSetEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ResourceAggregateTupleSchemeFactory implements SchemeFactory { - public ResourceAggregateTupleScheme getScheme() { - return new ResourceAggregateTupleScheme(); - } - } - - private static class ResourceAggregateTupleScheme extends TupleScheme<ResourceAggregate> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ResourceAggregate struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetNumCpus()) { - optionals.set(0); - } - if (struct.isSetRamMb()) { - optionals.set(1); - } - if (struct.isSetDiskMb()) { - optionals.set(2); - } - if (struct.isSetResources()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetNumCpus()) { - oprot.writeDouble(struct.numCpus); - } - if (struct.isSetRamMb()) { - oprot.writeI64(struct.ramMb); - } - if (struct.isSetDiskMb()) { - oprot.writeI64(struct.diskMb); - } - if (struct.isSetResources()) { - { - oprot.writeI32(struct.resources.size()); - for (Resource _iter88 : struct.resources) - { - _iter88.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ResourceAggregate struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.numCpus = iprot.readDouble(); - struct.setNumCpusIsSet(true); - } - if (incoming.get(1)) { - struct.ramMb = iprot.readI64(); - struct.setRamMbIsSet(true); - } - if (incoming.get(2)) { - struct.diskMb = iprot.readI64(); - struct.setDiskMbIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TSet _set89 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.resources = new HashSet<Resource>(2*_set89.size); - Resource _elem90; - for (int _i91 = 0; _i91 < _set89.size; ++_i91) - { - _elem90 = new Resource(); - _elem90.read(iprot); - struct.resources.add(_elem90); - } - } - struct.setResourcesIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Response.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Response.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Response.java deleted file mode 100644 index ffcfb2f..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Response.java +++ /dev/null @@ -1,840 +0,0 @@ -/** - * - * 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.cloud.aurora.client.sdk; - -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-10-21") -public class Response implements org.apache.thrift.TBase<Response, Response._Fields>, java.io.Serializable, Cloneable, Comparable<Response> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Response"); - - private static final org.apache.thrift.protocol.TField RESPONSE_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("responseCode", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField SERVER_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("serverInfo", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField DETAILS_FIELD_DESC = new org.apache.thrift.protocol.TField("details", org.apache.thrift.protocol.TType.LIST, (short)6); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ResponseStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ResponseTupleSchemeFactory()); - } - - /** - * - * @see ResponseCode - */ - public ResponseCode responseCode; // required - public ServerInfo serverInfo; // required - /** - * Payload from the invoked RPC. - */ - public Result result; // optional - /** - * Messages from the server relevant to the request, such as warnings or use of deprecated - * features. - */ - public List<ResponseDetail> details; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see ResponseCode - */ - RESPONSE_CODE((short)1, "responseCode"), - SERVER_INFO((short)5, "serverInfo"), - /** - * Payload from the invoked RPC. - */ - RESULT((short)3, "result"), - /** - * Messages from the server relevant to the request, such as warnings or use of deprecated - * features. - */ - DETAILS((short)6, "details"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - 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: // RESPONSE_CODE - return RESPONSE_CODE; - case 5: // SERVER_INFO - return SERVER_INFO; - case 3: // RESULT - return RESULT; - case 6: // DETAILS - return DETAILS; - 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 _Fields optionals[] = {_Fields.RESULT}; - 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.RESPONSE_CODE, new org.apache.thrift.meta_data.FieldMetaData("responseCode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ResponseCode.class))); - tmpMap.put(_Fields.SERVER_INFO, new org.apache.thrift.meta_data.FieldMetaData("serverInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ServerInfo.class))); - tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Result.class))); - tmpMap.put(_Fields.DETAILS, new org.apache.thrift.meta_data.FieldMetaData("details", org.apache.thrift.TFieldRequirementType.DEFAULT, - 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, ResponseDetail.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Response.class, metaDataMap); - } - - public Response() { - } - - public Response( - ResponseCode responseCode, - ServerInfo serverInfo, - List<ResponseDetail> details) - { - this(); - this.responseCode = responseCode; - this.serverInfo = serverInfo; - this.details = details; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public Response(Response other) { - if (other.isSetResponseCode()) { - this.responseCode = other.responseCode; - } - if (other.isSetServerInfo()) { - this.serverInfo = new ServerInfo(other.serverInfo); - } - if (other.isSetResult()) { - this.result = new Result(other.result); - } - if (other.isSetDetails()) { - List<ResponseDetail> __this__details = new ArrayList<ResponseDetail>(other.details.size()); - for (ResponseDetail other_element : other.details) { - __this__details.add(new ResponseDetail(other_element)); - } - this.details = __this__details; - } - } - - public Response deepCopy() { - return new Response(this); - } - - @Override - public void clear() { - this.responseCode = null; - this.serverInfo = null; - this.result = null; - this.details = null; - } - - /** - * - * @see ResponseCode - */ - public ResponseCode getResponseCode() { - return this.responseCode; - } - - /** - * - * @see ResponseCode - */ - public Response setResponseCode(ResponseCode responseCode) { - this.responseCode = responseCode; - return this; - } - - public void unsetResponseCode() { - this.responseCode = null; - } - - /** Returns true if field responseCode is set (has been assigned a value) and false otherwise */ - public boolean isSetResponseCode() { - return this.responseCode != null; - } - - public void setResponseCodeIsSet(boolean value) { - if (!value) { - this.responseCode = null; - } - } - - public ServerInfo getServerInfo() { - return this.serverInfo; - } - - public Response setServerInfo(ServerInfo serverInfo) { - this.serverInfo = serverInfo; - return this; - } - - public void unsetServerInfo() { - this.serverInfo = null; - } - - /** Returns true if field serverInfo is set (has been assigned a value) and false otherwise */ - public boolean isSetServerInfo() { - return this.serverInfo != null; - } - - public void setServerInfoIsSet(boolean value) { - if (!value) { - this.serverInfo = null; - } - } - - /** - * Payload from the invoked RPC. - */ - public Result getResult() { - return this.result; - } - - /** - * Payload from the invoked RPC. - */ - public Response setResult(Result result) { - this.result = result; - return this; - } - - public void unsetResult() { - this.result = null; - } - - /** Returns true if field result is set (has been assigned a value) and false otherwise */ - public boolean isSetResult() { - return this.result != null; - } - - public void setResultIsSet(boolean value) { - if (!value) { - this.result = null; - } - } - - public int getDetailsSize() { - return (this.details == null) ? 0 : this.details.size(); - } - - public java.util.Iterator<ResponseDetail> getDetailsIterator() { - return (this.details == null) ? null : this.details.iterator(); - } - - public void addToDetails(ResponseDetail elem) { - if (this.details == null) { - this.details = new ArrayList<ResponseDetail>(); - } - this.details.add(elem); - } - - /** - * Messages from the server relevant to the request, such as warnings or use of deprecated - * features. - */ - public List<ResponseDetail> getDetails() { - return this.details; - } - - /** - * Messages from the server relevant to the request, such as warnings or use of deprecated - * features. - */ - public Response setDetails(List<ResponseDetail> details) { - this.details = details; - return this; - } - - public void unsetDetails() { - this.details = null; - } - - /** Returns true if field details is set (has been assigned a value) and false otherwise */ - public boolean isSetDetails() { - return this.details != null; - } - - public void setDetailsIsSet(boolean value) { - if (!value) { - this.details = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case RESPONSE_CODE: - if (value == null) { - unsetResponseCode(); - } else { - setResponseCode((ResponseCode)value); - } - break; - - case SERVER_INFO: - if (value == null) { - unsetServerInfo(); - } else { - setServerInfo((ServerInfo)value); - } - break; - - case RESULT: - if (value == null) { - unsetResult(); - } else { - setResult((Result)value); - } - break; - - case DETAILS: - if (value == null) { - unsetDetails(); - } else { - setDetails((List<ResponseDetail>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case RESPONSE_CODE: - return getResponseCode(); - - case SERVER_INFO: - return getServerInfo(); - - case RESULT: - return getResult(); - - case DETAILS: - return getDetails(); - - } - 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 RESPONSE_CODE: - return isSetResponseCode(); - case SERVER_INFO: - return isSetServerInfo(); - case RESULT: - return isSetResult(); - case DETAILS: - return isSetDetails(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Response) - return this.equals((Response)that); - return false; - } - - public boolean equals(Response that) { - if (that == null) - return false; - - boolean this_present_responseCode = true && this.isSetResponseCode(); - boolean that_present_responseCode = true && that.isSetResponseCode(); - if (this_present_responseCode || that_present_responseCode) { - if (!(this_present_responseCode && that_present_responseCode)) - return false; - if (!this.responseCode.equals(that.responseCode)) - return false; - } - - boolean this_present_serverInfo = true && this.isSetServerInfo(); - boolean that_present_serverInfo = true && that.isSetServerInfo(); - if (this_present_serverInfo || that_present_serverInfo) { - if (!(this_present_serverInfo && that_present_serverInfo)) - return false; - if (!this.serverInfo.equals(that.serverInfo)) - return false; - } - - boolean this_present_result = true && this.isSetResult(); - boolean that_present_result = true && that.isSetResult(); - if (this_present_result || that_present_result) { - if (!(this_present_result && that_present_result)) - return false; - if (!this.result.equals(that.result)) - return false; - } - - boolean this_present_details = true && this.isSetDetails(); - boolean that_present_details = true && that.isSetDetails(); - if (this_present_details || that_present_details) { - if (!(this_present_details && that_present_details)) - return false; - if (!this.details.equals(that.details)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_responseCode = true && (isSetResponseCode()); - list.add(present_responseCode); - if (present_responseCode) - list.add(responseCode.getValue()); - - boolean present_serverInfo = true && (isSetServerInfo()); - list.add(present_serverInfo); - if (present_serverInfo) - list.add(serverInfo); - - boolean present_result = true && (isSetResult()); - list.add(present_result); - if (present_result) - list.add(result); - - boolean present_details = true && (isSetDetails()); - list.add(present_details); - if (present_details) - list.add(details); - - return list.hashCode(); - } - - @Override - public int compareTo(Response other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetResponseCode()).compareTo(other.isSetResponseCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetResponseCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.responseCode, other.responseCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServerInfo()).compareTo(other.isSetServerInfo()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServerInfo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverInfo, other.serverInfo); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetResult()).compareTo(other.isSetResult()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetResult()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, other.result); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDetails()).compareTo(other.isSetDetails()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDetails()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.details, other.details); - 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("Response("); - boolean first = true; - - sb.append("responseCode:"); - if (this.responseCode == null) { - sb.append("null"); - } else { - sb.append(this.responseCode); - } - first = false; - if (!first) sb.append(", "); - sb.append("serverInfo:"); - if (this.serverInfo == null) { - sb.append("null"); - } else { - sb.append(this.serverInfo); - } - first = false; - if (isSetResult()) { - if (!first) sb.append(", "); - sb.append("result:"); - if (this.result == null) { - sb.append("null"); - } else { - sb.append(this.result); - } - first = false; - } - if (!first) sb.append(", "); - sb.append("details:"); - if (this.details == null) { - sb.append("null"); - } else { - sb.append(this.details); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (serverInfo != null) { - serverInfo.validate(); - } - } - - 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 { - 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 ResponseStandardSchemeFactory implements SchemeFactory { - public ResponseStandardScheme getScheme() { - return new ResponseStandardScheme(); - } - } - - private static class ResponseStandardScheme extends StandardScheme<Response> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Response 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: // RESPONSE_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.responseCode = org.apache.airavata.cloud.aurora.client.sdk.ResponseCode.findByValue(iprot.readI32()); - struct.setResponseCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // SERVER_INFO - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.serverInfo = new ServerInfo(); - struct.serverInfo.read(iprot); - struct.setServerInfoIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RESULT - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.result = new Result(); - struct.result.read(iprot); - struct.setResultIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // DETAILS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list392 = iprot.readListBegin(); - struct.details = new ArrayList<ResponseDetail>(_list392.size); - ResponseDetail _elem393; - for (int _i394 = 0; _i394 < _list392.size; ++_i394) - { - _elem393 = new ResponseDetail(); - _elem393.read(iprot); - struct.details.add(_elem393); - } - iprot.readListEnd(); - } - struct.setDetailsIsSet(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(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, Response struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.responseCode != null) { - oprot.writeFieldBegin(RESPONSE_CODE_FIELD_DESC); - oprot.writeI32(struct.responseCode.getValue()); - oprot.writeFieldEnd(); - } - if (struct.result != null) { - if (struct.isSetResult()) { - oprot.writeFieldBegin(RESULT_FIELD_DESC); - struct.result.write(oprot); - oprot.writeFieldEnd(); - } - } - if (struct.serverInfo != null) { - oprot.writeFieldBegin(SERVER_INFO_FIELD_DESC); - struct.serverInfo.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.details != null) { - oprot.writeFieldBegin(DETAILS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.details.size())); - for (ResponseDetail _iter395 : struct.details) - { - _iter395.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ResponseTupleSchemeFactory implements SchemeFactory { - public ResponseTupleScheme getScheme() { - return new ResponseTupleScheme(); - } - } - - private static class ResponseTupleScheme extends TupleScheme<Response> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Response struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetResponseCode()) { - optionals.set(0); - } - if (struct.isSetServerInfo()) { - optionals.set(1); - } - if (struct.isSetResult()) { - optionals.set(2); - } - if (struct.isSetDetails()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetResponseCode()) { - oprot.writeI32(struct.responseCode.getValue()); - } - if (struct.isSetServerInfo()) { - struct.serverInfo.write(oprot); - } - if (struct.isSetResult()) { - struct.result.write(oprot); - } - if (struct.isSetDetails()) { - { - oprot.writeI32(struct.details.size()); - for (ResponseDetail _iter396 : struct.details) - { - _iter396.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Response struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.responseCode = org.apache.airavata.cloud.aurora.client.sdk.ResponseCode.findByValue(iprot.readI32()); - struct.setResponseCodeIsSet(true); - } - if (incoming.get(1)) { - struct.serverInfo = new ServerInfo(); - struct.serverInfo.read(iprot); - struct.setServerInfoIsSet(true); - } - if (incoming.get(2)) { - struct.result = new Result(); - struct.result.read(iprot); - struct.setResultIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TList _list397 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.details = new ArrayList<ResponseDetail>(_list397.size); - ResponseDetail _elem398; - for (int _i399 = 0; _i399 < _list397.size; ++_i399) - { - _elem398 = new ResponseDetail(); - _elem398.read(iprot); - struct.details.add(_elem398); - } - } - struct.setDetailsIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/488b772f/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResponseCode.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResponseCode.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResponseCode.java deleted file mode 100644 index 268c101..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ResponseCode.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * - * 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.cloud.aurora.client.sdk; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum ResponseCode implements org.apache.thrift.TEnum { - INVALID_REQUEST(0), - OK(1), - ERROR(2), - WARNING(3), - AUTH_FAILED(4), - /** - * Raised when a Lock-protected operation failed due to lock validation. - */ - LOCK_ERROR(5), - /** - * Raised when a scheduler is transiently unavailable and later retry is recommended. - */ - ERROR_TRANSIENT(6); - - private final int value; - - private ResponseCode(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 ResponseCode findByValue(int value) { - switch (value) { - case 0: - return INVALID_REQUEST; - case 1: - return OK; - case 2: - return ERROR; - case 3: - return WARNING; - case 4: - return AUTH_FAILED; - case 5: - return LOCK_ERROR; - case 6: - return ERROR_TRANSIENT; - default: - return null; - } - } -}
