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/ValueConstraint.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ValueConstraint.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ValueConstraint.java deleted file mode 100644 index 2e8f12e..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/ValueConstraint.java +++ /dev/null @@ -1,585 +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 constraint that specifies an explicit set of values, at least one of which must be present - * on a host for a task to be scheduled there. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class ValueConstraint implements org.apache.thrift.TBase<ValueConstraint, ValueConstraint._Fields>, java.io.Serializable, Cloneable, Comparable<ValueConstraint> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ValueConstraint"); - - private static final org.apache.thrift.protocol.TField NEGATED_FIELD_DESC = new org.apache.thrift.protocol.TField("negated", org.apache.thrift.protocol.TType.BOOL, (short)1); - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.SET, (short)2); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ValueConstraintStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ValueConstraintTupleSchemeFactory()); - } - - /** - * If true, treat this as a 'not' - to avoid specific values. - */ - public boolean negated; // required - public Set<String> values; // 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 { - /** - * If true, treat this as a 'not' - to avoid specific values. - */ - NEGATED((short)1, "negated"), - VALUES((short)2, "values"); - - 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: // NEGATED - return NEGATED; - case 2: // VALUES - return VALUES; - 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 __NEGATED_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.NEGATED, new org.apache.thrift.meta_data.FieldMetaData("negated", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ValueConstraint.class, metaDataMap); - } - - public ValueConstraint() { - } - - public ValueConstraint( - boolean negated, - Set<String> values) - { - this(); - this.negated = negated; - setNegatedIsSet(true); - this.values = values; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public ValueConstraint(ValueConstraint other) { - __isset_bitfield = other.__isset_bitfield; - this.negated = other.negated; - if (other.isSetValues()) { - Set<String> __this__values = new HashSet<String>(other.values); - this.values = __this__values; - } - } - - public ValueConstraint deepCopy() { - return new ValueConstraint(this); - } - - @Override - public void clear() { - setNegatedIsSet(false); - this.negated = false; - this.values = null; - } - - /** - * If true, treat this as a 'not' - to avoid specific values. - */ - public boolean isNegated() { - return this.negated; - } - - /** - * If true, treat this as a 'not' - to avoid specific values. - */ - public ValueConstraint setNegated(boolean negated) { - this.negated = negated; - setNegatedIsSet(true); - return this; - } - - public void unsetNegated() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NEGATED_ISSET_ID); - } - - /** Returns true if field negated is set (has been assigned a value) and false otherwise */ - public boolean isSetNegated() { - return EncodingUtils.testBit(__isset_bitfield, __NEGATED_ISSET_ID); - } - - public void setNegatedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NEGATED_ISSET_ID, value); - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator<String> getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(String elem) { - if (this.values == null) { - this.values = new HashSet<String>(); - } - this.values.add(elem); - } - - public Set<String> getValues() { - return this.values; - } - - public ValueConstraint setValues(Set<String> values) { - this.values = values; - return this; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NEGATED: - if (value == null) { - unsetNegated(); - } else { - setNegated((Boolean)value); - } - break; - - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((Set<String>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NEGATED: - return isNegated(); - - case VALUES: - return getValues(); - - } - 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 NEGATED: - return isSetNegated(); - case VALUES: - return isSetValues(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ValueConstraint) - return this.equals((ValueConstraint)that); - return false; - } - - public boolean equals(ValueConstraint that) { - if (that == null) - return false; - - boolean this_present_negated = true; - boolean that_present_negated = true; - if (this_present_negated || that_present_negated) { - if (!(this_present_negated && that_present_negated)) - return false; - if (this.negated != that.negated) - return false; - } - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_negated = true; - list.add(present_negated); - if (present_negated) - list.add(negated); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - return list.hashCode(); - } - - @Override - public int compareTo(ValueConstraint other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetNegated()).compareTo(other.isSetNegated()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNegated()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.negated, other.negated); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - 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("ValueConstraint("); - boolean first = true; - - sb.append("negated:"); - sb.append(this.negated); - first = false; - if (!first) sb.append(", "); - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - 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 ValueConstraintStandardSchemeFactory implements SchemeFactory { - public ValueConstraintStandardScheme getScheme() { - return new ValueConstraintStandardScheme(); - } - } - - private static class ValueConstraintStandardScheme extends StandardScheme<ValueConstraint> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ValueConstraint 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: // NEGATED - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.negated = iprot.readBool(); - struct.setNegatedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set16 = iprot.readSetBegin(); - struct.values = new HashSet<String>(2*_set16.size); - String _elem17; - for (int _i18 = 0; _i18 < _set16.size; ++_i18) - { - _elem17 = iprot.readString(); - struct.values.add(_elem17); - } - iprot.readSetEnd(); - } - struct.setValuesIsSet(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, ValueConstraint struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(NEGATED_FIELD_DESC); - oprot.writeBool(struct.negated); - oprot.writeFieldEnd(); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (String _iter19 : struct.values) - { - oprot.writeString(_iter19); - } - oprot.writeSetEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ValueConstraintTupleSchemeFactory implements SchemeFactory { - public ValueConstraintTupleScheme getScheme() { - return new ValueConstraintTupleScheme(); - } - } - - private static class ValueConstraintTupleScheme extends TupleScheme<ValueConstraint> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ValueConstraint struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetNegated()) { - optionals.set(0); - } - if (struct.isSetValues()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetNegated()) { - oprot.writeBool(struct.negated); - } - if (struct.isSetValues()) { - { - oprot.writeI32(struct.values.size()); - for (String _iter20 : struct.values) - { - oprot.writeString(_iter20); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ValueConstraint struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.negated = iprot.readBool(); - struct.setNegatedIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TSet _set21 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new HashSet<String>(2*_set21.size); - String _elem22; - for (int _i23 = 0; _i23 < _set21.size; ++_i23) - { - _elem22 = iprot.readString(); - struct.values.add(_elem22); - } - } - struct.setValuesIsSet(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/Volume.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Volume.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Volume.java deleted file mode 100644 index 74597f2..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/Volume.java +++ /dev/null @@ -1,674 +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 volume mount point within a container - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-10-21") -public class Volume implements org.apache.thrift.TBase<Volume, Volume._Fields>, java.io.Serializable, Cloneable, Comparable<Volume> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Volume"); - - private static final org.apache.thrift.protocol.TField CONTAINER_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("containerPath", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField HOST_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("hostPath", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("mode", org.apache.thrift.protocol.TType.I32, (short)3); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new VolumeStandardSchemeFactory()); - schemes.put(TupleScheme.class, new VolumeTupleSchemeFactory()); - } - - /** - * The path inside the container where the mount will be created. - */ - public String containerPath; // required - /** - * The path on the host that will serve as the source for the mount. - */ - public String hostPath; // required - /** - * The access mode - * - * @see Mode - */ - public Mode mode; // 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 path inside the container where the mount will be created. - */ - CONTAINER_PATH((short)1, "containerPath"), - /** - * The path on the host that will serve as the source for the mount. - */ - HOST_PATH((short)2, "hostPath"), - /** - * The access mode - * - * @see Mode - */ - MODE((short)3, "mode"); - - 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: // CONTAINER_PATH - return CONTAINER_PATH; - case 2: // HOST_PATH - return HOST_PATH; - case 3: // MODE - return MODE; - 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.CONTAINER_PATH, new org.apache.thrift.meta_data.FieldMetaData("containerPath", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.HOST_PATH, new org.apache.thrift.meta_data.FieldMetaData("hostPath", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MODE, new org.apache.thrift.meta_data.FieldMetaData("mode", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Mode.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Volume.class, metaDataMap); - } - - public Volume() { - } - - public Volume( - String containerPath, - String hostPath, - Mode mode) - { - this(); - this.containerPath = containerPath; - this.hostPath = hostPath; - this.mode = mode; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public Volume(Volume other) { - if (other.isSetContainerPath()) { - this.containerPath = other.containerPath; - } - if (other.isSetHostPath()) { - this.hostPath = other.hostPath; - } - if (other.isSetMode()) { - this.mode = other.mode; - } - } - - public Volume deepCopy() { - return new Volume(this); - } - - @Override - public void clear() { - this.containerPath = null; - this.hostPath = null; - this.mode = null; - } - - /** - * The path inside the container where the mount will be created. - */ - public String getContainerPath() { - return this.containerPath; - } - - /** - * The path inside the container where the mount will be created. - */ - public Volume setContainerPath(String containerPath) { - this.containerPath = containerPath; - return this; - } - - public void unsetContainerPath() { - this.containerPath = null; - } - - /** Returns true if field containerPath is set (has been assigned a value) and false otherwise */ - public boolean isSetContainerPath() { - return this.containerPath != null; - } - - public void setContainerPathIsSet(boolean value) { - if (!value) { - this.containerPath = null; - } - } - - /** - * The path on the host that will serve as the source for the mount. - */ - public String getHostPath() { - return this.hostPath; - } - - /** - * The path on the host that will serve as the source for the mount. - */ - public Volume setHostPath(String hostPath) { - this.hostPath = hostPath; - return this; - } - - public void unsetHostPath() { - this.hostPath = null; - } - - /** Returns true if field hostPath is set (has been assigned a value) and false otherwise */ - public boolean isSetHostPath() { - return this.hostPath != null; - } - - public void setHostPathIsSet(boolean value) { - if (!value) { - this.hostPath = null; - } - } - - /** - * The access mode - * - * @see Mode - */ - public Mode getMode() { - return this.mode; - } - - /** - * The access mode - * - * @see Mode - */ - public Volume setMode(Mode mode) { - this.mode = mode; - return this; - } - - public void unsetMode() { - this.mode = null; - } - - /** Returns true if field mode is set (has been assigned a value) and false otherwise */ - public boolean isSetMode() { - return this.mode != null; - } - - public void setModeIsSet(boolean value) { - if (!value) { - this.mode = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case CONTAINER_PATH: - if (value == null) { - unsetContainerPath(); - } else { - setContainerPath((String)value); - } - break; - - case HOST_PATH: - if (value == null) { - unsetHostPath(); - } else { - setHostPath((String)value); - } - break; - - case MODE: - if (value == null) { - unsetMode(); - } else { - setMode((Mode)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case CONTAINER_PATH: - return getContainerPath(); - - case HOST_PATH: - return getHostPath(); - - case MODE: - return getMode(); - - } - 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 CONTAINER_PATH: - return isSetContainerPath(); - case HOST_PATH: - return isSetHostPath(); - case MODE: - return isSetMode(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Volume) - return this.equals((Volume)that); - return false; - } - - public boolean equals(Volume that) { - if (that == null) - return false; - - boolean this_present_containerPath = true && this.isSetContainerPath(); - boolean that_present_containerPath = true && that.isSetContainerPath(); - if (this_present_containerPath || that_present_containerPath) { - if (!(this_present_containerPath && that_present_containerPath)) - return false; - if (!this.containerPath.equals(that.containerPath)) - return false; - } - - boolean this_present_hostPath = true && this.isSetHostPath(); - boolean that_present_hostPath = true && that.isSetHostPath(); - if (this_present_hostPath || that_present_hostPath) { - if (!(this_present_hostPath && that_present_hostPath)) - return false; - if (!this.hostPath.equals(that.hostPath)) - return false; - } - - boolean this_present_mode = true && this.isSetMode(); - boolean that_present_mode = true && that.isSetMode(); - if (this_present_mode || that_present_mode) { - if (!(this_present_mode && that_present_mode)) - return false; - if (!this.mode.equals(that.mode)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_containerPath = true && (isSetContainerPath()); - list.add(present_containerPath); - if (present_containerPath) - list.add(containerPath); - - boolean present_hostPath = true && (isSetHostPath()); - list.add(present_hostPath); - if (present_hostPath) - list.add(hostPath); - - boolean present_mode = true && (isSetMode()); - list.add(present_mode); - if (present_mode) - list.add(mode.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(Volume other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetContainerPath()).compareTo(other.isSetContainerPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetContainerPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.containerPath, other.containerPath); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHostPath()).compareTo(other.isSetHostPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHostPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostPath, other.hostPath); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMode()).compareTo(other.isSetMode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mode, other.mode); - 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("Volume("); - boolean first = true; - - sb.append("containerPath:"); - if (this.containerPath == null) { - sb.append("null"); - } else { - sb.append(this.containerPath); - } - first = false; - if (!first) sb.append(", "); - sb.append("hostPath:"); - if (this.hostPath == null) { - sb.append("null"); - } else { - sb.append(this.hostPath); - } - first = false; - if (!first) sb.append(", "); - sb.append("mode:"); - if (this.mode == null) { - sb.append("null"); - } else { - sb.append(this.mode); - } - 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 VolumeStandardSchemeFactory implements SchemeFactory { - public VolumeStandardScheme getScheme() { - return new VolumeStandardScheme(); - } - } - - private static class VolumeStandardScheme extends StandardScheme<Volume> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Volume 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: // CONTAINER_PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.containerPath = iprot.readString(); - struct.setContainerPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // HOST_PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.hostPath = iprot.readString(); - struct.setHostPathIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.mode = org.apache.airavata.cloud.aurora.client.sdk.Mode.findByValue(iprot.readI32()); - struct.setModeIsSet(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, Volume struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.containerPath != null) { - oprot.writeFieldBegin(CONTAINER_PATH_FIELD_DESC); - oprot.writeString(struct.containerPath); - oprot.writeFieldEnd(); - } - if (struct.hostPath != null) { - oprot.writeFieldBegin(HOST_PATH_FIELD_DESC); - oprot.writeString(struct.hostPath); - oprot.writeFieldEnd(); - } - if (struct.mode != null) { - oprot.writeFieldBegin(MODE_FIELD_DESC); - oprot.writeI32(struct.mode.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class VolumeTupleSchemeFactory implements SchemeFactory { - public VolumeTupleScheme getScheme() { - return new VolumeTupleScheme(); - } - } - - private static class VolumeTupleScheme extends TupleScheme<Volume> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Volume struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetContainerPath()) { - optionals.set(0); - } - if (struct.isSetHostPath()) { - optionals.set(1); - } - if (struct.isSetMode()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetContainerPath()) { - oprot.writeString(struct.containerPath); - } - if (struct.isSetHostPath()) { - oprot.writeString(struct.hostPath); - } - if (struct.isSetMode()) { - oprot.writeI32(struct.mode.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Volume struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.containerPath = iprot.readString(); - struct.setContainerPathIsSet(true); - } - if (incoming.get(1)) { - struct.hostPath = iprot.readString(); - struct.setHostPathIsSet(true); - } - if (incoming.get(2)) { - struct.mode = org.apache.airavata.cloud.aurora.client.sdk.Mode.findByValue(iprot.readI32()); - struct.setModeIsSet(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/aurora_apiConstants.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/aurora_apiConstants.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/aurora_apiConstants.java deleted file mode 100644 index 80019f2..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/client/sdk/aurora_apiConstants.java +++ /dev/null @@ -1,124 +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"}) -public class aurora_apiConstants { - - public static final String AURORA_EXECUTOR_NAME = "AuroraExecutor"; - - public static final Set<ScheduleStatus> ACTIVE_STATES = new HashSet<ScheduleStatus>(); - static { - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.ASSIGNED); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.DRAINING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.KILLING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.PENDING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.PREEMPTING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.RESTARTING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.RUNNING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.STARTING); - ACTIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.THROTTLED); - } - - public static final Set<ScheduleStatus> SLAVE_ASSIGNED_STATES = new HashSet<ScheduleStatus>(); - static { - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.ASSIGNED); - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.DRAINING); - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.KILLING); - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.PREEMPTING); - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.RESTARTING); - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.RUNNING); - SLAVE_ASSIGNED_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.STARTING); - } - - public static final Set<ScheduleStatus> LIVE_STATES = new HashSet<ScheduleStatus>(); - static { - LIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.KILLING); - LIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.PREEMPTING); - LIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.RESTARTING); - LIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.DRAINING); - LIVE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.RUNNING); - } - - public static final Set<ScheduleStatus> TERMINAL_STATES = new HashSet<ScheduleStatus>(); - static { - TERMINAL_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.FAILED); - TERMINAL_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.FINISHED); - TERMINAL_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.KILLED); - TERMINAL_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.ScheduleStatus.LOST); - } - - public static final String GOOD_IDENTIFIER_PATTERN = "^[\\w\\-\\.]+$"; - - public static final String GOOD_IDENTIFIER_PATTERN_JVM = "^[\\w\\-\\.]+$"; - - public static final String GOOD_IDENTIFIER_PATTERN_PYTHON = "^[\\w\\-\\.]+$"; - - /** - * States the job update can be in while still considered active. - */ - public static final Set<JobUpdateStatus> ACTIVE_JOB_UPDATE_STATES = new HashSet<JobUpdateStatus>(); - static { - ACTIVE_JOB_UPDATE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.ROLLING_FORWARD); - ACTIVE_JOB_UPDATE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.ROLLING_BACK); - ACTIVE_JOB_UPDATE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.ROLL_FORWARD_PAUSED); - ACTIVE_JOB_UPDATE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.ROLL_BACK_PAUSED); - ACTIVE_JOB_UPDATE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.ROLL_FORWARD_AWAITING_PULSE); - ACTIVE_JOB_UPDATE_STATES.add(org.apache.airavata.cloud.aurora.client.sdk.JobUpdateStatus.ROLL_BACK_AWAITING_PULSE); - } - - public static final String BYPASS_LEADER_REDIRECT_HEADER_NAME = "Bypass-Leader-Redirect"; - - public static final String TASK_FILESYSTEM_MOUNT_POINT = "taskfs"; - -} 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/sample/AuroraClientSample.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/sample/AuroraClientSample.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/sample/AuroraClientSample.java deleted file mode 100644 index 10cac08..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/sample/AuroraClientSample.java +++ /dev/null @@ -1,187 +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. - */ -package org.apache.airavata.cloud.aurora.sample; - -import java.util.HashSet; -import java.util.LinkedHashSet; -import java.util.Set; -import java.util.concurrent.ThreadLocalRandom; - -import org.apache.airavata.cloud.aurora.client.AuroraThriftClient; -import org.apache.airavata.cloud.aurora.client.bean.GetJobsResponseBean; -import org.apache.airavata.cloud.aurora.client.bean.IdentityBean; -import org.apache.airavata.cloud.aurora.client.bean.JobConfigBean; -import org.apache.airavata.cloud.aurora.client.bean.JobKeyBean; -import org.apache.airavata.cloud.aurora.client.bean.ProcessBean; -import org.apache.airavata.cloud.aurora.client.bean.ResourceBean; -import org.apache.airavata.cloud.aurora.client.bean.ResponseBean; -import org.apache.airavata.cloud.aurora.client.bean.TaskConfigBean; -import org.apache.airavata.cloud.aurora.util.AuroraThriftClientUtil; -import org.apache.thrift.TException; - -/** - * The Class AuroraClientSample. - */ -public class AuroraClientSample { - - /** - * Gets the job summary. - * - * @param client the client - * @return the job summary - * @throws Exception - */ - public static void getRunningJobsList(String ownerRole) throws Exception { - try { - AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient(); - ResponseBean response = client.getJobList(ownerRole); - System.out.println("Response status: " + response.getResponseCode().name()); - if(response instanceof GetJobsResponseBean) { - GetJobsResponseBean result = (GetJobsResponseBean) response; - System.out.println(result); - - Set<JobConfigBean> jobConfigs = result.getJobConfigs(); - for(JobConfigBean jobConfig : jobConfigs) { - System.out.println(jobConfig); - JobKeyBean jobKey = jobConfig.getJob(); - IdentityBean owner = jobConfig.getOwner(); - TaskConfigBean taskConfig = jobConfig.getTaskConfig(); - Set<ProcessBean> processes = taskConfig.getProcesses(); - - System.out.println("\n**** JOB CONFIG ****"); - System.out.println("\t # cluster: " + jobConfig.getCluster()); - System.out.println("\t # instanceCount: " + jobConfig.getInstances()); - System.out.println("\t # isService: " + jobConfig.isService()); - System.out.println("\t\t # priority: " + jobConfig.getPriority()); - - System.out.println("\t >> Job Key <<"); - System.out.println("\t\t # name: " + jobKey.getName()); - System.out.println("\t\t # role: " + jobKey.getRole()); - System.out.println("\t\t # environment: " + jobKey.getEnvironment()); - - System.out.println("\t >> Identity <<"); - System.out.println("\t\t # owner: " + owner.getUser()); - - System.out.println("\t >> Task Config <<"); - System.out.println("\t\t >> Resources <<"); - System.out.println("\t\t\t # numCPUs: " + taskConfig.getResources().getNumCpus()); - System.out.println("\t\t\t # diskMb: " + taskConfig.getResources().getDiskMb()); - System.out.println("\t\t\t # ramMb: " + taskConfig.getResources().getRamMb()); - - System.out.println("\t\t >> Processes <<"); - for(ProcessBean process : processes) { - System.out.println("\t\t\t ***** PROCESS *****"); - System.out.println("\t\t\t # name: " + process.getName()); - System.out.println("\t\t\t # cmdline: " + process.getCmdLine()); - } - } - - } - } catch (TException e) { - e.printStackTrace(); - } - } - - public static void createJob() throws Exception { - JobKeyBean jobKey = new JobKeyBean("devel", "centos", "test_job"); - IdentityBean owner = new IdentityBean("centos"); - - ProcessBean proc1 = new ProcessBean("process_1", "echo 'hello_world_1'", false); - ProcessBean proc2 = new ProcessBean("process_2", "echo 'hello_world_2'", false); - Set<ProcessBean> processes = new HashSet<>(); - processes.add(proc1); - processes.add(proc2); - - ResourceBean resources = new ResourceBean(0.1, 8, 1); - - TaskConfigBean taskConfig = new TaskConfigBean("task_hello_world", processes, resources); - JobConfigBean jobConfig = new JobConfigBean(jobKey, owner, taskConfig, "example"); - - String executorConfigJson = AuroraThriftClientUtil.getExecutorConfigJson(jobConfig); - System.out.println(executorConfigJson); - - AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient(); - ResponseBean response = client.createJob(jobConfig); - System.out.println(response); - } - - public static void createAutoDockJob() throws Exception { - JobKeyBean jobKey = new JobKeyBean("devel", "centos", "test_autodock"); - IdentityBean owner = new IdentityBean("centos"); - - String working_dir = "/home/centos/efs-mount-point/job_" + ThreadLocalRandom.current().nextInt(1, 101) + "/"; - String autodock_path = "/home/centos/efs-mount-point/autodock-vina"; - ProcessBean proc1 = new ProcessBean("process_1", "mkdir " + working_dir, false); - ProcessBean proc2 = new ProcessBean("process_2", "cp " + autodock_path + "/vina_screenM.sh " + working_dir, false); - ProcessBean proc3 = new ProcessBean("process_3", "cp " + autodock_path + "/ligand* " + working_dir, false); - ProcessBean proc4 = new ProcessBean("process_4", "cd " + working_dir + " && sh vina_screenM.sh", false); - - Set<ProcessBean> processes = new LinkedHashSet<>(); - processes.add(proc1); - processes.add(proc2); - processes.add(proc3); - processes.add(proc4); - - ResourceBean resources = new ResourceBean(1.5, 125, 512); - - TaskConfigBean taskConfig = new TaskConfigBean("test_autodock", processes, resources); - JobConfigBean jobConfig = new JobConfigBean(jobKey, owner, taskConfig, "example"); - - String executorConfigJson = AuroraThriftClientUtil.getExecutorConfigJson(jobConfig); - System.out.println(executorConfigJson); - - AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient(); - ResponseBean response = client.createJob(jobConfig); - System.out.println(response); - } - - public static void killTasks(String jobName) throws Exception { - JobKeyBean jobKey = new JobKeyBean("devel", "centos", jobName); - AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient(); - ResponseBean response = client.killTasks(jobKey, new HashSet<>()); - System.out.println(response); - } - - /** - * The main method. - * - * @param args the arguments - */ - public static void main(String[] args) { - try { - // create sample job -// AuroraClientSample.createJob(); -// AuroraClientSample.createAutoDockJob(); - - // kill pending job -// AuroraClientSample.killTasks("test_autodock"); - - // get jobs summary - AuroraClientSample.getRunningJobsList("centos"); - -// AuroraThriftClient client = AuroraThriftClient.getAuroraThriftClient(Constants.AURORA_SCHEDULER_PROP_FILE); -// ResponseBean response = client.getPendingReasonForJob(new JobKeyBean("devel", "centos", "hello_pending")); -// System.out.println(response); - } catch (Exception ex) { - ex.printStackTrace(); - } - } - -} 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/util/AuroraThriftClientUtil.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/AuroraThriftClientUtil.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/AuroraThriftClientUtil.java deleted file mode 100644 index c13ef8f..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/AuroraThriftClientUtil.java +++ /dev/null @@ -1,424 +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. - */ -package org.apache.airavata.cloud.aurora.util; - -import java.io.InputStream; -import java.util.HashSet; -import java.util.Set; - -import org.apache.airavata.cloud.aurora.client.AuroraSchedulerClientFactory; -import org.apache.airavata.cloud.aurora.client.bean.GetJobsResponseBean; -import org.apache.airavata.cloud.aurora.client.bean.IdentityBean; -import org.apache.airavata.cloud.aurora.client.bean.JobConfigBean; -import org.apache.airavata.cloud.aurora.client.bean.JobDetailsResponseBean; -import org.apache.airavata.cloud.aurora.client.bean.JobKeyBean; -import org.apache.airavata.cloud.aurora.client.bean.PendingJobReasonBean; -import org.apache.airavata.cloud.aurora.client.bean.ProcessBean; -import org.apache.airavata.cloud.aurora.client.bean.ResourceBean; -import org.apache.airavata.cloud.aurora.client.bean.ResponseBean; -import org.apache.airavata.cloud.aurora.client.bean.ServerInfoBean; -import org.apache.airavata.cloud.aurora.client.sdk.ExecutorConfig; -import org.apache.airavata.cloud.aurora.client.sdk.Identity; -import org.apache.airavata.cloud.aurora.client.sdk.JobConfiguration; -import org.apache.airavata.cloud.aurora.client.sdk.JobKey; -import org.apache.airavata.cloud.aurora.client.sdk.ReadOnlyScheduler; -import org.apache.airavata.cloud.aurora.client.sdk.Resource; -import org.apache.airavata.cloud.aurora.client.sdk.Response; -import org.apache.airavata.cloud.aurora.client.sdk.TaskConfig; -import org.apache.airavata.common.utils.ServerSettings; -import org.json.JSONObject; -import org.json.JSONTokener; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * The Class AuroraThriftClientUtil. - */ -public class AuroraThriftClientUtil { - - /** The Constant logger. */ - private final static Logger logger = LoggerFactory.getLogger(AuroraThriftClientUtil.class); - - /** - * Gets the executor config json. - * - * @param jobConfig the job config - * @return the executor config json - * @throws Exception the exception - */ - public static String getExecutorConfigJson(JobConfigBean jobConfig) throws Exception { - String exeConfigJson = null; - try { - // read the executor config json template - InputStream resourceAsStream = AuroraThriftClientUtil.class.getClassLoader() - .getResourceAsStream(ServerSettings.getAuroraExecutorConfigTemplateFileName()); - JSONObject exeConfig = new JSONObject(new JSONTokener(resourceAsStream)); - if(exeConfig != null) { - exeConfig.put("environment", jobConfig.getJob().getEnvironment()); - exeConfig.put("name", jobConfig.getJob().getName()); - exeConfig.put("role", jobConfig.getJob().getRole()); - exeConfig.put("cluster", jobConfig.getCluster()); - exeConfig.put("max_task_failures", jobConfig.getMaxTaskFailures()); - exeConfig.put("service", jobConfig.isService()); - - exeConfig.getJSONObject("task").put("name", jobConfig.getTaskConfig().getTaskName()); - - // add task resources - exeConfig.getJSONObject("task").getJSONObject("resources") - .put("cpu", jobConfig.getTaskConfig().getResources().getNumCpus()); - - exeConfig.getJSONObject("task").getJSONObject("resources") - .put("disk", jobConfig.getTaskConfig().getResources().getDiskMb() * 1024 * 1024); - - exeConfig.getJSONObject("task").getJSONObject("resources") - .put("ram", jobConfig.getTaskConfig().getResources().getRamMb() * 1024 * 1024); - - // iterate over all processes - for(ProcessBean process : jobConfig.getTaskConfig().getProcesses()) { - // add process to constraints - exeConfig.getJSONObject("task") - .getJSONArray("constraints") - .getJSONObject(0) - .getJSONArray("order").put(process.getName()); - - // define the process json - JSONObject processJson = new JSONObject(); - processJson.put("final", process.isFinal()) - .put("daemon", process.isDaemon()) - .put("name", process.getName()) - .put("ephemeral", process.isEphemeral()) - .put("max_failures", process.getMax_failures()) - .put("min_duration", process.getMin_duration()) - .put("cmdline", process.getCmdLine()); - - // add process json to list - exeConfig.getJSONObject("task") - .getJSONArray("processes").put(processJson); - } - - // convert json object to string - exeConfigJson = exeConfig.toString(); - } - } catch(Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; - } - return exeConfigJson; - } - - /** - * Gets the resource set. - * - * @param resources the resources - * @return the resource set - * @throws Exception the exception - */ - public static Set<Resource> getResourceSet(ResourceBean resources) throws Exception { - Set<Resource> resourceSet = new HashSet<>(); - - try { - if(resources != null) { - // add numCpus - Resource resource = new Resource(); - resource.setNumCpus(resources.getNumCpus()); - resourceSet.add(resource); - - // add diskMb - resource = new Resource(); - resource.setDiskMb(resources.getDiskMb()); - resourceSet.add(resource); - - // add ramMb - resource = new Resource(); - resource.setRamMb(resources.getRamMb()); - resourceSet.add(resource); - } else { - throw new Exception("Resource Bean is NULL!"); - } - } catch(Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; - } - - return resourceSet; - } - - /** - * Gets the executor config. - * - * @param exeConfigJson the exe config json - * @return the executor config - * @throws Exception the exception - */ - public static ExecutorConfig getExecutorConfig(String exeConfigJson) throws Exception { - ExecutorConfig exeConfig = null; - - try { - String executorName = ServerSettings.getAuroraExecutorName(); - - // create the executor config - if(exeConfigJson != null) { - exeConfig = new ExecutorConfig(executorName, exeConfigJson); - } else { - throw new Exception("Aurora Executor Config Data is NULL!"); - } - } catch(Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; - } - - return exeConfig; - } - - /** - * Gets the aurora job key. - * - * @param jobKeyBean the job key bean - * @return the aurora job key - * @throws Exception the exception - */ - public static JobKey getAuroraJobKey(JobKeyBean jobKeyBean) throws Exception { - JobKey jobKey = null; - - try { - if(jobKeyBean != null) { - jobKey = new JobKey(jobKeyBean.getRole(), - jobKeyBean.getEnvironment(), - jobKeyBean.getName()); - } else { - throw new Exception("JobKey Bean is NULL!"); - } - } catch(Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; - } - - return jobKey; - } - - /** - * Gets the aurora identity. - * - * @param identityBean the identity bean - * @return the aurora identity - * @throws Exception the exception - */ - public static Identity getAuroraIdentity(IdentityBean identityBean) throws Exception { - Identity owner = null; - - try { - if(identityBean != null) { - owner = new Identity(identityBean.getUser()); - } else { - throw new Exception("Identity Bean is NULL!"); - } - } catch(Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; - } - - return owner; - } - - /** - * Gets the aurora job config. - * - * @param jobConfigBean the job config bean - * @return the aurora job config - * @throws Exception the exception - */ - public static JobConfiguration getAuroraJobConfig(JobConfigBean jobConfigBean) throws Exception { - JobConfiguration jobConfig = null; - - try { - if(jobConfigBean != null && - jobConfigBean.getTaskConfig() != null) { - - JobKey jobKey = getAuroraJobKey(jobConfigBean.getJob()); - Identity owner = getAuroraIdentity(jobConfigBean.getOwner()); - // Construct the task config - TaskConfig taskConfig = new TaskConfig(); - taskConfig.setJob(jobKey); - taskConfig.setOwner(owner); - taskConfig.setIsService(jobConfigBean.isService()); - taskConfig.setNumCpus(jobConfigBean.getTaskConfig().getResources().getNumCpus()); - taskConfig.setRamMb(jobConfigBean.getTaskConfig().getResources().getRamMb()); - taskConfig.setDiskMb(jobConfigBean.getTaskConfig().getResources().getDiskMb()); - taskConfig.setPriority(jobConfigBean.getPriority()); - taskConfig.setMaxTaskFailures(jobConfigBean.getMaxTaskFailures()); - taskConfig.setResources(getResourceSet(jobConfigBean.getTaskConfig().getResources())); - - // construct the executor config for this job - taskConfig.setExecutorConfig(getExecutorConfig(getExecutorConfigJson(jobConfigBean))); - - // construct the job configuration - jobConfig = new JobConfiguration(jobKey, - owner, null, taskConfig, jobConfigBean.getInstances()); - - } else { - throw new Exception("JobConfig, TaskConfig Bean is/are NULL!"); - } - } catch(Exception ex) { - logger.error(ex.getMessage(), ex); - throw ex; - } - - return jobConfig; - } - - /** - * Gets the response bean. - * - * @param response the response - * @param resultType the result type - * @return the response bean - */ - public static ResponseBean getResponseBean(Response response, ResponseResultType resultType) { - switch (resultType) { - case GET_JOBS: - return getJobsResponseBean(response); - case GET_JOB_DETAILS: - return getJobDetailsResponseBean(response); - case GET_PENDING_JOB_REASON: - return getPendingJobReasonBean(response); - default: - return getJobResponse(response); - } - } - - /** - * Gets the job details response bean. - * - * @param response the response - * @return the job details response bean - */ - private static JobDetailsResponseBean getJobDetailsResponseBean(Response response) { - JobDetailsResponseBean responseBean = null; - if(response != null) { - responseBean = new JobDetailsResponseBean(getJobResponse(response)); - responseBean.setTasks(response.getResult().getScheduleStatusResult().getTasks()); - } - - return responseBean; - } - - /** - * Gets the pending job reason bean. - * - * @param response the response - * @return the pending job reason bean - */ - private static PendingJobReasonBean getPendingJobReasonBean(Response response) { - PendingJobReasonBean responseBean = null; - if(response != null) { - responseBean = new PendingJobReasonBean(getJobResponse(response)); - responseBean.setReasons(response.getResult().getGetPendingReasonResult().getReasons()); - } - - return responseBean; - } - - /** - * Gets the jobs response bean. - * - * @param response the response - * @return the jobs response bean - */ - private static GetJobsResponseBean getJobsResponseBean(Response response) { - GetJobsResponseBean responseBean = null; - if(response != null) { - responseBean = new GetJobsResponseBean(getJobResponse(response)); - //TODO: set jobconfig list in response - } - - return responseBean; - } - - /** - * Gets the job response. - * - * @param response the response - * @return the job response - */ - private static ResponseBean getJobResponse(Response response) { - ResponseBean responseBean = null; - if(response != null) { - responseBean = new ResponseBean(); - responseBean.setResponseCode(ResponseCodeEnum - .findByValue(response.getResponseCode().getValue())); - - ServerInfoBean serverInfo = new ServerInfoBean(response.getServerInfo().getClusterName(), - response.getServerInfo().getStatsUrlPrefix()); - responseBean.setServerInfo(serverInfo); - } - - return responseBean; - } - - /** - * Checks if is scheduler host reachable. - * - * @param connectionUrl the connection url - * @param connectionTimeout the connection timeout - * @return true, if is scheduler host reachable - */ - public static boolean isSchedulerHostReachable(String connectionUrl, int connectionTimeout) { - boolean isReachable = false; - ReadOnlyScheduler.Client auroraSchedulerClient = null; - try { - // connect to scheduler & run dummy command - auroraSchedulerClient = AuroraSchedulerClientFactory.createReadOnlySchedulerClient(connectionUrl, connectionTimeout); - auroraSchedulerClient.getTierConfigs(); - - // host is reachable - isReachable = true; - } catch(Exception ex) { - logger.error("Timed-out connecting to URL: " + connectionUrl); - } - return isReachable; - } - - /** - * The main method. - * - * @param args the arguments - * @throws Exception the exception - */ - public static void main(String[] args) throws Exception { -// JobKeyBean jobKey = new JobKeyBean("devel", "centos", "test_job"); -// IdentityBean owner = new IdentityBean("centos"); -// -// ProcessBean proc1 = new ProcessBean("process_1", "echo 'hello_world_1'", false); -// ProcessBean proc2 = new ProcessBean("process_2", "echo 'hello_world_2'", false); -// Set<ProcessBean> processes = new HashSet<>(); -// processes.add(proc1); -// processes.add(proc2); -// -// ResourceBean resources = new ResourceBean(0.1, 8, 1); -// -// TaskConfigBean taskConfig = new TaskConfigBean("task_hello_world", processes, resources); -// JobConfigBean jobConfig = new JobConfigBean(jobKey, owner, taskConfig, "example"); -// -// String executorConfigJson = getExecutorConfigJson(jobConfig); -// System.out.println(executorConfigJson); - -// System.out.println(new Scanner(AuroraThriftClientUtil.class.getClassLoader().getResourceAsStream("executor-config-template.json"), "UTF-8").useDelimiter("\\A").next()); - } -} 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/util/Constants.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/Constants.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/Constants.java deleted file mode 100644 index fea8d92..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/Constants.java +++ /dev/null @@ -1,47 +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. - */ -package org.apache.airavata.cloud.aurora.util; - -/** - * The Class Constants. - */ -public class Constants { - - /** The Constant AURORA_SCHEDULER_PROP_FILE. */ - public static final String AURORA_SCHEDULER_PROP_FILE = "aurora-scheduler.properties"; - - /** The Constant AURORA_SCHEDULER_HOST. */ - public static final String AURORA_SCHEDULER_HOSTS = "aurora.scheduler.hosts"; - - /** The Constant AURORA_SCHEDULER_PORT. */ - public static final String AURORA_SCHEDULER_PORT = "aurora.scheduler.port"; - - /** The Constant AURORA_EXECUTOR_NAME. */ - public static final String AURORA_EXECUTOR_NAME = "aurora.executor.name"; - - /** The Constant MESOS_CLUSTER_NAME. */ - public static final String MESOS_CLUSTER_NAME = "mesos.cluster.name"; - - /** The Constant AURORA_SCHEDULER_CONNECTION_URL. */ - public static final String AURORA_SCHEDULER_CONNECTION_URL = "http://%s:%s/api"; - - /** The Constant AURORA_SCHEDULER_CONNECT_TIMEOUT_MS. */ - public static final String AURORA_SCHEDULER_CONNECT_TIMEOUT_MS = "aurora.scheduler.timeoutms"; -} 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/util/ResponseCodeEnum.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/ResponseCodeEnum.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/ResponseCodeEnum.java deleted file mode 100644 index 39228ea..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/ResponseCodeEnum.java +++ /dev/null @@ -1,95 +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. - */ -package org.apache.airavata.cloud.aurora.util; - -/** - * The Enum ResponseCodeEnum. - */ -public enum ResponseCodeEnum { - - /** The invalid request. */ - INVALID_REQUEST(0), - - /** The ok. */ - OK(1), - - /** The error. */ - ERROR(2), - - /** The warning. */ - WARNING(3), - - /** The auth failed. */ - AUTH_FAILED(4), - - /** The lock error. */ - LOCK_ERROR(5), - - /** The error transient. */ - ERROR_TRANSIENT(6); - - /** The value. */ - private final int value; - - /** - * Instantiates a new response code enum. - * - * @param value the value - */ - private ResponseCodeEnum(int value) { - this.value = value; - } - - /** - * Gets the value. - * - * @return the value - */ - public int getValue() { - return value; - } - - /** - * Find by value. - * - * @param value the value - * @return the response code enum - */ - public static ResponseCodeEnum 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; - } - } -} 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/util/ResponseResultType.java ---------------------------------------------------------------------- diff --git a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/ResponseResultType.java b/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/ResponseResultType.java deleted file mode 100644 index 2dc0547..0000000 --- a/modules/cloud/aurora-client/src/main/java/org/apache/airavata/cloud/aurora/util/ResponseResultType.java +++ /dev/null @@ -1,47 +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. - */ -package org.apache.airavata.cloud.aurora.util; - -/** - * The Enum ResponseResultType. - */ -public enum ResponseResultType { - - /** The create job. */ - CREATE_JOB, - - /** The get jobs. */ - GET_JOBS, - - /** The get job summary. */ - GET_JOB_SUMMARY, - - /** The get pending reason. */ - GET_PENDING_REASON, - - /** The get job details. */ - GET_JOB_DETAILS, - - /** The get pending job reason. */ - GET_PENDING_JOB_REASON, - - /** The kill task. */ - KILL_TASKS -}
