You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2015/02/02 23:17:16 UTC

[1/4] airavata git commit: adding credential store cpi - AIRAVATA-1560

Repository: airavata
Updated Branches:
  refs/heads/master f339c2eae -> fb661cfc8


http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
new file mode 100644
index 0000000..60ed316
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/SSHCredential.java
@@ -0,0 +1,1004 @@
+    /*
+     * 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.1)
+ *
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class SSHCredential implements org.apache.thrift.TBase<SSHCredential, SSHCredential._Fields>, java.io.Serializable, Cloneable, Comparable<SSHCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SSHCredential");
+
+  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)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 PASSPHRASE_FIELD_DESC = new org.apache.thrift.protocol.TField("passphrase", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField PUBLIC_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("publicKey", org.apache.thrift.protocol.TType.STRING, (short)4);
+  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)5);
+  private static final org.apache.thrift.protocol.TField PERSISTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("persistedTime", org.apache.thrift.protocol.TType.I32, (short)6);
+  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)7);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new SSHCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new SSHCredentialTupleSchemeFactory());
+  }
+
+  public String gatewayId; // required
+  public String username; // required
+  public String passphrase; // optional
+  public String publicKey; // optional
+  public String privateKey; // optional
+  public int persistedTime; // optional
+  public String token; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    GATEWAY_ID((short)1, "gatewayId"),
+    USERNAME((short)2, "username"),
+    PASSPHRASE((short)3, "passphrase"),
+    PUBLIC_KEY((short)4, "publicKey"),
+    PRIVATE_KEY((short)5, "privateKey"),
+    PERSISTED_TIME((short)6, "persistedTime"),
+    TOKEN((short)7, "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: // GATEWAY_ID
+          return GATEWAY_ID;
+        case 2: // USERNAME
+          return USERNAME;
+        case 3: // PASSPHRASE
+          return PASSPHRASE;
+        case 4: // PUBLIC_KEY
+          return PUBLIC_KEY;
+        case 5: // PRIVATE_KEY
+          return PRIVATE_KEY;
+        case 6: // PERSISTED_TIME
+          return PERSISTED_TIME;
+        case 7: // 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 _Fields optionals[] = {_Fields.PASSPHRASE,_Fields.PUBLIC_KEY,_Fields.PRIVATE_KEY,_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.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", 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.PASSPHRASE, new org.apache.thrift.meta_data.FieldMetaData("passphrase", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.PUBLIC_KEY, new org.apache.thrift.meta_data.FieldMetaData("publicKey", 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.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.I32)));
+    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(SSHCredential.class, metaDataMap);
+  }
+
+  public SSHCredential() {
+  }
+
+  public SSHCredential(
+    String gatewayId,
+    String username)
+  {
+    this();
+    this.gatewayId = gatewayId;
+    this.username = username;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public SSHCredential(SSHCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetGatewayId()) {
+      this.gatewayId = other.gatewayId;
+    }
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetPassphrase()) {
+      this.passphrase = other.passphrase;
+    }
+    if (other.isSetPublicKey()) {
+      this.publicKey = other.publicKey;
+    }
+    if (other.isSetPrivateKey()) {
+      this.privateKey = other.privateKey;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public SSHCredential deepCopy() {
+    return new SSHCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.gatewayId = null;
+    this.username = null;
+    this.passphrase = null;
+    this.publicKey = null;
+    this.privateKey = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public String getGatewayId() {
+    return this.gatewayId;
+  }
+
+  public SSHCredential setGatewayId(String gatewayId) {
+    this.gatewayId = gatewayId;
+    return this;
+  }
+
+  public void unsetGatewayId() {
+    this.gatewayId = null;
+  }
+
+  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
+  public boolean isSetGatewayId() {
+    return this.gatewayId != null;
+  }
+
+  public void setGatewayIdIsSet(boolean value) {
+    if (!value) {
+      this.gatewayId = null;
+    }
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public SSHCredential 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 getPassphrase() {
+    return this.passphrase;
+  }
+
+  public SSHCredential setPassphrase(String passphrase) {
+    this.passphrase = passphrase;
+    return this;
+  }
+
+  public void unsetPassphrase() {
+    this.passphrase = null;
+  }
+
+  /** Returns true if field passphrase is set (has been assigned a value) and false otherwise */
+  public boolean isSetPassphrase() {
+    return this.passphrase != null;
+  }
+
+  public void setPassphraseIsSet(boolean value) {
+    if (!value) {
+      this.passphrase = null;
+    }
+  }
+
+  public String getPublicKey() {
+    return this.publicKey;
+  }
+
+  public SSHCredential setPublicKey(String publicKey) {
+    this.publicKey = publicKey;
+    return this;
+  }
+
+  public void unsetPublicKey() {
+    this.publicKey = null;
+  }
+
+  /** Returns true if field publicKey is set (has been assigned a value) and false otherwise */
+  public boolean isSetPublicKey() {
+    return this.publicKey != null;
+  }
+
+  public void setPublicKeyIsSet(boolean value) {
+    if (!value) {
+      this.publicKey = null;
+    }
+  }
+
+  public String getPrivateKey() {
+    return this.privateKey;
+  }
+
+  public SSHCredential 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 int getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public SSHCredential setPersistedTime(int 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 SSHCredential 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 GATEWAY_ID:
+      if (value == null) {
+        unsetGatewayId();
+      } else {
+        setGatewayId((String)value);
+      }
+      break;
+
+    case USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case PASSPHRASE:
+      if (value == null) {
+        unsetPassphrase();
+      } else {
+        setPassphrase((String)value);
+      }
+      break;
+
+    case PUBLIC_KEY:
+      if (value == null) {
+        unsetPublicKey();
+      } else {
+        setPublicKey((String)value);
+      }
+      break;
+
+    case PRIVATE_KEY:
+      if (value == null) {
+        unsetPrivateKey();
+      } else {
+        setPrivateKey((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Integer)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case GATEWAY_ID:
+      return getGatewayId();
+
+    case USERNAME:
+      return getUsername();
+
+    case PASSPHRASE:
+      return getPassphrase();
+
+    case PUBLIC_KEY:
+      return getPublicKey();
+
+    case PRIVATE_KEY:
+      return getPrivateKey();
+
+    case PERSISTED_TIME:
+      return Integer.valueOf(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 GATEWAY_ID:
+      return isSetGatewayId();
+    case USERNAME:
+      return isSetUsername();
+    case PASSPHRASE:
+      return isSetPassphrase();
+    case PUBLIC_KEY:
+      return isSetPublicKey();
+    case PRIVATE_KEY:
+      return isSetPrivateKey();
+    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 SSHCredential)
+      return this.equals((SSHCredential)that);
+    return false;
+  }
+
+  public boolean equals(SSHCredential that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_gatewayId = true && this.isSetGatewayId();
+    boolean that_present_gatewayId = true && that.isSetGatewayId();
+    if (this_present_gatewayId || that_present_gatewayId) {
+      if (!(this_present_gatewayId && that_present_gatewayId))
+        return false;
+      if (!this.gatewayId.equals(that.gatewayId))
+        return false;
+    }
+
+    boolean this_present_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_passphrase = true && this.isSetPassphrase();
+    boolean that_present_passphrase = true && that.isSetPassphrase();
+    if (this_present_passphrase || that_present_passphrase) {
+      if (!(this_present_passphrase && that_present_passphrase))
+        return false;
+      if (!this.passphrase.equals(that.passphrase))
+        return false;
+    }
+
+    boolean this_present_publicKey = true && this.isSetPublicKey();
+    boolean that_present_publicKey = true && that.isSetPublicKey();
+    if (this_present_publicKey || that_present_publicKey) {
+      if (!(this_present_publicKey && that_present_publicKey))
+        return false;
+      if (!this.publicKey.equals(that.publicKey))
+        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_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() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(SSHCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGatewayId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(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(isSetPassphrase()).compareTo(other.isSetPassphrase());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPassphrase()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passphrase, other.passphrase);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    lastComparison = Boolean.valueOf(isSetPublicKey()).compareTo(other.isSetPublicKey());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPublicKey()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.publicKey, other.publicKey);
+      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(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("SSHCredential(");
+    boolean first = true;
+
+    sb.append("gatewayId:");
+    if (this.gatewayId == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.gatewayId);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (isSetPassphrase()) {
+      if (!first) sb.append(", ");
+      sb.append("passphrase:");
+      if (this.passphrase == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.passphrase);
+      }
+      first = false;
+    }
+    if (isSetPublicKey()) {
+      if (!first) sb.append(", ");
+      sb.append("publicKey:");
+      if (this.publicKey == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.publicKey);
+      }
+      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 (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 (gatewayId == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' was not present! Struct: " + toString());
+    }
+    if (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' 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 SSHCredentialStandardSchemeFactory implements SchemeFactory {
+    public SSHCredentialStandardScheme getScheme() {
+      return new SSHCredentialStandardScheme();
+    }
+  }
+
+  private static class SSHCredentialStandardScheme extends StandardScheme<SSHCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, SSHCredential 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_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.gatewayId = iprot.readString();
+              struct.setGatewayIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 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: // PASSPHRASE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.passphrase = iprot.readString();
+              struct.setPassphraseIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // PUBLIC_KEY
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.publicKey = iprot.readString();
+              struct.setPublicKeyIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 5: // 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 6: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.persistedTime = iprot.readI32();
+              struct.setPersistedTimeIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 7: // 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, SSHCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.gatewayId != null) {
+        oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
+        oprot.writeString(struct.gatewayId);
+        oprot.writeFieldEnd();
+      }
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.passphrase != null) {
+        if (struct.isSetPassphrase()) {
+          oprot.writeFieldBegin(PASSPHRASE_FIELD_DESC);
+          oprot.writeString(struct.passphrase);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.publicKey != null) {
+        if (struct.isSetPublicKey()) {
+          oprot.writeFieldBegin(PUBLIC_KEY_FIELD_DESC);
+          oprot.writeString(struct.publicKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.privateKey != null) {
+        if (struct.isSetPrivateKey()) {
+          oprot.writeFieldBegin(PRIVATE_KEY_FIELD_DESC);
+          oprot.writeString(struct.privateKey);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI32(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 SSHCredentialTupleSchemeFactory implements SchemeFactory {
+    public SSHCredentialTupleScheme getScheme() {
+      return new SSHCredentialTupleScheme();
+    }
+  }
+
+  private static class SSHCredentialTupleScheme extends TupleScheme<SSHCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.gatewayId);
+      oprot.writeString(struct.username);
+      BitSet optionals = new BitSet();
+      if (struct.isSetPassphrase()) {
+        optionals.set(0);
+      }
+      if (struct.isSetPublicKey()) {
+        optionals.set(1);
+      }
+      if (struct.isSetPrivateKey()) {
+        optionals.set(2);
+      }
+      if (struct.isSetPersistedTime()) {
+        optionals.set(3);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(4);
+      }
+      oprot.writeBitSet(optionals, 5);
+      if (struct.isSetPassphrase()) {
+        oprot.writeString(struct.passphrase);
+      }
+      if (struct.isSetPublicKey()) {
+        oprot.writeString(struct.publicKey);
+      }
+      if (struct.isSetPrivateKey()) {
+        oprot.writeString(struct.privateKey);
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI32(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, SSHCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.gatewayId = iprot.readString();
+      struct.setGatewayIdIsSet(true);
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      BitSet incoming = iprot.readBitSet(5);
+      if (incoming.get(0)) {
+        struct.passphrase = iprot.readString();
+        struct.setPassphraseIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.publicKey = iprot.readString();
+        struct.setPublicKeyIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.privateKey = iprot.readString();
+        struct.setPrivateKeyIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.persistedTime = iprot.readI32();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
new file mode 100644
index 0000000..b17513a
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/csDataModelConstants.java
@@ -0,0 +1,55 @@
+    /*
+     * 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.1)
+ *
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class csDataModelConstants {
+
+  public static final String DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift b/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift
new file mode 100644
index 0000000..859b6f5
--- /dev/null
+++ b/modules/credential-store-service/cs-thrift-description/cs.cpi.service.thrift
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+ * Component Programming Interface definition for Apache Airavata GFac Service.
+ *
+*/
+
+include "csDataModel.thrift"
+include "airavataErrors.thrift"
+
+namespace java org.apache.airavata.credential.store.cpi
+
+const string CS_CPI_VERSION = "0.15.0"
+
+service CredentialStoreService {
+
+  /** Query CS server to fetch the CPI version */
+  string getCSServiceVersion(),
+
+  /**
+  * This method is to add SSHCredential which will return the token Id in success
+  **/
+  string addSSHCredential (1: required csDataModel.SSHCredential sshCredential) ;
+  string addCertificateCredential (1: required csDataModel.CertificateCredential certificateCredential);
+  string addPasswordCredential (1: required csDataModel.PasswordCredential passwordCredential);
+  csDataModel.SSHCredential getSSHCredential (1: required string tokenId);
+  csDataModel.CertificateCredential getCertificateCredential (1: required string tokenId);
+  csDataModel.PasswordCredential getPasswordCredential (1: required string tokenId);
+
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/cs-thrift-description/csDataModel.thrift
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/csDataModel.thrift b/modules/credential-store-service/cs-thrift-description/csDataModel.thrift
new file mode 100644
index 0000000..28dc977
--- /dev/null
+++ b/modules/credential-store-service/cs-thrift-description/csDataModel.thrift
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ *
+ */
+
+
+namespace java org.apache.airavata.credential.store.datamodel
+namespace php Airavata.Model.Credential.Store
+
+
+const string DEFAULT_ID = "DO_NOT_SET_AT_CLIENTS"
+
+
+struct SSHCredential {
+    1: required string gatewayId,
+    2: required string username,
+    3: optional string passphrase,
+    4: optional string publicKey,
+    5: optional string privateKey,
+    6: optional i32 persistedTime,
+    7: optional string token
+}
+
+struct CommunityUser {
+    1: required string gatewayNmae,
+    2: required string username,
+    3: required string userEmail
+}
+
+struct CertificateCredential {
+    1: required CommunityUser communityUser,
+    2: optional string notAfter,
+    3: optional string x509Cert,
+    4: optional string privateKey,
+    5: optional i32 lifeTime,
+    6: optional string notBefore
+    7: optional i32 persistedTime,
+    8: optional string token
+}
+
+struct PasswordCredential {
+    1: required string username,
+    2: required string password,
+    3: optional i32 persistedTime,
+    4: optional string token
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh b/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh
new file mode 100755
index 0000000..156aaa6
--- /dev/null
+++ b/modules/credential-store-service/cs-thrift-description/generate-cs-stubs.sh
@@ -0,0 +1,134 @@
+#! /usr/bin/env bash
+
+# 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.
+
+# This script will regenerate the thrift code for Airavata Credential Store Server Skeltons and Client Stubs.
+
+
+# Global Constants used across the script
+REQUIRED_THRIFT_VERSION='0.9.1'
+BASE_TARGET_DIR='target'
+CS_SERVICE_DIR='../credential-store/src/main/java'
+
+# The Function fail prints error messages on failure and quits the script.
+fail() {
+    echo $@
+    exit 1
+}
+
+# The function add_license_header adds the ASF V2 license header to all java files within the specified generated
+#   directory. The function also adds suppress all warnings annotation to all public classes and enums
+#  To Call:
+#   add_license_header $generated_code_directory
+add_license_header() {
+
+    # Fetch the generated code directory passed as the argument
+    GENERATED_CODE_DIR=$1
+
+    # For all generated thrift code, add the suppress all warnings annotation
+    #  NOTE: In order to save the original file as a backup, use sed -i.orig in place of sed -i ''
+    find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /'
+    find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /'
+
+    # For each java file within the generated directory, add the ASF V2 LICENSE header
+    for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do
+      cat - ${f} >${f}-with-license <<EOF
+    /*
+     * 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.
+     */
+EOF
+    mv ${f}-with-license ${f}
+    done
+}
+
+# The function compares every generated java file with the one in specified existing source location. If the comparison
+#   shows a difference, then it replaces with the newly generated file (with added license header).
+#  To Call:
+#   copy_changed_files $generated_code_directory $existing_source_directory
+copy_changed_files() {
+
+    # Read all the function arguments
+    GENERATED_CODE_DIR=$1
+    WORKSPACE_SRC_DIR=$2
+
+    echo "Generated sources are in ${GENERATED_CODE_DIR}"
+    echo "Destination workspace is in ${WORKSPACE_SRC_DIR}"
+
+    # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced.
+    #  the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied.
+    rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR}
+}
+
+# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
+#  Verify is thrift is installed, is in the path is at a specified version.
+VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" |  wc -l)
+if [ "$VERSION" -ne 1 ] ; then
+    echo "****************************************************"
+    echo "*** thrift is not installed or is not in the path"
+    echo "***   expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}"
+    echo "*** generated code will not be updated"
+    fail "****************************************************"
+fi
+
+# Initialize the thrift arguments.
+#  Since most of the Airavata API and Data Models have includes, use recursive option by default.
+#  Generate all the files in target directory
+THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
+# Ensure the required target directories exists, if not create.
+mkdir -p ${BASE_TARGET_DIR}
+
+#######################################################################
+# Generate/Update the Credential Store CPI service stubs
+#  To start with both the servicer and client are in same package, but
+#  needs to be split using a common generated api-boilerplate-code
+#######################################################################
+
+#Java generation directory
+JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java
+
+# As a precaution  remove and previously generated files if exists
+rm -rf ${JAVA_GEN_DIR}
+
+# Using thrift Java generator, generate the java classes based on Airavata API. This
+#   The airavataAPI.thrift includes rest of data models.
+thrift ${THRIFT_ARGS} --gen java cs.cpi.service.thrift || fail unable to generate java thrift classes
+thrift ${THRIFT_ARGS} --gen java csDataModel.thrift || fail unable to generate java thrift classes
+
+
+# For the generated java classes add the ASF V2 License header
+add_license_header $JAVA_GEN_DIR
+
+# Compare the newly generated classes with existing java generated skeleton/stub sources and replace the changed ones.
+copy_changed_files ${JAVA_GEN_DIR} ${CS_SERVICE_DIR}
+
+# CleanUp: Delete the base target build directory
+#rm -rf ${BASE_TARGET_DIR}
+
+echo "Successfully generated new sources, compared against exiting code and replaced the changed files"
+exit 0


[3/4] airavata git commit: adding credential store cpi - AIRAVATA-1560

Posted by ch...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
new file mode 100644
index 0000000..9cbf519
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/CredentialStoreService.java
@@ -0,0 +1,5898 @@
+    /*
+     * 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.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.cpi;
+
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class CredentialStoreService {
+
+  public interface Iface {
+
+    /**
+     * Query CS server to fetch the CPI version
+     */
+    public String getCSServiceVersion() throws org.apache.thrift.TException;
+
+    /**
+     * This method is to add SSHCredential which will return the token Id in success
+     * 
+     * 
+     * @param sshCredential
+     */
+    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException;
+
+    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException;
+
+    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId) throws org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId) throws org.apache.thrift.TException;
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId) throws org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getSSHCredential(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getCertificateCredential(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void getPasswordCredential(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+  }
+
+  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+      public Factory() {}
+      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+        return new Client(prot);
+      }
+      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+        return new Client(iprot, oprot);
+      }
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol prot)
+    {
+      super(prot, prot);
+    }
+
+    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+      super(iprot, oprot);
+    }
+
+    public String getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      send_getCSServiceVersion();
+      return recv_getCSServiceVersion();
+    }
+
+    public void send_getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      getCSServiceVersion_args args = new getCSServiceVersion_args();
+      sendBase("getCSServiceVersion", args);
+    }
+
+    public String recv_getCSServiceVersion() throws org.apache.thrift.TException
+    {
+      getCSServiceVersion_result result = new getCSServiceVersion_result();
+      receiveBase(result, "getCSServiceVersion");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCSServiceVersion failed: unknown result");
+    }
+
+    public String addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException
+    {
+      send_addSSHCredential(sshCredential);
+      return recv_addSSHCredential();
+    }
+
+    public void send_addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) throws org.apache.thrift.TException
+    {
+      addSSHCredential_args args = new addSSHCredential_args();
+      args.setSshCredential(sshCredential);
+      sendBase("addSSHCredential", args);
+    }
+
+    public String recv_addSSHCredential() throws org.apache.thrift.TException
+    {
+      addSSHCredential_result result = new addSSHCredential_result();
+      receiveBase(result, "addSSHCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addSSHCredential failed: unknown result");
+    }
+
+    public String addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException
+    {
+      send_addCertificateCredential(certificateCredential);
+      return recv_addCertificateCredential();
+    }
+
+    public void send_addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential) throws org.apache.thrift.TException
+    {
+      addCertificateCredential_args args = new addCertificateCredential_args();
+      args.setCertificateCredential(certificateCredential);
+      sendBase("addCertificateCredential", args);
+    }
+
+    public String recv_addCertificateCredential() throws org.apache.thrift.TException
+    {
+      addCertificateCredential_result result = new addCertificateCredential_result();
+      receiveBase(result, "addCertificateCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addCertificateCredential failed: unknown result");
+    }
+
+    public String addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException
+    {
+      send_addPasswordCredential(passwordCredential);
+      return recv_addPasswordCredential();
+    }
+
+    public void send_addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential) throws org.apache.thrift.TException
+    {
+      addPasswordCredential_args args = new addPasswordCredential_args();
+      args.setPasswordCredential(passwordCredential);
+      sendBase("addPasswordCredential", args);
+    }
+
+    public String recv_addPasswordCredential() throws org.apache.thrift.TException
+    {
+      addPasswordCredential_result result = new addPasswordCredential_result();
+      receiveBase(result, "addPasswordCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addPasswordCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSSHCredential(String tokenId) throws org.apache.thrift.TException
+    {
+      send_getSSHCredential(tokenId);
+      return recv_getSSHCredential();
+    }
+
+    public void send_getSSHCredential(String tokenId) throws org.apache.thrift.TException
+    {
+      getSSHCredential_args args = new getSSHCredential_args();
+      args.setTokenId(tokenId);
+      sendBase("getSSHCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential recv_getSSHCredential() throws org.apache.thrift.TException
+    {
+      getSSHCredential_result result = new getSSHCredential_result();
+      receiveBase(result, "getSSHCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSSHCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential getCertificateCredential(String tokenId) throws org.apache.thrift.TException
+    {
+      send_getCertificateCredential(tokenId);
+      return recv_getCertificateCredential();
+    }
+
+    public void send_getCertificateCredential(String tokenId) throws org.apache.thrift.TException
+    {
+      getCertificateCredential_args args = new getCertificateCredential_args();
+      args.setTokenId(tokenId);
+      sendBase("getCertificateCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.CertificateCredential recv_getCertificateCredential() throws org.apache.thrift.TException
+    {
+      getCertificateCredential_result result = new getCertificateCredential_result();
+      receiveBase(result, "getCertificateCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCertificateCredential failed: unknown result");
+    }
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential getPasswordCredential(String tokenId) throws org.apache.thrift.TException
+    {
+      send_getPasswordCredential(tokenId);
+      return recv_getPasswordCredential();
+    }
+
+    public void send_getPasswordCredential(String tokenId) throws org.apache.thrift.TException
+    {
+      getPasswordCredential_args args = new getPasswordCredential_args();
+      args.setTokenId(tokenId);
+      sendBase("getPasswordCredential", args);
+    }
+
+    public org.apache.airavata.credential.store.datamodel.PasswordCredential recv_getPasswordCredential() throws org.apache.thrift.TException
+    {
+      getPasswordCredential_result result = new getPasswordCredential_result();
+      receiveBase(result, "getPasswordCredential");
+      if (result.isSetSuccess()) {
+        return result.success;
+      }
+      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPasswordCredential failed: unknown result");
+    }
+
+  }
+  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
+    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
+      private org.apache.thrift.async.TAsyncClientManager clientManager;
+      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+        this.clientManager = clientManager;
+        this.protocolFactory = protocolFactory;
+      }
+      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+        return new AsyncClient(protocolFactory, clientManager, transport);
+      }
+    }
+
+    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+      super(protocolFactory, clientManager, transport);
+    }
+
+    public void getCSServiceVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getCSServiceVersion_call method_call = new getCSServiceVersion_call(resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getCSServiceVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
+      public getCSServiceVersion_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCSServiceVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getCSServiceVersion_args args = new getCSServiceVersion_args();
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getCSServiceVersion();
+      }
+    }
+
+    public void addSSHCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addSSHCredential_call method_call = new addSSHCredential_call(sshCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential;
+      public addSSHCredential_call(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.sshCredential = sshCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addSSHCredential_args args = new addSSHCredential_args();
+        args.setSshCredential(sshCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addSSHCredential();
+      }
+    }
+
+    public void addCertificateCredential(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addCertificateCredential_call method_call = new addCertificateCredential_call(certificateCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential;
+      public addCertificateCredential_call(org.apache.airavata.credential.store.datamodel.CertificateCredential certificateCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.certificateCredential = certificateCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addCertificateCredential_args args = new addCertificateCredential_args();
+        args.setCertificateCredential(certificateCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addCertificateCredential();
+      }
+    }
+
+    public void addPasswordCredential(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      addPasswordCredential_call method_call = new addPasswordCredential_call(passwordCredential, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class addPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential;
+      public addPasswordCredential_call(org.apache.airavata.credential.store.datamodel.PasswordCredential passwordCredential, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.passwordCredential = passwordCredential;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        addPasswordCredential_args args = new addPasswordCredential_args();
+        args.setPasswordCredential(passwordCredential);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public String getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_addPasswordCredential();
+      }
+    }
+
+    public void getSSHCredential(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getSSHCredential_call method_call = new getSSHCredential_call(tokenId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getSSHCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      public getSSHCredential_call(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.tokenId = tokenId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSSHCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getSSHCredential_args args = new getSSHCredential_args();
+        args.setTokenId(tokenId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.SSHCredential getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getSSHCredential();
+      }
+    }
+
+    public void getCertificateCredential(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getCertificateCredential_call method_call = new getCertificateCredential_call(tokenId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getCertificateCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      public getCertificateCredential_call(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.tokenId = tokenId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCertificateCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getCertificateCredential_args args = new getCertificateCredential_args();
+        args.setTokenId(tokenId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.CertificateCredential getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getCertificateCredential();
+      }
+    }
+
+    public void getPasswordCredential(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+      checkReady();
+      getPasswordCredential_call method_call = new getPasswordCredential_call(tokenId, resultHandler, this, ___protocolFactory, ___transport);
+      this.___currentMethod = method_call;
+      ___manager.call(method_call);
+    }
+
+    public static class getPasswordCredential_call extends org.apache.thrift.async.TAsyncMethodCall {
+      private String tokenId;
+      public getPasswordCredential_call(String tokenId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+        super(client, protocolFactory, transport, resultHandler, false);
+        this.tokenId = tokenId;
+      }
+
+      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPasswordCredential", org.apache.thrift.protocol.TMessageType.CALL, 0));
+        getPasswordCredential_args args = new getPasswordCredential_args();
+        args.setTokenId(tokenId);
+        args.write(prot);
+        prot.writeMessageEnd();
+      }
+
+      public org.apache.airavata.credential.store.datamodel.PasswordCredential getResult() throws org.apache.thrift.TException {
+        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+          throw new IllegalStateException("Method call not finished!");
+        }
+        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+        return (new Client(prot)).recv_getPasswordCredential();
+      }
+    }
+
+  }
+
+  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+    public Processor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+    }
+
+    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
+      processMap.put("getCSServiceVersion", new getCSServiceVersion());
+      processMap.put("addSSHCredential", new addSSHCredential());
+      processMap.put("addCertificateCredential", new addCertificateCredential());
+      processMap.put("addPasswordCredential", new addPasswordCredential());
+      processMap.put("getSSHCredential", new getSSHCredential());
+      processMap.put("getCertificateCredential", new getCertificateCredential());
+      processMap.put("getPasswordCredential", new getPasswordCredential());
+      return processMap;
+    }
+
+    public static class getCSServiceVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCSServiceVersion_args> {
+      public getCSServiceVersion() {
+        super("getCSServiceVersion");
+      }
+
+      public getCSServiceVersion_args getEmptyArgsInstance() {
+        return new getCSServiceVersion_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getCSServiceVersion_result getResult(I iface, getCSServiceVersion_args args) throws org.apache.thrift.TException {
+        getCSServiceVersion_result result = new getCSServiceVersion_result();
+        result.success = iface.getCSServiceVersion();
+        return result;
+      }
+    }
+
+    public static class addSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addSSHCredential_args> {
+      public addSSHCredential() {
+        super("addSSHCredential");
+      }
+
+      public addSSHCredential_args getEmptyArgsInstance() {
+        return new addSSHCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addSSHCredential_result getResult(I iface, addSSHCredential_args args) throws org.apache.thrift.TException {
+        addSSHCredential_result result = new addSSHCredential_result();
+        result.success = iface.addSSHCredential(args.sshCredential);
+        return result;
+      }
+    }
+
+    public static class addCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addCertificateCredential_args> {
+      public addCertificateCredential() {
+        super("addCertificateCredential");
+      }
+
+      public addCertificateCredential_args getEmptyArgsInstance() {
+        return new addCertificateCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addCertificateCredential_result getResult(I iface, addCertificateCredential_args args) throws org.apache.thrift.TException {
+        addCertificateCredential_result result = new addCertificateCredential_result();
+        result.success = iface.addCertificateCredential(args.certificateCredential);
+        return result;
+      }
+    }
+
+    public static class addPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addPasswordCredential_args> {
+      public addPasswordCredential() {
+        super("addPasswordCredential");
+      }
+
+      public addPasswordCredential_args getEmptyArgsInstance() {
+        return new addPasswordCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public addPasswordCredential_result getResult(I iface, addPasswordCredential_args args) throws org.apache.thrift.TException {
+        addPasswordCredential_result result = new addPasswordCredential_result();
+        result.success = iface.addPasswordCredential(args.passwordCredential);
+        return result;
+      }
+    }
+
+    public static class getSSHCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSSHCredential_args> {
+      public getSSHCredential() {
+        super("getSSHCredential");
+      }
+
+      public getSSHCredential_args getEmptyArgsInstance() {
+        return new getSSHCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getSSHCredential_result getResult(I iface, getSSHCredential_args args) throws org.apache.thrift.TException {
+        getSSHCredential_result result = new getSSHCredential_result();
+        result.success = iface.getSSHCredential(args.tokenId);
+        return result;
+      }
+    }
+
+    public static class getCertificateCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCertificateCredential_args> {
+      public getCertificateCredential() {
+        super("getCertificateCredential");
+      }
+
+      public getCertificateCredential_args getEmptyArgsInstance() {
+        return new getCertificateCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getCertificateCredential_result getResult(I iface, getCertificateCredential_args args) throws org.apache.thrift.TException {
+        getCertificateCredential_result result = new getCertificateCredential_result();
+        result.success = iface.getCertificateCredential(args.tokenId);
+        return result;
+      }
+    }
+
+    public static class getPasswordCredential<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPasswordCredential_args> {
+      public getPasswordCredential() {
+        super("getPasswordCredential");
+      }
+
+      public getPasswordCredential_args getEmptyArgsInstance() {
+        return new getPasswordCredential_args();
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public getPasswordCredential_result getResult(I iface, getPasswordCredential_args args) throws org.apache.thrift.TException {
+        getPasswordCredential_result result = new getPasswordCredential_result();
+        result.success = iface.getPasswordCredential(args.tokenId);
+        return result;
+      }
+    }
+
+  }
+
+  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
+    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
+    public AsyncProcessor(I iface) {
+      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+    }
+
+    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      super(iface, getProcessMap(processMap));
+    }
+
+    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
+      processMap.put("getCSServiceVersion", new getCSServiceVersion());
+      processMap.put("addSSHCredential", new addSSHCredential());
+      processMap.put("addCertificateCredential", new addCertificateCredential());
+      processMap.put("addPasswordCredential", new addPasswordCredential());
+      processMap.put("getSSHCredential", new getSSHCredential());
+      processMap.put("getCertificateCredential", new getCertificateCredential());
+      processMap.put("getPasswordCredential", new getPasswordCredential());
+      return processMap;
+    }
+
+    public static class getCSServiceVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCSServiceVersion_args, String> {
+      public getCSServiceVersion() {
+        super("getCSServiceVersion");
+      }
+
+      public getCSServiceVersion_args getEmptyArgsInstance() {
+        return new getCSServiceVersion_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            getCSServiceVersion_result result = new getCSServiceVersion_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getCSServiceVersion_result result = new getCSServiceVersion_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getCSServiceVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.getCSServiceVersion(resultHandler);
+      }
+    }
+
+    public static class addSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addSSHCredential_args, String> {
+      public addSSHCredential() {
+        super("addSSHCredential");
+      }
+
+      public addSSHCredential_args getEmptyArgsInstance() {
+        return new addSSHCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addSSHCredential_result result = new addSSHCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addSSHCredential_result result = new addSSHCredential_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addSSHCredential(args.sshCredential,resultHandler);
+      }
+    }
+
+    public static class addCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addCertificateCredential_args, String> {
+      public addCertificateCredential() {
+        super("addCertificateCredential");
+      }
+
+      public addCertificateCredential_args getEmptyArgsInstance() {
+        return new addCertificateCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addCertificateCredential_result result = new addCertificateCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addCertificateCredential_result result = new addCertificateCredential_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addCertificateCredential(args.certificateCredential,resultHandler);
+      }
+    }
+
+    public static class addPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addPasswordCredential_args, String> {
+      public addPasswordCredential() {
+        super("addPasswordCredential");
+      }
+
+      public addPasswordCredential_args getEmptyArgsInstance() {
+        return new addPasswordCredential_args();
+      }
+
+      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<String>() { 
+          public void onComplete(String o) {
+            addPasswordCredential_result result = new addPasswordCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            addPasswordCredential_result result = new addPasswordCredential_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, addPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+        iface.addPasswordCredential(args.passwordCredential,resultHandler);
+      }
+    }
+
+    public static class getSSHCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSSHCredential_args, org.apache.airavata.credential.store.datamodel.SSHCredential> {
+      public getSSHCredential() {
+        super("getSSHCredential");
+      }
+
+      public getSSHCredential_args getEmptyArgsInstance() {
+        return new getSSHCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.SSHCredential o) {
+            getSSHCredential_result result = new getSSHCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getSSHCredential_result result = new getSSHCredential_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getSSHCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.SSHCredential> resultHandler) throws TException {
+        iface.getSSHCredential(args.tokenId,resultHandler);
+      }
+    }
+
+    public static class getCertificateCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getCertificateCredential_args, org.apache.airavata.credential.store.datamodel.CertificateCredential> {
+      public getCertificateCredential() {
+        super("getCertificateCredential");
+      }
+
+      public getCertificateCredential_args getEmptyArgsInstance() {
+        return new getCertificateCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.CertificateCredential o) {
+            getCertificateCredential_result result = new getCertificateCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getCertificateCredential_result result = new getCertificateCredential_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getCertificateCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.CertificateCredential> resultHandler) throws TException {
+        iface.getCertificateCredential(args.tokenId,resultHandler);
+      }
+    }
+
+    public static class getPasswordCredential<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPasswordCredential_args, org.apache.airavata.credential.store.datamodel.PasswordCredential> {
+      public getPasswordCredential() {
+        super("getPasswordCredential");
+      }
+
+      public getPasswordCredential_args getEmptyArgsInstance() {
+        return new getPasswordCredential_args();
+      }
+
+      public AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+        final org.apache.thrift.AsyncProcessFunction fcall = this;
+        return new AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential>() { 
+          public void onComplete(org.apache.airavata.credential.store.datamodel.PasswordCredential o) {
+            getPasswordCredential_result result = new getPasswordCredential_result();
+            result.success = o;
+            try {
+              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+              return;
+            } catch (Exception e) {
+              LOGGER.error("Exception writing to internal frame buffer", e);
+            }
+            fb.close();
+          }
+          public void onError(Exception e) {
+            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+            org.apache.thrift.TBase msg;
+            getPasswordCredential_result result = new getPasswordCredential_result();
+            {
+              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+            }
+            try {
+              fcall.sendResponse(fb,msg,msgType,seqid);
+              return;
+            } catch (Exception ex) {
+              LOGGER.error("Exception writing to internal frame buffer", ex);
+            }
+            fb.close();
+          }
+        };
+      }
+
+      protected boolean isOneway() {
+        return false;
+      }
+
+      public void start(I iface, getPasswordCredential_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.airavata.credential.store.datamodel.PasswordCredential> resultHandler) throws TException {
+        iface.getPasswordCredential(args.tokenId,resultHandler);
+      }
+    }
+
+  }
+
+  public static class getCSServiceVersion_args implements org.apache.thrift.TBase<getCSServiceVersion_args, getCSServiceVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_args");
+
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getCSServiceVersion_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getCSServiceVersion_argsTupleSchemeFactory());
+    }
+
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+;
+
+      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) {
+          default:
+            return null;
+        }
+      }
+
+      /**
+       * Find the _Fields constant that matches fieldId, throwing an exception
+       * if it is not found.
+       */
+      public static _Fields findByThriftIdOrThrow(int fieldId) {
+        _Fields fields = findByThriftId(fieldId);
+        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+        return fields;
+      }
+
+      /**
+       * Find the _Fields constant that matches name, or null if its not found.
+       */
+      public static _Fields findByName(String name) {
+        return byName.get(name);
+      }
+
+      private final short _thriftId;
+      private final String _fieldName;
+
+      _Fields(short thriftId, String fieldName) {
+        _thriftId = thriftId;
+        _fieldName = fieldName;
+      }
+
+      public short getThriftFieldId() {
+        return _thriftId;
+      }
+
+      public String getFieldName() {
+        return _fieldName;
+      }
+    }
+    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+    static {
+      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_args.class, metaDataMap);
+    }
+
+    public getCSServiceVersion_args() {
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getCSServiceVersion_args(getCSServiceVersion_args other) {
+    }
+
+    public getCSServiceVersion_args deepCopy() {
+      return new getCSServiceVersion_args(this);
+    }
+
+    @Override
+    public void clear() {
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      }
+      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) {
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getCSServiceVersion_args)
+        return this.equals((getCSServiceVersion_args)that);
+      return false;
+    }
+
+    public boolean equals(getCSServiceVersion_args that) {
+      if (that == null)
+        return false;
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getCSServiceVersion_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      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("getCSServiceVersion_args(");
+      boolean first = true;
+
+      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 getCSServiceVersion_argsStandardSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_argsStandardScheme getScheme() {
+        return new getCSServiceVersion_argsStandardScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_argsStandardScheme extends StandardScheme<getCSServiceVersion_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_args 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) {
+            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, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getCSServiceVersion_argsTupleSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_argsTupleScheme getScheme() {
+        return new getCSServiceVersion_argsTupleScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_argsTupleScheme extends TupleScheme<getCSServiceVersion_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+      }
+    }
+
+  }
+
+  public static class getCSServiceVersion_result implements org.apache.thrift.TBase<getCSServiceVersion_result, getCSServiceVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getCSServiceVersion_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCSServiceVersion_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new getCSServiceVersion_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new getCSServiceVersion_resultTupleSchemeFactory());
+    }
+
+    public String success; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success");
+
+      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 0: // SUCCESS
+            return SUCCESS;
+          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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCSServiceVersion_result.class, metaDataMap);
+    }
+
+    public getCSServiceVersion_result() {
+    }
+
+    public getCSServiceVersion_result(
+      String success)
+    {
+      this();
+      this.success = success;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public getCSServiceVersion_result(getCSServiceVersion_result other) {
+      if (other.isSetSuccess()) {
+        this.success = other.success;
+      }
+    }
+
+    public getCSServiceVersion_result deepCopy() {
+      return new getCSServiceVersion_result(this);
+    }
+
+    @Override
+    public void clear() {
+      this.success = null;
+    }
+
+    public String getSuccess() {
+      return this.success;
+    }
+
+    public getCSServiceVersion_result setSuccess(String success) {
+      this.success = success;
+      return this;
+    }
+
+    public void unsetSuccess() {
+      this.success = null;
+    }
+
+    /** Returns true if field success is set (has been assigned a value) and false otherwise */
+    public boolean isSetSuccess() {
+      return this.success != null;
+    }
+
+    public void setSuccessIsSet(boolean value) {
+      if (!value) {
+        this.success = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SUCCESS:
+        if (value == null) {
+          unsetSuccess();
+        } else {
+          setSuccess((String)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SUCCESS:
+        return getSuccess();
+
+      }
+      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 SUCCESS:
+        return isSetSuccess();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof getCSServiceVersion_result)
+        return this.equals((getCSServiceVersion_result)that);
+      return false;
+    }
+
+    public boolean equals(getCSServiceVersion_result that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_success = true && this.isSetSuccess();
+      boolean that_present_success = true && that.isSetSuccess();
+      if (this_present_success || that_present_success) {
+        if (!(this_present_success && that_present_success))
+          return false;
+        if (!this.success.equals(that.success))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(getCSServiceVersion_result other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSuccess()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+        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("getCSServiceVersion_result(");
+      boolean first = true;
+
+      sb.append("success:");
+      if (this.success == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.success);
+      }
+      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 getCSServiceVersion_resultStandardSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_resultStandardScheme getScheme() {
+        return new getCSServiceVersion_resultStandardScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_resultStandardScheme extends StandardScheme<getCSServiceVersion_result> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, getCSServiceVersion_result 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 0: // SUCCESS
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.success = iprot.readString();
+                struct.setSuccessIsSet(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, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.success != null) {
+          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+          oprot.writeString(struct.success);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class getCSServiceVersion_resultTupleSchemeFactory implements SchemeFactory {
+      public getCSServiceVersion_resultTupleScheme getScheme() {
+        return new getCSServiceVersion_resultTupleScheme();
+      }
+    }
+
+    private static class getCSServiceVersion_resultTupleScheme extends TupleScheme<getCSServiceVersion_result> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        BitSet optionals = new BitSet();
+        if (struct.isSetSuccess()) {
+          optionals.set(0);
+        }
+        oprot.writeBitSet(optionals, 1);
+        if (struct.isSetSuccess()) {
+          oprot.writeString(struct.success);
+        }
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, getCSServiceVersion_result struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        BitSet incoming = iprot.readBitSet(1);
+        if (incoming.get(0)) {
+          struct.success = iprot.readString();
+          struct.setSuccessIsSet(true);
+        }
+      }
+    }
+
+  }
+
+  public static class addSSHCredential_args implements org.apache.thrift.TBase<addSSHCredential_args, addSSHCredential_args._Fields>, java.io.Serializable, Cloneable, Comparable<addSSHCredential_args>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSSHCredential_args");
+
+    private static final org.apache.thrift.protocol.TField SSH_CREDENTIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("sshCredential", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new addSSHCredential_argsStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new addSSHCredential_argsTupleSchemeFactory());
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SSH_CREDENTIAL((short)1, "sshCredential");
+
+      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: // SSH_CREDENTIAL
+            return SSH_CREDENTIAL;
+          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.SSH_CREDENTIAL, new org.apache.thrift.meta_data.FieldMetaData("sshCredential", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.credential.store.datamodel.SSHCredential.class)));
+      metaDataMap = Collections.unmodifiableMap(tmpMap);
+      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addSSHCredential_args.class, metaDataMap);
+    }
+
+    public addSSHCredential_args() {
+    }
+
+    public addSSHCredential_args(
+      org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential)
+    {
+      this();
+      this.sshCredential = sshCredential;
+    }
+
+    /**
+     * Performs a deep copy on <i>other</i>.
+     */
+    public addSSHCredential_args(addSSHCredential_args other) {
+      if (other.isSetSshCredential()) {
+        this.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential(other.sshCredential);
+      }
+    }
+
+    public addSSHCredential_args deepCopy() {
+      return new addSSHCredential_args(this);
+    }
+
+    @Override
+    public void clear() {
+      this.sshCredential = null;
+    }
+
+    public org.apache.airavata.credential.store.datamodel.SSHCredential getSshCredential() {
+      return this.sshCredential;
+    }
+
+    public addSSHCredential_args setSshCredential(org.apache.airavata.credential.store.datamodel.SSHCredential sshCredential) {
+      this.sshCredential = sshCredential;
+      return this;
+    }
+
+    public void unsetSshCredential() {
+      this.sshCredential = null;
+    }
+
+    /** Returns true if field sshCredential is set (has been assigned a value) and false otherwise */
+    public boolean isSetSshCredential() {
+      return this.sshCredential != null;
+    }
+
+    public void setSshCredentialIsSet(boolean value) {
+      if (!value) {
+        this.sshCredential = null;
+      }
+    }
+
+    public void setFieldValue(_Fields field, Object value) {
+      switch (field) {
+      case SSH_CREDENTIAL:
+        if (value == null) {
+          unsetSshCredential();
+        } else {
+          setSshCredential((org.apache.airavata.credential.store.datamodel.SSHCredential)value);
+        }
+        break;
+
+      }
+    }
+
+    public Object getFieldValue(_Fields field) {
+      switch (field) {
+      case SSH_CREDENTIAL:
+        return getSshCredential();
+
+      }
+      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 SSH_CREDENTIAL:
+        return isSetSshCredential();
+      }
+      throw new IllegalStateException();
+    }
+
+    @Override
+    public boolean equals(Object that) {
+      if (that == null)
+        return false;
+      if (that instanceof addSSHCredential_args)
+        return this.equals((addSSHCredential_args)that);
+      return false;
+    }
+
+    public boolean equals(addSSHCredential_args that) {
+      if (that == null)
+        return false;
+
+      boolean this_present_sshCredential = true && this.isSetSshCredential();
+      boolean that_present_sshCredential = true && that.isSetSshCredential();
+      if (this_present_sshCredential || that_present_sshCredential) {
+        if (!(this_present_sshCredential && that_present_sshCredential))
+          return false;
+        if (!this.sshCredential.equals(that.sshCredential))
+          return false;
+      }
+
+      return true;
+    }
+
+    @Override
+    public int hashCode() {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(addSSHCredential_args other) {
+      if (!getClass().equals(other.getClass())) {
+        return getClass().getName().compareTo(other.getClass().getName());
+      }
+
+      int lastComparison = 0;
+
+      lastComparison = Boolean.valueOf(isSetSshCredential()).compareTo(other.isSetSshCredential());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetSshCredential()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sshCredential, other.sshCredential);
+        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("addSSHCredential_args(");
+      boolean first = true;
+
+      sb.append("sshCredential:");
+      if (this.sshCredential == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.sshCredential);
+      }
+      first = false;
+      sb.append(")");
+      return sb.toString();
+    }
+
+    public void validate() throws org.apache.thrift.TException {
+      // check for required fields
+      if (sshCredential == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'sshCredential' was not present! Struct: " + toString());
+      }
+      // check for sub-struct validity
+      if (sshCredential != null) {
+        sshCredential.validate();
+      }
+    }
+
+    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+      try {
+        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+      try {
+        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+      } catch (org.apache.thrift.TException te) {
+        throw new java.io.IOException(te);
+      }
+    }
+
+    private static class addSSHCredential_argsStandardSchemeFactory implements SchemeFactory {
+      public addSSHCredential_argsStandardScheme getScheme() {
+        return new addSSHCredential_argsStandardScheme();
+      }
+    }
+
+    private static class addSSHCredential_argsStandardScheme extends StandardScheme<addSSHCredential_args> {
+
+      public void read(org.apache.thrift.protocol.TProtocol iprot, addSSHCredential_args 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: // SSH_CREDENTIAL
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+                struct.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential();
+                struct.sshCredential.read(iprot);
+                struct.setSshCredentialIsSet(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, addSSHCredential_args struct) throws org.apache.thrift.TException {
+        struct.validate();
+
+        oprot.writeStructBegin(STRUCT_DESC);
+        if (struct.sshCredential != null) {
+          oprot.writeFieldBegin(SSH_CREDENTIAL_FIELD_DESC);
+          struct.sshCredential.write(oprot);
+          oprot.writeFieldEnd();
+        }
+        oprot.writeFieldStop();
+        oprot.writeStructEnd();
+      }
+
+    }
+
+    private static class addSSHCredential_argsTupleSchemeFactory implements SchemeFactory {
+      public addSSHCredential_argsTupleScheme getScheme() {
+        return new addSSHCredential_argsTupleScheme();
+      }
+    }
+
+    private static class addSSHCredential_argsTupleScheme extends TupleScheme<addSSHCredential_args> {
+
+      @Override
+      public void write(org.apache.thrift.protocol.TProtocol prot, addSSHCredential_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol oprot = (TTupleProtocol) prot;
+        struct.sshCredential.write(oprot);
+      }
+
+      @Override
+      public void read(org.apache.thrift.protocol.TProtocol prot, addSSHCredential_args struct) throws org.apache.thrift.TException {
+        TTupleProtocol iprot = (TTupleProtocol) prot;
+        struct.sshCredential = new org.apache.airavata.credential.store.datamodel.SSHCredential();
+        struct.sshCredential.read(iprot);
+        struct.setSshCredentialIsSet(true);
+      }
+    }
+
+  }
+
+  public static class addSSHCredential_result implements org.apache.thrift.TBase<addSSHCredential_result, addSSHCredential_result._Fields>, java.io.Serializable, Cloneable, Comparable<addSSHCredential_result>   {
+    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addSSHCredential_result");
+
+    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+    static {
+      schemes.put(StandardScheme.class, new addSSHCredential_resultStandardSchemeFactory());
+      schemes.put(TupleScheme.class, new addSSHCredential_resultTupleSchemeFactory());
+    }
+
+    public String success; // required
+
+    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+      SUCCESS((short)0, "success");
+
+      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 0: // SUCCESS
+            return SUCCESS;
+          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<_Fiel

<TRUNCATED>

[4/4] airavata git commit: adding credential store cpi - AIRAVATA-1560

Posted by ch...@apache.org.
adding credential store cpi - AIRAVATA-1560


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/fb661cfc
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/fb661cfc
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/fb661cfc

Branch: refs/heads/master
Commit: fb661cfc8d3b82cb950bb26cfb70bfe74a08227e
Parents: f339c2e
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Mon Feb 2 17:17:12 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Mon Feb 2 17:17:12 2015 -0500

----------------------------------------------------------------------
 .../store/cpi/CredentialStoreService.java       | 5898 ++++++++++++++++++
 .../store/cpi/cs_cpi_serviceConstants.java      |   55 +
 .../store/datamodel/CertificateCredential.java  | 1110 ++++
 .../store/datamodel/CommunityUser.java          |  589 ++
 .../store/datamodel/PasswordCredential.java     |  698 +++
 .../store/datamodel/SSHCredential.java          | 1004 +++
 .../store/datamodel/csDataModelConstants.java   |   55 +
 .../cs-thrift-description/cs.cpi.service.thrift |   50 +
 .../cs-thrift-description/csDataModel.thrift    |   61 +
 .../cs-thrift-description/generate-cs-stubs.sh  |  134 +
 10 files changed, 9654 insertions(+)
----------------------------------------------------------------------



[2/4] airavata git commit: adding credential store cpi - AIRAVATA-1560

Posted by ch...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
new file mode 100644
index 0000000..2b8858e
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/cpi/cs_cpi_serviceConstants.java
@@ -0,0 +1,55 @@
+    /*
+     * 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.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.credential.store.cpi;
+
+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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class cs_cpi_serviceConstants {
+
+  public static final String CS_CPI_VERSION = "0.15.0";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
new file mode 100644
index 0000000..7bcf5a6
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CertificateCredential.java
@@ -0,0 +1,1110 @@
+    /*
+     * 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.1)
+ *
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") 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 NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("notAfter", org.apache.thrift.protocol.TType.STRING, (short)2);
+  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)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.I32, (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.I32, (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 notAfter; // optional
+  public String x509Cert; // optional
+  public String privateKey; // optional
+  public int lifeTime; // optional
+  public String notBefore; // optional
+  public int persistedTime; // optional
+  public String token; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    COMMUNITY_USER((short)1, "communityUser"),
+    NOT_AFTER((short)2, "notAfter"),
+    X509_CERT((short)3, "x509Cert"),
+    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: // NOT_AFTER
+          return NOT_AFTER;
+        case 3: // X509_CERT
+          return X509_CERT;
+        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 _Fields optionals[] = {_Fields.NOT_AFTER,_Fields.X509_CERT,_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.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.X509_CERT, new org.apache.thrift.meta_data.FieldMetaData("x509Cert", 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.I32)));
+    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.I32)));
+    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)
+  {
+    this();
+    this.communityUser = communityUser;
+  }
+
+  /**
+   * 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.isSetNotAfter()) {
+      this.notAfter = other.notAfter;
+    }
+    if (other.isSetX509Cert()) {
+      this.x509Cert = other.x509Cert;
+    }
+    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.notAfter = null;
+    this.x509Cert = 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 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 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 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 int getLifeTime() {
+    return this.lifeTime;
+  }
+
+  public CertificateCredential setLifeTime(int 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 int getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public CertificateCredential setPersistedTime(int 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 NOT_AFTER:
+      if (value == null) {
+        unsetNotAfter();
+      } else {
+        setNotAfter((String)value);
+      }
+      break;
+
+    case X509_CERT:
+      if (value == null) {
+        unsetX509Cert();
+      } else {
+        setX509Cert((String)value);
+      }
+      break;
+
+    case PRIVATE_KEY:
+      if (value == null) {
+        unsetPrivateKey();
+      } else {
+        setPrivateKey((String)value);
+      }
+      break;
+
+    case LIFE_TIME:
+      if (value == null) {
+        unsetLifeTime();
+      } else {
+        setLifeTime((Integer)value);
+      }
+      break;
+
+    case NOT_BEFORE:
+      if (value == null) {
+        unsetNotBefore();
+      } else {
+        setNotBefore((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Integer)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 NOT_AFTER:
+      return getNotAfter();
+
+    case X509_CERT:
+      return getX509Cert();
+
+    case PRIVATE_KEY:
+      return getPrivateKey();
+
+    case LIFE_TIME:
+      return Integer.valueOf(getLifeTime());
+
+    case NOT_BEFORE:
+      return getNotBefore();
+
+    case PERSISTED_TIME:
+      return Integer.valueOf(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 NOT_AFTER:
+      return isSetNotAfter();
+    case X509_CERT:
+      return isSetX509Cert();
+    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_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_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_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() {
+    return 0;
+  }
+
+  @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(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(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(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 (isSetNotAfter()) {
+      if (!first) sb.append(", ");
+      sb.append("notAfter:");
+      if (this.notAfter == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.notAfter);
+      }
+      first = false;
+    }
+    if (isSetX509Cert()) {
+      if (!first) sb.append(", ");
+      sb.append("x509Cert:");
+      if (this.x509Cert == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.x509Cert);
+      }
+      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());
+    }
+    // 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: // 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 3: // 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 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.I32) {
+              struct.lifeTime = iprot.readI32();
+              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.I32) {
+              struct.persistedTime = iprot.readI32();
+              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.notAfter != null) {
+        if (struct.isSetNotAfter()) {
+          oprot.writeFieldBegin(NOT_AFTER_FIELD_DESC);
+          oprot.writeString(struct.notAfter);
+          oprot.writeFieldEnd();
+        }
+      }
+      if (struct.x509Cert != null) {
+        if (struct.isSetX509Cert()) {
+          oprot.writeFieldBegin(X509_CERT_FIELD_DESC);
+          oprot.writeString(struct.x509Cert);
+          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.writeI32(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.writeI32(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);
+      BitSet optionals = new BitSet();
+      if (struct.isSetNotAfter()) {
+        optionals.set(0);
+      }
+      if (struct.isSetX509Cert()) {
+        optionals.set(1);
+      }
+      if (struct.isSetPrivateKey()) {
+        optionals.set(2);
+      }
+      if (struct.isSetLifeTime()) {
+        optionals.set(3);
+      }
+      if (struct.isSetNotBefore()) {
+        optionals.set(4);
+      }
+      if (struct.isSetPersistedTime()) {
+        optionals.set(5);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(6);
+      }
+      oprot.writeBitSet(optionals, 7);
+      if (struct.isSetNotAfter()) {
+        oprot.writeString(struct.notAfter);
+      }
+      if (struct.isSetX509Cert()) {
+        oprot.writeString(struct.x509Cert);
+      }
+      if (struct.isSetPrivateKey()) {
+        oprot.writeString(struct.privateKey);
+      }
+      if (struct.isSetLifeTime()) {
+        oprot.writeI32(struct.lifeTime);
+      }
+      if (struct.isSetNotBefore()) {
+        oprot.writeString(struct.notBefore);
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI32(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);
+      BitSet incoming = iprot.readBitSet(7);
+      if (incoming.get(0)) {
+        struct.notAfter = iprot.readString();
+        struct.setNotAfterIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.x509Cert = iprot.readString();
+        struct.setX509CertIsSet(true);
+      }
+      if (incoming.get(2)) {
+        struct.privateKey = iprot.readString();
+        struct.setPrivateKeyIsSet(true);
+      }
+      if (incoming.get(3)) {
+        struct.lifeTime = iprot.readI32();
+        struct.setLifeTimeIsSet(true);
+      }
+      if (incoming.get(4)) {
+        struct.notBefore = iprot.readString();
+        struct.setNotBeforeIsSet(true);
+      }
+      if (incoming.get(5)) {
+        struct.persistedTime = iprot.readI32();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(6)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
new file mode 100644
index 0000000..9b62310
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/CommunityUser.java
@@ -0,0 +1,589 @@
+    /*
+     * 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.1)
+ *
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") 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_NMAE_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayNmae", 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 gatewayNmae; // 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. */
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    GATEWAY_NMAE((short)1, "gatewayNmae"),
+    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_NMAE
+          return GATEWAY_NMAE;
+        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_NMAE, new org.apache.thrift.meta_data.FieldMetaData("gatewayNmae", 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 gatewayNmae,
+    String username,
+    String userEmail)
+  {
+    this();
+    this.gatewayNmae = gatewayNmae;
+    this.username = username;
+    this.userEmail = userEmail;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public CommunityUser(CommunityUser other) {
+    if (other.isSetGatewayNmae()) {
+      this.gatewayNmae = other.gatewayNmae;
+    }
+    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.gatewayNmae = null;
+    this.username = null;
+    this.userEmail = null;
+  }
+
+  public String getGatewayNmae() {
+    return this.gatewayNmae;
+  }
+
+  public CommunityUser setGatewayNmae(String gatewayNmae) {
+    this.gatewayNmae = gatewayNmae;
+    return this;
+  }
+
+  public void unsetGatewayNmae() {
+    this.gatewayNmae = null;
+  }
+
+  /** Returns true if field gatewayNmae is set (has been assigned a value) and false otherwise */
+  public boolean isSetGatewayNmae() {
+    return this.gatewayNmae != null;
+  }
+
+  public void setGatewayNmaeIsSet(boolean value) {
+    if (!value) {
+      this.gatewayNmae = 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_NMAE:
+      if (value == null) {
+        unsetGatewayNmae();
+      } else {
+        setGatewayNmae((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_NMAE:
+      return getGatewayNmae();
+
+    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_NMAE:
+      return isSetGatewayNmae();
+    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_gatewayNmae = true && this.isSetGatewayNmae();
+    boolean that_present_gatewayNmae = true && that.isSetGatewayNmae();
+    if (this_present_gatewayNmae || that_present_gatewayNmae) {
+      if (!(this_present_gatewayNmae && that_present_gatewayNmae))
+        return false;
+      if (!this.gatewayNmae.equals(that.gatewayNmae))
+        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() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(CommunityUser other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetGatewayNmae()).compareTo(other.isSetGatewayNmae());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetGatewayNmae()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayNmae, other.gatewayNmae);
+      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("gatewayNmae:");
+    if (this.gatewayNmae == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.gatewayNmae);
+    }
+    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 (gatewayNmae == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayNmae' 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_NMAE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.gatewayNmae = iprot.readString();
+              struct.setGatewayNmaeIsSet(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.gatewayNmae != null) {
+        oprot.writeFieldBegin(GATEWAY_NMAE_FIELD_DESC);
+        oprot.writeString(struct.gatewayNmae);
+        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.gatewayNmae);
+      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.gatewayNmae = iprot.readString();
+      struct.setGatewayNmaeIsSet(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/fb661cfc/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
new file mode 100644
index 0000000..1c91304
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/datamodel/PasswordCredential.java
@@ -0,0 +1,698 @@
+    /*
+     * 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.1)
+ *
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class PasswordCredential implements org.apache.thrift.TBase<PasswordCredential, PasswordCredential._Fields>, java.io.Serializable, Cloneable, Comparable<PasswordCredential> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PasswordCredential");
+
+  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)1);
+  private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", 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.I32, (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 PasswordCredentialStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new PasswordCredentialTupleSchemeFactory());
+  }
+
+  public String username; // required
+  public String password; // required
+  public int persistedTime; // optional
+  public String token; // optional
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    USERNAME((short)1, "username"),
+    PASSWORD((short)2, "password"),
+    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: // USERNAME
+          return USERNAME;
+        case 2: // PASSWORD
+          return PASSWORD;
+        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 _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.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.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", 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.I32)));
+    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(PasswordCredential.class, metaDataMap);
+  }
+
+  public PasswordCredential() {
+  }
+
+  public PasswordCredential(
+    String username,
+    String password)
+  {
+    this();
+    this.username = username;
+    this.password = password;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public PasswordCredential(PasswordCredential other) {
+    __isset_bitfield = other.__isset_bitfield;
+    if (other.isSetUsername()) {
+      this.username = other.username;
+    }
+    if (other.isSetPassword()) {
+      this.password = other.password;
+    }
+    this.persistedTime = other.persistedTime;
+    if (other.isSetToken()) {
+      this.token = other.token;
+    }
+  }
+
+  public PasswordCredential deepCopy() {
+    return new PasswordCredential(this);
+  }
+
+  @Override
+  public void clear() {
+    this.username = null;
+    this.password = null;
+    setPersistedTimeIsSet(false);
+    this.persistedTime = 0;
+    this.token = null;
+  }
+
+  public String getUsername() {
+    return this.username;
+  }
+
+  public PasswordCredential 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 getPassword() {
+    return this.password;
+  }
+
+  public PasswordCredential setPassword(String password) {
+    this.password = password;
+    return this;
+  }
+
+  public void unsetPassword() {
+    this.password = null;
+  }
+
+  /** Returns true if field password is set (has been assigned a value) and false otherwise */
+  public boolean isSetPassword() {
+    return this.password != null;
+  }
+
+  public void setPasswordIsSet(boolean value) {
+    if (!value) {
+      this.password = null;
+    }
+  }
+
+  public int getPersistedTime() {
+    return this.persistedTime;
+  }
+
+  public PasswordCredential setPersistedTime(int 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 PasswordCredential 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 USERNAME:
+      if (value == null) {
+        unsetUsername();
+      } else {
+        setUsername((String)value);
+      }
+      break;
+
+    case PASSWORD:
+      if (value == null) {
+        unsetPassword();
+      } else {
+        setPassword((String)value);
+      }
+      break;
+
+    case PERSISTED_TIME:
+      if (value == null) {
+        unsetPersistedTime();
+      } else {
+        setPersistedTime((Integer)value);
+      }
+      break;
+
+    case TOKEN:
+      if (value == null) {
+        unsetToken();
+      } else {
+        setToken((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case USERNAME:
+      return getUsername();
+
+    case PASSWORD:
+      return getPassword();
+
+    case PERSISTED_TIME:
+      return Integer.valueOf(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 USERNAME:
+      return isSetUsername();
+    case PASSWORD:
+      return isSetPassword();
+    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 PasswordCredential)
+      return this.equals((PasswordCredential)that);
+    return false;
+  }
+
+  public boolean equals(PasswordCredential that) {
+    if (that == null)
+      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_password = true && this.isSetPassword();
+    boolean that_present_password = true && that.isSetPassword();
+    if (this_present_password || that_present_password) {
+      if (!(this_present_password && that_present_password))
+        return false;
+      if (!this.password.equals(that.password))
+        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() {
+    return 0;
+  }
+
+  @Override
+  public int compareTo(PasswordCredential other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    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(isSetPassword()).compareTo(other.isSetPassword());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetPassword()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
+      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("PasswordCredential(");
+    boolean first = true;
+
+    sb.append("username:");
+    if (this.username == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.username);
+    }
+    first = false;
+    if (!first) sb.append(", ");
+    sb.append("password:");
+    if (this.password == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.password);
+    }
+    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 (username == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'username' was not present! Struct: " + toString());
+    }
+    if (password == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'password' 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 PasswordCredentialStandardSchemeFactory implements SchemeFactory {
+    public PasswordCredentialStandardScheme getScheme() {
+      return new PasswordCredentialStandardScheme();
+    }
+  }
+
+  private static class PasswordCredentialStandardScheme extends StandardScheme<PasswordCredential> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, PasswordCredential 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: // 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 2: // PASSWORD
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.password = iprot.readString();
+              struct.setPasswordIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 3: // PERSISTED_TIME
+            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+              struct.persistedTime = iprot.readI32();
+              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, PasswordCredential struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.username != null) {
+        oprot.writeFieldBegin(USERNAME_FIELD_DESC);
+        oprot.writeString(struct.username);
+        oprot.writeFieldEnd();
+      }
+      if (struct.password != null) {
+        oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
+        oprot.writeString(struct.password);
+        oprot.writeFieldEnd();
+      }
+      if (struct.isSetPersistedTime()) {
+        oprot.writeFieldBegin(PERSISTED_TIME_FIELD_DESC);
+        oprot.writeI32(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 PasswordCredentialTupleSchemeFactory implements SchemeFactory {
+    public PasswordCredentialTupleScheme getScheme() {
+      return new PasswordCredentialTupleScheme();
+    }
+  }
+
+  private static class PasswordCredentialTupleScheme extends TupleScheme<PasswordCredential> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.username);
+      oprot.writeString(struct.password);
+      BitSet optionals = new BitSet();
+      if (struct.isSetPersistedTime()) {
+        optionals.set(0);
+      }
+      if (struct.isSetToken()) {
+        optionals.set(1);
+      }
+      oprot.writeBitSet(optionals, 2);
+      if (struct.isSetPersistedTime()) {
+        oprot.writeI32(struct.persistedTime);
+      }
+      if (struct.isSetToken()) {
+        oprot.writeString(struct.token);
+      }
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, PasswordCredential struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.username = iprot.readString();
+      struct.setUsernameIsSet(true);
+      struct.password = iprot.readString();
+      struct.setPasswordIsSet(true);
+      BitSet incoming = iprot.readBitSet(2);
+      if (incoming.get(0)) {
+        struct.persistedTime = iprot.readI32();
+        struct.setPersistedTimeIsSet(true);
+      }
+      if (incoming.get(1)) {
+        struct.token = iprot.readString();
+        struct.setTokenIsSet(true);
+      }
+    }
+  }
+
+}
+