http://git-wip-us.apache.org/repos/asf/airavata/blob/122fb8da/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/APICredential.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/APICredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/APICredential.java deleted file mode 100644 index 27347e9..0000000 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/APICredential.java +++ /dev/null @@ -1,723 +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.credential.store.datamodel; - -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)") -public class APICredential implements org.apache.thrift.TBase<APICredential, APICredential._Fields>, java.io.Serializable, Cloneable, Comparable<APICredential> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("APICredential"); - - private static final org.apache.thrift.protocol.TField API_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("apiKey", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField API_SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("apiSecret", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new APICredentialStandardSchemeFactory()); - schemes.put(TupleScheme.class, new APICredentialTupleSchemeFactory()); - } - - public String apiKey; // required - public String apiSecret; // required - public long persistedTime; // optional - public String token; // 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 { - API_KEY((short)1, "apiKey"), - API_SECRET((short)2, "apiSecret"), - PERSISTED_TIME((short)3, "persistedTime"), - TOKEN((short)4, "token"); - - 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: // API_KEY - return API_KEY; - case 2: // API_SECRET - return API_SECRET; - case 3: // PERSISTED_TIME - return PERSISTED_TIME; - case 4: // TOKEN - return TOKEN; - 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 __PERSISTEDTIME_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.PERSISTED_TIME,_Fields.TOKEN}; - 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.API_KEY, new org.apache.thrift.meta_data.FieldMetaData("apiKey", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.API_SECRET, new org.apache.thrift.meta_data.FieldMetaData("apiSecret", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(APICredential.class, metaDataMap); - } - - public APICredential() { - } - - public APICredential( - String apiKey, - String apiSecret) - { - this(); - this.apiKey = apiKey; - this.apiSecret = apiSecret; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public APICredential(APICredential other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetApiKey()) { - this.apiKey = other.apiKey; - } - if (other.isSetApiSecret()) { - this.apiSecret = other.apiSecret; - } - this.persistedTime = other.persistedTime; - if (other.isSetToken()) { - this.token = other.token; - } - } - - public APICredential deepCopy() { - return new APICredential(this); - } - - @Override - public void clear() { - this.apiKey = null; - this.apiSecret = null; - setPersistedTimeIsSet(false); - this.persistedTime = 0; - this.token = null; - } - - public String getApiKey() { - return this.apiKey; - } - - public APICredential setApiKey(String apiKey) { - this.apiKey = apiKey; - return this; - } - - public void unsetApiKey() { - this.apiKey = null; - } - - /** Returns true if field apiKey is set (has been assigned a value) and false otherwise */ - public boolean isSetApiKey() { - return this.apiKey != null; - } - - public void setApiKeyIsSet(boolean value) { - if (!value) { - this.apiKey = null; - } - } - - public String getApiSecret() { - return this.apiSecret; - } - - public APICredential setApiSecret(String apiSecret) { - this.apiSecret = apiSecret; - return this; - } - - public void unsetApiSecret() { - this.apiSecret = null; - } - - /** Returns true if field apiSecret is set (has been assigned a value) and false otherwise */ - public boolean isSetApiSecret() { - return this.apiSecret != null; - } - - public void setApiSecretIsSet(boolean value) { - if (!value) { - this.apiSecret = null; - } - } - - public long getPersistedTime() { - return this.persistedTime; - } - - public APICredential setPersistedTime(long persistedTime) { - this.persistedTime = persistedTime; - setPersistedTimeIsSet(true); - return this; - } - - public void unsetPersistedTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID); - } - - /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */ - public boolean isSetPersistedTime() { - return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID); - } - - public void setPersistedTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value); - } - - public String getToken() { - return this.token; - } - - public APICredential setToken(String token) { - this.token = token; - return this; - } - - public void unsetToken() { - this.token = null; - } - - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != null; - } - - public void setTokenIsSet(boolean value) { - if (!value) { - this.token = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case API_KEY: - if (value == null) { - unsetApiKey(); - } else { - setApiKey((String)value); - } - break; - - case API_SECRET: - if (value == null) { - unsetApiSecret(); - } else { - setApiSecret((String)value); - } - break; - - case PERSISTED_TIME: - if (value == null) { - unsetPersistedTime(); - } else { - setPersistedTime((Long)value); - } - break; - - case TOKEN: - if (value == null) { - unsetToken(); - } else { - setToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case API_KEY: - return getApiKey(); - - case API_SECRET: - return getApiSecret(); - - case PERSISTED_TIME: - return getPersistedTime(); - - case TOKEN: - return getToken(); - - } - 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 API_KEY: - return isSetApiKey(); - case API_SECRET: - return isSetApiSecret(); - case PERSISTED_TIME: - return isSetPersistedTime(); - case TOKEN: - return isSetToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof APICredential) - return this.equals((APICredential)that); - return false; - } - - public boolean equals(APICredential that) { - if (that == null) - return false; - - boolean this_present_apiKey = true && this.isSetApiKey(); - boolean that_present_apiKey = true && that.isSetApiKey(); - if (this_present_apiKey || that_present_apiKey) { - if (!(this_present_apiKey && that_present_apiKey)) - return false; - if (!this.apiKey.equals(that.apiKey)) - return false; - } - - boolean this_present_apiSecret = true && this.isSetApiSecret(); - boolean that_present_apiSecret = true && that.isSetApiSecret(); - if (this_present_apiSecret || that_present_apiSecret) { - if (!(this_present_apiSecret && that_present_apiSecret)) - return false; - if (!this.apiSecret.equals(that.apiSecret)) - return false; - } - - boolean this_present_persistedTime = true && this.isSetPersistedTime(); - boolean that_present_persistedTime = true && that.isSetPersistedTime(); - if (this_present_persistedTime || that_present_persistedTime) { - if (!(this_present_persistedTime && that_present_persistedTime)) - return false; - if (this.persistedTime != that.persistedTime) - return false; - } - - boolean this_present_token = true && this.isSetToken(); - boolean that_present_token = true && that.isSetToken(); - if (this_present_token || that_present_token) { - if (!(this_present_token && that_present_token)) - return false; - if (!this.token.equals(that.token)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_apiKey = true && (isSetApiKey()); - list.add(present_apiKey); - if (present_apiKey) - list.add(apiKey); - - boolean present_apiSecret = true && (isSetApiSecret()); - list.add(present_apiSecret); - if (present_apiSecret) - list.add(apiSecret); - - boolean present_persistedTime = true && (isSetPersistedTime()); - list.add(present_persistedTime); - if (present_persistedTime) - list.add(persistedTime); - - boolean present_token = true && (isSetToken()); - list.add(present_token); - if (present_token) - list.add(token); - - return list.hashCode(); - } - - @Override - public int compareTo(APICredential other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetApiKey()).compareTo(other.isSetApiKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApiKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.apiKey, other.apiKey); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetApiSecret()).compareTo(other.isSetApiSecret()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetApiSecret()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.apiSecret, other.apiSecret); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPersistedTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); - 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("APICredential("); - boolean first = true; - - sb.append("apiKey:"); - if (this.apiKey == null) { - sb.append("null"); - } else { - sb.append(this.apiKey); - } - first = false; - if (!first) sb.append(", "); - sb.append("apiSecret:"); - if (this.apiSecret == null) { - sb.append("null"); - } else { - sb.append(this.apiSecret); - } - first = false; - if (isSetPersistedTime()) { - if (!first) sb.append(", "); - sb.append("persistedTime:"); - sb.append(this.persistedTime); - first = false; - } - if (isSetToken()) { - if (!first) sb.append(", "); - sb.append("token:"); - if (this.token == null) { - sb.append("null"); - } else { - sb.append(this.token); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (apiKey == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'apiKey' was not present! Struct: " + toString()); - } - if (apiSecret == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'apiSecret' was not present! Struct: " + toString()); - } - // 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 APICredentialStandardSchemeFactory implements SchemeFactory { - public APICredentialStandardScheme getScheme() { - return new APICredentialStandardScheme(); - } - } - - private static class APICredentialStandardScheme extends StandardScheme<APICredential> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, APICredential 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: // API_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.apiKey = iprot.readString(); - struct.setApiKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // API_SECRET - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.apiSecret = iprot.readString(); - struct.setApiSecretIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PERSISTED_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.persistedTime = iprot.readI64(); - struct.setPersistedTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.token = iprot.readString(); - struct.setTokenIsSet(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, APICredential struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.apiKey != null) { - oprot.writeFieldBegin(API_KEY_FIELD_DESC); - oprot.writeString(struct.apiKey); - oprot.writeFieldEnd(); - } - if (struct.apiSecret != null) { - oprot.writeFieldBegin(API_SECRET_FIELD_DESC); - oprot.writeString(struct.apiSecret); - oprot.writeFieldEnd(); - } - if (struct.isSetPersistedTime()) { - oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC); - oprot.writeI64(struct.persistedTime); - oprot.writeFieldEnd(); - } - if (struct.token != null) { - if (struct.isSetToken()) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - oprot.writeString(struct.token); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class APICredentialTupleSchemeFactory implements SchemeFactory { - public APICredentialTupleScheme getScheme() { - return new APICredentialTupleScheme(); - } - } - - private static class APICredentialTupleScheme extends TupleScheme<APICredential> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, APICredential struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.apiKey); - oprot.writeString(struct.apiSecret); - BitSet optionals = new BitSet(); - if (struct.isSetPersistedTime()) { - optionals.set(0); - } - if (struct.isSetToken()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetPersistedTime()) { - oprot.writeI64(struct.persistedTime); - } - if (struct.isSetToken()) { - oprot.writeString(struct.token); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, APICredential struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.apiKey = iprot.readString(); - struct.setApiKeyIsSet(true); - struct.apiSecret = iprot.readString(); - struct.setApiSecretIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.persistedTime = iprot.readI64(); - struct.setPersistedTimeIsSet(true); - } - if (incoming.get(1)) { - struct.token = iprot.readString(); - struct.setTokenIsSet(true); - } - } - } - -} -
http://git-wip-us.apache.org/repos/asf/airavata/blob/122fb8da/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java deleted file mode 100644 index 989b277..0000000 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java +++ /dev/null @@ -1,1149 +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.credential.store.datamodel; - -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)") -public class CertificateCredential implements org.apache.thrift.TBase<CertificateCredential, CertificateCredential._Fields>, java.io.Serializable, Cloneable, Comparable<CertificateCredential> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CertificateCredential"); - - private static final org.apache.thrift.protocol.TField COMMUNITY_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("communityUser", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField X509_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("x509Cert", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("notAfter", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PRIVATE_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("privateKey", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField LIFE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lifeTime", org.apache.thrift.protocol.TType.I64, (short)5); - private static final org.apache.thrift.protocol.TField NOT_BEFORE_FIELD_DESC = new org.apache.thrift.protocol.TField("notBefore", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I64, (short)7); - private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)8); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CertificateCredentialStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CertificateCredentialTupleSchemeFactory()); - } - - public CommunityUser communityUser; // required - public String x509Cert; // required - public String notAfter; // optional - public String privateKey; // optional - public long lifeTime; // optional - public String notBefore; // optional - public long persistedTime; // optional - public String token; // 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 { - COMMUNITY_USER((short)1, "communityUser"), - X509_CERT((short)2, "x509Cert"), - NOT_AFTER((short)3, "notAfter"), - PRIVATE_KEY((short)4, "privateKey"), - LIFE_TIME((short)5, "lifeTime"), - NOT_BEFORE((short)6, "notBefore"), - PERSISTED_TIME((short)7, "persistedTime"), - TOKEN((short)8, "token"); - - 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: // COMMUNITY_USER - return COMMUNITY_USER; - case 2: // X509_CERT - return X509_CERT; - case 3: // NOT_AFTER - return NOT_AFTER; - case 4: // PRIVATE_KEY - return PRIVATE_KEY; - case 5: // LIFE_TIME - return LIFE_TIME; - case 6: // NOT_BEFORE - return NOT_BEFORE; - case 7: // PERSISTED_TIME - return PERSISTED_TIME; - case 8: // TOKEN - return TOKEN; - 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 __LIFETIME_ISSET_ID = 0; - private static final int __PERSISTEDTIME_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.NOT_AFTER,_Fields.PRIVATE_KEY,_Fields.LIFE_TIME,_Fields.NOT_BEFORE,_Fields.PERSISTED_TIME,_Fields.TOKEN}; - 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.COMMUNITY_USER, new org.apache.thrift.meta_data.FieldMetaData("communityUser", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommunityUser.class))); - tmpMap.put(_Fields.X509_CERT, new org.apache.thrift.meta_data.FieldMetaData("x509Cert", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.NOT_AFTER, new org.apache.thrift.meta_data.FieldMetaData("notAfter", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PRIVATE_KEY, new org.apache.thrift.meta_data.FieldMetaData("privateKey", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.LIFE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lifeTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.NOT_BEFORE, new org.apache.thrift.meta_data.FieldMetaData("notBefore", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PERSISTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("persistedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CertificateCredential.class, metaDataMap); - } - - public CertificateCredential() { - } - - public CertificateCredential( - CommunityUser communityUser, - String x509Cert) - { - this(); - this.communityUser = communityUser; - this.x509Cert = x509Cert; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public CertificateCredential(CertificateCredential other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetCommunityUser()) { - this.communityUser = new CommunityUser(other.communityUser); - } - if (other.isSetX509Cert()) { - this.x509Cert = other.x509Cert; - } - if (other.isSetNotAfter()) { - this.notAfter = other.notAfter; - } - if (other.isSetPrivateKey()) { - this.privateKey = other.privateKey; - } - this.lifeTime = other.lifeTime; - if (other.isSetNotBefore()) { - this.notBefore = other.notBefore; - } - this.persistedTime = other.persistedTime; - if (other.isSetToken()) { - this.token = other.token; - } - } - - public CertificateCredential deepCopy() { - return new CertificateCredential(this); - } - - @Override - public void clear() { - this.communityUser = null; - this.x509Cert = null; - this.notAfter = null; - this.privateKey = null; - setLifeTimeIsSet(false); - this.lifeTime = 0; - this.notBefore = null; - setPersistedTimeIsSet(false); - this.persistedTime = 0; - this.token = null; - } - - public CommunityUser getCommunityUser() { - return this.communityUser; - } - - public CertificateCredential setCommunityUser(CommunityUser communityUser) { - this.communityUser = communityUser; - return this; - } - - public void unsetCommunityUser() { - this.communityUser = null; - } - - /** Returns true if field communityUser is set (has been assigned a value) and false otherwise */ - public boolean isSetCommunityUser() { - return this.communityUser != null; - } - - public void setCommunityUserIsSet(boolean value) { - if (!value) { - this.communityUser = null; - } - } - - public String getX509Cert() { - return this.x509Cert; - } - - public CertificateCredential setX509Cert(String x509Cert) { - this.x509Cert = x509Cert; - return this; - } - - public void unsetX509Cert() { - this.x509Cert = null; - } - - /** Returns true if field x509Cert is set (has been assigned a value) and false otherwise */ - public boolean isSetX509Cert() { - return this.x509Cert != null; - } - - public void setX509CertIsSet(boolean value) { - if (!value) { - this.x509Cert = null; - } - } - - public String getNotAfter() { - return this.notAfter; - } - - public CertificateCredential setNotAfter(String notAfter) { - this.notAfter = notAfter; - return this; - } - - public void unsetNotAfter() { - this.notAfter = null; - } - - /** Returns true if field notAfter is set (has been assigned a value) and false otherwise */ - public boolean isSetNotAfter() { - return this.notAfter != null; - } - - public void setNotAfterIsSet(boolean value) { - if (!value) { - this.notAfter = null; - } - } - - public String getPrivateKey() { - return this.privateKey; - } - - public CertificateCredential setPrivateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } - - public void unsetPrivateKey() { - this.privateKey = null; - } - - /** Returns true if field privateKey is set (has been assigned a value) and false otherwise */ - public boolean isSetPrivateKey() { - return this.privateKey != null; - } - - public void setPrivateKeyIsSet(boolean value) { - if (!value) { - this.privateKey = null; - } - } - - public long getLifeTime() { - return this.lifeTime; - } - - public CertificateCredential setLifeTime(long lifeTime) { - this.lifeTime = lifeTime; - setLifeTimeIsSet(true); - return this; - } - - public void unsetLifeTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIFETIME_ISSET_ID); - } - - /** Returns true if field lifeTime is set (has been assigned a value) and false otherwise */ - public boolean isSetLifeTime() { - return EncodingUtils.testBit(__isset_bitfield, __LIFETIME_ISSET_ID); - } - - public void setLifeTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIFETIME_ISSET_ID, value); - } - - public String getNotBefore() { - return this.notBefore; - } - - public CertificateCredential setNotBefore(String notBefore) { - this.notBefore = notBefore; - return this; - } - - public void unsetNotBefore() { - this.notBefore = null; - } - - /** Returns true if field notBefore is set (has been assigned a value) and false otherwise */ - public boolean isSetNotBefore() { - return this.notBefore != null; - } - - public void setNotBeforeIsSet(boolean value) { - if (!value) { - this.notBefore = null; - } - } - - public long getPersistedTime() { - return this.persistedTime; - } - - public CertificateCredential setPersistedTime(long persistedTime) { - this.persistedTime = persistedTime; - setPersistedTimeIsSet(true); - return this; - } - - public void unsetPersistedTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID); - } - - /** Returns true if field persistedTime is set (has been assigned a value) and false otherwise */ - public boolean isSetPersistedTime() { - return EncodingUtils.testBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID); - } - - public void setPersistedTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PERSISTEDTIME_ISSET_ID, value); - } - - public String getToken() { - return this.token; - } - - public CertificateCredential setToken(String token) { - this.token = token; - return this; - } - - public void unsetToken() { - this.token = null; - } - - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != null; - } - - public void setTokenIsSet(boolean value) { - if (!value) { - this.token = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COMMUNITY_USER: - if (value == null) { - unsetCommunityUser(); - } else { - setCommunityUser((CommunityUser)value); - } - break; - - case X509_CERT: - if (value == null) { - unsetX509Cert(); - } else { - setX509Cert((String)value); - } - break; - - case NOT_AFTER: - if (value == null) { - unsetNotAfter(); - } else { - setNotAfter((String)value); - } - break; - - case PRIVATE_KEY: - if (value == null) { - unsetPrivateKey(); - } else { - setPrivateKey((String)value); - } - break; - - case LIFE_TIME: - if (value == null) { - unsetLifeTime(); - } else { - setLifeTime((Long)value); - } - break; - - case NOT_BEFORE: - if (value == null) { - unsetNotBefore(); - } else { - setNotBefore((String)value); - } - break; - - case PERSISTED_TIME: - if (value == null) { - unsetPersistedTime(); - } else { - setPersistedTime((Long)value); - } - break; - - case TOKEN: - if (value == null) { - unsetToken(); - } else { - setToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COMMUNITY_USER: - return getCommunityUser(); - - case X509_CERT: - return getX509Cert(); - - case NOT_AFTER: - return getNotAfter(); - - case PRIVATE_KEY: - return getPrivateKey(); - - case LIFE_TIME: - return getLifeTime(); - - case NOT_BEFORE: - return getNotBefore(); - - case PERSISTED_TIME: - return getPersistedTime(); - - case TOKEN: - return getToken(); - - } - 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 COMMUNITY_USER: - return isSetCommunityUser(); - case X509_CERT: - return isSetX509Cert(); - case NOT_AFTER: - return isSetNotAfter(); - case PRIVATE_KEY: - return isSetPrivateKey(); - case LIFE_TIME: - return isSetLifeTime(); - case NOT_BEFORE: - return isSetNotBefore(); - case PERSISTED_TIME: - return isSetPersistedTime(); - case TOKEN: - return isSetToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CertificateCredential) - return this.equals((CertificateCredential)that); - return false; - } - - public boolean equals(CertificateCredential that) { - if (that == null) - return false; - - boolean this_present_communityUser = true && this.isSetCommunityUser(); - boolean that_present_communityUser = true && that.isSetCommunityUser(); - if (this_present_communityUser || that_present_communityUser) { - if (!(this_present_communityUser && that_present_communityUser)) - return false; - if (!this.communityUser.equals(that.communityUser)) - return false; - } - - boolean this_present_x509Cert = true && this.isSetX509Cert(); - boolean that_present_x509Cert = true && that.isSetX509Cert(); - if (this_present_x509Cert || that_present_x509Cert) { - if (!(this_present_x509Cert && that_present_x509Cert)) - return false; - if (!this.x509Cert.equals(that.x509Cert)) - return false; - } - - boolean this_present_notAfter = true && this.isSetNotAfter(); - boolean that_present_notAfter = true && that.isSetNotAfter(); - if (this_present_notAfter || that_present_notAfter) { - if (!(this_present_notAfter && that_present_notAfter)) - return false; - if (!this.notAfter.equals(that.notAfter)) - return false; - } - - boolean this_present_privateKey = true && this.isSetPrivateKey(); - boolean that_present_privateKey = true && that.isSetPrivateKey(); - if (this_present_privateKey || that_present_privateKey) { - if (!(this_present_privateKey && that_present_privateKey)) - return false; - if (!this.privateKey.equals(that.privateKey)) - return false; - } - - boolean this_present_lifeTime = true && this.isSetLifeTime(); - boolean that_present_lifeTime = true && that.isSetLifeTime(); - if (this_present_lifeTime || that_present_lifeTime) { - if (!(this_present_lifeTime && that_present_lifeTime)) - return false; - if (this.lifeTime != that.lifeTime) - return false; - } - - boolean this_present_notBefore = true && this.isSetNotBefore(); - boolean that_present_notBefore = true && that.isSetNotBefore(); - if (this_present_notBefore || that_present_notBefore) { - if (!(this_present_notBefore && that_present_notBefore)) - return false; - if (!this.notBefore.equals(that.notBefore)) - return false; - } - - boolean this_present_persistedTime = true && this.isSetPersistedTime(); - boolean that_present_persistedTime = true && that.isSetPersistedTime(); - if (this_present_persistedTime || that_present_persistedTime) { - if (!(this_present_persistedTime && that_present_persistedTime)) - return false; - if (this.persistedTime != that.persistedTime) - return false; - } - - boolean this_present_token = true && this.isSetToken(); - boolean that_present_token = true && that.isSetToken(); - if (this_present_token || that_present_token) { - if (!(this_present_token && that_present_token)) - return false; - if (!this.token.equals(that.token)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_communityUser = true && (isSetCommunityUser()); - list.add(present_communityUser); - if (present_communityUser) - list.add(communityUser); - - boolean present_x509Cert = true && (isSetX509Cert()); - list.add(present_x509Cert); - if (present_x509Cert) - list.add(x509Cert); - - boolean present_notAfter = true && (isSetNotAfter()); - list.add(present_notAfter); - if (present_notAfter) - list.add(notAfter); - - boolean present_privateKey = true && (isSetPrivateKey()); - list.add(present_privateKey); - if (present_privateKey) - list.add(privateKey); - - boolean present_lifeTime = true && (isSetLifeTime()); - list.add(present_lifeTime); - if (present_lifeTime) - list.add(lifeTime); - - boolean present_notBefore = true && (isSetNotBefore()); - list.add(present_notBefore); - if (present_notBefore) - list.add(notBefore); - - boolean present_persistedTime = true && (isSetPersistedTime()); - list.add(present_persistedTime); - if (present_persistedTime) - list.add(persistedTime); - - boolean present_token = true && (isSetToken()); - list.add(present_token); - if (present_token) - list.add(token); - - return list.hashCode(); - } - - @Override - public int compareTo(CertificateCredential other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetCommunityUser()).compareTo(other.isSetCommunityUser()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCommunityUser()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.communityUser, other.communityUser); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetX509Cert()).compareTo(other.isSetX509Cert()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetX509Cert()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.x509Cert, other.x509Cert); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNotAfter()).compareTo(other.isSetNotAfter()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNotAfter()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notAfter, other.notAfter); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPrivateKey()).compareTo(other.isSetPrivateKey()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPrivateKey()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privateKey, other.privateKey); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLifeTime()).compareTo(other.isSetLifeTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLifeTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lifeTime, other.lifeTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNotBefore()).compareTo(other.isSetNotBefore()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNotBefore()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notBefore, other.notBefore); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPersistedTime()).compareTo(other.isSetPersistedTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPersistedTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persistedTime, other.persistedTime); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); - 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("CertificateCredential("); - boolean first = true; - - sb.append("communityUser:"); - if (this.communityUser == null) { - sb.append("null"); - } else { - sb.append(this.communityUser); - } - first = false; - if (!first) sb.append(", "); - sb.append("x509Cert:"); - if (this.x509Cert == null) { - sb.append("null"); - } else { - sb.append(this.x509Cert); - } - first = false; - if (isSetNotAfter()) { - if (!first) sb.append(", "); - sb.append("notAfter:"); - if (this.notAfter == null) { - sb.append("null"); - } else { - sb.append(this.notAfter); - } - first = false; - } - if (isSetPrivateKey()) { - if (!first) sb.append(", "); - sb.append("privateKey:"); - if (this.privateKey == null) { - sb.append("null"); - } else { - sb.append(this.privateKey); - } - first = false; - } - if (isSetLifeTime()) { - if (!first) sb.append(", "); - sb.append("lifeTime:"); - sb.append(this.lifeTime); - first = false; - } - if (isSetNotBefore()) { - if (!first) sb.append(", "); - sb.append("notBefore:"); - if (this.notBefore == null) { - sb.append("null"); - } else { - sb.append(this.notBefore); - } - first = false; - } - if (isSetPersistedTime()) { - if (!first) sb.append(", "); - sb.append("persistedTime:"); - sb.append(this.persistedTime); - first = false; - } - if (isSetToken()) { - if (!first) sb.append(", "); - sb.append("token:"); - if (this.token == null) { - sb.append("null"); - } else { - sb.append(this.token); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (communityUser == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'communityUser' was not present! Struct: " + toString()); - } - if (x509Cert == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'x509Cert' was not present! Struct: " + toString()); - } - // check for sub-struct validity - if (communityUser != null) { - communityUser.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 CertificateCredentialStandardSchemeFactory implements SchemeFactory { - public CertificateCredentialStandardScheme getScheme() { - return new CertificateCredentialStandardScheme(); - } - } - - private static class CertificateCredentialStandardScheme extends StandardScheme<CertificateCredential> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CertificateCredential 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: // COMMUNITY_USER - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.communityUser = new CommunityUser(); - struct.communityUser.read(iprot); - struct.setCommunityUserIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // X509_CERT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.x509Cert = iprot.readString(); - struct.setX509CertIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // NOT_AFTER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.notAfter = iprot.readString(); - struct.setNotAfterIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PRIVATE_KEY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.privateKey = iprot.readString(); - struct.setPrivateKeyIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // LIFE_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.lifeTime = iprot.readI64(); - struct.setLifeTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // NOT_BEFORE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.notBefore = iprot.readString(); - struct.setNotBeforeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // PERSISTED_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.persistedTime = iprot.readI64(); - struct.setPersistedTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.token = iprot.readString(); - struct.setTokenIsSet(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, CertificateCredential struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.communityUser != null) { - oprot.writeFieldBegin(COMMUNITY_USER_FIELD_DESC); - struct.communityUser.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.x509Cert != null) { - oprot.writeFieldBegin(X509_CERT_FIELD_DESC); - oprot.writeString(struct.x509Cert); - oprot.writeFieldEnd(); - } - if (struct.notAfter != null) { - if (struct.isSetNotAfter()) { - oprot.writeFieldBegin(NOT_AFTER_FIELD_DESC); - oprot.writeString(struct.notAfter); - oprot.writeFieldEnd(); - } - } - if (struct.privateKey != null) { - if (struct.isSetPrivateKey()) { - oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC); - oprot.writeString(struct.privateKey); - oprot.writeFieldEnd(); - } - } - if (struct.isSetLifeTime()) { - oprot.writeFieldBegin(LIFE_TIME_FIELD_DESC); - oprot.writeI64(struct.lifeTime); - oprot.writeFieldEnd(); - } - if (struct.notBefore != null) { - if (struct.isSetNotBefore()) { - oprot.writeFieldBegin(NOT_BEFORE_FIELD_DESC); - oprot.writeString(struct.notBefore); - oprot.writeFieldEnd(); - } - } - if (struct.isSetPersistedTime()) { - oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC); - oprot.writeI64(struct.persistedTime); - oprot.writeFieldEnd(); - } - if (struct.token != null) { - if (struct.isSetToken()) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - oprot.writeString(struct.token); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CertificateCredentialTupleSchemeFactory implements SchemeFactory { - public CertificateCredentialTupleScheme getScheme() { - return new CertificateCredentialTupleScheme(); - } - } - - private static class CertificateCredentialTupleScheme extends TupleScheme<CertificateCredential> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.communityUser.write(oprot); - oprot.writeString(struct.x509Cert); - BitSet optionals = new BitSet(); - if (struct.isSetNotAfter()) { - optionals.set(0); - } - if (struct.isSetPrivateKey()) { - optionals.set(1); - } - if (struct.isSetLifeTime()) { - optionals.set(2); - } - if (struct.isSetNotBefore()) { - optionals.set(3); - } - if (struct.isSetPersistedTime()) { - optionals.set(4); - } - if (struct.isSetToken()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetNotAfter()) { - oprot.writeString(struct.notAfter); - } - if (struct.isSetPrivateKey()) { - oprot.writeString(struct.privateKey); - } - if (struct.isSetLifeTime()) { - oprot.writeI64(struct.lifeTime); - } - if (struct.isSetNotBefore()) { - oprot.writeString(struct.notBefore); - } - if (struct.isSetPersistedTime()) { - oprot.writeI64(struct.persistedTime); - } - if (struct.isSetToken()) { - oprot.writeString(struct.token); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CertificateCredential struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.communityUser = new CommunityUser(); - struct.communityUser.read(iprot); - struct.setCommunityUserIsSet(true); - struct.x509Cert = iprot.readString(); - struct.setX509CertIsSet(true); - BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.notAfter = iprot.readString(); - struct.setNotAfterIsSet(true); - } - if (incoming.get(1)) { - struct.privateKey = iprot.readString(); - struct.setPrivateKeyIsSet(true); - } - if (incoming.get(2)) { - struct.lifeTime = iprot.readI64(); - struct.setLifeTimeIsSet(true); - } - if (incoming.get(3)) { - struct.notBefore = iprot.readString(); - struct.setNotBeforeIsSet(true); - } - if (incoming.get(4)) { - struct.persistedTime = iprot.readI64(); - struct.setPersistedTimeIsSet(true); - } - if (incoming.get(5)) { - struct.token = iprot.readString(); - struct.setTokenIsSet(true); - } - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/122fb8da/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java deleted file mode 100644 index ac11739..0000000 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java +++ /dev/null @@ -1,609 +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.credential.store.datamodel; - -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)") -public class CommunityUser implements org.apache.thrift.TBase<CommunityUser, CommunityUser._Fields>, java.io.Serializable, Cloneable, Comparable<CommunityUser> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CommunityUser"); - - private static final org.apache.thrift.protocol.TField GATEWAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField USER_EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("userEmail", 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 CommunityUserStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CommunityUserTupleSchemeFactory()); - } - - public String gatewayName; // required - public String username; // required - public String userEmail; // 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 { - GATEWAY_NAME((short)1, "gatewayName"), - USERNAME((short)2, "username"), - USER_EMAIL((short)3, "userEmail"); - - 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: // GATEWAY_NAME - return GATEWAY_NAME; - case 2: // USERNAME - return USERNAME; - case 3: // USER_EMAIL - return USER_EMAIL; - 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.GATEWAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("gatewayName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CommunityUser.class, metaDataMap); - } - - public CommunityUser() { - } - - public CommunityUser( - String gatewayName, - String username, - String userEmail) - { - this(); - this.gatewayName = gatewayName; - this.username = username; - this.userEmail = userEmail; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public CommunityUser(CommunityUser other) { - if (other.isSetGatewayName()) { - this.gatewayName = other.gatewayName; - } - if (other.isSetUsername()) { - this.username = other.username; - } - if (other.isSetUserEmail()) { - this.userEmail = other.userEmail; - } - } - - public CommunityUser deepCopy() { - return new CommunityUser(this); - } - - @Override - public void clear() { - this.gatewayName = null; - this.username = null; - this.userEmail = null; - } - - public String getGatewayName() { - return this.gatewayName; - } - - public CommunityUser setGatewayName(String gatewayName) { - this.gatewayName = gatewayName; - return this; - } - - public void unsetGatewayName() { - this.gatewayName = null; - } - - /** Returns true if field gatewayName is set (has been assigned a value) and false otherwise */ - public boolean isSetGatewayName() { - return this.gatewayName != null; - } - - public void setGatewayNameIsSet(boolean value) { - if (!value) { - this.gatewayName = null; - } - } - - public String getUsername() { - return this.username; - } - - public CommunityUser setUsername(String username) { - this.username = username; - return this; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public String getUserEmail() { - return this.userEmail; - } - - public CommunityUser setUserEmail(String userEmail) { - this.userEmail = userEmail; - return this; - } - - public void unsetUserEmail() { - this.userEmail = null; - } - - /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */ - public boolean isSetUserEmail() { - return this.userEmail != null; - } - - public void setUserEmailIsSet(boolean value) { - if (!value) { - this.userEmail = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case GATEWAY_NAME: - if (value == null) { - unsetGatewayName(); - } else { - setGatewayName((String)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - case USER_EMAIL: - if (value == null) { - unsetUserEmail(); - } else { - setUserEmail((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case GATEWAY_NAME: - return getGatewayName(); - - case USERNAME: - return getUsername(); - - case USER_EMAIL: - return getUserEmail(); - - } - 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 GATEWAY_NAME: - return isSetGatewayName(); - case USERNAME: - return isSetUsername(); - case USER_EMAIL: - return isSetUserEmail(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CommunityUser) - return this.equals((CommunityUser)that); - return false; - } - - public boolean equals(CommunityUser that) { - if (that == null) - return false; - - boolean this_present_gatewayName = true && this.isSetGatewayName(); - boolean that_present_gatewayName = true && that.isSetGatewayName(); - if (this_present_gatewayName || that_present_gatewayName) { - if (!(this_present_gatewayName && that_present_gatewayName)) - return false; - if (!this.gatewayName.equals(that.gatewayName)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - boolean this_present_userEmail = true && this.isSetUserEmail(); - boolean that_present_userEmail = true && that.isSetUserEmail(); - if (this_present_userEmail || that_present_userEmail) { - if (!(this_present_userEmail && that_present_userEmail)) - return false; - if (!this.userEmail.equals(that.userEmail)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List<Object> list = new ArrayList<Object>(); - - boolean present_gatewayName = true && (isSetGatewayName()); - list.add(present_gatewayName); - if (present_gatewayName) - list.add(gatewayName); - - boolean present_username = true && (isSetUsername()); - list.add(present_username); - if (present_username) - list.add(username); - - boolean present_userEmail = true && (isSetUserEmail()); - list.add(present_userEmail); - if (present_userEmail) - list.add(userEmail); - - return list.hashCode(); - } - - @Override - public int compareTo(CommunityUser other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetGatewayName()).compareTo(other.isSetGatewayName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGatewayName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayName, other.gatewayName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(other.isSetUserEmail()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUserEmail()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, other.userEmail); - 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("CommunityUser("); - boolean first = true; - - sb.append("gatewayName:"); - if (this.gatewayName == null) { - sb.append("null"); - } else { - sb.append(this.gatewayName); - } - first = false; - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - if (!first) sb.append(", "); - sb.append("userEmail:"); - if (this.userEmail == null) { - sb.append("null"); - } else { - sb.append(this.userEmail); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (gatewayName == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayName' was not present! Struct: " + toString()); - } - if (username == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString()); - } - if (userEmail == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'userEmail' was not present! Struct: " + toString()); - } - // 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 CommunityUserStandardSchemeFactory implements SchemeFactory { - public CommunityUserStandardScheme getScheme() { - return new CommunityUserStandardScheme(); - } - } - - private static class CommunityUserStandardScheme extends StandardScheme<CommunityUser> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CommunityUser 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: // GATEWAY_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.gatewayName = iprot.readString(); - struct.setGatewayNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // USER_EMAIL - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.userEmail = iprot.readString(); - struct.setUserEmailIsSet(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, CommunityUser struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.gatewayName != null) { - oprot.writeFieldBegin(GATEWAY_NAME_FIELD_DESC); - oprot.writeString(struct.gatewayName); - oprot.writeFieldEnd(); - } - if (struct.username != null) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - if (struct.userEmail != null) { - oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC); - oprot.writeString(struct.userEmail); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CommunityUserTupleSchemeFactory implements SchemeFactory { - public CommunityUserTupleScheme getScheme() { - return new CommunityUserTupleScheme(); - } - } - - private static class CommunityUserTupleScheme extends TupleScheme<CommunityUser> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.gatewayName); - oprot.writeString(struct.username); - oprot.writeString(struct.userEmail); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CommunityUser struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.gatewayName = iprot.readString(); - struct.setGatewayNameIsSet(true); - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - struct.userEmail = iprot.readString(); - struct.setUserEmailIsSet(true); - } - } - -} - http://git-wip-us.apache.org/repos/asf/airavata/blob/122fb8da/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CredentialOwnerType.java ---------------------------------------------------------------------- diff --git a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CredentialOwnerType.java b/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CredentialOwnerType.java deleted file mode 100644 index 745f921..0000000 --- a/modules/credential-store/credential-store-stubs/src/main/java/org/apache/airavata/credential/store/datamodel/CredentialOwnerType.java +++ /dev/null @@ -1,61 +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.credential.store.datamodel; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum CredentialOwnerType implements org.apache.thrift.TEnum { - GATEWAY(0), - USER(1); - - private final int value; - - private CredentialOwnerType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static CredentialOwnerType findByValue(int value) { - switch (value) { - case 0: - return GATEWAY; - case 1: - return USER; - default: - return null; - } - } -}
