
tech.aroma.thrift.authentication.AuthenticationToken Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aroma-thrift Show documentation
Show all versions of aroma-thrift Show documentation
Part of the Aroma Project.
This project contains the Service and Model Definitions.
From this the Server and Client interfaces are generated for the Aroma Service.
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package tech.aroma.thrift.authentication;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
* Represents an Authentication Token that is used
* and accepted by the Authentication Service.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-10")
public class AuthenticationToken implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationToken");
private static final org.apache.thrift.protocol.TField TOKEN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField OWNER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField TIME_OF_CREATION_FIELD_DESC = new org.apache.thrift.protocol.TField("timeOfCreation", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField TIME_OF_EXPIRATION_FIELD_DESC = new org.apache.thrift.protocol.TField("timeOfExpiration", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField TOKEN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenType", org.apache.thrift.protocol.TType.I32, (short)5);
private static final org.apache.thrift.protocol.TField ORGANIZATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("organizationId", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField OWNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerName", org.apache.thrift.protocol.TType.STRING, (short)7);
private static final org.apache.thrift.protocol.TField ORGANIZATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("organizationName", org.apache.thrift.protocol.TType.STRING, (short)8);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new AuthenticationTokenStandardSchemeFactory());
schemes.put(TupleScheme.class, new AuthenticationTokenTupleSchemeFactory());
}
public String tokenId; // required
public String ownerId; // required
public long timeOfCreation; // required
public long timeOfExpiration; // required
/**
*
* @see TokenType
*/
public TokenType tokenType; // required
public String organizationId; // required
public String ownerName; // required
public String organizationName; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TOKEN_ID((short)1, "tokenId"),
OWNER_ID((short)2, "ownerId"),
TIME_OF_CREATION((short)3, "timeOfCreation"),
TIME_OF_EXPIRATION((short)4, "timeOfExpiration"),
/**
*
* @see TokenType
*/
TOKEN_TYPE((short)5, "tokenType"),
ORGANIZATION_ID((short)6, "organizationId"),
OWNER_NAME((short)7, "ownerName"),
ORGANIZATION_NAME((short)8, "organizationName");
private static final Map byName = new HashMap();
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: // TOKEN_ID
return TOKEN_ID;
case 2: // OWNER_ID
return OWNER_ID;
case 3: // TIME_OF_CREATION
return TIME_OF_CREATION;
case 4: // TIME_OF_EXPIRATION
return TIME_OF_EXPIRATION;
case 5: // TOKEN_TYPE
return TOKEN_TYPE;
case 6: // ORGANIZATION_ID
return ORGANIZATION_ID;
case 7: // OWNER_NAME
return OWNER_NAME;
case 8: // ORGANIZATION_NAME
return ORGANIZATION_NAME;
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 __TIMEOFCREATION_ISSET_ID = 0;
private static final int __TIMEOFEXPIRATION_ISSET_ID = 1;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TOKEN_ID, new org.apache.thrift.meta_data.FieldMetaData("tokenId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.OWNER_ID, new org.apache.thrift.meta_data.FieldMetaData("ownerId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "uuid")));
tmpMap.put(_Fields.TIME_OF_CREATION, new org.apache.thrift.meta_data.FieldMetaData("timeOfCreation", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "timestamp")));
tmpMap.put(_Fields.TIME_OF_EXPIRATION, new org.apache.thrift.meta_data.FieldMetaData("timeOfExpiration", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "timestamp")));
tmpMap.put(_Fields.TOKEN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("tokenType", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TokenType.class)));
tmpMap.put(_Fields.ORGANIZATION_ID, new org.apache.thrift.meta_data.FieldMetaData("organizationId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "uuid")));
tmpMap.put(_Fields.OWNER_NAME, new org.apache.thrift.meta_data.FieldMetaData("ownerName", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.ORGANIZATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("organizationName", 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(AuthenticationToken.class, metaDataMap);
}
public AuthenticationToken() {
}
public AuthenticationToken(
String tokenId,
String ownerId,
long timeOfCreation,
long timeOfExpiration,
TokenType tokenType,
String organizationId,
String ownerName,
String organizationName)
{
this();
this.tokenId = tokenId;
this.ownerId = ownerId;
this.timeOfCreation = timeOfCreation;
setTimeOfCreationIsSet(true);
this.timeOfExpiration = timeOfExpiration;
setTimeOfExpirationIsSet(true);
this.tokenType = tokenType;
this.organizationId = organizationId;
this.ownerName = ownerName;
this.organizationName = organizationName;
}
/**
* Performs a deep copy on other.
*/
public AuthenticationToken(AuthenticationToken other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetTokenId()) {
this.tokenId = other.tokenId;
}
if (other.isSetOwnerId()) {
this.ownerId = other.ownerId;
}
this.timeOfCreation = other.timeOfCreation;
this.timeOfExpiration = other.timeOfExpiration;
if (other.isSetTokenType()) {
this.tokenType = other.tokenType;
}
if (other.isSetOrganizationId()) {
this.organizationId = other.organizationId;
}
if (other.isSetOwnerName()) {
this.ownerName = other.ownerName;
}
if (other.isSetOrganizationName()) {
this.organizationName = other.organizationName;
}
}
public AuthenticationToken deepCopy() {
return new AuthenticationToken(this);
}
@Override
public void clear() {
this.tokenId = null;
this.ownerId = null;
setTimeOfCreationIsSet(false);
this.timeOfCreation = 0;
setTimeOfExpirationIsSet(false);
this.timeOfExpiration = 0;
this.tokenType = null;
this.organizationId = null;
this.ownerName = null;
this.organizationName = null;
}
public String getTokenId() {
return this.tokenId;
}
public AuthenticationToken setTokenId(String tokenId) {
this.tokenId = tokenId;
return this;
}
public void unsetTokenId() {
this.tokenId = null;
}
/** Returns true if field tokenId is set (has been assigned a value) and false otherwise */
public boolean isSetTokenId() {
return this.tokenId != null;
}
public void setTokenIdIsSet(boolean value) {
if (!value) {
this.tokenId = null;
}
}
public String getOwnerId() {
return this.ownerId;
}
public AuthenticationToken setOwnerId(String ownerId) {
this.ownerId = ownerId;
return this;
}
public void unsetOwnerId() {
this.ownerId = null;
}
/** Returns true if field ownerId is set (has been assigned a value) and false otherwise */
public boolean isSetOwnerId() {
return this.ownerId != null;
}
public void setOwnerIdIsSet(boolean value) {
if (!value) {
this.ownerId = null;
}
}
public long getTimeOfCreation() {
return this.timeOfCreation;
}
public AuthenticationToken setTimeOfCreation(long timeOfCreation) {
this.timeOfCreation = timeOfCreation;
setTimeOfCreationIsSet(true);
return this;
}
public void unsetTimeOfCreation() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOFCREATION_ISSET_ID);
}
/** Returns true if field timeOfCreation is set (has been assigned a value) and false otherwise */
public boolean isSetTimeOfCreation() {
return EncodingUtils.testBit(__isset_bitfield, __TIMEOFCREATION_ISSET_ID);
}
public void setTimeOfCreationIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOFCREATION_ISSET_ID, value);
}
public long getTimeOfExpiration() {
return this.timeOfExpiration;
}
public AuthenticationToken setTimeOfExpiration(long timeOfExpiration) {
this.timeOfExpiration = timeOfExpiration;
setTimeOfExpirationIsSet(true);
return this;
}
public void unsetTimeOfExpiration() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TIMEOFEXPIRATION_ISSET_ID);
}
/** Returns true if field timeOfExpiration is set (has been assigned a value) and false otherwise */
public boolean isSetTimeOfExpiration() {
return EncodingUtils.testBit(__isset_bitfield, __TIMEOFEXPIRATION_ISSET_ID);
}
public void setTimeOfExpirationIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TIMEOFEXPIRATION_ISSET_ID, value);
}
/**
*
* @see TokenType
*/
public TokenType getTokenType() {
return this.tokenType;
}
/**
*
* @see TokenType
*/
public AuthenticationToken setTokenType(TokenType tokenType) {
this.tokenType = tokenType;
return this;
}
public void unsetTokenType() {
this.tokenType = null;
}
/** Returns true if field tokenType is set (has been assigned a value) and false otherwise */
public boolean isSetTokenType() {
return this.tokenType != null;
}
public void setTokenTypeIsSet(boolean value) {
if (!value) {
this.tokenType = null;
}
}
public String getOrganizationId() {
return this.organizationId;
}
public AuthenticationToken setOrganizationId(String organizationId) {
this.organizationId = organizationId;
return this;
}
public void unsetOrganizationId() {
this.organizationId = null;
}
/** Returns true if field organizationId is set (has been assigned a value) and false otherwise */
public boolean isSetOrganizationId() {
return this.organizationId != null;
}
public void setOrganizationIdIsSet(boolean value) {
if (!value) {
this.organizationId = null;
}
}
public String getOwnerName() {
return this.ownerName;
}
public AuthenticationToken setOwnerName(String ownerName) {
this.ownerName = ownerName;
return this;
}
public void unsetOwnerName() {
this.ownerName = null;
}
/** Returns true if field ownerName is set (has been assigned a value) and false otherwise */
public boolean isSetOwnerName() {
return this.ownerName != null;
}
public void setOwnerNameIsSet(boolean value) {
if (!value) {
this.ownerName = null;
}
}
public String getOrganizationName() {
return this.organizationName;
}
public AuthenticationToken setOrganizationName(String organizationName) {
this.organizationName = organizationName;
return this;
}
public void unsetOrganizationName() {
this.organizationName = null;
}
/** Returns true if field organizationName is set (has been assigned a value) and false otherwise */
public boolean isSetOrganizationName() {
return this.organizationName != null;
}
public void setOrganizationNameIsSet(boolean value) {
if (!value) {
this.organizationName = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TOKEN_ID:
if (value == null) {
unsetTokenId();
} else {
setTokenId((String)value);
}
break;
case OWNER_ID:
if (value == null) {
unsetOwnerId();
} else {
setOwnerId((String)value);
}
break;
case TIME_OF_CREATION:
if (value == null) {
unsetTimeOfCreation();
} else {
setTimeOfCreation((Long)value);
}
break;
case TIME_OF_EXPIRATION:
if (value == null) {
unsetTimeOfExpiration();
} else {
setTimeOfExpiration((Long)value);
}
break;
case TOKEN_TYPE:
if (value == null) {
unsetTokenType();
} else {
setTokenType((TokenType)value);
}
break;
case ORGANIZATION_ID:
if (value == null) {
unsetOrganizationId();
} else {
setOrganizationId((String)value);
}
break;
case OWNER_NAME:
if (value == null) {
unsetOwnerName();
} else {
setOwnerName((String)value);
}
break;
case ORGANIZATION_NAME:
if (value == null) {
unsetOrganizationName();
} else {
setOrganizationName((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TOKEN_ID:
return getTokenId();
case OWNER_ID:
return getOwnerId();
case TIME_OF_CREATION:
return getTimeOfCreation();
case TIME_OF_EXPIRATION:
return getTimeOfExpiration();
case TOKEN_TYPE:
return getTokenType();
case ORGANIZATION_ID:
return getOrganizationId();
case OWNER_NAME:
return getOwnerName();
case ORGANIZATION_NAME:
return getOrganizationName();
}
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 TOKEN_ID:
return isSetTokenId();
case OWNER_ID:
return isSetOwnerId();
case TIME_OF_CREATION:
return isSetTimeOfCreation();
case TIME_OF_EXPIRATION:
return isSetTimeOfExpiration();
case TOKEN_TYPE:
return isSetTokenType();
case ORGANIZATION_ID:
return isSetOrganizationId();
case OWNER_NAME:
return isSetOwnerName();
case ORGANIZATION_NAME:
return isSetOrganizationName();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof AuthenticationToken)
return this.equals((AuthenticationToken)that);
return false;
}
public boolean equals(AuthenticationToken that) {
if (that == null)
return false;
boolean this_present_tokenId = true && this.isSetTokenId();
boolean that_present_tokenId = true && that.isSetTokenId();
if (this_present_tokenId || that_present_tokenId) {
if (!(this_present_tokenId && that_present_tokenId))
return false;
if (!this.tokenId.equals(that.tokenId))
return false;
}
boolean this_present_ownerId = true && this.isSetOwnerId();
boolean that_present_ownerId = true && that.isSetOwnerId();
if (this_present_ownerId || that_present_ownerId) {
if (!(this_present_ownerId && that_present_ownerId))
return false;
if (!this.ownerId.equals(that.ownerId))
return false;
}
boolean this_present_timeOfCreation = true;
boolean that_present_timeOfCreation = true;
if (this_present_timeOfCreation || that_present_timeOfCreation) {
if (!(this_present_timeOfCreation && that_present_timeOfCreation))
return false;
if (this.timeOfCreation != that.timeOfCreation)
return false;
}
boolean this_present_timeOfExpiration = true;
boolean that_present_timeOfExpiration = true;
if (this_present_timeOfExpiration || that_present_timeOfExpiration) {
if (!(this_present_timeOfExpiration && that_present_timeOfExpiration))
return false;
if (this.timeOfExpiration != that.timeOfExpiration)
return false;
}
boolean this_present_tokenType = true && this.isSetTokenType();
boolean that_present_tokenType = true && that.isSetTokenType();
if (this_present_tokenType || that_present_tokenType) {
if (!(this_present_tokenType && that_present_tokenType))
return false;
if (!this.tokenType.equals(that.tokenType))
return false;
}
boolean this_present_organizationId = true && this.isSetOrganizationId();
boolean that_present_organizationId = true && that.isSetOrganizationId();
if (this_present_organizationId || that_present_organizationId) {
if (!(this_present_organizationId && that_present_organizationId))
return false;
if (!this.organizationId.equals(that.organizationId))
return false;
}
boolean this_present_ownerName = true && this.isSetOwnerName();
boolean that_present_ownerName = true && that.isSetOwnerName();
if (this_present_ownerName || that_present_ownerName) {
if (!(this_present_ownerName && that_present_ownerName))
return false;
if (!this.ownerName.equals(that.ownerName))
return false;
}
boolean this_present_organizationName = true && this.isSetOrganizationName();
boolean that_present_organizationName = true && that.isSetOrganizationName();
if (this_present_organizationName || that_present_organizationName) {
if (!(this_present_organizationName && that_present_organizationName))
return false;
if (!this.organizationName.equals(that.organizationName))
return false;
}
return true;
}
@Override
public int hashCode() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy