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/ScheduledTask.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ScheduledTask.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ScheduledTask.java deleted file mode 100644 index aec4fac..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ScheduledTask.java +++ /dev/null @@ -1,973 +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"}) -/** - * A task that has been scheduled. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class ScheduledTask implements org.apache.thrift.TBase<ScheduledTask, ScheduledTask._Fields>, java.io.Serializable, Cloneable, Comparable<ScheduledTask> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ScheduledTask"); - - private static final org.apache.thrift.protocol.TField ASSIGNED_TASK_FIELD_DESC = new org.apache.thrift.protocol.TField("assignedTask", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField FAILURE_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("failureCount", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField TASK_EVENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskEvents", org.apache.thrift.protocol.TType.LIST, (short)4); - private static final org.apache.thrift.protocol.TField ANCESTOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ancestorId", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ScheduledTaskStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ScheduledTaskTupleSchemeFactory()); - } - - /** - * The task that was scheduled. - */ - public AssignedTask assignedTask; // required - /** - * The current status of this task. - * - * @see ScheduleStatus - */ - public ScheduleStatus status; // required - /** - * The number of failures that this task has accumulated over the multi-generational history of - * this task. - */ - public int failureCount; // required - /** - * State change history for this task. - */ - public List<TaskEvent> taskEvents; // required - /** - * The task ID of the previous generation of this task. When a task is automatically rescheduled, - * a copy of the task is created and ancestor ID of the previous task's task ID. - */ - public String ancestorId; // 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 { - /** - * The task that was scheduled. - */ - ASSIGNED_TASK((short)1, "assignedTask"), - /** - * The current status of this task. - * - * @see ScheduleStatus - */ - STATUS((short)2, "status"), - /** - * The number of failures that this task has accumulated over the multi-generational history of - * this task. - */ - FAILURE_COUNT((short)3, "failureCount"), - /** - * State change history for this task. - */ - TASK_EVENTS((short)4, "taskEvents"), - /** - * The task ID of the previous generation of this task. When a task is automatically rescheduled, - * a copy of the task is created and ancestor ID of the previous task's task ID. - */ - ANCESTOR_ID((short)5, "ancestorId"); - - 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: // ASSIGNED_TASK - return ASSIGNED_TASK; - case 2: // STATUS - return STATUS; - case 3: // FAILURE_COUNT - return FAILURE_COUNT; - case 4: // TASK_EVENTS - return TASK_EVENTS; - case 5: // ANCESTOR_ID - return ANCESTOR_ID; - 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 __FAILURECOUNT_ISSET_ID = 0; - 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.ASSIGNED_TASK, new org.apache.thrift.meta_data.FieldMetaData("assignedTask", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AssignedTask.class))); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ScheduleStatus.class))); - tmpMap.put(_Fields.FAILURE_COUNT, new org.apache.thrift.meta_data.FieldMetaData("failureCount", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.TASK_EVENTS, new org.apache.thrift.meta_data.FieldMetaData("taskEvents", 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, TaskEvent.class)))); - tmpMap.put(_Fields.ANCESTOR_ID, new org.apache.thrift.meta_data.FieldMetaData("ancestorId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ScheduledTask.class, metaDataMap); - } - - public ScheduledTask() { - } - - public ScheduledTask( - AssignedTask assignedTask, - ScheduleStatus status, - int failureCount, - List<TaskEvent> taskEvents, - String ancestorId) - { - this(); - this.assignedTask = assignedTask; - this.status = status; - this.failureCount = failureCount; - setFailureCountIsSet(true); - this.taskEvents = taskEvents; - this.ancestorId = ancestorId; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public ScheduledTask(ScheduledTask other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetAssignedTask()) { - this.assignedTask = new AssignedTask(other.assignedTask); - } - if (other.isSetStatus()) { - this.status = other.status; - } - this.failureCount = other.failureCount; - if (other.isSetTaskEvents()) { - List<TaskEvent> __this__taskEvents = new ArrayList<TaskEvent>(other.taskEvents.size()); - for (TaskEvent other_element : other.taskEvents) { - __this__taskEvents.add(new TaskEvent(other_element)); - } - this.taskEvents = __this__taskEvents; - } - if (other.isSetAncestorId()) { - this.ancestorId = other.ancestorId; - } - } - - public ScheduledTask deepCopy() { - return new ScheduledTask(this); - } - - @Override - public void clear() { - this.assignedTask = null; - this.status = null; - setFailureCountIsSet(false); - this.failureCount = 0; - this.taskEvents = null; - this.ancestorId = null; - } - - /** - * The task that was scheduled. - */ - public AssignedTask getAssignedTask() { - return this.assignedTask; - } - - /** - * The task that was scheduled. - */ - public ScheduledTask setAssignedTask(AssignedTask assignedTask) { - this.assignedTask = assignedTask; - return this; - } - - public void unsetAssignedTask() { - this.assignedTask = null; - } - - /** Returns true if field assignedTask is set (has been assigned a value) and false otherwise */ - public boolean isSetAssignedTask() { - return this.assignedTask != null; - } - - public void setAssignedTaskIsSet(boolean value) { - if (!value) { - this.assignedTask = null; - } - } - - /** - * The current status of this task. - * - * @see ScheduleStatus - */ - public ScheduleStatus getStatus() { - return this.status; - } - - /** - * The current status of this task. - * - * @see ScheduleStatus - */ - public ScheduledTask setStatus(ScheduleStatus status) { - this.status = status; - return this; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - /** - * The number of failures that this task has accumulated over the multi-generational history of - * this task. - */ - public int getFailureCount() { - return this.failureCount; - } - - /** - * The number of failures that this task has accumulated over the multi-generational history of - * this task. - */ - public ScheduledTask setFailureCount(int failureCount) { - this.failureCount = failureCount; - setFailureCountIsSet(true); - return this; - } - - public void unsetFailureCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FAILURECOUNT_ISSET_ID); - } - - /** Returns true if field failureCount is set (has been assigned a value) and false otherwise */ - public boolean isSetFailureCount() { - return EncodingUtils.testBit(__isset_bitfield, __FAILURECOUNT_ISSET_ID); - } - - public void setFailureCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FAILURECOUNT_ISSET_ID, value); - } - - public int getTaskEventsSize() { - return (this.taskEvents == null) ? 0 : this.taskEvents.size(); - } - - public java.util.Iterator<TaskEvent> getTaskEventsIterator() { - return (this.taskEvents == null) ? null : this.taskEvents.iterator(); - } - - public void addToTaskEvents(TaskEvent elem) { - if (this.taskEvents == null) { - this.taskEvents = new ArrayList<TaskEvent>(); - } - this.taskEvents.add(elem); - } - - /** - * State change history for this task. - */ - public List<TaskEvent> getTaskEvents() { - return this.taskEvents; - } - - /** - * State change history for this task. - */ - public ScheduledTask setTaskEvents(List<TaskEvent> taskEvents) { - this.taskEvents = taskEvents; - return this; - } - - public void unsetTaskEvents() { - this.taskEvents = null; - } - - /** Returns true if field taskEvents is set (has been assigned a value) and false otherwise */ - public boolean isSetTaskEvents() { - return this.taskEvents != null; - } - - public void setTaskEventsIsSet(boolean value) { - if (!value) { - this.taskEvents = null; - } - } - - /** - * The task ID of the previous generation of this task. When a task is automatically rescheduled, - * a copy of the task is created and ancestor ID of the previous task's task ID. - */ - public String getAncestorId() { - return this.ancestorId; - } - - /** - * The task ID of the previous generation of this task. When a task is automatically rescheduled, - * a copy of the task is created and ancestor ID of the previous task's task ID. - */ - public ScheduledTask setAncestorId(String ancestorId) { - this.ancestorId = ancestorId; - return this; - } - - public void unsetAncestorId() { - this.ancestorId = null; - } - - /** Returns true if field ancestorId is set (has been assigned a value) and false otherwise */ - public boolean isSetAncestorId() { - return this.ancestorId != null; - } - - public void setAncestorIdIsSet(boolean value) { - if (!value) { - this.ancestorId = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case ASSIGNED_TASK: - if (value == null) { - unsetAssignedTask(); - } else { - setAssignedTask((AssignedTask)value); - } - break; - - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((ScheduleStatus)value); - } - break; - - case FAILURE_COUNT: - if (value == null) { - unsetFailureCount(); - } else { - setFailureCount((Integer)value); - } - break; - - case TASK_EVENTS: - if (value == null) { - unsetTaskEvents(); - } else { - setTaskEvents((List<TaskEvent>)value); - } - break; - - case ANCESTOR_ID: - if (value == null) { - unsetAncestorId(); - } else { - setAncestorId((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case ASSIGNED_TASK: - return getAssignedTask(); - - case STATUS: - return getStatus(); - - case FAILURE_COUNT: - return getFailureCount(); - - case TASK_EVENTS: - return getTaskEvents(); - - case ANCESTOR_ID: - return getAncestorId(); - - } - 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 ASSIGNED_TASK: - return isSetAssignedTask(); - case STATUS: - return isSetStatus(); - case FAILURE_COUNT: - return isSetFailureCount(); - case TASK_EVENTS: - return isSetTaskEvents(); - case ANCESTOR_ID: - return isSetAncestorId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ScheduledTask) - return this.equals((ScheduledTask)that); - return false; - } - - public boolean equals(ScheduledTask that) { - if (that == null) - return false; - - boolean this_present_assignedTask = true && this.isSetAssignedTask(); - boolean that_present_assignedTask = true && that.isSetAssignedTask(); - if (this_present_assignedTask || that_present_assignedTask) { - if (!(this_present_assignedTask && that_present_assignedTask)) - return false; - if (!this.assignedTask.equals(that.assignedTask)) - return false; - } - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_failureCount = true; - boolean that_present_failureCount = true; - if (this_present_failureCount || that_present_failureCount) { - if (!(this_present_failureCount && that_present_failureCount)) - return false; - if (this.failureCount != that.failureCount) - return false; - } - - boolean this_present_taskEvents = true && this.isSetTaskEvents(); - boolean that_present_taskEvents = true && that.isSetTaskEvents(); - if (this_present_taskEvents || that_present_taskEvents) { - if (!(this_present_taskEvents && that_present_taskEvents)) - return false; - if (!this.taskEvents.equals(that.taskEvents)) - return false; - } - - boolean this_present_ancestorId = true && this.isSetAncestorId(); - boolean that_present_ancestorId = true && that.isSetAncestorId(); - if (this_present_ancestorId || that_present_ancestorId) { - if (!(this_present_ancestorId && that_present_ancestorId)) - return false; - if (!this.ancestorId.equals(that.ancestorId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_assignedTask = true && (isSetAssignedTask()); - list.add(present_assignedTask); - if (present_assignedTask) - list.add(assignedTask); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status.getValue()); - - boolean present_failureCount = true; - list.add(present_failureCount); - if (present_failureCount) - list.add(failureCount); - - boolean present_taskEvents = true && (isSetTaskEvents()); - list.add(present_taskEvents); - if (present_taskEvents) - list.add(taskEvents); - - boolean present_ancestorId = true && (isSetAncestorId()); - list.add(present_ancestorId); - if (present_ancestorId) - list.add(ancestorId); - - return list.hashCode(); - } - - @Override - public int compareTo(ScheduledTask other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetAssignedTask()).compareTo(other.isSetAssignedTask()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAssignedTask()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.assignedTask, other.assignedTask); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFailureCount()).compareTo(other.isSetFailureCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFailureCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failureCount, other.failureCount); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTaskEvents()).compareTo(other.isSetTaskEvents()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTaskEvents()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskEvents, other.taskEvents); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetAncestorId()).compareTo(other.isSetAncestorId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetAncestorId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ancestorId, other.ancestorId); - 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("ScheduledTask("); - boolean first = true; - - sb.append("assignedTask:"); - if (this.assignedTask == null) { - sb.append("null"); - } else { - sb.append(this.assignedTask); - } - first = false; - if (!first) sb.append(", "); - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("failureCount:"); - sb.append(this.failureCount); - first = false; - if (!first) sb.append(", "); - sb.append("taskEvents:"); - if (this.taskEvents == null) { - sb.append("null"); - } else { - sb.append(this.taskEvents); - } - first = false; - if (!first) sb.append(", "); - sb.append("ancestorId:"); - if (this.ancestorId == null) { - sb.append("null"); - } else { - sb.append(this.ancestorId); - } - 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 (assignedTask != null) { - assignedTask.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 { - // 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 ScheduledTaskStandardSchemeFactory implements SchemeFactory { - public ScheduledTaskStandardScheme getScheme() { - return new ScheduledTaskStandardScheme(); - } - } - - private static class ScheduledTaskStandardScheme extends StandardScheme<ScheduledTask> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ScheduledTask 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: // ASSIGNED_TASK - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.assignedTask = new AssignedTask(); - struct.assignedTask.read(iprot); - struct.setAssignedTaskIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.status = org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // FAILURE_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.failureCount = iprot.readI32(); - struct.setFailureCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TASK_EVENTS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); - struct.taskEvents = new ArrayList<TaskEvent>(_list118.size); - TaskEvent _elem119; - for (int _i120 = 0; _i120 < _list118.size; ++_i120) - { - _elem119 = new TaskEvent(); - _elem119.read(iprot); - struct.taskEvents.add(_elem119); - } - iprot.readListEnd(); - } - struct.setTaskEventsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ANCESTOR_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.ancestorId = iprot.readString(); - struct.setAncestorIdIsSet(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, ScheduledTask struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.assignedTask != null) { - oprot.writeFieldBegin(ASSIGNED_TASK_FIELD_DESC); - struct.assignedTask.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeI32(struct.status.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(FAILURE_COUNT_FIELD_DESC); - oprot.writeI32(struct.failureCount); - oprot.writeFieldEnd(); - if (struct.taskEvents != null) { - oprot.writeFieldBegin(TASK_EVENTS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.taskEvents.size())); - for (TaskEvent _iter121 : struct.taskEvents) - { - _iter121.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.ancestorId != null) { - oprot.writeFieldBegin(ANCESTOR_ID_FIELD_DESC); - oprot.writeString(struct.ancestorId); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ScheduledTaskTupleSchemeFactory implements SchemeFactory { - public ScheduledTaskTupleScheme getScheme() { - return new ScheduledTaskTupleScheme(); - } - } - - private static class ScheduledTaskTupleScheme extends TupleScheme<ScheduledTask> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ScheduledTask struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetAssignedTask()) { - optionals.set(0); - } - if (struct.isSetStatus()) { - optionals.set(1); - } - if (struct.isSetFailureCount()) { - optionals.set(2); - } - if (struct.isSetTaskEvents()) { - optionals.set(3); - } - if (struct.isSetAncestorId()) { - optionals.set(4); - } - oprot.writeBitSet(optionals, 5); - if (struct.isSetAssignedTask()) { - struct.assignedTask.write(oprot); - } - if (struct.isSetStatus()) { - oprot.writeI32(struct.status.getValue()); - } - if (struct.isSetFailureCount()) { - oprot.writeI32(struct.failureCount); - } - if (struct.isSetTaskEvents()) { - { - oprot.writeI32(struct.taskEvents.size()); - for (TaskEvent _iter122 : struct.taskEvents) - { - _iter122.write(oprot); - } - } - } - if (struct.isSetAncestorId()) { - oprot.writeString(struct.ancestorId); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ScheduledTask struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(5); - if (incoming.get(0)) { - struct.assignedTask = new AssignedTask(); - struct.assignedTask.read(iprot); - struct.setAssignedTaskIsSet(true); - } - if (incoming.get(1)) { - struct.status = org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } - if (incoming.get(2)) { - struct.failureCount = iprot.readI32(); - struct.setFailureCountIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TList _list123 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.taskEvents = new ArrayList<TaskEvent>(_list123.size); - TaskEvent _elem124; - for (int _i125 = 0; _i125 < _list123.size; ++_i125) - { - _elem124 = new TaskEvent(); - _elem124.read(iprot); - struct.taskEvents.add(_elem124); - } - } - struct.setTaskEventsIsSet(true); - } - if (incoming.get(4)) { - struct.ancestorId = iprot.readString(); - struct.setAncestorIdIsSet(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/ServerInfo.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ServerInfo.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ServerInfo.java deleted file mode 100644 index a55ec64..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ServerInfo.java +++ /dev/null @@ -1,537 +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"}) -/** - * Information about the scheduler. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class ServerInfo implements org.apache.thrift.TBase<ServerInfo, ServerInfo._Fields>, java.io.Serializable, Cloneable, Comparable<ServerInfo> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ServerInfo"); - - private static final org.apache.thrift.protocol.TField CLUSTER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("clusterName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField STATS_URL_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("statsUrlPrefix", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ServerInfoStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ServerInfoTupleSchemeFactory()); - } - - public String clusterName; // required - /** - * A url prefix for job container stats. - */ - public String statsUrlPrefix; // 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 { - CLUSTER_NAME((short)1, "clusterName"), - /** - * A url prefix for job container stats. - */ - STATS_URL_PREFIX((short)3, "statsUrlPrefix"); - - 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: // CLUSTER_NAME - return CLUSTER_NAME; - case 3: // STATS_URL_PREFIX - return STATS_URL_PREFIX; - 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 - 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.CLUSTER_NAME, new org.apache.thrift.meta_data.FieldMetaData("clusterName", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STATS_URL_PREFIX, new org.apache.thrift.meta_data.FieldMetaData("statsUrlPrefix", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ServerInfo.class, metaDataMap); - } - - public ServerInfo() { - } - - public ServerInfo( - String clusterName, - String statsUrlPrefix) - { - this(); - this.clusterName = clusterName; - this.statsUrlPrefix = statsUrlPrefix; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public ServerInfo(ServerInfo other) { - if (other.isSetClusterName()) { - this.clusterName = other.clusterName; - } - if (other.isSetStatsUrlPrefix()) { - this.statsUrlPrefix = other.statsUrlPrefix; - } - } - - public ServerInfo deepCopy() { - return new ServerInfo(this); - } - - @Override - public void clear() { - this.clusterName = null; - this.statsUrlPrefix = null; - } - - public String getClusterName() { - return this.clusterName; - } - - public ServerInfo setClusterName(String clusterName) { - this.clusterName = clusterName; - return this; - } - - public void unsetClusterName() { - this.clusterName = null; - } - - /** Returns true if field clusterName is set (has been assigned a value) and false otherwise */ - public boolean isSetClusterName() { - return this.clusterName != null; - } - - public void setClusterNameIsSet(boolean value) { - if (!value) { - this.clusterName = null; - } - } - - /** - * A url prefix for job container stats. - */ - public String getStatsUrlPrefix() { - return this.statsUrlPrefix; - } - - /** - * A url prefix for job container stats. - */ - public ServerInfo setStatsUrlPrefix(String statsUrlPrefix) { - this.statsUrlPrefix = statsUrlPrefix; - return this; - } - - public void unsetStatsUrlPrefix() { - this.statsUrlPrefix = null; - } - - /** Returns true if field statsUrlPrefix is set (has been assigned a value) and false otherwise */ - public boolean isSetStatsUrlPrefix() { - return this.statsUrlPrefix != null; - } - - public void setStatsUrlPrefixIsSet(boolean value) { - if (!value) { - this.statsUrlPrefix = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case CLUSTER_NAME: - if (value == null) { - unsetClusterName(); - } else { - setClusterName((String)value); - } - break; - - case STATS_URL_PREFIX: - if (value == null) { - unsetStatsUrlPrefix(); - } else { - setStatsUrlPrefix((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case CLUSTER_NAME: - return getClusterName(); - - case STATS_URL_PREFIX: - return getStatsUrlPrefix(); - - } - 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 CLUSTER_NAME: - return isSetClusterName(); - case STATS_URL_PREFIX: - return isSetStatsUrlPrefix(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ServerInfo) - return this.equals((ServerInfo)that); - return false; - } - - public boolean equals(ServerInfo that) { - if (that == null) - return false; - - boolean this_present_clusterName = true && this.isSetClusterName(); - boolean that_present_clusterName = true && that.isSetClusterName(); - if (this_present_clusterName || that_present_clusterName) { - if (!(this_present_clusterName && that_present_clusterName)) - return false; - if (!this.clusterName.equals(that.clusterName)) - return false; - } - - boolean this_present_statsUrlPrefix = true && this.isSetStatsUrlPrefix(); - boolean that_present_statsUrlPrefix = true && that.isSetStatsUrlPrefix(); - if (this_present_statsUrlPrefix || that_present_statsUrlPrefix) { - if (!(this_present_statsUrlPrefix && that_present_statsUrlPrefix)) - return false; - if (!this.statsUrlPrefix.equals(that.statsUrlPrefix)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_clusterName = true && (isSetClusterName()); - list.add(present_clusterName); - if (present_clusterName) - list.add(clusterName); - - boolean present_statsUrlPrefix = true && (isSetStatsUrlPrefix()); - list.add(present_statsUrlPrefix); - if (present_statsUrlPrefix) - list.add(statsUrlPrefix); - - return list.hashCode(); - } - - @Override - public int compareTo(ServerInfo other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetClusterName()).compareTo(other.isSetClusterName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClusterName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clusterName, other.clusterName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStatsUrlPrefix()).compareTo(other.isSetStatsUrlPrefix()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatsUrlPrefix()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statsUrlPrefix, other.statsUrlPrefix); - 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("ServerInfo("); - boolean first = true; - - sb.append("clusterName:"); - if (this.clusterName == null) { - sb.append("null"); - } else { - sb.append(this.clusterName); - } - first = false; - if (!first) sb.append(", "); - sb.append("statsUrlPrefix:"); - if (this.statsUrlPrefix == null) { - sb.append("null"); - } else { - sb.append(this.statsUrlPrefix); - } - 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 { - 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 ServerInfoStandardSchemeFactory implements SchemeFactory { - public ServerInfoStandardScheme getScheme() { - return new ServerInfoStandardScheme(); - } - } - - private static class ServerInfoStandardScheme extends StandardScheme<ServerInfo> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ServerInfo 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: // CLUSTER_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.clusterName = iprot.readString(); - struct.setClusterNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // STATS_URL_PREFIX - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.statsUrlPrefix = iprot.readString(); - struct.setStatsUrlPrefixIsSet(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, ServerInfo struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.clusterName != null) { - oprot.writeFieldBegin(CLUSTER_NAME_FIELD_DESC); - oprot.writeString(struct.clusterName); - oprot.writeFieldEnd(); - } - if (struct.statsUrlPrefix != null) { - oprot.writeFieldBegin(STATS_URL_PREFIX_FIELD_DESC); - oprot.writeString(struct.statsUrlPrefix); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ServerInfoTupleSchemeFactory implements SchemeFactory { - public ServerInfoTupleScheme getScheme() { - return new ServerInfoTupleScheme(); - } - } - - private static class ServerInfoTupleScheme extends TupleScheme<ServerInfo> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ServerInfo struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetClusterName()) { - optionals.set(0); - } - if (struct.isSetStatsUrlPrefix()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetClusterName()) { - oprot.writeString(struct.clusterName); - } - if (struct.isSetStatsUrlPrefix()) { - oprot.writeString(struct.statsUrlPrefix); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ServerInfo struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.clusterName = iprot.readString(); - struct.setClusterNameIsSet(true); - } - if (incoming.get(1)) { - struct.statsUrlPrefix = iprot.readString(); - struct.setStatsUrlPrefixIsSet(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/StartJobUpdateResult.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/StartJobUpdateResult.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/StartJobUpdateResult.java deleted file mode 100644 index 64af59c..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/StartJobUpdateResult.java +++ /dev/null @@ -1,562 +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"}) -/** - * Result of the startUpdate call. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class StartJobUpdateResult implements org.apache.thrift.TBase<StartJobUpdateResult, StartJobUpdateResult._Fields>, java.io.Serializable, Cloneable, Comparable<StartJobUpdateResult> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StartJobUpdateResult"); - - private static final org.apache.thrift.protocol.TField KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("key", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField UPDATE_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("updateSummary", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new StartJobUpdateResultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new StartJobUpdateResultTupleSchemeFactory()); - } - - /** - * Unique identifier for the job update. - */ - public JobUpdateKey key; // required - /** - * Summary of the update that is in progress for the given JobKey. - */ - public JobUpdateSummary updateSummary; // 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 { - /** - * Unique identifier for the job update. - */ - KEY((short)1, "key"), - /** - * Summary of the update that is in progress for the given JobKey. - */ - UPDATE_SUMMARY((short)2, "updateSummary"); - - 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: // KEY - return KEY; - case 2: // UPDATE_SUMMARY - return UPDATE_SUMMARY; - 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.UPDATE_SUMMARY}; - 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.KEY, new org.apache.thrift.meta_data.FieldMetaData("key", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobUpdateKey.class))); - tmpMap.put(_Fields.UPDATE_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("updateSummary", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobUpdateSummary.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StartJobUpdateResult.class, metaDataMap); - } - - public StartJobUpdateResult() { - } - - public StartJobUpdateResult( - JobUpdateKey key) - { - this(); - this.key = key; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public StartJobUpdateResult(StartJobUpdateResult other) { - if (other.isSetKey()) { - this.key = new JobUpdateKey(other.key); - } - if (other.isSetUpdateSummary()) { - this.updateSummary = new JobUpdateSummary(other.updateSummary); - } - } - - public StartJobUpdateResult deepCopy() { - return new StartJobUpdateResult(this); - } - - @Override - public void clear() { - this.key = null; - this.updateSummary = null; - } - - /** - * Unique identifier for the job update. - */ - public JobUpdateKey getKey() { - return this.key; - } - - /** - * Unique identifier for the job update. - */ - public StartJobUpdateResult setKey(JobUpdateKey key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been assigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - /** - * Summary of the update that is in progress for the given JobKey. - */ - public JobUpdateSummary getUpdateSummary() { - return this.updateSummary; - } - - /** - * Summary of the update that is in progress for the given JobKey. - */ - public StartJobUpdateResult setUpdateSummary(JobUpdateSummary updateSummary) { - this.updateSummary = updateSummary; - return this; - } - - public void unsetUpdateSummary() { - this.updateSummary = null; - } - - /** Returns true if field updateSummary is set (has been assigned a value) and false otherwise */ - public boolean isSetUpdateSummary() { - return this.updateSummary != null; - } - - public void setUpdateSummaryIsSet(boolean value) { - if (!value) { - this.updateSummary = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((JobUpdateKey)value); - } - break; - - case UPDATE_SUMMARY: - if (value == null) { - unsetUpdateSummary(); - } else { - setUpdateSummary((JobUpdateSummary)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case UPDATE_SUMMARY: - return getUpdateSummary(); - - } - 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 KEY: - return isSetKey(); - case UPDATE_SUMMARY: - return isSetUpdateSummary(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof StartJobUpdateResult) - return this.equals((StartJobUpdateResult)that); - return false; - } - - public boolean equals(StartJobUpdateResult that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_updateSummary = true && this.isSetUpdateSummary(); - boolean that_present_updateSummary = true && that.isSetUpdateSummary(); - if (this_present_updateSummary || that_present_updateSummary) { - if (!(this_present_updateSummary && that_present_updateSummary)) - return false; - if (!this.updateSummary.equals(that.updateSummary)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_key = true && (isSetKey()); - list.add(present_key); - if (present_key) - list.add(key); - - boolean present_updateSummary = true && (isSetUpdateSummary()); - list.add(present_updateSummary); - if (present_updateSummary) - list.add(updateSummary); - - return list.hashCode(); - } - - @Override - public int compareTo(StartJobUpdateResult other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(other.isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key, other.key); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUpdateSummary()).compareTo(other.isSetUpdateSummary()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUpdateSummary()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateSummary, other.updateSummary); - 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("StartJobUpdateResult("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (isSetUpdateSummary()) { - if (!first) sb.append(", "); - sb.append("updateSummary:"); - if (this.updateSummary == null) { - sb.append("null"); - } else { - sb.append(this.updateSummary); - } - 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 (key != null) { - key.validate(); - } - if (updateSummary != null) { - updateSummary.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 StartJobUpdateResultStandardSchemeFactory implements SchemeFactory { - public StartJobUpdateResultStandardScheme getScheme() { - return new StartJobUpdateResultStandardScheme(); - } - } - - private static class StartJobUpdateResultStandardScheme extends StandardScheme<StartJobUpdateResult> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, StartJobUpdateResult 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: // KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.key = new JobUpdateKey(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // UPDATE_SUMMARY - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.updateSummary = new JobUpdateSummary(); - struct.updateSummary.read(iprot); - struct.setUpdateSummaryIsSet(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, StartJobUpdateResult struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - struct.key.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.updateSummary != null) { - if (struct.isSetUpdateSummary()) { - oprot.writeFieldBegin(UPDATE_SUMMARY_FIELD_DESC); - struct.updateSummary.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class StartJobUpdateResultTupleSchemeFactory implements SchemeFactory { - public StartJobUpdateResultTupleScheme getScheme() { - return new StartJobUpdateResultTupleScheme(); - } - } - - private static class StartJobUpdateResultTupleScheme extends TupleScheme<StartJobUpdateResult> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, StartJobUpdateResult struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetKey()) { - optionals.set(0); - } - if (struct.isSetUpdateSummary()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetKey()) { - struct.key.write(oprot); - } - if (struct.isSetUpdateSummary()) { - struct.updateSummary.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, StartJobUpdateResult struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.key = new JobUpdateKey(); - struct.key.read(iprot); - struct.setKeyIsSet(true); - } - if (incoming.get(1)) { - struct.updateSummary = new JobUpdateSummary(); - struct.updateSummary.read(iprot); - struct.setUpdateSummaryIsSet(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/StartMaintenanceResult.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/StartMaintenanceResult.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/StartMaintenanceResult.java deleted file mode 100644 index 765b35f..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/StartMaintenanceResult.java +++ /dev/null @@ -1,471 +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 StartMaintenanceResult implements org.apache.thrift.TBase<StartMaintenanceResult, StartMaintenanceResult._Fields>, java.io.Serializable, Cloneable, Comparable<StartMaintenanceResult> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StartMaintenanceResult"); - - private static final org.apache.thrift.protocol.TField STATUSES_FIELD_DESC = new org.apache.thrift.protocol.TField("statuses", org.apache.thrift.protocol.TType.SET, (short)1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new StartMaintenanceResultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new StartMaintenanceResultTupleSchemeFactory()); - } - - public Set<HostStatus> statuses; // 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 { - STATUSES((short)1, "statuses"); - - 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: // STATUSES - return STATUSES; - 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 - 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.STATUSES, new org.apache.thrift.meta_data.FieldMetaData("statuses", 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, HostStatus.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StartMaintenanceResult.class, metaDataMap); - } - - public StartMaintenanceResult() { - } - - public StartMaintenanceResult( - Set<HostStatus> statuses) - { - this(); - this.statuses = statuses; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public StartMaintenanceResult(StartMaintenanceResult other) { - if (other.isSetStatuses()) { - Set<HostStatus> __this__statuses = new HashSet<HostStatus>(other.statuses.size()); - for (HostStatus other_element : other.statuses) { - __this__statuses.add(new HostStatus(other_element)); - } - this.statuses = __this__statuses; - } - } - - public StartMaintenanceResult deepCopy() { - return new StartMaintenanceResult(this); - } - - @Override - public void clear() { - this.statuses = null; - } - - public int getStatusesSize() { - return (this.statuses == null) ? 0 : this.statuses.size(); - } - - public java.util.Iterator<HostStatus> getStatusesIterator() { - return (this.statuses == null) ? null : this.statuses.iterator(); - } - - public void addToStatuses(HostStatus elem) { - if (this.statuses == null) { - this.statuses = new HashSet<HostStatus>(); - } - this.statuses.add(elem); - } - - public Set<HostStatus> getStatuses() { - return this.statuses; - } - - public StartMaintenanceResult setStatuses(Set<HostStatus> statuses) { - this.statuses = statuses; - return this; - } - - public void unsetStatuses() { - this.statuses = null; - } - - /** Returns true if field statuses is set (has been assigned a value) and false otherwise */ - public boolean isSetStatuses() { - return this.statuses != null; - } - - public void setStatusesIsSet(boolean value) { - if (!value) { - this.statuses = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUSES: - if (value == null) { - unsetStatuses(); - } else { - setStatuses((Set<HostStatus>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUSES: - return getStatuses(); - - } - 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 STATUSES: - return isSetStatuses(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof StartMaintenanceResult) - return this.equals((StartMaintenanceResult)that); - return false; - } - - public boolean equals(StartMaintenanceResult that) { - if (that == null) - return false; - - boolean this_present_statuses = true && this.isSetStatuses(); - boolean that_present_statuses = true && that.isSetStatuses(); - if (this_present_statuses || that_present_statuses) { - if (!(this_present_statuses && that_present_statuses)) - return false; - if (!this.statuses.equals(that.statuses)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_statuses = true && (isSetStatuses()); - list.add(present_statuses); - if (present_statuses) - list.add(statuses); - - return list.hashCode(); - } - - @Override - public int compareTo(StartMaintenanceResult other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatuses()).compareTo(other.isSetStatuses()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatuses()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statuses, other.statuses); - 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("StartMaintenanceResult("); - boolean first = true; - - sb.append("statuses:"); - if (this.statuses == null) { - sb.append("null"); - } else { - sb.append(this.statuses); - } - 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 { - 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 StartMaintenanceResultStandardSchemeFactory implements SchemeFactory { - public StartMaintenanceResultStandardScheme getScheme() { - return new StartMaintenanceResultStandardScheme(); - } - } - - private static class StartMaintenanceResultStandardScheme extends StandardScheme<StartMaintenanceResult> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, StartMaintenanceResult 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: // STATUSES - if (schemeField.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set262 = iprot.readSetBegin(); - struct.statuses = new HashSet<HostStatus>(2*_set262.size); - HostStatus _elem263; - for (int _i264 = 0; _i264 < _set262.size; ++_i264) - { - _elem263 = new HostStatus(); - _elem263.read(iprot); - struct.statuses.add(_elem263); - } - iprot.readSetEnd(); - } - struct.setStatusesIsSet(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, StartMaintenanceResult struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.statuses != null) { - oprot.writeFieldBegin(STATUSES_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.statuses.size())); - for (HostStatus _iter265 : struct.statuses) - { - _iter265.write(oprot); - } - oprot.writeSetEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class StartMaintenanceResultTupleSchemeFactory implements SchemeFactory { - public StartMaintenanceResultTupleScheme getScheme() { - return new StartMaintenanceResultTupleScheme(); - } - } - - private static class StartMaintenanceResultTupleScheme extends TupleScheme<StartMaintenanceResult> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, StartMaintenanceResult struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetStatuses()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetStatuses()) { - { - oprot.writeI32(struct.statuses.size()); - for (HostStatus _iter266 : struct.statuses) - { - _iter266.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, StartMaintenanceResult struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TSet _set267 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.statuses = new HashSet<HostStatus>(2*_set267.size); - HostStatus _elem268; - for (int _i269 = 0; _i269 < _set267.size; ++_i269) - { - _elem268 = new HostStatus(); - _elem268.read(iprot); - struct.statuses.add(_elem268); - } - } - struct.setStatusesIsSet(true); - } - } - } - -} -
