diff options
| author | Simon Rettberg | 2014-10-02 15:33:59 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2014-10-02 15:33:59 +0200 |
| commit | 4a057de0f17a17453f603feaf5fb9a5f4c1a5ef1 (patch) | |
| tree | ad6d03421e96092289c8130336076403342f2f6c /src/main | |
| parent | better exception handling. (diff) | |
| download | master-sync-shared-4a057de0f17a17453f603feaf5fb9a5f4c1a5ef1.tar.gz master-sync-shared-4a057de0f17a17453f603feaf5fb9a5f4c1a5ef1.tar.xz master-sync-shared-4a057de0f17a17453f603feaf5fb9a5f4c1a5ef1.zip | |
Rename and clean up some structs and member names
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java | 11 | ||||
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java | 1034 | ||||
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java | 5232 | ||||
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/OrganizationData.java (renamed from src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationException.java) | 278 | ||||
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationError.java | 54 | ||||
| -rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/UserInfo.java | 108 | ||||
| -rw-r--r-- | src/main/thrift/imagemaster.thrift | 66 |
7 files changed, 5454 insertions, 1329 deletions
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java b/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java index 2fd9fcf..965ddd2 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java +++ b/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java @@ -15,7 +15,10 @@ public enum AuthenticationError implements org.apache.thrift.TEnum { GENERIC_ERROR(0), INVALID_CREDENTIALS(1), ACCOUNT_SUSPENDED(2), - BANNED_NETWORK(3); + INVALID_ORGANIZATION(3), + INVALID_KEY(4), + CHALLENGE_FAILED(5), + BANNED_NETWORK(6); private final int value; @@ -43,6 +46,12 @@ public enum AuthenticationError implements org.apache.thrift.TEnum { case 2: return ACCOUNT_SUSPENDED; case 3: + return INVALID_ORGANIZATION; + case 4: + return INVALID_KEY; + case 5: + return CHALLENGE_FAILED; + case 6: return BANNED_NETWORK; default: return null; diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java index 02daf62..30b49a3 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java +++ b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java @@ -36,16 +36,15 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ImageData"); private static final org.apache.thrift.protocol.TField UUID_FIELD_DESC = new org.apache.thrift.protocol.TField("uuid", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField IMAGE_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageVersion", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField IMAGE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField IMAGE_CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageCreateTime", org.apache.thrift.protocol.TType.I64, (short)4); - private static final org.apache.thrift.protocol.TField IMAGE_UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("imageUpdateTime", org.apache.thrift.protocol.TType.I64, (short)5); - private static final org.apache.thrift.protocol.TField IMAGE_OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("imageOwner", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField CONTENT_OPERATING_SYSTEM_FIELD_DESC = new org.apache.thrift.protocol.TField("contentOperatingSystem", org.apache.thrift.protocol.TType.STRING, (short)7); - private static final org.apache.thrift.protocol.TField STATUS_IS_VALID_FIELD_DESC = new org.apache.thrift.protocol.TField("statusIsValid", org.apache.thrift.protocol.TType.BOOL, (short)8); - private static final org.apache.thrift.protocol.TField STATUS_IS_DELETED_FIELD_DESC = new org.apache.thrift.protocol.TField("statusIsDeleted", org.apache.thrift.protocol.TType.BOOL, (short)9); - private static final org.apache.thrift.protocol.TField IMAGE_SHORT_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageShortDescription", org.apache.thrift.protocol.TType.STRING, (short)10); - private static final org.apache.thrift.protocol.TField IMAGE_LONG_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageLongDescription", org.apache.thrift.protocol.TType.STRING, (short)11); + private static final org.apache.thrift.protocol.TField REVISION_FIELD_DESC = new org.apache.thrift.protocol.TField("revision", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("title", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I64, (short)4); + private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField OWNER_LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerLogin", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField OPERATING_SYSTEM_FIELD_DESC = new org.apache.thrift.protocol.TField("operatingSystem", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField IS_VALID_FIELD_DESC = new org.apache.thrift.protocol.TField("isValid", org.apache.thrift.protocol.TType.BOOL, (short)8); + private static final org.apache.thrift.protocol.TField IS_DELETED_FIELD_DESC = new org.apache.thrift.protocol.TField("isDeleted", org.apache.thrift.protocol.TType.BOOL, (short)9); + private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)11); private static final org.apache.thrift.protocol.TField FILE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("fileSize", org.apache.thrift.protocol.TType.I64, (short)12); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); @@ -55,31 +54,29 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ } public String uuid; // required - public int imageVersion; // required - public String imageName; // required - public long imageCreateTime; // required - public long imageUpdateTime; // required - public String imageOwner; // required - public String contentOperatingSystem; // required - public boolean statusIsValid; // required - public boolean statusIsDeleted; // required - public String imageShortDescription; // required - public String imageLongDescription; // required + public int revision; // required + public String title; // required + public long createTime; // required + public long updateTime; // required + public String ownerLogin; // required + public String operatingSystem; // required + public boolean isValid; // required + public boolean isDeleted; // required + public String description; // required public long fileSize; // 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 { UUID((short)1, "uuid"), - IMAGE_VERSION((short)2, "imageVersion"), - IMAGE_NAME((short)3, "imageName"), - IMAGE_CREATE_TIME((short)4, "imageCreateTime"), - IMAGE_UPDATE_TIME((short)5, "imageUpdateTime"), - IMAGE_OWNER((short)6, "imageOwner"), - CONTENT_OPERATING_SYSTEM((short)7, "contentOperatingSystem"), - STATUS_IS_VALID((short)8, "statusIsValid"), - STATUS_IS_DELETED((short)9, "statusIsDeleted"), - IMAGE_SHORT_DESCRIPTION((short)10, "imageShortDescription"), - IMAGE_LONG_DESCRIPTION((short)11, "imageLongDescription"), + REVISION((short)2, "revision"), + TITLE((short)3, "title"), + CREATE_TIME((short)4, "createTime"), + UPDATE_TIME((short)5, "updateTime"), + OWNER_LOGIN((short)6, "ownerLogin"), + OPERATING_SYSTEM((short)7, "operatingSystem"), + IS_VALID((short)8, "isValid"), + IS_DELETED((short)9, "isDeleted"), + DESCRIPTION((short)11, "description"), FILE_SIZE((short)12, "fileSize"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -97,26 +94,24 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ switch(fieldId) { case 1: // UUID return UUID; - case 2: // IMAGE_VERSION - return IMAGE_VERSION; - case 3: // IMAGE_NAME - return IMAGE_NAME; - case 4: // IMAGE_CREATE_TIME - return IMAGE_CREATE_TIME; - case 5: // IMAGE_UPDATE_TIME - return IMAGE_UPDATE_TIME; - case 6: // IMAGE_OWNER - return IMAGE_OWNER; - case 7: // CONTENT_OPERATING_SYSTEM - return CONTENT_OPERATING_SYSTEM; - case 8: // STATUS_IS_VALID - return STATUS_IS_VALID; - case 9: // STATUS_IS_DELETED - return STATUS_IS_DELETED; - case 10: // IMAGE_SHORT_DESCRIPTION - return IMAGE_SHORT_DESCRIPTION; - case 11: // IMAGE_LONG_DESCRIPTION - return IMAGE_LONG_DESCRIPTION; + case 2: // REVISION + return REVISION; + case 3: // TITLE + return TITLE; + case 4: // CREATE_TIME + return CREATE_TIME; + case 5: // UPDATE_TIME + return UPDATE_TIME; + case 6: // OWNER_LOGIN + return OWNER_LOGIN; + case 7: // OPERATING_SYSTEM + return OPERATING_SYSTEM; + case 8: // IS_VALID + return IS_VALID; + case 9: // IS_DELETED + return IS_DELETED; + case 11: // DESCRIPTION + return DESCRIPTION; case 12: // FILE_SIZE return FILE_SIZE; default: @@ -159,11 +154,11 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ } // isset id assignments - private static final int __IMAGEVERSION_ISSET_ID = 0; - private static final int __IMAGECREATETIME_ISSET_ID = 1; - private static final int __IMAGEUPDATETIME_ISSET_ID = 2; - private static final int __STATUSISVALID_ISSET_ID = 3; - private static final int __STATUSISDELETED_ISSET_ID = 4; + private static final int __REVISION_ISSET_ID = 0; + private static final int __CREATETIME_ISSET_ID = 1; + private static final int __UPDATETIME_ISSET_ID = 2; + private static final int __ISVALID_ISSET_ID = 3; + private static final int __ISDELETED_ISSET_ID = 4; private static final int __FILESIZE_ISSET_ID = 5; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; @@ -171,25 +166,23 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); - tmpMap.put(_Fields.IMAGE_VERSION, new org.apache.thrift.meta_data.FieldMetaData("imageVersion", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.REVISION, new org.apache.thrift.meta_data.FieldMetaData("revision", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.IMAGE_NAME, new org.apache.thrift.meta_data.FieldMetaData("imageName", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.TITLE, new org.apache.thrift.meta_data.FieldMetaData("title", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGE_CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("imageCreateTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp"))); - tmpMap.put(_Fields.IMAGE_UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("imageUpdateTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp"))); - tmpMap.put(_Fields.IMAGE_OWNER, new org.apache.thrift.meta_data.FieldMetaData("imageOwner", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.OWNER_LOGIN, new org.apache.thrift.meta_data.FieldMetaData("ownerLogin", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONTENT_OPERATING_SYSTEM, new org.apache.thrift.meta_data.FieldMetaData("contentOperatingSystem", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.OPERATING_SYSTEM, new org.apache.thrift.meta_data.FieldMetaData("operatingSystem", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.STATUS_IS_VALID, new org.apache.thrift.meta_data.FieldMetaData("statusIsValid", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IS_VALID, new org.apache.thrift.meta_data.FieldMetaData("isValid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.STATUS_IS_DELETED, new org.apache.thrift.meta_data.FieldMetaData("statusIsDeleted", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.IS_DELETED, new org.apache.thrift.meta_data.FieldMetaData("isDeleted", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.IMAGE_SHORT_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("imageShortDescription", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.IMAGE_LONG_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("imageLongDescription", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FILE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("fileSize", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); @@ -202,35 +195,33 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ public ImageData( String uuid, - int imageVersion, - String imageName, - long imageCreateTime, - long imageUpdateTime, - String imageOwner, - String contentOperatingSystem, - boolean statusIsValid, - boolean statusIsDeleted, - String imageShortDescription, - String imageLongDescription, + int revision, + String title, + long createTime, + long updateTime, + String ownerLogin, + String operatingSystem, + boolean isValid, + boolean isDeleted, + String description, long fileSize) { this(); this.uuid = uuid; - this.imageVersion = imageVersion; - setImageVersionIsSet(true); - this.imageName = imageName; - this.imageCreateTime = imageCreateTime; - setImageCreateTimeIsSet(true); - this.imageUpdateTime = imageUpdateTime; - setImageUpdateTimeIsSet(true); - this.imageOwner = imageOwner; - this.contentOperatingSystem = contentOperatingSystem; - this.statusIsValid = statusIsValid; - setStatusIsValidIsSet(true); - this.statusIsDeleted = statusIsDeleted; - setStatusIsDeletedIsSet(true); - this.imageShortDescription = imageShortDescription; - this.imageLongDescription = imageLongDescription; + this.revision = revision; + setRevisionIsSet(true); + this.title = title; + this.createTime = createTime; + setCreateTimeIsSet(true); + this.updateTime = updateTime; + setUpdateTimeIsSet(true); + this.ownerLogin = ownerLogin; + this.operatingSystem = operatingSystem; + this.isValid = isValid; + setIsValidIsSet(true); + this.isDeleted = isDeleted; + setIsDeletedIsSet(true); + this.description = description; this.fileSize = fileSize; setFileSizeIsSet(true); } @@ -243,25 +234,22 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ if (other.isSetUuid()) { this.uuid = other.uuid; } - this.imageVersion = other.imageVersion; - if (other.isSetImageName()) { - this.imageName = other.imageName; - } - this.imageCreateTime = other.imageCreateTime; - this.imageUpdateTime = other.imageUpdateTime; - if (other.isSetImageOwner()) { - this.imageOwner = other.imageOwner; + this.revision = other.revision; + if (other.isSetTitle()) { + this.title = other.title; } - if (other.isSetContentOperatingSystem()) { - this.contentOperatingSystem = other.contentOperatingSystem; + this.createTime = other.createTime; + this.updateTime = other.updateTime; + if (other.isSetOwnerLogin()) { + this.ownerLogin = other.ownerLogin; } - this.statusIsValid = other.statusIsValid; - this.statusIsDeleted = other.statusIsDeleted; - if (other.isSetImageShortDescription()) { - this.imageShortDescription = other.imageShortDescription; + if (other.isSetOperatingSystem()) { + this.operatingSystem = other.operatingSystem; } - if (other.isSetImageLongDescription()) { - this.imageLongDescription = other.imageLongDescription; + this.isValid = other.isValid; + this.isDeleted = other.isDeleted; + if (other.isSetDescription()) { + this.description = other.description; } this.fileSize = other.fileSize; } @@ -273,21 +261,20 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ @Override public void clear() { this.uuid = null; - setImageVersionIsSet(false); - this.imageVersion = 0; - this.imageName = null; - setImageCreateTimeIsSet(false); - this.imageCreateTime = 0; - setImageUpdateTimeIsSet(false); - this.imageUpdateTime = 0; - this.imageOwner = null; - this.contentOperatingSystem = null; - setStatusIsValidIsSet(false); - this.statusIsValid = false; - setStatusIsDeletedIsSet(false); - this.statusIsDeleted = false; - this.imageShortDescription = null; - this.imageLongDescription = null; + setRevisionIsSet(false); + this.revision = 0; + this.title = null; + setCreateTimeIsSet(false); + this.createTime = 0; + setUpdateTimeIsSet(false); + this.updateTime = 0; + this.ownerLogin = null; + this.operatingSystem = null; + setIsValidIsSet(false); + this.isValid = false; + setIsDeletedIsSet(false); + this.isDeleted = false; + this.description = null; setFileSizeIsSet(false); this.fileSize = 0; } @@ -316,238 +303,214 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ } } - public int getImageVersion() { - return this.imageVersion; + public int getRevision() { + return this.revision; } - public ImageData setImageVersion(int imageVersion) { - this.imageVersion = imageVersion; - setImageVersionIsSet(true); + public ImageData setRevision(int revision) { + this.revision = revision; + setRevisionIsSet(true); return this; } - public void unsetImageVersion() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __IMAGEVERSION_ISSET_ID); + public void unsetRevision() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REVISION_ISSET_ID); } - /** Returns true if field imageVersion is set (has been assigned a value) and false otherwise */ - public boolean isSetImageVersion() { - return EncodingUtils.testBit(__isset_bitfield, __IMAGEVERSION_ISSET_ID); + /** Returns true if field revision is set (has been assigned a value) and false otherwise */ + public boolean isSetRevision() { + return EncodingUtils.testBit(__isset_bitfield, __REVISION_ISSET_ID); } - public void setImageVersionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __IMAGEVERSION_ISSET_ID, value); + public void setRevisionIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REVISION_ISSET_ID, value); } - public String getImageName() { - return this.imageName; + public String getTitle() { + return this.title; } - public ImageData setImageName(String imageName) { - this.imageName = imageName; + public ImageData setTitle(String title) { + this.title = title; return this; } - public void unsetImageName() { - this.imageName = null; + public void unsetTitle() { + this.title = null; } - /** Returns true if field imageName is set (has been assigned a value) and false otherwise */ - public boolean isSetImageName() { - return this.imageName != null; + /** Returns true if field title is set (has been assigned a value) and false otherwise */ + public boolean isSetTitle() { + return this.title != null; } - public void setImageNameIsSet(boolean value) { + public void setTitleIsSet(boolean value) { if (!value) { - this.imageName = null; + this.title = null; } } - public long getImageCreateTime() { - return this.imageCreateTime; + public long getCreateTime() { + return this.createTime; } - public ImageData setImageCreateTime(long imageCreateTime) { - this.imageCreateTime = imageCreateTime; - setImageCreateTimeIsSet(true); + public ImageData setCreateTime(long createTime) { + this.createTime = createTime; + setCreateTimeIsSet(true); return this; } - public void unsetImageCreateTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __IMAGECREATETIME_ISSET_ID); + public void unsetCreateTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID); } - /** Returns true if field imageCreateTime is set (has been assigned a value) and false otherwise */ - public boolean isSetImageCreateTime() { - return EncodingUtils.testBit(__isset_bitfield, __IMAGECREATETIME_ISSET_ID); + /** Returns true if field createTime is set (has been assigned a value) and false otherwise */ + public boolean isSetCreateTime() { + return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID); } - public void setImageCreateTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __IMAGECREATETIME_ISSET_ID, value); + public void setCreateTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value); } - public long getImageUpdateTime() { - return this.imageUpdateTime; + public long getUpdateTime() { + return this.updateTime; } - public ImageData setImageUpdateTime(long imageUpdateTime) { - this.imageUpdateTime = imageUpdateTime; - setImageUpdateTimeIsSet(true); + public ImageData setUpdateTime(long updateTime) { + this.updateTime = updateTime; + setUpdateTimeIsSet(true); return this; } - public void unsetImageUpdateTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __IMAGEUPDATETIME_ISSET_ID); + public void unsetUpdateTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATETIME_ISSET_ID); } - /** Returns true if field imageUpdateTime is set (has been assigned a value) and false otherwise */ - public boolean isSetImageUpdateTime() { - return EncodingUtils.testBit(__isset_bitfield, __IMAGEUPDATETIME_ISSET_ID); + /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */ + public boolean isSetUpdateTime() { + return EncodingUtils.testBit(__isset_bitfield, __UPDATETIME_ISSET_ID); } - public void setImageUpdateTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __IMAGEUPDATETIME_ISSET_ID, value); + public void setUpdateTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATETIME_ISSET_ID, value); } - public String getImageOwner() { - return this.imageOwner; + public String getOwnerLogin() { + return this.ownerLogin; } - public ImageData setImageOwner(String imageOwner) { - this.imageOwner = imageOwner; + public ImageData setOwnerLogin(String ownerLogin) { + this.ownerLogin = ownerLogin; return this; } - public void unsetImageOwner() { - this.imageOwner = null; + public void unsetOwnerLogin() { + this.ownerLogin = null; } - /** Returns true if field imageOwner is set (has been assigned a value) and false otherwise */ - public boolean isSetImageOwner() { - return this.imageOwner != null; + /** Returns true if field ownerLogin is set (has been assigned a value) and false otherwise */ + public boolean isSetOwnerLogin() { + return this.ownerLogin != null; } - public void setImageOwnerIsSet(boolean value) { + public void setOwnerLoginIsSet(boolean value) { if (!value) { - this.imageOwner = null; + this.ownerLogin = null; } } - public String getContentOperatingSystem() { - return this.contentOperatingSystem; + public String getOperatingSystem() { + return this.operatingSystem; } - public ImageData setContentOperatingSystem(String contentOperatingSystem) { - this.contentOperatingSystem = contentOperatingSystem; + public ImageData setOperatingSystem(String operatingSystem) { + this.operatingSystem = operatingSystem; return this; } - public void unsetContentOperatingSystem() { - this.contentOperatingSystem = null; + public void unsetOperatingSystem() { + this.operatingSystem = null; } - /** Returns true if field contentOperatingSystem is set (has been assigned a value) and false otherwise */ - public boolean isSetContentOperatingSystem() { - return this.contentOperatingSystem != null; + /** Returns true if field operatingSystem is set (has been assigned a value) and false otherwise */ + public boolean isSetOperatingSystem() { + return this.operatingSystem != null; } - public void setContentOperatingSystemIsSet(boolean value) { + public void setOperatingSystemIsSet(boolean value) { if (!value) { - this.contentOperatingSystem = null; + this.operatingSystem = null; } } - public boolean isStatusIsValid() { - return this.statusIsValid; + public boolean isIsValid() { + return this.isValid; } - public ImageData setStatusIsValid(boolean statusIsValid) { - this.statusIsValid = statusIsValid; - setStatusIsValidIsSet(true); + public ImageData setIsValid(boolean isValid) { + this.isValid = isValid; + setIsValidIsSet(true); return this; } - public void unsetStatusIsValid() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STATUSISVALID_ISSET_ID); + public void unsetIsValid() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISVALID_ISSET_ID); } - /** Returns true if field statusIsValid is set (has been assigned a value) and false otherwise */ - public boolean isSetStatusIsValid() { - return EncodingUtils.testBit(__isset_bitfield, __STATUSISVALID_ISSET_ID); + /** Returns true if field isValid is set (has been assigned a value) and false otherwise */ + public boolean isSetIsValid() { + return EncodingUtils.testBit(__isset_bitfield, __ISVALID_ISSET_ID); } - public void setStatusIsValidIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STATUSISVALID_ISSET_ID, value); + public void setIsValidIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISVALID_ISSET_ID, value); } - public boolean isStatusIsDeleted() { - return this.statusIsDeleted; + public boolean isIsDeleted() { + return this.isDeleted; } - public ImageData setStatusIsDeleted(boolean statusIsDeleted) { - this.statusIsDeleted = statusIsDeleted; - setStatusIsDeletedIsSet(true); + public ImageData setIsDeleted(boolean isDeleted) { + this.isDeleted = isDeleted; + setIsDeletedIsSet(true); return this; } - public void unsetStatusIsDeleted() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STATUSISDELETED_ISSET_ID); + public void unsetIsDeleted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISDELETED_ISSET_ID); } - /** Returns true if field statusIsDeleted is set (has been assigned a value) and false otherwise */ - public boolean isSetStatusIsDeleted() { - return EncodingUtils.testBit(__isset_bitfield, __STATUSISDELETED_ISSET_ID); + /** Returns true if field isDeleted is set (has been assigned a value) and false otherwise */ + public boolean isSetIsDeleted() { + return EncodingUtils.testBit(__isset_bitfield, __ISDELETED_ISSET_ID); } - public void setStatusIsDeletedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STATUSISDELETED_ISSET_ID, value); + public void setIsDeletedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISDELETED_ISSET_ID, value); } - public String getImageShortDescription() { - return this.imageShortDescription; + public String getDescription() { + return this.description; } - public ImageData setImageShortDescription(String imageShortDescription) { - this.imageShortDescription = imageShortDescription; + public ImageData setDescription(String description) { + this.description = description; return this; } - public void unsetImageShortDescription() { - this.imageShortDescription = null; + public void unsetDescription() { + this.description = null; } - /** Returns true if field imageShortDescription is set (has been assigned a value) and false otherwise */ - public boolean isSetImageShortDescription() { - return this.imageShortDescription != null; + /** Returns true if field description is set (has been assigned a value) and false otherwise */ + public boolean isSetDescription() { + return this.description != null; } - public void setImageShortDescriptionIsSet(boolean value) { + public void setDescriptionIsSet(boolean value) { if (!value) { - this.imageShortDescription = null; - } - } - - public String getImageLongDescription() { - return this.imageLongDescription; - } - - public ImageData setImageLongDescription(String imageLongDescription) { - this.imageLongDescription = imageLongDescription; - return this; - } - - public void unsetImageLongDescription() { - this.imageLongDescription = null; - } - - /** Returns true if field imageLongDescription is set (has been assigned a value) and false otherwise */ - public boolean isSetImageLongDescription() { - return this.imageLongDescription != null; - } - - public void setImageLongDescriptionIsSet(boolean value) { - if (!value) { - this.imageLongDescription = null; + this.description = null; } } @@ -584,83 +547,75 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ } break; - case IMAGE_VERSION: - if (value == null) { - unsetImageVersion(); - } else { - setImageVersion((Integer)value); - } - break; - - case IMAGE_NAME: + case REVISION: if (value == null) { - unsetImageName(); + unsetRevision(); } else { - setImageName((String)value); + setRevision((Integer)value); } break; - case IMAGE_CREATE_TIME: + case TITLE: if (value == null) { - unsetImageCreateTime(); + unsetTitle(); } else { - setImageCreateTime((Long)value); + setTitle((String)value); } break; - case IMAGE_UPDATE_TIME: + case CREATE_TIME: if (value == null) { - unsetImageUpdateTime(); + unsetCreateTime(); } else { - setImageUpdateTime((Long)value); + setCreateTime((Long)value); } break; - case IMAGE_OWNER: + case UPDATE_TIME: if (value == null) { - unsetImageOwner(); + unsetUpdateTime(); } else { - setImageOwner((String)value); + setUpdateTime((Long)value); } break; - case CONTENT_OPERATING_SYSTEM: + case OWNER_LOGIN: if (value == null) { - unsetContentOperatingSystem(); + unsetOwnerLogin(); } else { - setContentOperatingSystem((String)value); + setOwnerLogin((String)value); } break; - case STATUS_IS_VALID: + case OPERATING_SYSTEM: if (value == null) { - unsetStatusIsValid(); + unsetOperatingSystem(); } else { - setStatusIsValid((Boolean)value); + setOperatingSystem((String)value); } break; - case STATUS_IS_DELETED: + case IS_VALID: if (value == null) { - unsetStatusIsDeleted(); + unsetIsValid(); } else { - setStatusIsDeleted((Boolean)value); + setIsValid((Boolean)value); } break; - case IMAGE_SHORT_DESCRIPTION: + case IS_DELETED: if (value == null) { - unsetImageShortDescription(); + unsetIsDeleted(); } else { - setImageShortDescription((String)value); + setIsDeleted((Boolean)value); } break; - case IMAGE_LONG_DESCRIPTION: + case DESCRIPTION: if (value == null) { - unsetImageLongDescription(); + unsetDescription(); } else { - setImageLongDescription((String)value); + setDescription((String)value); } break; @@ -680,35 +635,32 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ case UUID: return getUuid(); - case IMAGE_VERSION: - return Integer.valueOf(getImageVersion()); - - case IMAGE_NAME: - return getImageName(); + case REVISION: + return Integer.valueOf(getRevision()); - case IMAGE_CREATE_TIME: - return Long.valueOf(getImageCreateTime()); + case TITLE: + return getTitle(); - case IMAGE_UPDATE_TIME: - return Long.valueOf(getImageUpdateTime()); + case CREATE_TIME: + return Long.valueOf(getCreateTime()); - case IMAGE_OWNER: - return getImageOwner(); + case UPDATE_TIME: + return Long.valueOf(getUpdateTime()); - case CONTENT_OPERATING_SYSTEM: - return getContentOperatingSystem(); + case OWNER_LOGIN: + return getOwnerLogin(); - case STATUS_IS_VALID: - return Boolean.valueOf(isStatusIsValid()); + case OPERATING_SYSTEM: + return getOperatingSystem(); - case STATUS_IS_DELETED: - return Boolean.valueOf(isStatusIsDeleted()); + case IS_VALID: + return Boolean.valueOf(isIsValid()); - case IMAGE_SHORT_DESCRIPTION: - return getImageShortDescription(); + case IS_DELETED: + return Boolean.valueOf(isIsDeleted()); - case IMAGE_LONG_DESCRIPTION: - return getImageLongDescription(); + case DESCRIPTION: + return getDescription(); case FILE_SIZE: return Long.valueOf(getFileSize()); @@ -726,26 +678,24 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ switch (field) { case UUID: return isSetUuid(); - case IMAGE_VERSION: - return isSetImageVersion(); - case IMAGE_NAME: - return isSetImageName(); - case IMAGE_CREATE_TIME: - return isSetImageCreateTime(); - case IMAGE_UPDATE_TIME: - return isSetImageUpdateTime(); - case IMAGE_OWNER: - return isSetImageOwner(); - case CONTENT_OPERATING_SYSTEM: - return isSetContentOperatingSystem(); - case STATUS_IS_VALID: - return isSetStatusIsValid(); - case STATUS_IS_DELETED: - return isSetStatusIsDeleted(); - case IMAGE_SHORT_DESCRIPTION: - return isSetImageShortDescription(); - case IMAGE_LONG_DESCRIPTION: - return isSetImageLongDescription(); + case REVISION: + return isSetRevision(); + case TITLE: + return isSetTitle(); + case CREATE_TIME: + return isSetCreateTime(); + case UPDATE_TIME: + return isSetUpdateTime(); + case OWNER_LOGIN: + return isSetOwnerLogin(); + case OPERATING_SYSTEM: + return isSetOperatingSystem(); + case IS_VALID: + return isSetIsValid(); + case IS_DELETED: + return isSetIsDeleted(); + case DESCRIPTION: + return isSetDescription(); case FILE_SIZE: return isSetFileSize(); } @@ -774,93 +724,84 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ return false; } - boolean this_present_imageVersion = true; - boolean that_present_imageVersion = true; - if (this_present_imageVersion || that_present_imageVersion) { - if (!(this_present_imageVersion && that_present_imageVersion)) - return false; - if (this.imageVersion != that.imageVersion) - return false; - } - - boolean this_present_imageName = true && this.isSetImageName(); - boolean that_present_imageName = true && that.isSetImageName(); - if (this_present_imageName || that_present_imageName) { - if (!(this_present_imageName && that_present_imageName)) + boolean this_present_revision = true; + boolean that_present_revision = true; + if (this_present_revision || that_present_revision) { + if (!(this_present_revision && that_present_revision)) return false; - if (!this.imageName.equals(that.imageName)) + if (this.revision != that.revision) return false; } - boolean this_present_imageCreateTime = true; - boolean that_present_imageCreateTime = true; - if (this_present_imageCreateTime || that_present_imageCreateTime) { - if (!(this_present_imageCreateTime && that_present_imageCreateTime)) + boolean this_present_title = true && this.isSetTitle(); + boolean that_present_title = true && that.isSetTitle(); + if (this_present_title || that_present_title) { + if (!(this_present_title && that_present_title)) return false; - if (this.imageCreateTime != that.imageCreateTime) + if (!this.title.equals(that.title)) return false; } - boolean this_present_imageUpdateTime = true; - boolean that_present_imageUpdateTime = true; - if (this_present_imageUpdateTime || that_present_imageUpdateTime) { - if (!(this_present_imageUpdateTime && that_present_imageUpdateTime)) + boolean this_present_createTime = true; + boolean that_present_createTime = true; + if (this_present_createTime || that_present_createTime) { + if (!(this_present_createTime && that_present_createTime)) return false; - if (this.imageUpdateTime != that.imageUpdateTime) + if (this.createTime != that.createTime) return false; } - boolean this_present_imageOwner = true && this.isSetImageOwner(); - boolean that_present_imageOwner = true && that.isSetImageOwner(); - if (this_present_imageOwner || that_present_imageOwner) { - if (!(this_present_imageOwner && that_present_imageOwner)) + boolean this_present_updateTime = true; + boolean that_present_updateTime = true; + if (this_present_updateTime || that_present_updateTime) { + if (!(this_present_updateTime && that_present_updateTime)) return false; - if (!this.imageOwner.equals(that.imageOwner)) + if (this.updateTime != that.updateTime) return false; } - boolean this_present_contentOperatingSystem = true && this.isSetContentOperatingSystem(); - boolean that_present_contentOperatingSystem = true && that.isSetContentOperatingSystem(); - if (this_present_contentOperatingSystem || that_present_contentOperatingSystem) { - if (!(this_present_contentOperatingSystem && that_present_contentOperatingSystem)) + boolean this_present_ownerLogin = true && this.isSetOwnerLogin(); + boolean that_present_ownerLogin = true && that.isSetOwnerLogin(); + if (this_present_ownerLogin || that_present_ownerLogin) { + if (!(this_present_ownerLogin && that_present_ownerLogin)) return false; - if (!this.contentOperatingSystem.equals(that.contentOperatingSystem)) + if (!this.ownerLogin.equals(that.ownerLogin)) return false; } - boolean this_present_statusIsValid = true; - boolean that_present_statusIsValid = true; - if (this_present_statusIsValid || that_present_statusIsValid) { - if (!(this_present_statusIsValid && that_present_statusIsValid)) + boolean this_present_operatingSystem = true && this.isSetOperatingSystem(); + boolean that_present_operatingSystem = true && that.isSetOperatingSystem(); + if (this_present_operatingSystem || that_present_operatingSystem) { + if (!(this_present_operatingSystem && that_present_operatingSystem)) return false; - if (this.statusIsValid != that.statusIsValid) + if (!this.operatingSystem.equals(that.operatingSystem)) return false; } - boolean this_present_statusIsDeleted = true; - boolean that_present_statusIsDeleted = true; - if (this_present_statusIsDeleted || that_present_statusIsDeleted) { - if (!(this_present_statusIsDeleted && that_present_statusIsDeleted)) + boolean this_present_isValid = true; + boolean that_present_isValid = true; + if (this_present_isValid || that_present_isValid) { + if (!(this_present_isValid && that_present_isValid)) return false; - if (this.statusIsDeleted != that.statusIsDeleted) + if (this.isValid != that.isValid) return false; } - boolean this_present_imageShortDescription = true && this.isSetImageShortDescription(); - boolean that_present_imageShortDescription = true && that.isSetImageShortDescription(); - if (this_present_imageShortDescription || that_present_imageShortDescription) { - if (!(this_present_imageShortDescription && that_present_imageShortDescription)) + boolean this_present_isDeleted = true; + boolean that_present_isDeleted = true; + if (this_present_isDeleted || that_present_isDeleted) { + if (!(this_present_isDeleted && that_present_isDeleted)) return false; - if (!this.imageShortDescription.equals(that.imageShortDescription)) + if (this.isDeleted != that.isDeleted) return false; } - boolean this_present_imageLongDescription = true && this.isSetImageLongDescription(); - boolean that_present_imageLongDescription = true && that.isSetImageLongDescription(); - if (this_present_imageLongDescription || that_present_imageLongDescription) { - if (!(this_present_imageLongDescription && that_present_imageLongDescription)) + boolean this_present_description = true && this.isSetDescription(); + boolean that_present_description = true && that.isSetDescription(); + if (this_present_description || that_present_description) { + if (!(this_present_description && that_present_description)) return false; - if (!this.imageLongDescription.equals(that.imageLongDescription)) + if (!this.description.equals(that.description)) return false; } @@ -899,102 +840,92 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImageVersion()).compareTo(other.isSetImageVersion()); + lastComparison = Boolean.valueOf(isSetRevision()).compareTo(other.isSetRevision()); if (lastComparison != 0) { return lastComparison; } - if (isSetImageVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageVersion, other.imageVersion); + if (isSetRevision()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.revision, other.revision); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImageName()).compareTo(other.isSetImageName()); + lastComparison = Boolean.valueOf(isSetTitle()).compareTo(other.isSetTitle()); if (lastComparison != 0) { return lastComparison; } - if (isSetImageName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageName, other.imageName); + if (isSetTitle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, other.title); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImageCreateTime()).compareTo(other.isSetImageCreateTime()); + lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime()); if (lastComparison != 0) { return lastComparison; } - if (isSetImageCreateTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageCreateTime, other.imageCreateTime); + if (isSetCreateTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImageUpdateTime()).compareTo(other.isSetImageUpdateTime()); + lastComparison = Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime()); if (lastComparison != 0) { return lastComparison; } - if (isSetImageUpdateTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageUpdateTime, other.imageUpdateTime); + if (isSetUpdateTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImageOwner()).compareTo(other.isSetImageOwner()); + lastComparison = Boolean.valueOf(isSetOwnerLogin()).compareTo(other.isSetOwnerLogin()); if (lastComparison != 0) { return lastComparison; } - if (isSetImageOwner()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageOwner, other.imageOwner); + if (isSetOwnerLogin()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerLogin, other.ownerLogin); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetContentOperatingSystem()).compareTo(other.isSetContentOperatingSystem()); + lastComparison = Boolean.valueOf(isSetOperatingSystem()).compareTo(other.isSetOperatingSystem()); if (lastComparison != 0) { return lastComparison; } - if (isSetContentOperatingSystem()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.contentOperatingSystem, other.contentOperatingSystem); + if (isSetOperatingSystem()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operatingSystem, other.operatingSystem); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStatusIsValid()).compareTo(other.isSetStatusIsValid()); + lastComparison = Boolean.valueOf(isSetIsValid()).compareTo(other.isSetIsValid()); if (lastComparison != 0) { return lastComparison; } - if (isSetStatusIsValid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusIsValid, other.statusIsValid); + if (isSetIsValid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isValid, other.isValid); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStatusIsDeleted()).compareTo(other.isSetStatusIsDeleted()); + lastComparison = Boolean.valueOf(isSetIsDeleted()).compareTo(other.isSetIsDeleted()); if (lastComparison != 0) { return lastComparison; } - if (isSetStatusIsDeleted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusIsDeleted, other.statusIsDeleted); + if (isSetIsDeleted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDeleted, other.isDeleted); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetImageShortDescription()).compareTo(other.isSetImageShortDescription()); + lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription()); if (lastComparison != 0) { return lastComparison; } - if (isSetImageShortDescription()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageShortDescription, other.imageShortDescription); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetImageLongDescription()).compareTo(other.isSetImageLongDescription()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetImageLongDescription()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageLongDescription, other.imageLongDescription); + if (isSetDescription()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description); if (lastComparison != 0) { return lastComparison; } @@ -1037,63 +968,55 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ } first = false; if (!first) sb.append(", "); - sb.append("imageVersion:"); - sb.append(this.imageVersion); + sb.append("revision:"); + sb.append(this.revision); first = false; if (!first) sb.append(", "); - sb.append("imageName:"); - if (this.imageName == null) { + sb.append("title:"); + if (this.title == null) { sb.append("null"); } else { - sb.append(this.imageName); + sb.append(this.title); } first = false; if (!first) sb.append(", "); - sb.append("imageCreateTime:"); - sb.append(this.imageCreateTime); + sb.append("createTime:"); + sb.append(this.createTime); first = false; if (!first) sb.append(", "); - sb.append("imageUpdateTime:"); - sb.append(this.imageUpdateTime); + sb.append("updateTime:"); + sb.append(this.updateTime); first = false; if (!first) sb.append(", "); - sb.append("imageOwner:"); - if (this.imageOwner == null) { + sb.append("ownerLogin:"); + if (this.ownerLogin == null) { sb.append("null"); } else { - sb.append(this.imageOwner); + sb.append(this.ownerLogin); } first = false; if (!first) sb.append(", "); - sb.append("contentOperatingSystem:"); - if (this.contentOperatingSystem == null) { + sb.append("operatingSystem:"); + if (this.operatingSystem == null) { sb.append("null"); } else { - sb.append(this.contentOperatingSystem); + sb.append(this.operatingSystem); } first = false; if (!first) sb.append(", "); - sb.append("statusIsValid:"); - sb.append(this.statusIsValid); - first = false; - if (!first) sb.append(", "); - sb.append("statusIsDeleted:"); - sb.append(this.statusIsDeleted); + sb.append("isValid:"); + sb.append(this.isValid); first = false; if (!first) sb.append(", "); - sb.append("imageShortDescription:"); - if (this.imageShortDescription == null) { - sb.append("null"); - } else { - sb.append(this.imageShortDescription); - } + sb.append("isDeleted:"); + sb.append(this.isDeleted); first = false; if (!first) sb.append(", "); - sb.append("imageLongDescription:"); - if (this.imageLongDescription == null) { + sb.append("description:"); + if (this.description == null) { sb.append("null"); } else { - sb.append(this.imageLongDescription); + sb.append(this.description); } first = false; if (!first) sb.append(", "); @@ -1153,82 +1076,74 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // IMAGE_VERSION + case 2: // REVISION if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.imageVersion = iprot.readI32(); - struct.setImageVersionIsSet(true); + struct.revision = iprot.readI32(); + struct.setRevisionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // IMAGE_NAME + case 3: // TITLE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageName = iprot.readString(); - struct.setImageNameIsSet(true); + struct.title = iprot.readString(); + struct.setTitleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // IMAGE_CREATE_TIME + case 4: // CREATE_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.imageCreateTime = iprot.readI64(); - struct.setImageCreateTimeIsSet(true); + struct.createTime = iprot.readI64(); + struct.setCreateTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 5: // IMAGE_UPDATE_TIME + case 5: // UPDATE_TIME if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.imageUpdateTime = iprot.readI64(); - struct.setImageUpdateTimeIsSet(true); + struct.updateTime = iprot.readI64(); + struct.setUpdateTimeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 6: // IMAGE_OWNER + case 6: // OWNER_LOGIN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageOwner = iprot.readString(); - struct.setImageOwnerIsSet(true); + struct.ownerLogin = iprot.readString(); + struct.setOwnerLoginIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 7: // CONTENT_OPERATING_SYSTEM + case 7: // OPERATING_SYSTEM if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.contentOperatingSystem = iprot.readString(); - struct.setContentOperatingSystemIsSet(true); + struct.operatingSystem = iprot.readString(); + struct.setOperatingSystemIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 8: // STATUS_IS_VALID + case 8: // IS_VALID if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.statusIsValid = iprot.readBool(); - struct.setStatusIsValidIsSet(true); + struct.isValid = iprot.readBool(); + struct.setIsValidIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 9: // STATUS_IS_DELETED + case 9: // IS_DELETED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.statusIsDeleted = iprot.readBool(); - struct.setStatusIsDeletedIsSet(true); + struct.isDeleted = iprot.readBool(); + struct.setIsDeletedIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 10: // IMAGE_SHORT_DESCRIPTION + case 11: // DESCRIPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageShortDescription = iprot.readString(); - struct.setImageShortDescriptionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // IMAGE_LONG_DESCRIPTION - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.imageLongDescription = iprot.readString(); - struct.setImageLongDescriptionIsSet(true); + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -1261,44 +1176,39 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ oprot.writeString(struct.uuid); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(IMAGE_VERSION_FIELD_DESC); - oprot.writeI32(struct.imageVersion); + oprot.writeFieldBegin(REVISION_FIELD_DESC); + oprot.writeI32(struct.revision); oprot.writeFieldEnd(); - if (struct.imageName != null) { - oprot.writeFieldBegin(IMAGE_NAME_FIELD_DESC); - oprot.writeString(struct.imageName); + if (struct.title != null) { + oprot.writeFieldBegin(TITLE_FIELD_DESC); + oprot.writeString(struct.title); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(IMAGE_CREATE_TIME_FIELD_DESC); - oprot.writeI64(struct.imageCreateTime); + oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC); + oprot.writeI64(struct.createTime); oprot.writeFieldEnd(); - oprot.writeFieldBegin(IMAGE_UPDATE_TIME_FIELD_DESC); - oprot.writeI64(struct.imageUpdateTime); + oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC); + oprot.writeI64(struct.updateTime); oprot.writeFieldEnd(); - if (struct.imageOwner != null) { - oprot.writeFieldBegin(IMAGE_OWNER_FIELD_DESC); - oprot.writeString(struct.imageOwner); + if (struct.ownerLogin != null) { + oprot.writeFieldBegin(OWNER_LOGIN_FIELD_DESC); + oprot.writeString(struct.ownerLogin); oprot.writeFieldEnd(); } - if (struct.contentOperatingSystem != null) { - oprot.writeFieldBegin(CONTENT_OPERATING_SYSTEM_FIELD_DESC); - oprot.writeString(struct.contentOperatingSystem); + if (struct.operatingSystem != null) { + oprot.writeFieldBegin(OPERATING_SYSTEM_FIELD_DESC); + oprot.writeString(struct.operatingSystem); oprot.writeFieldEnd(); } - oprot.writeFieldBegin(STATUS_IS_VALID_FIELD_DESC); - oprot.writeBool(struct.statusIsValid); + oprot.writeFieldBegin(IS_VALID_FIELD_DESC); + oprot.writeBool(struct.isValid); oprot.writeFieldEnd(); - oprot.writeFieldBegin(STATUS_IS_DELETED_FIELD_DESC); - oprot.writeBool(struct.statusIsDeleted); + oprot.writeFieldBegin(IS_DELETED_FIELD_DESC); + oprot.writeBool(struct.isDeleted); oprot.writeFieldEnd(); - if (struct.imageShortDescription != null) { - oprot.writeFieldBegin(IMAGE_SHORT_DESCRIPTION_FIELD_DESC); - oprot.writeString(struct.imageShortDescription); - oprot.writeFieldEnd(); - } - if (struct.imageLongDescription != null) { - oprot.writeFieldBegin(IMAGE_LONG_DESCRIPTION_FIELD_DESC); - oprot.writeString(struct.imageLongDescription); + if (struct.description != null) { + oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.description); oprot.writeFieldEnd(); } oprot.writeFieldBegin(FILE_SIZE_FIELD_DESC); @@ -1325,72 +1235,66 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ if (struct.isSetUuid()) { optionals.set(0); } - if (struct.isSetImageVersion()) { + if (struct.isSetRevision()) { optionals.set(1); } - if (struct.isSetImageName()) { + if (struct.isSetTitle()) { optionals.set(2); } - if (struct.isSetImageCreateTime()) { + if (struct.isSetCreateTime()) { optionals.set(3); } - if (struct.isSetImageUpdateTime()) { + if (struct.isSetUpdateTime()) { optionals.set(4); } - if (struct.isSetImageOwner()) { + if (struct.isSetOwnerLogin()) { optionals.set(5); } - if (struct.isSetContentOperatingSystem()) { + if (struct.isSetOperatingSystem()) { optionals.set(6); } - if (struct.isSetStatusIsValid()) { + if (struct.isSetIsValid()) { optionals.set(7); } - if (struct.isSetStatusIsDeleted()) { + if (struct.isSetIsDeleted()) { optionals.set(8); } - if (struct.isSetImageShortDescription()) { + if (struct.isSetDescription()) { optionals.set(9); } - if (struct.isSetImageLongDescription()) { - optionals.set(10); - } if (struct.isSetFileSize()) { - optionals.set(11); + optionals.set(10); } - oprot.writeBitSet(optionals, 12); + oprot.writeBitSet(optionals, 11); if (struct.isSetUuid()) { oprot.writeString(struct.uuid); } - if (struct.isSetImageVersion()) { - oprot.writeI32(struct.imageVersion); - } - if (struct.isSetImageName()) { - oprot.writeString(struct.imageName); + if (struct.isSetRevision()) { + oprot.writeI32(struct.revision); } - if (struct.isSetImageCreateTime()) { - oprot.writeI64(struct.imageCreateTime); + if (struct.isSetTitle()) { + oprot.writeString(struct.title); } - if (struct.isSetImageUpdateTime()) { - oprot.writeI64(struct.imageUpdateTime); + if (struct.isSetCreateTime()) { + oprot.writeI64(struct.createTime); } - if (struct.isSetImageOwner()) { - oprot.writeString(struct.imageOwner); + if (struct.isSetUpdateTime()) { + oprot.writeI64(struct.updateTime); } - if (struct.isSetContentOperatingSystem()) { - oprot.writeString(struct.contentOperatingSystem); + if (struct.isSetOwnerLogin()) { + oprot.writeString(struct.ownerLogin); } - if (struct.isSetStatusIsValid()) { - oprot.writeBool(struct.statusIsValid); + if (struct.isSetOperatingSystem()) { + oprot.writeString(struct.operatingSystem); } - if (struct.isSetStatusIsDeleted()) { - oprot.writeBool(struct.statusIsDeleted); + if (struct.isSetIsValid()) { + oprot.writeBool(struct.isValid); } - if (struct.isSetImageShortDescription()) { - oprot.writeString(struct.imageShortDescription); + if (struct.isSetIsDeleted()) { + oprot.writeBool(struct.isDeleted); } - if (struct.isSetImageLongDescription()) { - oprot.writeString(struct.imageLongDescription); + if (struct.isSetDescription()) { + oprot.writeString(struct.description); } if (struct.isSetFileSize()) { oprot.writeI64(struct.fileSize); @@ -1400,52 +1304,48 @@ public class ImageData implements org.apache.thrift.TBase<ImageData, ImageData._ @Override public void read(org.apache.thrift.protocol.TProtocol prot, ImageData struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(12); + BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { struct.uuid = iprot.readString(); struct.setUuidIsSet(true); } if (incoming.get(1)) { - struct.imageVersion = iprot.readI32(); - struct.setImageVersionIsSet(true); + struct.revision = iprot.readI32(); + struct.setRevisionIsSet(true); } if (incoming.get(2)) { - struct.imageName = iprot.readString(); - struct.setImageNameIsSet(true); + struct.title = iprot.readString(); + struct.setTitleIsSet(true); } if (incoming.get(3)) { - struct.imageCreateTime = iprot.readI64(); - struct.setImageCreateTimeIsSet(true); + struct.createTime = iprot.readI64(); + struct.setCreateTimeIsSet(true); } if (incoming.get(4)) { - struct.imageUpdateTime = iprot.readI64(); - struct.setImageUpdateTimeIsSet(true); + struct.updateTime = iprot.readI64(); + struct.setUpdateTimeIsSet(true); } if (incoming.get(5)) { - struct.imageOwner = iprot.readString(); - struct.setImageOwnerIsSet(true); + struct.ownerLogin = iprot.readString(); + struct.setOwnerLoginIsSet(true); } if (incoming.get(6)) { - struct.contentOperatingSystem = iprot.readString(); - struct.setContentOperatingSystemIsSet(true); + struct.operatingSystem = iprot.readString(); + struct.setOperatingSystemIsSet(true); } if (incoming.get(7)) { - struct.statusIsValid = iprot.readBool(); - struct.setStatusIsValidIsSet(true); + struct.isValid = iprot.readBool(); + struct.setIsValidIsSet(true); } if (incoming.get(8)) { - struct.statusIsDeleted = iprot.readBool(); - struct.setStatusIsDeletedIsSet(true); + struct.isDeleted = iprot.readBool(); + struct.setIsDeletedIsSet(true); } if (incoming.get(9)) { - struct.imageShortDescription = iprot.readString(); - struct.setImageShortDescriptionIsSet(true); + struct.description = iprot.readString(); + struct.setDescriptionIsSet(true); } if (incoming.get(10)) { - struct.imageLongDescription = iprot.readString(); - struct.setImageLongDescriptionIsSet(true); - } - if (incoming.get(11)) { struct.fileSize = iprot.readI64(); struct.setFileSizeIsSet(true); } diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java index cd7f02b..aeb6894 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java +++ b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java @@ -38,40 +38,56 @@ public class ImageServer { public boolean ping() throws org.apache.thrift.TException; - public SessionData authenticate(String username, String password) throws AuthenticationException, org.apache.thrift.TException; + public SessionData authenticate(String login, String password) throws AuthenticationException, org.apache.thrift.TException; - public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException; + public List<OrganizationData> getOrganizations() throws org.apache.thrift.TException; + + public List<UserInfo> findUser(String sessionId, String organizationId, String searchTerm) throws AuthorizationException, org.apache.thrift.TException; - public ByteBuffer startServerAuthentication(String organization) throws ServerAuthenticationException, org.apache.thrift.TException; + public List<ImageData> getPublicImages(String sessionId, int page) throws AuthorizationException, org.apache.thrift.TException; + + public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException; public boolean isServerAuthenticated(String serverSessionId) throws org.apache.thrift.TException; - public ServerSessionData serverAuthenticate(String organization, ByteBuffer challengeResponse) throws ServerAuthenticationException, org.apache.thrift.TException; + public ByteBuffer startServerAuthentication(String organization) throws AuthenticationException, org.apache.thrift.TException; + + public ServerSessionData serverAuthenticate(String organizationId, ByteBuffer challengeResponse) throws AuthenticationException, org.apache.thrift.TException; public UploadData submitImage(String serverSessionId, ImageData imageDescription, List<Integer> crcSums) throws AuthorizationException, ImageDataException, UploadException, org.apache.thrift.TException; public DownloadData getImage(String serverSessionId, String uuid) throws AuthorizationException, ImageDataException, org.apache.thrift.TException; + public boolean publishUser(String serverSessionId, UserInfo user) throws AuthorizationException, org.apache.thrift.TException; + } public interface AsyncIface { public void ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void authenticate(String username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void authenticate(String login, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getOrganizations(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void startServerAuthentication(String organization, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void findUser(String sessionId, String organizationId, String searchTerm, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getPublicImages(String sessionId, int page, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void isServerAuthenticated(String serverSessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void serverAuthenticate(String organization, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void startServerAuthentication(String organization, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void serverAuthenticate(String organizationId, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void submitImage(String serverSessionId, ImageData imageDescription, List<Integer> crcSums, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getImage(String serverSessionId, String uuid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void publishUser(String serverSessionId, UserInfo user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -116,16 +132,16 @@ public class ImageServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ping failed: unknown result"); } - public SessionData authenticate(String username, String password) throws AuthenticationException, org.apache.thrift.TException + public SessionData authenticate(String login, String password) throws AuthenticationException, org.apache.thrift.TException { - send_authenticate(username, password); + send_authenticate(login, password); return recv_authenticate(); } - public void send_authenticate(String username, String password) throws org.apache.thrift.TException + public void send_authenticate(String login, String password) throws org.apache.thrift.TException { authenticate_args args = new authenticate_args(); - args.setUsername(username); + args.setLogin(login); args.setPassword(password); sendBase("authenticate", args); } @@ -143,56 +159,107 @@ public class ImageServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "authenticate failed: unknown result"); } - public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException + public List<OrganizationData> getOrganizations() throws org.apache.thrift.TException { - send_getUserFromToken(token); - return recv_getUserFromToken(); + send_getOrganizations(); + return recv_getOrganizations(); } - public void send_getUserFromToken(String token) throws org.apache.thrift.TException + public void send_getOrganizations() throws org.apache.thrift.TException { - getUserFromToken_args args = new getUserFromToken_args(); - args.setToken(token); - sendBase("getUserFromToken", args); + getOrganizations_args args = new getOrganizations_args(); + sendBase("getOrganizations", args); } - public UserInfo recv_getUserFromToken() throws InvalidTokenException, org.apache.thrift.TException + public List<OrganizationData> recv_getOrganizations() throws org.apache.thrift.TException { - getUserFromToken_result result = new getUserFromToken_result(); - receiveBase(result, "getUserFromToken"); + getOrganizations_result result = new getOrganizations_result(); + receiveBase(result, "getOrganizations"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOrganizations failed: unknown result"); + } + + public List<UserInfo> findUser(String sessionId, String organizationId, String searchTerm) throws AuthorizationException, org.apache.thrift.TException + { + send_findUser(sessionId, organizationId, searchTerm); + return recv_findUser(); + } + + public void send_findUser(String sessionId, String organizationId, String searchTerm) throws org.apache.thrift.TException + { + findUser_args args = new findUser_args(); + args.setSessionId(sessionId); + args.setOrganizationId(organizationId); + args.setSearchTerm(searchTerm); + sendBase("findUser", args); + } + + public List<UserInfo> recv_findUser() throws AuthorizationException, org.apache.thrift.TException + { + findUser_result result = new findUser_result(); + receiveBase(result, "findUser"); if (result.isSetSuccess()) { return result.success; } if (result.failure != null) { throw result.failure; } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserFromToken failed: unknown result"); + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "findUser failed: unknown result"); } - public ByteBuffer startServerAuthentication(String organization) throws ServerAuthenticationException, org.apache.thrift.TException + public List<ImageData> getPublicImages(String sessionId, int page) throws AuthorizationException, org.apache.thrift.TException { - send_startServerAuthentication(organization); - return recv_startServerAuthentication(); + send_getPublicImages(sessionId, page); + return recv_getPublicImages(); } - public void send_startServerAuthentication(String organization) throws org.apache.thrift.TException + public void send_getPublicImages(String sessionId, int page) throws org.apache.thrift.TException { - startServerAuthentication_args args = new startServerAuthentication_args(); - args.setOrganization(organization); - sendBase("startServerAuthentication", args); + getPublicImages_args args = new getPublicImages_args(); + args.setSessionId(sessionId); + args.setPage(page); + sendBase("getPublicImages", args); } - public ByteBuffer recv_startServerAuthentication() throws ServerAuthenticationException, org.apache.thrift.TException + public List<ImageData> recv_getPublicImages() throws AuthorizationException, org.apache.thrift.TException { - startServerAuthentication_result result = new startServerAuthentication_result(); - receiveBase(result, "startServerAuthentication"); + getPublicImages_result result = new getPublicImages_result(); + receiveBase(result, "getPublicImages"); if (result.isSetSuccess()) { return result.success; } if (result.failure != null) { throw result.failure; } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startServerAuthentication failed: unknown result"); + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPublicImages failed: unknown result"); + } + + public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException + { + send_getUserFromToken(token); + return recv_getUserFromToken(); + } + + public void send_getUserFromToken(String token) throws org.apache.thrift.TException + { + getUserFromToken_args args = new getUserFromToken_args(); + args.setToken(token); + sendBase("getUserFromToken", args); + } + + public UserInfo recv_getUserFromToken() throws InvalidTokenException, org.apache.thrift.TException + { + getUserFromToken_result result = new getUserFromToken_result(); + receiveBase(result, "getUserFromToken"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.failure != null) { + throw result.failure; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserFromToken failed: unknown result"); } public boolean isServerAuthenticated(String serverSessionId) throws org.apache.thrift.TException @@ -218,21 +285,47 @@ public class ImageServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isServerAuthenticated failed: unknown result"); } - public ServerSessionData serverAuthenticate(String organization, ByteBuffer challengeResponse) throws ServerAuthenticationException, org.apache.thrift.TException + public ByteBuffer startServerAuthentication(String organization) throws AuthenticationException, org.apache.thrift.TException + { + send_startServerAuthentication(organization); + return recv_startServerAuthentication(); + } + + public void send_startServerAuthentication(String organization) throws org.apache.thrift.TException + { + startServerAuthentication_args args = new startServerAuthentication_args(); + args.setOrganization(organization); + sendBase("startServerAuthentication", args); + } + + public ByteBuffer recv_startServerAuthentication() throws AuthenticationException, org.apache.thrift.TException + { + startServerAuthentication_result result = new startServerAuthentication_result(); + receiveBase(result, "startServerAuthentication"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.failure != null) { + throw result.failure; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startServerAuthentication failed: unknown result"); + } + + public ServerSessionData serverAuthenticate(String organizationId, ByteBuffer challengeResponse) throws AuthenticationException, org.apache.thrift.TException { - send_serverAuthenticate(organization, challengeResponse); + send_serverAuthenticate(organizationId, challengeResponse); return recv_serverAuthenticate(); } - public void send_serverAuthenticate(String organization, ByteBuffer challengeResponse) throws org.apache.thrift.TException + public void send_serverAuthenticate(String organizationId, ByteBuffer challengeResponse) throws org.apache.thrift.TException { serverAuthenticate_args args = new serverAuthenticate_args(); - args.setOrganization(organization); + args.setOrganizationId(organizationId); args.setChallengeResponse(challengeResponse); sendBase("serverAuthenticate", args); } - public ServerSessionData recv_serverAuthenticate() throws ServerAuthenticationException, org.apache.thrift.TException + public ServerSessionData recv_serverAuthenticate() throws AuthenticationException, org.apache.thrift.TException { serverAuthenticate_result result = new serverAuthenticate_result(); receiveBase(result, "serverAuthenticate"); @@ -309,6 +402,33 @@ public class ImageServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImage failed: unknown result"); } + public boolean publishUser(String serverSessionId, UserInfo user) throws AuthorizationException, org.apache.thrift.TException + { + send_publishUser(serverSessionId, user); + return recv_publishUser(); + } + + public void send_publishUser(String serverSessionId, UserInfo user) throws org.apache.thrift.TException + { + publishUser_args args = new publishUser_args(); + args.setServerSessionId(serverSessionId); + args.setUser(user); + sendBase("publishUser", args); + } + + public boolean recv_publishUser() throws AuthorizationException, org.apache.thrift.TException + { + publishUser_result result = new publishUser_result(); + receiveBase(result, "publishUser"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.failure != null) { + throw result.failure; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "publishUser 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> { @@ -356,26 +476,26 @@ public class ImageServer { } } - public void authenticate(String username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void authenticate(String login, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - authenticate_call method_call = new authenticate_call(username, password, resultHandler, this, ___protocolFactory, ___transport); + authenticate_call method_call = new authenticate_call(login, password, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class authenticate_call extends org.apache.thrift.async.TAsyncMethodCall { - private String username; + private String login; private String password; - public authenticate_call(String username, String password, 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 { + public authenticate_call(String login, String password, 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.username = username; + this.login = login; this.password = password; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("authenticate", org.apache.thrift.protocol.TMessageType.CALL, 0)); authenticate_args args = new authenticate_args(); - args.setUsername(username); + args.setLogin(login); args.setPassword(password); args.write(prot); prot.writeMessageEnd(); @@ -391,67 +511,137 @@ public class ImageServer { } } - public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void getOrganizations(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - getUserFromToken_call method_call = new getUserFromToken_call(token, resultHandler, this, ___protocolFactory, ___transport); + getOrganizations_call method_call = new getOrganizations_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class getUserFromToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private String token; - public getUserFromToken_call(String token, 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 { + public static class getOrganizations_call extends org.apache.thrift.async.TAsyncMethodCall { + public getOrganizations_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); - this.token = token; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserFromToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getUserFromToken_args args = new getUserFromToken_args(); - args.setToken(token); + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getOrganizations", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getOrganizations_args args = new getOrganizations_args(); args.write(prot); prot.writeMessageEnd(); } - public UserInfo getResult() throws InvalidTokenException, org.apache.thrift.TException { + public List<OrganizationData> 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_getUserFromToken(); + return (new Client(prot)).recv_getOrganizations(); } } - public void startServerAuthentication(String organization, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void findUser(String sessionId, String organizationId, String searchTerm, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - startServerAuthentication_call method_call = new startServerAuthentication_call(organization, resultHandler, this, ___protocolFactory, ___transport); + findUser_call method_call = new findUser_call(sessionId, organizationId, searchTerm, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class startServerAuthentication_call extends org.apache.thrift.async.TAsyncMethodCall { - private String organization; - public startServerAuthentication_call(String organization, 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 { + public static class findUser_call extends org.apache.thrift.async.TAsyncMethodCall { + private String sessionId; + private String organizationId; + private String searchTerm; + public findUser_call(String sessionId, String organizationId, String searchTerm, 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.organization = organization; + this.sessionId = sessionId; + this.organizationId = organizationId; + this.searchTerm = searchTerm; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startServerAuthentication", org.apache.thrift.protocol.TMessageType.CALL, 0)); - startServerAuthentication_args args = new startServerAuthentication_args(); - args.setOrganization(organization); + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("findUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + findUser_args args = new findUser_args(); + args.setSessionId(sessionId); + args.setOrganizationId(organizationId); + args.setSearchTerm(searchTerm); args.write(prot); prot.writeMessageEnd(); } - public ByteBuffer getResult() throws ServerAuthenticationException, org.apache.thrift.TException { + public List<UserInfo> getResult() throws AuthorizationException, 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_startServerAuthentication(); + return (new Client(prot)).recv_findUser(); + } + } + + public void getPublicImages(String sessionId, int page, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getPublicImages_call method_call = new getPublicImages_call(sessionId, page, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getPublicImages_call extends org.apache.thrift.async.TAsyncMethodCall { + private String sessionId; + private int page; + public getPublicImages_call(String sessionId, int page, 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.sessionId = sessionId; + this.page = page; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPublicImages", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getPublicImages_args args = new getPublicImages_args(); + args.setSessionId(sessionId); + args.setPage(page); + args.write(prot); + prot.writeMessageEnd(); + } + + public List<ImageData> getResult() throws AuthorizationException, 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_getPublicImages(); + } + } + + public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getUserFromToken_call method_call = new getUserFromToken_call(token, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getUserFromToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private String token; + public getUserFromToken_call(String token, 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.token = token; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserFromToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getUserFromToken_args args = new getUserFromToken_args(); + args.setToken(token); + args.write(prot); + prot.writeMessageEnd(); + } + + public UserInfo getResult() throws InvalidTokenException, 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_getUserFromToken(); } } @@ -487,32 +677,64 @@ public class ImageServer { } } - public void serverAuthenticate(String organization, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void startServerAuthentication(String organization, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - serverAuthenticate_call method_call = new serverAuthenticate_call(organization, challengeResponse, resultHandler, this, ___protocolFactory, ___transport); + startServerAuthentication_call method_call = new startServerAuthentication_call(organization, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class serverAuthenticate_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class startServerAuthentication_call extends org.apache.thrift.async.TAsyncMethodCall { private String organization; - private ByteBuffer challengeResponse; - public serverAuthenticate_call(String organization, ByteBuffer challengeResponse, 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 { + public startServerAuthentication_call(String organization, 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.organization = organization; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startServerAuthentication", org.apache.thrift.protocol.TMessageType.CALL, 0)); + startServerAuthentication_args args = new startServerAuthentication_args(); + args.setOrganization(organization); + args.write(prot); + prot.writeMessageEnd(); + } + + public ByteBuffer getResult() throws AuthenticationException, 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_startServerAuthentication(); + } + } + + public void serverAuthenticate(String organizationId, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + serverAuthenticate_call method_call = new serverAuthenticate_call(organizationId, challengeResponse, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class serverAuthenticate_call extends org.apache.thrift.async.TAsyncMethodCall { + private String organizationId; + private ByteBuffer challengeResponse; + public serverAuthenticate_call(String organizationId, ByteBuffer challengeResponse, 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.organizationId = organizationId; this.challengeResponse = challengeResponse; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("serverAuthenticate", org.apache.thrift.protocol.TMessageType.CALL, 0)); serverAuthenticate_args args = new serverAuthenticate_args(); - args.setOrganization(organization); + args.setOrganizationId(organizationId); args.setChallengeResponse(challengeResponse); args.write(prot); prot.writeMessageEnd(); } - public ServerSessionData getResult() throws ServerAuthenticationException, org.apache.thrift.TException { + public ServerSessionData getResult() throws AuthenticationException, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } @@ -595,6 +817,41 @@ public class ImageServer { } } + public void publishUser(String serverSessionId, UserInfo user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + publishUser_call method_call = new publishUser_call(serverSessionId, user, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class publishUser_call extends org.apache.thrift.async.TAsyncMethodCall { + private String serverSessionId; + private UserInfo user; + public publishUser_call(String serverSessionId, UserInfo user, 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.serverSessionId = serverSessionId; + this.user = user; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("publishUser", org.apache.thrift.protocol.TMessageType.CALL, 0)); + publishUser_args args = new publishUser_args(); + args.setServerSessionId(serverSessionId); + args.setUser(user); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws AuthorizationException, 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_publishUser(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -610,12 +867,16 @@ public class ImageServer { 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("ping", new ping()); processMap.put("authenticate", new authenticate()); + processMap.put("getOrganizations", new getOrganizations()); + processMap.put("findUser", new findUser()); + processMap.put("getPublicImages", new getPublicImages()); processMap.put("getUserFromToken", new getUserFromToken()); - processMap.put("startServerAuthentication", new startServerAuthentication()); processMap.put("isServerAuthenticated", new isServerAuthenticated()); + processMap.put("startServerAuthentication", new startServerAuthentication()); processMap.put("serverAuthenticate", new serverAuthenticate()); processMap.put("submitImage", new submitImage()); processMap.put("getImage", new getImage()); + processMap.put("publishUser", new publishUser()); return processMap; } @@ -656,7 +917,7 @@ public class ImageServer { public authenticate_result getResult(I iface, authenticate_args args) throws org.apache.thrift.TException { authenticate_result result = new authenticate_result(); try { - result.success = iface.authenticate(args.username, args.password); + result.success = iface.authenticate(args.login, args.password); } catch (AuthenticationException failure) { result.failure = failure; } @@ -664,48 +925,92 @@ public class ImageServer { } } - public static class getUserFromToken<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUserFromToken_args> { - public getUserFromToken() { - super("getUserFromToken"); + public static class getOrganizations<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getOrganizations_args> { + public getOrganizations() { + super("getOrganizations"); } - public getUserFromToken_args getEmptyArgsInstance() { - return new getUserFromToken_args(); + public getOrganizations_args getEmptyArgsInstance() { + return new getOrganizations_args(); } protected boolean isOneway() { return false; } - public getUserFromToken_result getResult(I iface, getUserFromToken_args args) throws org.apache.thrift.TException { - getUserFromToken_result result = new getUserFromToken_result(); + public getOrganizations_result getResult(I iface, getOrganizations_args args) throws org.apache.thrift.TException { + getOrganizations_result result = new getOrganizations_result(); + result.success = iface.getOrganizations(); + return result; + } + } + + public static class findUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, findUser_args> { + public findUser() { + super("findUser"); + } + + public findUser_args getEmptyArgsInstance() { + return new findUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public findUser_result getResult(I iface, findUser_args args) throws org.apache.thrift.TException { + findUser_result result = new findUser_result(); try { - result.success = iface.getUserFromToken(args.token); - } catch (InvalidTokenException failure) { + result.success = iface.findUser(args.sessionId, args.organizationId, args.searchTerm); + } catch (AuthorizationException failure) { result.failure = failure; } return result; } } - public static class startServerAuthentication<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startServerAuthentication_args> { - public startServerAuthentication() { - super("startServerAuthentication"); + public static class getPublicImages<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPublicImages_args> { + public getPublicImages() { + super("getPublicImages"); } - public startServerAuthentication_args getEmptyArgsInstance() { - return new startServerAuthentication_args(); + public getPublicImages_args getEmptyArgsInstance() { + return new getPublicImages_args(); } protected boolean isOneway() { return false; } - public startServerAuthentication_result getResult(I iface, startServerAuthentication_args args) throws org.apache.thrift.TException { - startServerAuthentication_result result = new startServerAuthentication_result(); + public getPublicImages_result getResult(I iface, getPublicImages_args args) throws org.apache.thrift.TException { + getPublicImages_result result = new getPublicImages_result(); try { - result.success = iface.startServerAuthentication(args.organization); - } catch (ServerAuthenticationException failure) { + result.success = iface.getPublicImages(args.sessionId, args.page); + } catch (AuthorizationException failure) { + result.failure = failure; + } + return result; + } + } + + public static class getUserFromToken<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUserFromToken_args> { + public getUserFromToken() { + super("getUserFromToken"); + } + + public getUserFromToken_args getEmptyArgsInstance() { + return new getUserFromToken_args(); + } + + protected boolean isOneway() { + return false; + } + + public getUserFromToken_result getResult(I iface, getUserFromToken_args args) throws org.apache.thrift.TException { + getUserFromToken_result result = new getUserFromToken_result(); + try { + result.success = iface.getUserFromToken(args.token); + } catch (InvalidTokenException failure) { result.failure = failure; } return result; @@ -733,6 +1038,30 @@ public class ImageServer { } } + public static class startServerAuthentication<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startServerAuthentication_args> { + public startServerAuthentication() { + super("startServerAuthentication"); + } + + public startServerAuthentication_args getEmptyArgsInstance() { + return new startServerAuthentication_args(); + } + + protected boolean isOneway() { + return false; + } + + public startServerAuthentication_result getResult(I iface, startServerAuthentication_args args) throws org.apache.thrift.TException { + startServerAuthentication_result result = new startServerAuthentication_result(); + try { + result.success = iface.startServerAuthentication(args.organization); + } catch (AuthenticationException failure) { + result.failure = failure; + } + return result; + } + } + public static class serverAuthenticate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, serverAuthenticate_args> { public serverAuthenticate() { super("serverAuthenticate"); @@ -749,8 +1078,8 @@ public class ImageServer { public serverAuthenticate_result getResult(I iface, serverAuthenticate_args args) throws org.apache.thrift.TException { serverAuthenticate_result result = new serverAuthenticate_result(); try { - result.success = iface.serverAuthenticate(args.organization, args.challengeResponse); - } catch (ServerAuthenticationException failure) { + result.success = iface.serverAuthenticate(args.organizationId, args.challengeResponse); + } catch (AuthenticationException failure) { result.failure = failure; } return result; @@ -811,6 +1140,31 @@ public class ImageServer { } } + public static class publishUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, publishUser_args> { + public publishUser() { + super("publishUser"); + } + + public publishUser_args getEmptyArgsInstance() { + return new publishUser_args(); + } + + protected boolean isOneway() { + return false; + } + + public publishUser_result getResult(I iface, publishUser_args args) throws org.apache.thrift.TException { + publishUser_result result = new publishUser_result(); + try { + result.success = iface.publishUser(args.serverSessionId, args.user); + result.setSuccessIsSet(true); + } catch (AuthorizationException failure) { + result.failure = failure; + } + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -826,12 +1180,16 @@ public class ImageServer { 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("ping", new ping()); processMap.put("authenticate", new authenticate()); + processMap.put("getOrganizations", new getOrganizations()); + processMap.put("findUser", new findUser()); + processMap.put("getPublicImages", new getPublicImages()); processMap.put("getUserFromToken", new getUserFromToken()); - processMap.put("startServerAuthentication", new startServerAuthentication()); processMap.put("isServerAuthenticated", new isServerAuthenticated()); + processMap.put("startServerAuthentication", new startServerAuthentication()); processMap.put("serverAuthenticate", new serverAuthenticate()); processMap.put("submitImage", new submitImage()); processMap.put("getImage", new getImage()); + processMap.put("publishUser", new publishUser()); return processMap; } @@ -940,24 +1298,24 @@ public class ImageServer { } public void start(I iface, authenticate_args args, org.apache.thrift.async.AsyncMethodCallback<SessionData> resultHandler) throws TException { - iface.authenticate(args.username, args.password,resultHandler); + iface.authenticate(args.login, args.password,resultHandler); } } - public static class getUserFromToken<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUserFromToken_args, UserInfo> { - public getUserFromToken() { - super("getUserFromToken"); + public static class getOrganizations<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getOrganizations_args, List<OrganizationData>> { + public getOrganizations() { + super("getOrganizations"); } - public getUserFromToken_args getEmptyArgsInstance() { - return new getUserFromToken_args(); + public getOrganizations_args getEmptyArgsInstance() { + return new getOrganizations_args(); } - public AsyncMethodCallback<UserInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback<List<OrganizationData>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback<UserInfo>() { - public void onComplete(UserInfo o) { - getUserFromToken_result result = new getUserFromToken_result(); + return new AsyncMethodCallback<List<OrganizationData>>() { + public void onComplete(List<OrganizationData> o) { + getOrganizations_result result = new getOrganizations_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); @@ -970,9 +1328,60 @@ public class ImageServer { public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; - getUserFromToken_result result = new getUserFromToken_result(); - if (e instanceof InvalidTokenException) { - result.failure = (InvalidTokenException) e; + getOrganizations_result result = new getOrganizations_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, getOrganizations_args args, org.apache.thrift.async.AsyncMethodCallback<List<OrganizationData>> resultHandler) throws TException { + iface.getOrganizations(resultHandler); + } + } + + public static class findUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, findUser_args, List<UserInfo>> { + public findUser() { + super("findUser"); + } + + public findUser_args getEmptyArgsInstance() { + return new findUser_args(); + } + + public AsyncMethodCallback<List<UserInfo>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<List<UserInfo>>() { + public void onComplete(List<UserInfo> o) { + findUser_result result = new findUser_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; + findUser_result result = new findUser_result(); + if (e instanceof AuthorizationException) { + result.failure = (AuthorizationException) e; result.setFailureIsSet(true); msg = result; } @@ -996,25 +1405,25 @@ public class ImageServer { return false; } - public void start(I iface, getUserFromToken_args args, org.apache.thrift.async.AsyncMethodCallback<UserInfo> resultHandler) throws TException { - iface.getUserFromToken(args.token,resultHandler); + public void start(I iface, findUser_args args, org.apache.thrift.async.AsyncMethodCallback<List<UserInfo>> resultHandler) throws TException { + iface.findUser(args.sessionId, args.organizationId, args.searchTerm,resultHandler); } } - public static class startServerAuthentication<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startServerAuthentication_args, ByteBuffer> { - public startServerAuthentication() { - super("startServerAuthentication"); + public static class getPublicImages<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getPublicImages_args, List<ImageData>> { + public getPublicImages() { + super("getPublicImages"); } - public startServerAuthentication_args getEmptyArgsInstance() { - return new startServerAuthentication_args(); + public getPublicImages_args getEmptyArgsInstance() { + return new getPublicImages_args(); } - public AsyncMethodCallback<ByteBuffer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback<List<ImageData>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback<ByteBuffer>() { - public void onComplete(ByteBuffer o) { - startServerAuthentication_result result = new startServerAuthentication_result(); + return new AsyncMethodCallback<List<ImageData>>() { + public void onComplete(List<ImageData> o) { + getPublicImages_result result = new getPublicImages_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); @@ -1027,9 +1436,9 @@ public class ImageServer { public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; - startServerAuthentication_result result = new startServerAuthentication_result(); - if (e instanceof ServerAuthenticationException) { - result.failure = (ServerAuthenticationException) e; + getPublicImages_result result = new getPublicImages_result(); + if (e instanceof AuthorizationException) { + result.failure = (AuthorizationException) e; result.setFailureIsSet(true); msg = result; } @@ -1053,8 +1462,65 @@ public class ImageServer { return false; } - public void start(I iface, startServerAuthentication_args args, org.apache.thrift.async.AsyncMethodCallback<ByteBuffer> resultHandler) throws TException { - iface.startServerAuthentication(args.organization,resultHandler); + public void start(I iface, getPublicImages_args args, org.apache.thrift.async.AsyncMethodCallback<List<ImageData>> resultHandler) throws TException { + iface.getPublicImages(args.sessionId, args.page,resultHandler); + } + } + + public static class getUserFromToken<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUserFromToken_args, UserInfo> { + public getUserFromToken() { + super("getUserFromToken"); + } + + public getUserFromToken_args getEmptyArgsInstance() { + return new getUserFromToken_args(); + } + + public AsyncMethodCallback<UserInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<UserInfo>() { + public void onComplete(UserInfo o) { + getUserFromToken_result result = new getUserFromToken_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; + getUserFromToken_result result = new getUserFromToken_result(); + if (e instanceof InvalidTokenException) { + result.failure = (InvalidTokenException) e; + result.setFailureIsSet(true); + msg = result; + } + else + { + 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, getUserFromToken_args args, org.apache.thrift.async.AsyncMethodCallback<UserInfo> resultHandler) throws TException { + iface.getUserFromToken(args.token,resultHandler); } } @@ -1110,6 +1576,63 @@ public class ImageServer { } } + public static class startServerAuthentication<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startServerAuthentication_args, ByteBuffer> { + public startServerAuthentication() { + super("startServerAuthentication"); + } + + public startServerAuthentication_args getEmptyArgsInstance() { + return new startServerAuthentication_args(); + } + + public AsyncMethodCallback<ByteBuffer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<ByteBuffer>() { + public void onComplete(ByteBuffer o) { + startServerAuthentication_result result = new startServerAuthentication_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; + startServerAuthentication_result result = new startServerAuthentication_result(); + if (e instanceof AuthenticationException) { + result.failure = (AuthenticationException) e; + result.setFailureIsSet(true); + msg = result; + } + else + { + 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, startServerAuthentication_args args, org.apache.thrift.async.AsyncMethodCallback<ByteBuffer> resultHandler) throws TException { + iface.startServerAuthentication(args.organization,resultHandler); + } + } + public static class serverAuthenticate<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, serverAuthenticate_args, ServerSessionData> { public serverAuthenticate() { super("serverAuthenticate"); @@ -1137,8 +1660,8 @@ public class ImageServer { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; serverAuthenticate_result result = new serverAuthenticate_result(); - if (e instanceof ServerAuthenticationException) { - result.failure = (ServerAuthenticationException) e; + if (e instanceof AuthenticationException) { + result.failure = (AuthenticationException) e; result.setFailureIsSet(true); msg = result; } @@ -1163,7 +1686,7 @@ public class ImageServer { } public void start(I iface, serverAuthenticate_args args, org.apache.thrift.async.AsyncMethodCallback<ServerSessionData> resultHandler) throws TException { - iface.serverAuthenticate(args.organization, args.challengeResponse,resultHandler); + iface.serverAuthenticate(args.organizationId, args.challengeResponse,resultHandler); } } @@ -1296,6 +1819,64 @@ public class ImageServer { } } + public static class publishUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, publishUser_args, Boolean> { + public publishUser() { + super("publishUser"); + } + + public publishUser_args getEmptyArgsInstance() { + return new publishUser_args(); + } + + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + publishUser_result result = new publishUser_result(); + result.success = o; + result.setSuccessIsSet(true); + 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; + publishUser_result result = new publishUser_result(); + if (e instanceof AuthorizationException) { + result.failure = (AuthorizationException) e; + result.setFailureIsSet(true); + msg = result; + } + else + { + 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, publishUser_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.publishUser(args.serverSessionId, args.user,resultHandler); + } + } + } public static class ping_args implements org.apache.thrift.TBase<ping_args, ping_args._Fields>, java.io.Serializable, Cloneable, Comparable<ping_args> { @@ -1901,7 +2482,7 @@ public class ImageServer { public static class authenticate_args implements org.apache.thrift.TBase<authenticate_args, authenticate_args._Fields>, java.io.Serializable, Cloneable, Comparable<authenticate_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("authenticate_args"); - 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 LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", 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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); @@ -1910,12 +2491,12 @@ public class ImageServer { schemes.put(TupleScheme.class, new authenticate_argsTupleSchemeFactory()); } - public String username; // required + public String login; // required public String password; // 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 { - USERNAME((short)1, "username"), + LOGIN((short)1, "login"), PASSWORD((short)2, "password"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -1931,8 +2512,8 @@ public class ImageServer { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // USERNAME - return USERNAME; + case 1: // LOGIN + return LOGIN; case 2: // PASSWORD return PASSWORD; default: @@ -1978,7 +2559,7 @@ public class ImageServer { 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.DEFAULT, + tmpMap.put(_Fields.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); @@ -1990,11 +2571,11 @@ public class ImageServer { } public authenticate_args( - String username, + String login, String password) { this(); - this.username = username; + this.login = login; this.password = password; } @@ -2002,8 +2583,8 @@ public class ImageServer { * Performs a deep copy on <i>other</i>. */ public authenticate_args(authenticate_args other) { - if (other.isSetUsername()) { - this.username = other.username; + if (other.isSetLogin()) { + this.login = other.login; } if (other.isSetPassword()) { this.password = other.password; @@ -2016,31 +2597,31 @@ public class ImageServer { @Override public void clear() { - this.username = null; + this.login = null; this.password = null; } - public String getUsername() { - return this.username; + public String getLogin() { + return this.login; } - public authenticate_args setUsername(String username) { - this.username = username; + public authenticate_args setLogin(String login) { + this.login = login; return this; } - public void unsetUsername() { - this.username = null; + public void unsetLogin() { + this.login = null; } - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; + /** Returns true if field login is set (has been assigned a value) and false otherwise */ + public boolean isSetLogin() { + return this.login != null; } - public void setUsernameIsSet(boolean value) { + public void setLoginIsSet(boolean value) { if (!value) { - this.username = null; + this.login = null; } } @@ -2070,11 +2651,11 @@ public class ImageServer { public void setFieldValue(_Fields field, Object value) { switch (field) { - case USERNAME: + case LOGIN: if (value == null) { - unsetUsername(); + unsetLogin(); } else { - setUsername((String)value); + setLogin((String)value); } break; @@ -2091,8 +2672,8 @@ public class ImageServer { public Object getFieldValue(_Fields field) { switch (field) { - case USERNAME: - return getUsername(); + case LOGIN: + return getLogin(); case PASSWORD: return getPassword(); @@ -2108,8 +2689,8 @@ public class ImageServer { } switch (field) { - case USERNAME: - return isSetUsername(); + case LOGIN: + return isSetLogin(); case PASSWORD: return isSetPassword(); } @@ -2129,12 +2710,12 @@ public class ImageServer { 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)) + boolean this_present_login = true && this.isSetLogin(); + boolean that_present_login = true && that.isSetLogin(); + if (this_present_login || that_present_login) { + if (!(this_present_login && that_present_login)) return false; - if (!this.username.equals(that.username)) + if (!this.login.equals(that.login)) return false; } @@ -2163,12 +2744,12 @@ public class ImageServer { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + lastComparison = Boolean.valueOf(isSetLogin()).compareTo(other.isSetLogin()); if (lastComparison != 0) { return lastComparison; } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (isSetLogin()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, other.login); if (lastComparison != 0) { return lastComparison; } @@ -2203,11 +2784,11 @@ public class ImageServer { StringBuilder sb = new StringBuilder("authenticate_args("); boolean first = true; - sb.append("username:"); - if (this.username == null) { + sb.append("login:"); + if (this.login == null) { sb.append("null"); } else { - sb.append(this.username); + sb.append(this.login); } first = false; if (!first) sb.append(", "); @@ -2261,10 +2842,10 @@ public class ImageServer { break; } switch (schemeField.id) { - case 1: // USERNAME + case 1: // LOGIN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); + struct.login = iprot.readString(); + struct.setLoginIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -2292,9 +2873,9 @@ public class ImageServer { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.username != null) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); + if (struct.login != null) { + oprot.writeFieldBegin(LOGIN_FIELD_DESC); + oprot.writeString(struct.login); oprot.writeFieldEnd(); } if (struct.password != null) { @@ -2320,15 +2901,15 @@ public class ImageServer { public void write(org.apache.thrift.protocol.TProtocol prot, authenticate_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetUsername()) { + if (struct.isSetLogin()) { optionals.set(0); } if (struct.isSetPassword()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); - if (struct.isSetUsername()) { - oprot.writeString(struct.username); + if (struct.isSetLogin()) { + oprot.writeString(struct.login); } if (struct.isSetPassword()) { oprot.writeString(struct.password); @@ -2340,8 +2921,8 @@ public class ImageServer { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); + struct.login = iprot.readString(); + struct.setLoginIsSet(true); } if (incoming.get(1)) { struct.password = iprot.readString(); @@ -2813,22 +3394,20 @@ public class ImageServer { } - public static class getUserFromToken_args implements org.apache.thrift.TBase<getUserFromToken_args, getUserFromToken_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserFromToken_args> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserFromToken_args"); + public static class getOrganizations_args implements org.apache.thrift.TBase<getOrganizations_args, getOrganizations_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOrganizations_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrganizations_args"); - 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)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new getUserFromToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getUserFromToken_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new getOrganizations_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getOrganizations_argsTupleSchemeFactory()); } - public String token; // 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((short)1, "token"); +; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -2843,8 +3422,256 @@ public class ImageServer { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // 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; + } + } + 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(getOrganizations_args.class, metaDataMap); + } + + public getOrganizations_args() { + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getOrganizations_args(getOrganizations_args other) { + } + + public getOrganizations_args deepCopy() { + return new getOrganizations_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 getOrganizations_args) + return this.equals((getOrganizations_args)that); + return false; + } + + public boolean equals(getOrganizations_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getOrganizations_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("getOrganizations_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 getOrganizations_argsStandardSchemeFactory implements SchemeFactory { + public getOrganizations_argsStandardScheme getScheme() { + return new getOrganizations_argsStandardScheme(); + } + } + + private static class getOrganizations_argsStandardScheme extends StandardScheme<getOrganizations_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getOrganizations_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, getOrganizations_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getOrganizations_argsTupleSchemeFactory implements SchemeFactory { + public getOrganizations_argsTupleScheme getScheme() { + return new getOrganizations_argsTupleScheme(); + } + } + + private static class getOrganizations_argsTupleScheme extends TupleScheme<getOrganizations_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getOrganizations_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getOrganizations_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getOrganizations_result implements org.apache.thrift.TBase<getOrganizations_result, getOrganizations_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOrganizations_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrganizations_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getOrganizations_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getOrganizations_resultTupleSchemeFactory()); + } + + public List<OrganizationData> success; // 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 { + 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; } @@ -2888,71 +3715,91 @@ public class ImageServer { 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, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token"))); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OrganizationData.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserFromToken_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOrganizations_result.class, metaDataMap); } - public getUserFromToken_args() { + public getOrganizations_result() { } - public getUserFromToken_args( - String token) + public getOrganizations_result( + List<OrganizationData> success) { this(); - this.token = token; + this.success = success; } /** * Performs a deep copy on <i>other</i>. */ - public getUserFromToken_args(getUserFromToken_args other) { - if (other.isSetToken()) { - this.token = other.token; + public getOrganizations_result(getOrganizations_result other) { + if (other.isSetSuccess()) { + List<OrganizationData> __this__success = new ArrayList<OrganizationData>(other.success.size()); + for (OrganizationData other_element : other.success) { + __this__success.add(new OrganizationData(other_element)); + } + this.success = __this__success; } } - public getUserFromToken_args deepCopy() { - return new getUserFromToken_args(this); + public getOrganizations_result deepCopy() { + return new getOrganizations_result(this); } @Override public void clear() { - this.token = null; + this.success = null; } - public String getToken() { - return this.token; + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public getUserFromToken_args setToken(String token) { - this.token = token; + public java.util.Iterator<OrganizationData> getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(OrganizationData elem) { + if (this.success == null) { + this.success = new ArrayList<OrganizationData>(); + } + this.success.add(elem); + } + + public List<OrganizationData> getSuccess() { + return this.success; + } + + public getOrganizations_result setSuccess(List<OrganizationData> success) { + this.success = success; return this; } - public void unsetToken() { - this.token = null; + public void unsetSuccess() { + this.success = null; } - /** Returns true if field token is set (has been assigned a value) and false otherwise */ - public boolean isSetToken() { - return this.token != 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 setTokenIsSet(boolean value) { + public void setSuccessIsSet(boolean value) { if (!value) { - this.token = null; + this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case TOKEN: + case SUCCESS: if (value == null) { - unsetToken(); + unsetSuccess(); } else { - setToken((String)value); + setSuccess((List<OrganizationData>)value); } break; @@ -2961,8 +3808,8 @@ public class ImageServer { public Object getFieldValue(_Fields field) { switch (field) { - case TOKEN: - return getToken(); + case SUCCESS: + return getSuccess(); } throw new IllegalStateException(); @@ -2975,8 +3822,8 @@ public class ImageServer { } switch (field) { - case TOKEN: - return isSetToken(); + case SUCCESS: + return isSetSuccess(); } throw new IllegalStateException(); } @@ -2985,21 +3832,21 @@ public class ImageServer { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof getUserFromToken_args) - return this.equals((getUserFromToken_args)that); + if (that instanceof getOrganizations_result) + return this.equals((getOrganizations_result)that); return false; } - public boolean equals(getUserFromToken_args that) { + public boolean equals(getOrganizations_result that) { if (that == null) 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)) + 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.token.equals(that.token)) + if (!this.success.equals(that.success)) return false; } @@ -3012,19 +3859,19 @@ public class ImageServer { } @Override - public int compareTo(getUserFromToken_args other) { + public int compareTo(getOrganizations_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } - if (isSetToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } @@ -3042,18 +3889,18 @@ public class ImageServer { 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("getUserFromToken_args("); + StringBuilder sb = new StringBuilder("getOrganizations_result("); boolean first = true; - sb.append("token:"); - if (this.token == null) { + sb.append("success:"); + if (this.success == null) { sb.append("null"); } else { - sb.append(this.token); + sb.append(this.success); } first = false; sb.append(")"); @@ -3081,15 +3928,15 @@ public class ImageServer { } } - private static class getUserFromToken_argsStandardSchemeFactory implements SchemeFactory { - public getUserFromToken_argsStandardScheme getScheme() { - return new getUserFromToken_argsStandardScheme(); + private static class getOrganizations_resultStandardSchemeFactory implements SchemeFactory { + public getOrganizations_resultStandardScheme getScheme() { + return new getOrganizations_resultStandardScheme(); } } - private static class getUserFromToken_argsStandardScheme extends StandardScheme<getUserFromToken_args> { + private static class getOrganizations_resultStandardScheme extends StandardScheme<getOrganizations_result> { - public void read(org.apache.thrift.protocol.TProtocol iprot, getUserFromToken_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, getOrganizations_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -3099,10 +3946,21 @@ public class ImageServer { break; } switch (schemeField.id) { - case 1: // TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.token = iprot.readString(); - struct.setTokenIsSet(true); + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.success = new ArrayList<OrganizationData>(_list8.size); + for (int _i9 = 0; _i9 < _list8.size; ++_i9) + { + OrganizationData _elem10; + _elem10 = new OrganizationData(); + _elem10.read(iprot); + struct.success.add(_elem10); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -3118,13 +3976,20 @@ public class ImageServer { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, getUserFromToken_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, getOrganizations_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.token != null) { - oprot.writeFieldBegin(TOKEN_FIELD_DESC); - oprot.writeString(struct.token); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (OrganizationData _iter11 : struct.success) + { + _iter11.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -3133,54 +3998,624 @@ public class ImageServer { } - private static class getUserFromToken_argsTupleSchemeFactory implements SchemeFactory { - public getUserFromToken_argsTupleScheme getScheme() { - return new getUserFromToken_argsTupleScheme(); + private static class getOrganizations_resultTupleSchemeFactory implements SchemeFactory { + public getOrganizations_resultTupleScheme getScheme() { + return new getOrganizations_resultTupleScheme(); } } - private static class getUserFromToken_argsTupleScheme extends TupleScheme<getUserFromToken_args> { + private static class getOrganizations_resultTupleScheme extends TupleScheme<getOrganizations_result> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, getOrganizations_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetToken()) { + if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); - if (struct.isSetToken()) { - oprot.writeString(struct.token); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (OrganizationData _iter12 : struct.success) + { + _iter12.write(oprot); + } + } } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, getOrganizations_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - struct.token = iprot.readString(); - struct.setTokenIsSet(true); + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<OrganizationData>(_list13.size); + for (int _i14 = 0; _i14 < _list13.size; ++_i14) + { + OrganizationData _elem15; + _elem15 = new OrganizationData(); + _elem15.read(iprot); + struct.success.add(_elem15); + } + } + struct.setSuccessIsSet(true); } } } } - public static class getUserFromToken_result implements org.apache.thrift.TBase<getUserFromToken_result, getUserFromToken_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserFromToken_result> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserFromToken_result"); + public static class findUser_args implements org.apache.thrift.TBase<findUser_args, findUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<findUser_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("findUser_args"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)2); + private static final org.apache.thrift.protocol.TField SEARCH_TERM_FIELD_DESC = new org.apache.thrift.protocol.TField("searchTerm", 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 findUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new findUser_argsTupleSchemeFactory()); + } + + public String sessionId; // required + public String organizationId; // required + public String searchTerm; // 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 { + SESSION_ID((short)1, "sessionId"), + ORGANIZATION_ID((short)2, "organizationId"), + SEARCH_TERM((short)3, "searchTerm"); + + 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: // SESSION_ID + return SESSION_ID; + case 2: // ORGANIZATION_ID + return ORGANIZATION_ID; + case 3: // SEARCH_TERM + return SEARCH_TERM; + 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.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "ID"))); + 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))); + tmpMap.put(_Fields.SEARCH_TERM, new org.apache.thrift.meta_data.FieldMetaData("searchTerm", 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(findUser_args.class, metaDataMap); + } + + public findUser_args() { + } + + public findUser_args( + String sessionId, + String organizationId, + String searchTerm) + { + this(); + this.sessionId = sessionId; + this.organizationId = organizationId; + this.searchTerm = searchTerm; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public findUser_args(findUser_args other) { + if (other.isSetSessionId()) { + this.sessionId = other.sessionId; + } + if (other.isSetOrganizationId()) { + this.organizationId = other.organizationId; + } + if (other.isSetSearchTerm()) { + this.searchTerm = other.searchTerm; + } + } + + public findUser_args deepCopy() { + return new findUser_args(this); + } + + @Override + public void clear() { + this.sessionId = null; + this.organizationId = null; + this.searchTerm = null; + } + + public String getSessionId() { + return this.sessionId; + } + + public findUser_args setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + public void unsetSessionId() { + this.sessionId = null; + } + + /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionId() { + return this.sessionId != null; + } + + public void setSessionIdIsSet(boolean value) { + if (!value) { + this.sessionId = null; + } + } + + public String getOrganizationId() { + return this.organizationId; + } + + public findUser_args 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 getSearchTerm() { + return this.searchTerm; + } + + public findUser_args setSearchTerm(String searchTerm) { + this.searchTerm = searchTerm; + return this; + } + + public void unsetSearchTerm() { + this.searchTerm = null; + } + + /** Returns true if field searchTerm is set (has been assigned a value) and false otherwise */ + public boolean isSetSearchTerm() { + return this.searchTerm != null; + } + + public void setSearchTermIsSet(boolean value) { + if (!value) { + this.searchTerm = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_ID: + if (value == null) { + unsetSessionId(); + } else { + setSessionId((String)value); + } + break; + + case ORGANIZATION_ID: + if (value == null) { + unsetOrganizationId(); + } else { + setOrganizationId((String)value); + } + break; + + case SEARCH_TERM: + if (value == null) { + unsetSearchTerm(); + } else { + setSearchTerm((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_ID: + return getSessionId(); + + case ORGANIZATION_ID: + return getOrganizationId(); + + case SEARCH_TERM: + return getSearchTerm(); + + } + 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 SESSION_ID: + return isSetSessionId(); + case ORGANIZATION_ID: + return isSetOrganizationId(); + case SEARCH_TERM: + return isSetSearchTerm(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof findUser_args) + return this.equals((findUser_args)that); + return false; + } + + public boolean equals(findUser_args that) { + if (that == null) + return false; + + boolean this_present_sessionId = true && this.isSetSessionId(); + boolean that_present_sessionId = true && that.isSetSessionId(); + if (this_present_sessionId || that_present_sessionId) { + if (!(this_present_sessionId && that_present_sessionId)) + return false; + if (!this.sessionId.equals(that.sessionId)) + 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_searchTerm = true && this.isSetSearchTerm(); + boolean that_present_searchTerm = true && that.isSetSearchTerm(); + if (this_present_searchTerm || that_present_searchTerm) { + if (!(this_present_searchTerm && that_present_searchTerm)) + return false; + if (!this.searchTerm.equals(that.searchTerm)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(findUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOrganizationId()).compareTo(other.isSetOrganizationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOrganizationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organizationId, other.organizationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSearchTerm()).compareTo(other.isSetSearchTerm()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSearchTerm()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.searchTerm, other.searchTerm); + 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("findUser_args("); + boolean first = true; + + sb.append("sessionId:"); + if (this.sessionId == null) { + sb.append("null"); + } else { + sb.append(this.sessionId); + } + first = false; + if (!first) sb.append(", "); + sb.append("organizationId:"); + if (this.organizationId == null) { + sb.append("null"); + } else { + sb.append(this.organizationId); + } + first = false; + if (!first) sb.append(", "); + sb.append("searchTerm:"); + if (this.searchTerm == null) { + sb.append("null"); + } else { + sb.append(this.searchTerm); + } + 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 findUser_argsStandardSchemeFactory implements SchemeFactory { + public findUser_argsStandardScheme getScheme() { + return new findUser_argsStandardScheme(); + } + } + + private static class findUser_argsStandardScheme extends StandardScheme<findUser_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, findUser_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: // SESSION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sessionId = iprot.readString(); + struct.setSessionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ORGANIZATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SEARCH_TERM + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.searchTerm = iprot.readString(); + struct.setSearchTermIsSet(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, findUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.sessionId != null) { + oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); + oprot.writeString(struct.sessionId); + oprot.writeFieldEnd(); + } + if (struct.organizationId != null) { + oprot.writeFieldBegin(ORGANIZATION_ID_FIELD_DESC); + oprot.writeString(struct.organizationId); + oprot.writeFieldEnd(); + } + if (struct.searchTerm != null) { + oprot.writeFieldBegin(SEARCH_TERM_FIELD_DESC); + oprot.writeString(struct.searchTerm); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class findUser_argsTupleSchemeFactory implements SchemeFactory { + public findUser_argsTupleScheme getScheme() { + return new findUser_argsTupleScheme(); + } + } + + private static class findUser_argsTupleScheme extends TupleScheme<findUser_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, findUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSessionId()) { + optionals.set(0); + } + if (struct.isSetOrganizationId()) { + optionals.set(1); + } + if (struct.isSetSearchTerm()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSessionId()) { + oprot.writeString(struct.sessionId); + } + if (struct.isSetOrganizationId()) { + oprot.writeString(struct.organizationId); + } + if (struct.isSetSearchTerm()) { + oprot.writeString(struct.searchTerm); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, findUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.sessionId = iprot.readString(); + struct.setSessionIdIsSet(true); + } + if (incoming.get(1)) { + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); + } + if (incoming.get(2)) { + struct.searchTerm = iprot.readString(); + struct.setSearchTermIsSet(true); + } + } + } + + } + + public static class findUser_result implements org.apache.thrift.TBase<findUser_result, findUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<findUser_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("findUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 getUserFromToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getUserFromToken_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new findUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new findUser_resultTupleSchemeFactory()); } - public UserInfo success; // required - public InvalidTokenException failure; // required + public List<UserInfo> success; // required + public AuthorizationException failure; // 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 { @@ -3248,19 +4683,20 @@ public class ImageServer { 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserInfo.class))); + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserInfo.class)))); tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserFromToken_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(findUser_result.class, metaDataMap); } - public getUserFromToken_result() { + public findUser_result() { } - public getUserFromToken_result( - UserInfo success, - InvalidTokenException failure) + public findUser_result( + List<UserInfo> success, + AuthorizationException failure) { this(); this.success = success; @@ -3270,17 +4706,21 @@ public class ImageServer { /** * Performs a deep copy on <i>other</i>. */ - public getUserFromToken_result(getUserFromToken_result other) { + public findUser_result(findUser_result other) { if (other.isSetSuccess()) { - this.success = new UserInfo(other.success); + List<UserInfo> __this__success = new ArrayList<UserInfo>(other.success.size()); + for (UserInfo other_element : other.success) { + __this__success.add(new UserInfo(other_element)); + } + this.success = __this__success; } if (other.isSetFailure()) { - this.failure = new InvalidTokenException(other.failure); + this.failure = new AuthorizationException(other.failure); } } - public getUserFromToken_result deepCopy() { - return new getUserFromToken_result(this); + public findUser_result deepCopy() { + return new findUser_result(this); } @Override @@ -3289,11 +4729,26 @@ public class ImageServer { this.failure = null; } - public UserInfo getSuccess() { + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator<UserInfo> getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(UserInfo elem) { + if (this.success == null) { + this.success = new ArrayList<UserInfo>(); + } + this.success.add(elem); + } + + public List<UserInfo> getSuccess() { return this.success; } - public getUserFromToken_result setSuccess(UserInfo success) { + public findUser_result setSuccess(List<UserInfo> success) { this.success = success; return this; } @@ -3313,11 +4768,11 @@ public class ImageServer { } } - public InvalidTokenException getFailure() { + public AuthorizationException getFailure() { return this.failure; } - public getUserFromToken_result setFailure(InvalidTokenException failure) { + public findUser_result setFailure(AuthorizationException failure) { this.failure = failure; return this; } @@ -3343,7 +4798,7 @@ public class ImageServer { if (value == null) { unsetSuccess(); } else { - setSuccess((UserInfo)value); + setSuccess((List<UserInfo>)value); } break; @@ -3351,7 +4806,7 @@ public class ImageServer { if (value == null) { unsetFailure(); } else { - setFailure((InvalidTokenException)value); + setFailure((AuthorizationException)value); } break; @@ -3389,12 +4844,12 @@ public class ImageServer { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof getUserFromToken_result) - return this.equals((getUserFromToken_result)that); + if (that instanceof findUser_result) + return this.equals((findUser_result)that); return false; } - public boolean equals(getUserFromToken_result that) { + public boolean equals(findUser_result that) { if (that == null) return false; @@ -3425,7 +4880,7 @@ public class ImageServer { } @Override - public int compareTo(getUserFromToken_result other) { + public int compareTo(findUser_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -3469,7 +4924,7 @@ public class ImageServer { @Override public String toString() { - StringBuilder sb = new StringBuilder("getUserFromToken_result("); + StringBuilder sb = new StringBuilder("findUser_result("); boolean first = true; sb.append("success:"); @@ -3494,9 +4949,6 @@ public class ImageServer { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity - if (success != null) { - success.validate(); - } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -3515,15 +4967,15 @@ public class ImageServer { } } - private static class getUserFromToken_resultStandardSchemeFactory implements SchemeFactory { - public getUserFromToken_resultStandardScheme getScheme() { - return new getUserFromToken_resultStandardScheme(); + private static class findUser_resultStandardSchemeFactory implements SchemeFactory { + public findUser_resultStandardScheme getScheme() { + return new findUser_resultStandardScheme(); } } - private static class getUserFromToken_resultStandardScheme extends StandardScheme<getUserFromToken_result> { + private static class findUser_resultStandardScheme extends StandardScheme<findUser_result> { - public void read(org.apache.thrift.protocol.TProtocol iprot, getUserFromToken_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, findUser_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -3534,9 +4986,19 @@ public class ImageServer { } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new UserInfo(); - struct.success.read(iprot); + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.success = new ArrayList<UserInfo>(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) + { + UserInfo _elem18; + _elem18 = new UserInfo(); + _elem18.read(iprot); + struct.success.add(_elem18); + } + iprot.readListEnd(); + } struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -3544,7 +5006,7 @@ public class ImageServer { break; case 1: // FAILURE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.failure = new InvalidTokenException(); + struct.failure = new AuthorizationException(); struct.failure.read(iprot); struct.setFailureIsSet(true); } else { @@ -3562,13 +5024,20 @@ public class ImageServer { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, getUserFromToken_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, findUser_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (UserInfo _iter19 : struct.success) + { + _iter19.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } if (struct.failure != null) { @@ -3582,16 +5051,16 @@ public class ImageServer { } - private static class getUserFromToken_resultTupleSchemeFactory implements SchemeFactory { - public getUserFromToken_resultTupleScheme getScheme() { - return new getUserFromToken_resultTupleScheme(); + private static class findUser_resultTupleSchemeFactory implements SchemeFactory { + public findUser_resultTupleScheme getScheme() { + return new findUser_resultTupleScheme(); } } - private static class getUserFromToken_resultTupleScheme extends TupleScheme<getUserFromToken_result> { + private static class findUser_resultTupleScheme extends TupleScheme<findUser_result> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, findUser_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -3602,7 +5071,13 @@ public class ImageServer { } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { - struct.success.write(oprot); + { + oprot.writeI32(struct.success.size()); + for (UserInfo _iter20 : struct.success) + { + _iter20.write(oprot); + } + } } if (struct.isSetFailure()) { struct.failure.write(oprot); @@ -3610,16 +5085,25 @@ public class ImageServer { } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, findUser_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.success = new UserInfo(); - struct.success.read(iprot); + { + org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<UserInfo>(_list21.size); + for (int _i22 = 0; _i22 < _list21.size; ++_i22) + { + UserInfo _elem23; + _elem23 = new UserInfo(); + _elem23.read(iprot); + struct.success.add(_elem23); + } + } struct.setSuccessIsSet(true); } if (incoming.get(1)) { - struct.failure = new InvalidTokenException(); + struct.failure = new AuthorizationException(); struct.failure.read(iprot); struct.setFailureIsSet(true); } @@ -3628,22 +5112,25 @@ public class ImageServer { } - public static class startServerAuthentication_args implements org.apache.thrift.TBase<startServerAuthentication_args, startServerAuthentication_args._Fields>, java.io.Serializable, Cloneable, Comparable<startServerAuthentication_args> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startServerAuthentication_args"); + public static class getPublicImages_args implements org.apache.thrift.TBase<getPublicImages_args, getPublicImages_args._Fields>, java.io.Serializable, Cloneable, Comparable<getPublicImages_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPublicImages_args"); - private static final org.apache.thrift.protocol.TField ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("organization", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField PAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("page", org.apache.thrift.protocol.TType.I32, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new startServerAuthentication_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new startServerAuthentication_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new getPublicImages_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPublicImages_argsTupleSchemeFactory()); } - public String organization; // required + public String sessionId; // required + public int page; // 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 { - ORGANIZATION((short)1, "organization"); + SESSION_ID((short)1, "sessionId"), + PAGE((short)2, "page"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -3658,8 +5145,10 @@ public class ImageServer { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // ORGANIZATION - return ORGANIZATION; + case 1: // SESSION_ID + return SESSION_ID; + case 2: // PAGE + return PAGE; default: return null; } @@ -3700,74 +5189,116 @@ public class ImageServer { } // isset id assignments + private static final int __PAGE_ISSET_ID = 0; + private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.ORGANIZATION, new org.apache.thrift.meta_data.FieldMetaData("organization", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "ID"))); + tmpMap.put(_Fields.PAGE, new org.apache.thrift.meta_data.FieldMetaData("page", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startServerAuthentication_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPublicImages_args.class, metaDataMap); } - public startServerAuthentication_args() { + public getPublicImages_args() { } - public startServerAuthentication_args( - String organization) + public getPublicImages_args( + String sessionId, + int page) { this(); - this.organization = organization; + this.sessionId = sessionId; + this.page = page; + setPageIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ - public startServerAuthentication_args(startServerAuthentication_args other) { - if (other.isSetOrganization()) { - this.organization = other.organization; + public getPublicImages_args(getPublicImages_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetSessionId()) { + this.sessionId = other.sessionId; } + this.page = other.page; } - public startServerAuthentication_args deepCopy() { - return new startServerAuthentication_args(this); + public getPublicImages_args deepCopy() { + return new getPublicImages_args(this); } @Override public void clear() { - this.organization = null; + this.sessionId = null; + setPageIsSet(false); + this.page = 0; } - public String getOrganization() { - return this.organization; + public String getSessionId() { + return this.sessionId; } - public startServerAuthentication_args setOrganization(String organization) { - this.organization = organization; + public getPublicImages_args setSessionId(String sessionId) { + this.sessionId = sessionId; return this; } - public void unsetOrganization() { - this.organization = null; + public void unsetSessionId() { + this.sessionId = null; } - /** Returns true if field organization is set (has been assigned a value) and false otherwise */ - public boolean isSetOrganization() { - return this.organization != null; + /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionId() { + return this.sessionId != null; } - public void setOrganizationIsSet(boolean value) { + public void setSessionIdIsSet(boolean value) { if (!value) { - this.organization = null; + this.sessionId = null; } } + public int getPage() { + return this.page; + } + + public getPublicImages_args setPage(int page) { + this.page = page; + setPageIsSet(true); + return this; + } + + public void unsetPage() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PAGE_ISSET_ID); + } + + /** Returns true if field page is set (has been assigned a value) and false otherwise */ + public boolean isSetPage() { + return EncodingUtils.testBit(__isset_bitfield, __PAGE_ISSET_ID); + } + + public void setPageIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PAGE_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { - case ORGANIZATION: + case SESSION_ID: if (value == null) { - unsetOrganization(); + unsetSessionId(); } else { - setOrganization((String)value); + setSessionId((String)value); + } + break; + + case PAGE: + if (value == null) { + unsetPage(); + } else { + setPage((Integer)value); } break; @@ -3776,8 +5307,11 @@ public class ImageServer { public Object getFieldValue(_Fields field) { switch (field) { - case ORGANIZATION: - return getOrganization(); + case SESSION_ID: + return getSessionId(); + + case PAGE: + return Integer.valueOf(getPage()); } throw new IllegalStateException(); @@ -3790,8 +5324,10 @@ public class ImageServer { } switch (field) { - case ORGANIZATION: - return isSetOrganization(); + case SESSION_ID: + return isSetSessionId(); + case PAGE: + return isSetPage(); } throw new IllegalStateException(); } @@ -3800,21 +5336,30 @@ public class ImageServer { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof startServerAuthentication_args) - return this.equals((startServerAuthentication_args)that); + if (that instanceof getPublicImages_args) + return this.equals((getPublicImages_args)that); return false; } - public boolean equals(startServerAuthentication_args that) { + public boolean equals(getPublicImages_args that) { if (that == null) return false; - boolean this_present_organization = true && this.isSetOrganization(); - boolean that_present_organization = true && that.isSetOrganization(); - if (this_present_organization || that_present_organization) { - if (!(this_present_organization && that_present_organization)) + boolean this_present_sessionId = true && this.isSetSessionId(); + boolean that_present_sessionId = true && that.isSetSessionId(); + if (this_present_sessionId || that_present_sessionId) { + if (!(this_present_sessionId && that_present_sessionId)) return false; - if (!this.organization.equals(that.organization)) + if (!this.sessionId.equals(that.sessionId)) + return false; + } + + boolean this_present_page = true; + boolean that_present_page = true; + if (this_present_page || that_present_page) { + if (!(this_present_page && that_present_page)) + return false; + if (this.page != that.page) return false; } @@ -3827,19 +5372,29 @@ public class ImageServer { } @Override - public int compareTo(startServerAuthentication_args other) { + public int compareTo(getPublicImages_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOrganization()).compareTo(other.isSetOrganization()); + lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); if (lastComparison != 0) { return lastComparison; } - if (isSetOrganization()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organization, other.organization); + if (isSetSessionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPage()).compareTo(other.isSetPage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.page, other.page); if (lastComparison != 0) { return lastComparison; } @@ -3861,16 +5416,20 @@ public class ImageServer { @Override public String toString() { - StringBuilder sb = new StringBuilder("startServerAuthentication_args("); + StringBuilder sb = new StringBuilder("getPublicImages_args("); boolean first = true; - sb.append("organization:"); - if (this.organization == null) { + sb.append("sessionId:"); + if (this.sessionId == null) { sb.append("null"); } else { - sb.append(this.organization); + sb.append(this.sessionId); } first = false; + if (!first) sb.append(", "); + sb.append("page:"); + sb.append(this.page); + first = false; sb.append(")"); return sb.toString(); } @@ -3890,21 +5449,23 @@ public class ImageServer { 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 startServerAuthentication_argsStandardSchemeFactory implements SchemeFactory { - public startServerAuthentication_argsStandardScheme getScheme() { - return new startServerAuthentication_argsStandardScheme(); + private static class getPublicImages_argsStandardSchemeFactory implements SchemeFactory { + public getPublicImages_argsStandardScheme getScheme() { + return new getPublicImages_argsStandardScheme(); } } - private static class startServerAuthentication_argsStandardScheme extends StandardScheme<startServerAuthentication_args> { + private static class getPublicImages_argsStandardScheme extends StandardScheme<getPublicImages_args> { - public void read(org.apache.thrift.protocol.TProtocol iprot, startServerAuthentication_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, getPublicImages_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -3914,10 +5475,18 @@ public class ImageServer { break; } switch (schemeField.id) { - case 1: // ORGANIZATION + case 1: // SESSION_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.organization = iprot.readString(); - struct.setOrganizationIsSet(true); + struct.sessionId = iprot.readString(); + struct.setSessionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PAGE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.page = iprot.readI32(); + struct.setPageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -3933,69 +5502,82 @@ public class ImageServer { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, startServerAuthentication_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, getPublicImages_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.organization != null) { - oprot.writeFieldBegin(ORGANIZATION_FIELD_DESC); - oprot.writeString(struct.organization); + if (struct.sessionId != null) { + oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); + oprot.writeString(struct.sessionId); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(PAGE_FIELD_DESC); + oprot.writeI32(struct.page); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } - private static class startServerAuthentication_argsTupleSchemeFactory implements SchemeFactory { - public startServerAuthentication_argsTupleScheme getScheme() { - return new startServerAuthentication_argsTupleScheme(); + private static class getPublicImages_argsTupleSchemeFactory implements SchemeFactory { + public getPublicImages_argsTupleScheme getScheme() { + return new getPublicImages_argsTupleScheme(); } } - private static class startServerAuthentication_argsTupleScheme extends TupleScheme<startServerAuthentication_args> { + private static class getPublicImages_argsTupleScheme extends TupleScheme<getPublicImages_args> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, getPublicImages_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetOrganization()) { + if (struct.isSetSessionId()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOrganization()) { - oprot.writeString(struct.organization); + if (struct.isSetPage()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSessionId()) { + oprot.writeString(struct.sessionId); + } + if (struct.isSetPage()) { + oprot.writeI32(struct.page); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, getPublicImages_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.organization = iprot.readString(); - struct.setOrganizationIsSet(true); + struct.sessionId = iprot.readString(); + struct.setSessionIdIsSet(true); + } + if (incoming.get(1)) { + struct.page = iprot.readI32(); + struct.setPageIsSet(true); } } } } - public static class startServerAuthentication_result implements org.apache.thrift.TBase<startServerAuthentication_result, startServerAuthentication_result._Fields>, java.io.Serializable, Cloneable, Comparable<startServerAuthentication_result> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startServerAuthentication_result"); + public static class getPublicImages_result implements org.apache.thrift.TBase<getPublicImages_result, getPublicImages_result._Fields>, java.io.Serializable, Cloneable, Comparable<getPublicImages_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPublicImages_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 org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 startServerAuthentication_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new startServerAuthentication_resultTupleSchemeFactory()); + schemes.put(StandardScheme.class, new getPublicImages_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPublicImages_resultTupleSchemeFactory()); } - public ByteBuffer success; // required - public ServerAuthenticationException failure; // required + public List<ImageData> success; // required + public AuthorizationException failure; // 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 { @@ -4063,19 +5645,20 @@ public class ImageServer { 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 , true))); + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImageData.class)))); tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startServerAuthentication_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPublicImages_result.class, metaDataMap); } - public startServerAuthentication_result() { + public getPublicImages_result() { } - public startServerAuthentication_result( - ByteBuffer success, - ServerAuthenticationException failure) + public getPublicImages_result( + List<ImageData> success, + AuthorizationException failure) { this(); this.success = success; @@ -4085,18 +5668,21 @@ public class ImageServer { /** * Performs a deep copy on <i>other</i>. */ - public startServerAuthentication_result(startServerAuthentication_result other) { + public getPublicImages_result(getPublicImages_result other) { if (other.isSetSuccess()) { - this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); -; + List<ImageData> __this__success = new ArrayList<ImageData>(other.success.size()); + for (ImageData other_element : other.success) { + __this__success.add(new ImageData(other_element)); + } + this.success = __this__success; } if (other.isSetFailure()) { - this.failure = new ServerAuthenticationException(other.failure); + this.failure = new AuthorizationException(other.failure); } } - public startServerAuthentication_result deepCopy() { - return new startServerAuthentication_result(this); + public getPublicImages_result deepCopy() { + return new getPublicImages_result(this); } @Override @@ -4105,21 +5691,26 @@ public class ImageServer { this.failure = null; } - public byte[] getSuccess() { - setSuccess(org.apache.thrift.TBaseHelper.rightSize(success)); - return success == null ? null : success.array(); + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); } - public ByteBuffer bufferForSuccess() { - return success; + public java.util.Iterator<ImageData> getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); } - public startServerAuthentication_result setSuccess(byte[] success) { - setSuccess(success == null ? (ByteBuffer)null : ByteBuffer.wrap(success)); - return this; + public void addToSuccess(ImageData elem) { + if (this.success == null) { + this.success = new ArrayList<ImageData>(); + } + this.success.add(elem); } - public startServerAuthentication_result setSuccess(ByteBuffer success) { + public List<ImageData> getSuccess() { + return this.success; + } + + public getPublicImages_result setSuccess(List<ImageData> success) { this.success = success; return this; } @@ -4139,11 +5730,11 @@ public class ImageServer { } } - public ServerAuthenticationException getFailure() { + public AuthorizationException getFailure() { return this.failure; } - public startServerAuthentication_result setFailure(ServerAuthenticationException failure) { + public getPublicImages_result setFailure(AuthorizationException failure) { this.failure = failure; return this; } @@ -4169,7 +5760,7 @@ public class ImageServer { if (value == null) { unsetSuccess(); } else { - setSuccess((ByteBuffer)value); + setSuccess((List<ImageData>)value); } break; @@ -4177,7 +5768,7 @@ public class ImageServer { if (value == null) { unsetFailure(); } else { - setFailure((ServerAuthenticationException)value); + setFailure((AuthorizationException)value); } break; @@ -4215,12 +5806,12 @@ public class ImageServer { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof startServerAuthentication_result) - return this.equals((startServerAuthentication_result)that); + if (that instanceof getPublicImages_result) + return this.equals((getPublicImages_result)that); return false; } - public boolean equals(startServerAuthentication_result that) { + public boolean equals(getPublicImages_result that) { if (that == null) return false; @@ -4251,7 +5842,7 @@ public class ImageServer { } @Override - public int compareTo(startServerAuthentication_result other) { + public int compareTo(getPublicImages_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -4295,14 +5886,14 @@ public class ImageServer { @Override public String toString() { - StringBuilder sb = new StringBuilder("startServerAuthentication_result("); + StringBuilder sb = new StringBuilder("getPublicImages_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { - org.apache.thrift.TBaseHelper.toString(this.success, sb); + sb.append(this.success); } first = false; if (!first) sb.append(", "); @@ -4338,15 +5929,15 @@ public class ImageServer { } } - private static class startServerAuthentication_resultStandardSchemeFactory implements SchemeFactory { - public startServerAuthentication_resultStandardScheme getScheme() { - return new startServerAuthentication_resultStandardScheme(); + private static class getPublicImages_resultStandardSchemeFactory implements SchemeFactory { + public getPublicImages_resultStandardScheme getScheme() { + return new getPublicImages_resultStandardScheme(); } } - private static class startServerAuthentication_resultStandardScheme extends StandardScheme<startServerAuthentication_result> { + private static class getPublicImages_resultStandardScheme extends StandardScheme<getPublicImages_result> { - public void read(org.apache.thrift.protocol.TProtocol iprot, startServerAuthentication_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, getPublicImages_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -4357,8 +5948,856 @@ public class ImageServer { } switch (schemeField.id) { case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); + struct.success = new ArrayList<ImageData>(_list24.size); + for (int _i25 = 0; _i25 < _list24.size; ++_i25) + { + ImageData _elem26; + _elem26 = new ImageData(); + _elem26.read(iprot); + struct.success.add(_elem26); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // FAILURE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.failure = new AuthorizationException(); + struct.failure.read(iprot); + struct.setFailureIsSet(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, getPublicImages_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (ImageData _iter27 : struct.success) + { + _iter27.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.failure != null) { + oprot.writeFieldBegin(FAILURE_FIELD_DESC); + struct.failure.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPublicImages_resultTupleSchemeFactory implements SchemeFactory { + public getPublicImages_resultTupleScheme getScheme() { + return new getPublicImages_resultTupleScheme(); + } + } + + private static class getPublicImages_resultTupleScheme extends TupleScheme<getPublicImages_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPublicImages_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetFailure()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ImageData _iter28 : struct.success) + { + _iter28.write(oprot); + } + } + } + if (struct.isSetFailure()) { + struct.failure.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPublicImages_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<ImageData>(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + ImageData _elem31; + _elem31 = new ImageData(); + _elem31.read(iprot); + struct.success.add(_elem31); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.failure = new AuthorizationException(); + struct.failure.read(iprot); + struct.setFailureIsSet(true); + } + } + } + + } + + public static class getUserFromToken_args implements org.apache.thrift.TBase<getUserFromToken_args, getUserFromToken_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserFromToken_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserFromToken_args"); + + 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)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getUserFromToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getUserFromToken_argsTupleSchemeFactory()); + } + + public String token; // 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((short)1, "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: // 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 + 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, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserFromToken_args.class, metaDataMap); + } + + public getUserFromToken_args() { + } + + public getUserFromToken_args( + String token) + { + this(); + this.token = token; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getUserFromToken_args(getUserFromToken_args other) { + if (other.isSetToken()) { + this.token = other.token; + } + } + + public getUserFromToken_args deepCopy() { + return new getUserFromToken_args(this); + } + + @Override + public void clear() { + this.token = null; + } + + public String getToken() { + return this.token; + } + + public getUserFromToken_args 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 TOKEN: + if (value == null) { + unsetToken(); + } else { + setToken((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + 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 TOKEN: + return isSetToken(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getUserFromToken_args) + return this.equals((getUserFromToken_args)that); + return false; + } + + public boolean equals(getUserFromToken_args that) { + if (that == null) + 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(getUserFromToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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("getUserFromToken_args("); + boolean first = true; + + 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 + // 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 getUserFromToken_argsStandardSchemeFactory implements SchemeFactory { + public getUserFromToken_argsStandardScheme getScheme() { + return new getUserFromToken_argsStandardScheme(); + } + } + + private static class getUserFromToken_argsStandardScheme extends StandardScheme<getUserFromToken_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getUserFromToken_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: // TOKEN if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.success = iprot.readBinary(); + 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, getUserFromToken_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.token != null) { + oprot.writeFieldBegin(TOKEN_FIELD_DESC); + oprot.writeString(struct.token); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getUserFromToken_argsTupleSchemeFactory implements SchemeFactory { + public getUserFromToken_argsTupleScheme getScheme() { + return new getUserFromToken_argsTupleScheme(); + } + } + + private static class getUserFromToken_argsTupleScheme extends TupleScheme<getUserFromToken_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetToken()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetToken()) { + oprot.writeString(struct.token); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.token = iprot.readString(); + struct.setTokenIsSet(true); + } + } + } + + } + + public static class getUserFromToken_result implements org.apache.thrift.TBase<getUserFromToken_result, getUserFromToken_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserFromToken_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserFromToken_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 getUserFromToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getUserFromToken_resultTupleSchemeFactory()); + } + + public UserInfo success; // required + public InvalidTokenException failure; // 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 { + SUCCESS((short)0, "success"), + FAILURE((short)1, "failure"); + + 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; + case 1: // FAILURE + return FAILURE; + 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserInfo.class))); + tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserFromToken_result.class, metaDataMap); + } + + public getUserFromToken_result() { + } + + public getUserFromToken_result( + UserInfo success, + InvalidTokenException failure) + { + this(); + this.success = success; + this.failure = failure; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getUserFromToken_result(getUserFromToken_result other) { + if (other.isSetSuccess()) { + this.success = new UserInfo(other.success); + } + if (other.isSetFailure()) { + this.failure = new InvalidTokenException(other.failure); + } + } + + public getUserFromToken_result deepCopy() { + return new getUserFromToken_result(this); + } + + @Override + public void clear() { + this.success = null; + this.failure = null; + } + + public UserInfo getSuccess() { + return this.success; + } + + public getUserFromToken_result setSuccess(UserInfo 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 InvalidTokenException getFailure() { + return this.failure; + } + + public getUserFromToken_result setFailure(InvalidTokenException failure) { + this.failure = failure; + return this; + } + + public void unsetFailure() { + this.failure = null; + } + + /** Returns true if field failure is set (has been assigned a value) and false otherwise */ + public boolean isSetFailure() { + return this.failure != null; + } + + public void setFailureIsSet(boolean value) { + if (!value) { + this.failure = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((UserInfo)value); + } + break; + + case FAILURE: + if (value == null) { + unsetFailure(); + } else { + setFailure((InvalidTokenException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case FAILURE: + return getFailure(); + + } + 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(); + case FAILURE: + return isSetFailure(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getUserFromToken_result) + return this.equals((getUserFromToken_result)that); + return false; + } + + public boolean equals(getUserFromToken_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; + } + + boolean this_present_failure = true && this.isSetFailure(); + boolean that_present_failure = true && that.isSetFailure(); + if (this_present_failure || that_present_failure) { + if (!(this_present_failure && that_present_failure)) + return false; + if (!this.failure.equals(that.failure)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getUserFromToken_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; + } + } + lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFailure()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure); + 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("getUserFromToken_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("failure:"); + if (this.failure == null) { + sb.append("null"); + } else { + sb.append(this.failure); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.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 getUserFromToken_resultStandardSchemeFactory implements SchemeFactory { + public getUserFromToken_resultStandardScheme getScheme() { + return new getUserFromToken_resultStandardScheme(); + } + } + + private static class getUserFromToken_resultStandardScheme extends StandardScheme<getUserFromToken_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getUserFromToken_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.STRUCT) { + struct.success = new UserInfo(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -4366,7 +6805,7 @@ public class ImageServer { break; case 1: // FAILURE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.failure = new ServerAuthenticationException(); + struct.failure = new InvalidTokenException(); struct.failure.read(iprot); struct.setFailureIsSet(true); } else { @@ -4384,13 +6823,13 @@ public class ImageServer { struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, startServerAuthentication_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, getUserFromToken_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBinary(struct.success); + struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.failure != null) { @@ -4404,16 +6843,16 @@ public class ImageServer { } - private static class startServerAuthentication_resultTupleSchemeFactory implements SchemeFactory { - public startServerAuthentication_resultTupleScheme getScheme() { - return new startServerAuthentication_resultTupleScheme(); + private static class getUserFromToken_resultTupleSchemeFactory implements SchemeFactory { + public getUserFromToken_resultTupleScheme getScheme() { + return new getUserFromToken_resultTupleScheme(); } } - private static class startServerAuthentication_resultTupleScheme extends TupleScheme<startServerAuthentication_result> { + private static class getUserFromToken_resultTupleScheme extends TupleScheme<getUserFromToken_result> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { @@ -4424,7 +6863,7 @@ public class ImageServer { } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { - oprot.writeBinary(struct.success); + struct.success.write(oprot); } if (struct.isSetFailure()) { struct.failure.write(oprot); @@ -4432,15 +6871,16 @@ public class ImageServer { } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.success = iprot.readBinary(); + struct.success = new UserInfo(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { - struct.failure = new ServerAuthenticationException(); + struct.failure = new InvalidTokenException(); struct.failure.read(iprot); struct.setFailureIsSet(true); } @@ -5157,10 +7597,831 @@ public class ImageServer { } + public static class startServerAuthentication_args implements org.apache.thrift.TBase<startServerAuthentication_args, startServerAuthentication_args._Fields>, java.io.Serializable, Cloneable, Comparable<startServerAuthentication_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startServerAuthentication_args"); + + private static final org.apache.thrift.protocol.TField ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("organization", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new startServerAuthentication_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new startServerAuthentication_argsTupleSchemeFactory()); + } + + public String organization; // 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 { + ORGANIZATION((short)1, "organization"); + + 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: // ORGANIZATION + return ORGANIZATION; + 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.ORGANIZATION, new org.apache.thrift.meta_data.FieldMetaData("organization", 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(startServerAuthentication_args.class, metaDataMap); + } + + public startServerAuthentication_args() { + } + + public startServerAuthentication_args( + String organization) + { + this(); + this.organization = organization; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public startServerAuthentication_args(startServerAuthentication_args other) { + if (other.isSetOrganization()) { + this.organization = other.organization; + } + } + + public startServerAuthentication_args deepCopy() { + return new startServerAuthentication_args(this); + } + + @Override + public void clear() { + this.organization = null; + } + + public String getOrganization() { + return this.organization; + } + + public startServerAuthentication_args setOrganization(String organization) { + this.organization = organization; + return this; + } + + public void unsetOrganization() { + this.organization = null; + } + + /** Returns true if field organization is set (has been assigned a value) and false otherwise */ + public boolean isSetOrganization() { + return this.organization != null; + } + + public void setOrganizationIsSet(boolean value) { + if (!value) { + this.organization = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ORGANIZATION: + if (value == null) { + unsetOrganization(); + } else { + setOrganization((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ORGANIZATION: + return getOrganization(); + + } + 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 ORGANIZATION: + return isSetOrganization(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof startServerAuthentication_args) + return this.equals((startServerAuthentication_args)that); + return false; + } + + public boolean equals(startServerAuthentication_args that) { + if (that == null) + return false; + + boolean this_present_organization = true && this.isSetOrganization(); + boolean that_present_organization = true && that.isSetOrganization(); + if (this_present_organization || that_present_organization) { + if (!(this_present_organization && that_present_organization)) + return false; + if (!this.organization.equals(that.organization)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(startServerAuthentication_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOrganization()).compareTo(other.isSetOrganization()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOrganization()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organization, other.organization); + 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("startServerAuthentication_args("); + boolean first = true; + + sb.append("organization:"); + if (this.organization == null) { + sb.append("null"); + } else { + sb.append(this.organization); + } + 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 startServerAuthentication_argsStandardSchemeFactory implements SchemeFactory { + public startServerAuthentication_argsStandardScheme getScheme() { + return new startServerAuthentication_argsStandardScheme(); + } + } + + private static class startServerAuthentication_argsStandardScheme extends StandardScheme<startServerAuthentication_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, startServerAuthentication_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: // ORGANIZATION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.organization = iprot.readString(); + struct.setOrganizationIsSet(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, startServerAuthentication_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.organization != null) { + oprot.writeFieldBegin(ORGANIZATION_FIELD_DESC); + oprot.writeString(struct.organization); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class startServerAuthentication_argsTupleSchemeFactory implements SchemeFactory { + public startServerAuthentication_argsTupleScheme getScheme() { + return new startServerAuthentication_argsTupleScheme(); + } + } + + private static class startServerAuthentication_argsTupleScheme extends TupleScheme<startServerAuthentication_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetOrganization()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOrganization()) { + oprot.writeString(struct.organization); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.organization = iprot.readString(); + struct.setOrganizationIsSet(true); + } + } + } + + } + + public static class startServerAuthentication_result implements org.apache.thrift.TBase<startServerAuthentication_result, startServerAuthentication_result._Fields>, java.io.Serializable, Cloneable, Comparable<startServerAuthentication_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startServerAuthentication_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 org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 startServerAuthentication_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new startServerAuthentication_resultTupleSchemeFactory()); + } + + public ByteBuffer success; // required + public AuthenticationException failure; // 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 { + SUCCESS((short)0, "success"), + FAILURE((short)1, "failure"); + + 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; + case 1: // FAILURE + return FAILURE; + 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 , true))); + tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startServerAuthentication_result.class, metaDataMap); + } + + public startServerAuthentication_result() { + } + + public startServerAuthentication_result( + ByteBuffer success, + AuthenticationException failure) + { + this(); + this.success = success; + this.failure = failure; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public startServerAuthentication_result(startServerAuthentication_result other) { + if (other.isSetSuccess()) { + this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success); +; + } + if (other.isSetFailure()) { + this.failure = new AuthenticationException(other.failure); + } + } + + public startServerAuthentication_result deepCopy() { + return new startServerAuthentication_result(this); + } + + @Override + public void clear() { + this.success = null; + this.failure = null; + } + + public byte[] getSuccess() { + setSuccess(org.apache.thrift.TBaseHelper.rightSize(success)); + return success == null ? null : success.array(); + } + + public ByteBuffer bufferForSuccess() { + return success; + } + + public startServerAuthentication_result setSuccess(byte[] success) { + setSuccess(success == null ? (ByteBuffer)null : ByteBuffer.wrap(success)); + return this; + } + + public startServerAuthentication_result setSuccess(ByteBuffer 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 AuthenticationException getFailure() { + return this.failure; + } + + public startServerAuthentication_result setFailure(AuthenticationException failure) { + this.failure = failure; + return this; + } + + public void unsetFailure() { + this.failure = null; + } + + /** Returns true if field failure is set (has been assigned a value) and false otherwise */ + public boolean isSetFailure() { + return this.failure != null; + } + + public void setFailureIsSet(boolean value) { + if (!value) { + this.failure = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((ByteBuffer)value); + } + break; + + case FAILURE: + if (value == null) { + unsetFailure(); + } else { + setFailure((AuthenticationException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case FAILURE: + return getFailure(); + + } + 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(); + case FAILURE: + return isSetFailure(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof startServerAuthentication_result) + return this.equals((startServerAuthentication_result)that); + return false; + } + + public boolean equals(startServerAuthentication_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; + } + + boolean this_present_failure = true && this.isSetFailure(); + boolean that_present_failure = true && that.isSetFailure(); + if (this_present_failure || that_present_failure) { + if (!(this_present_failure && that_present_failure)) + return false; + if (!this.failure.equals(that.failure)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(startServerAuthentication_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; + } + } + lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFailure()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure); + 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("startServerAuthentication_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.success, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("failure:"); + if (this.failure == null) { + sb.append("null"); + } else { + sb.append(this.failure); + } + 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 startServerAuthentication_resultStandardSchemeFactory implements SchemeFactory { + public startServerAuthentication_resultStandardScheme getScheme() { + return new startServerAuthentication_resultStandardScheme(); + } + } + + private static class startServerAuthentication_resultStandardScheme extends StandardScheme<startServerAuthentication_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, startServerAuthentication_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.readBinary(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // FAILURE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.failure = new AuthenticationException(); + struct.failure.read(iprot); + struct.setFailureIsSet(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, startServerAuthentication_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBinary(struct.success); + oprot.writeFieldEnd(); + } + if (struct.failure != null) { + oprot.writeFieldBegin(FAILURE_FIELD_DESC); + struct.failure.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class startServerAuthentication_resultTupleSchemeFactory implements SchemeFactory { + public startServerAuthentication_resultTupleScheme getScheme() { + return new startServerAuthentication_resultTupleScheme(); + } + } + + private static class startServerAuthentication_resultTupleScheme extends TupleScheme<startServerAuthentication_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetFailure()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBinary(struct.success); + } + if (struct.isSetFailure()) { + struct.failure.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBinary(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.failure = new AuthenticationException(); + struct.failure.read(iprot); + struct.setFailureIsSet(true); + } + } + } + + } + public static class serverAuthenticate_args implements org.apache.thrift.TBase<serverAuthenticate_args, serverAuthenticate_args._Fields>, java.io.Serializable, Cloneable, Comparable<serverAuthenticate_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("serverAuthenticate_args"); - private static final org.apache.thrift.protocol.TField ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("organization", org.apache.thrift.protocol.TType.STRING, (short)1); + 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)1); private static final org.apache.thrift.protocol.TField CHALLENGE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("challengeResponse", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); @@ -5169,12 +8430,12 @@ public class ImageServer { schemes.put(TupleScheme.class, new serverAuthenticate_argsTupleSchemeFactory()); } - public String organization; // required + public String organizationId; // required public ByteBuffer challengeResponse; // 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 { - ORGANIZATION((short)1, "organization"), + ORGANIZATION_ID((short)1, "organizationId"), CHALLENGE_RESPONSE((short)2, "challengeResponse"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -5190,8 +8451,8 @@ public class ImageServer { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // ORGANIZATION - return ORGANIZATION; + case 1: // ORGANIZATION_ID + return ORGANIZATION_ID; case 2: // CHALLENGE_RESPONSE return CHALLENGE_RESPONSE; default: @@ -5237,7 +8498,7 @@ public class ImageServer { 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.ORGANIZATION, new org.apache.thrift.meta_data.FieldMetaData("organization", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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))); tmpMap.put(_Fields.CHALLENGE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("challengeResponse", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); @@ -5249,11 +8510,11 @@ public class ImageServer { } public serverAuthenticate_args( - String organization, + String organizationId, ByteBuffer challengeResponse) { this(); - this.organization = organization; + this.organizationId = organizationId; this.challengeResponse = challengeResponse; } @@ -5261,8 +8522,8 @@ public class ImageServer { * Performs a deep copy on <i>other</i>. */ public serverAuthenticate_args(serverAuthenticate_args other) { - if (other.isSetOrganization()) { - this.organization = other.organization; + if (other.isSetOrganizationId()) { + this.organizationId = other.organizationId; } if (other.isSetChallengeResponse()) { this.challengeResponse = org.apache.thrift.TBaseHelper.copyBinary(other.challengeResponse); @@ -5276,31 +8537,31 @@ public class ImageServer { @Override public void clear() { - this.organization = null; + this.organizationId = null; this.challengeResponse = null; } - public String getOrganization() { - return this.organization; + public String getOrganizationId() { + return this.organizationId; } - public serverAuthenticate_args setOrganization(String organization) { - this.organization = organization; + public serverAuthenticate_args setOrganizationId(String organizationId) { + this.organizationId = organizationId; return this; } - public void unsetOrganization() { - this.organization = null; + public void unsetOrganizationId() { + this.organizationId = null; } - /** Returns true if field organization is set (has been assigned a value) and false otherwise */ - public boolean isSetOrganization() { - return this.organization != 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 setOrganizationIsSet(boolean value) { + public void setOrganizationIdIsSet(boolean value) { if (!value) { - this.organization = null; + this.organizationId = null; } } @@ -5340,11 +8601,11 @@ public class ImageServer { public void setFieldValue(_Fields field, Object value) { switch (field) { - case ORGANIZATION: + case ORGANIZATION_ID: if (value == null) { - unsetOrganization(); + unsetOrganizationId(); } else { - setOrganization((String)value); + setOrganizationId((String)value); } break; @@ -5361,8 +8622,8 @@ public class ImageServer { public Object getFieldValue(_Fields field) { switch (field) { - case ORGANIZATION: - return getOrganization(); + case ORGANIZATION_ID: + return getOrganizationId(); case CHALLENGE_RESPONSE: return getChallengeResponse(); @@ -5378,8 +8639,8 @@ public class ImageServer { } switch (field) { - case ORGANIZATION: - return isSetOrganization(); + case ORGANIZATION_ID: + return isSetOrganizationId(); case CHALLENGE_RESPONSE: return isSetChallengeResponse(); } @@ -5399,12 +8660,12 @@ public class ImageServer { if (that == null) return false; - boolean this_present_organization = true && this.isSetOrganization(); - boolean that_present_organization = true && that.isSetOrganization(); - if (this_present_organization || that_present_organization) { - if (!(this_present_organization && that_present_organization)) + 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.organization.equals(that.organization)) + if (!this.organizationId.equals(that.organizationId)) return false; } @@ -5433,12 +8694,12 @@ public class ImageServer { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOrganization()).compareTo(other.isSetOrganization()); + lastComparison = Boolean.valueOf(isSetOrganizationId()).compareTo(other.isSetOrganizationId()); if (lastComparison != 0) { return lastComparison; } - if (isSetOrganization()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organization, other.organization); + if (isSetOrganizationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organizationId, other.organizationId); if (lastComparison != 0) { return lastComparison; } @@ -5473,11 +8734,11 @@ public class ImageServer { StringBuilder sb = new StringBuilder("serverAuthenticate_args("); boolean first = true; - sb.append("organization:"); - if (this.organization == null) { + sb.append("organizationId:"); + if (this.organizationId == null) { sb.append("null"); } else { - sb.append(this.organization); + sb.append(this.organizationId); } first = false; if (!first) sb.append(", "); @@ -5531,10 +8792,10 @@ public class ImageServer { break; } switch (schemeField.id) { - case 1: // ORGANIZATION + case 1: // ORGANIZATION_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.organization = iprot.readString(); - struct.setOrganizationIsSet(true); + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -5562,9 +8823,9 @@ public class ImageServer { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.organization != null) { - oprot.writeFieldBegin(ORGANIZATION_FIELD_DESC); - oprot.writeString(struct.organization); + if (struct.organizationId != null) { + oprot.writeFieldBegin(ORGANIZATION_ID_FIELD_DESC); + oprot.writeString(struct.organizationId); oprot.writeFieldEnd(); } if (struct.challengeResponse != null) { @@ -5590,15 +8851,15 @@ public class ImageServer { public void write(org.apache.thrift.protocol.TProtocol prot, serverAuthenticate_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetOrganization()) { + if (struct.isSetOrganizationId()) { optionals.set(0); } if (struct.isSetChallengeResponse()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); - if (struct.isSetOrganization()) { - oprot.writeString(struct.organization); + if (struct.isSetOrganizationId()) { + oprot.writeString(struct.organizationId); } if (struct.isSetChallengeResponse()) { oprot.writeBinary(struct.challengeResponse); @@ -5610,8 +8871,8 @@ public class ImageServer { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.organization = iprot.readString(); - struct.setOrganizationIsSet(true); + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); } if (incoming.get(1)) { struct.challengeResponse = iprot.readBinary(); @@ -5635,7 +8896,7 @@ public class ImageServer { } public ServerSessionData success; // required - public ServerAuthenticationException failure; // required + public AuthenticationException failure; // 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 { @@ -5715,7 +8976,7 @@ public class ImageServer { public serverAuthenticate_result( ServerSessionData success, - ServerAuthenticationException failure) + AuthenticationException failure) { this(); this.success = success; @@ -5730,7 +8991,7 @@ public class ImageServer { this.success = new ServerSessionData(other.success); } if (other.isSetFailure()) { - this.failure = new ServerAuthenticationException(other.failure); + this.failure = new AuthenticationException(other.failure); } } @@ -5768,11 +9029,11 @@ public class ImageServer { } } - public ServerAuthenticationException getFailure() { + public AuthenticationException getFailure() { return this.failure; } - public serverAuthenticate_result setFailure(ServerAuthenticationException failure) { + public serverAuthenticate_result setFailure(AuthenticationException failure) { this.failure = failure; return this; } @@ -5806,7 +9067,7 @@ public class ImageServer { if (value == null) { unsetFailure(); } else { - setFailure((ServerAuthenticationException)value); + setFailure((AuthenticationException)value); } break; @@ -5999,7 +9260,7 @@ public class ImageServer { break; case 1: // FAILURE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.failure = new ServerAuthenticationException(); + struct.failure = new AuthenticationException(); struct.failure.read(iprot); struct.setFailureIsSet(true); } else { @@ -6074,7 +9335,7 @@ public class ImageServer { struct.setSuccessIsSet(true); } if (incoming.get(1)) { - struct.failure = new ServerAuthenticationException(); + struct.failure = new AuthenticationException(); struct.failure.read(iprot); struct.setFailureIsSet(true); } @@ -6169,7 +9430,7 @@ public class ImageServer { static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SERVER_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("serverSessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "ID"))); tmpMap.put(_Fields.IMAGE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("imageDescription", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImageData.class))); tmpMap.put(_Fields.CRC_SUMS, new org.apache.thrift.meta_data.FieldMetaData("crcSums", org.apache.thrift.TFieldRequirementType.DEFAULT, @@ -6563,13 +9824,13 @@ public class ImageServer { case 3: // CRC_SUMS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.crcSums = new ArrayList<Integer>(_list8.size); - for (int _i9 = 0; _i9 < _list8.size; ++_i9) + org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); + struct.crcSums = new ArrayList<Integer>(_list32.size); + for (int _i33 = 0; _i33 < _list32.size; ++_i33) { - int _elem10; - _elem10 = iprot.readI32(); - struct.crcSums.add(_elem10); + int _elem34; + _elem34 = iprot.readI32(); + struct.crcSums.add(_elem34); } iprot.readListEnd(); } @@ -6607,9 +9868,9 @@ public class ImageServer { oprot.writeFieldBegin(CRC_SUMS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.crcSums.size())); - for (int _iter11 : struct.crcSums) + for (int _iter35 : struct.crcSums) { - oprot.writeI32(_iter11); + oprot.writeI32(_iter35); } oprot.writeListEnd(); } @@ -6652,9 +9913,9 @@ public class ImageServer { if (struct.isSetCrcSums()) { { oprot.writeI32(struct.crcSums.size()); - for (int _iter12 : struct.crcSums) + for (int _iter36 : struct.crcSums) { - oprot.writeI32(_iter12); + oprot.writeI32(_iter36); } } } @@ -6675,13 +9936,13 @@ public class ImageServer { } if (incoming.get(2)) { { - org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.crcSums = new ArrayList<Integer>(_list13.size); - for (int _i14 = 0; _i14 < _list13.size; ++_i14) + org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.crcSums = new ArrayList<Integer>(_list37.size); + for (int _i38 = 0; _i38 < _list37.size; ++_i38) { - int _elem15; - _elem15 = iprot.readI32(); - struct.crcSums.add(_elem15); + int _elem39; + _elem39 = iprot.readI32(); + struct.crcSums.add(_elem39); } } struct.setCrcSumsIsSet(true); @@ -7437,7 +10698,7 @@ public class ImageServer { static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SERVER_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("serverSessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "ID"))); tmpMap.put(_Fields.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); metaDataMap = Collections.unmodifiableMap(tmpMap); @@ -8373,4 +11634,919 @@ public class ImageServer { } + public static class publishUser_args implements org.apache.thrift.TBase<publishUser_args, publishUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<publishUser_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("publishUser_args"); + + private static final org.apache.thrift.protocol.TField SERVER_SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("serverSessionId", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new publishUser_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new publishUser_argsTupleSchemeFactory()); + } + + public String serverSessionId; // required + public UserInfo user; // 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 { + SERVER_SESSION_ID((short)1, "serverSessionId"), + USER((short)2, "user"); + + 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: // SERVER_SESSION_ID + return SERVER_SESSION_ID; + case 2: // USER + return USER; + 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.SERVER_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("serverSessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "ID"))); + tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserInfo.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(publishUser_args.class, metaDataMap); + } + + public publishUser_args() { + } + + public publishUser_args( + String serverSessionId, + UserInfo user) + { + this(); + this.serverSessionId = serverSessionId; + this.user = user; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public publishUser_args(publishUser_args other) { + if (other.isSetServerSessionId()) { + this.serverSessionId = other.serverSessionId; + } + if (other.isSetUser()) { + this.user = new UserInfo(other.user); + } + } + + public publishUser_args deepCopy() { + return new publishUser_args(this); + } + + @Override + public void clear() { + this.serverSessionId = null; + this.user = null; + } + + public String getServerSessionId() { + return this.serverSessionId; + } + + public publishUser_args setServerSessionId(String serverSessionId) { + this.serverSessionId = serverSessionId; + return this; + } + + public void unsetServerSessionId() { + this.serverSessionId = null; + } + + /** Returns true if field serverSessionId is set (has been assigned a value) and false otherwise */ + public boolean isSetServerSessionId() { + return this.serverSessionId != null; + } + + public void setServerSessionIdIsSet(boolean value) { + if (!value) { + this.serverSessionId = null; + } + } + + public UserInfo getUser() { + return this.user; + } + + public publishUser_args setUser(UserInfo user) { + this.user = user; + return this; + } + + public void unsetUser() { + this.user = null; + } + + /** Returns true if field user is set (has been assigned a value) and false otherwise */ + public boolean isSetUser() { + return this.user != null; + } + + public void setUserIsSet(boolean value) { + if (!value) { + this.user = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SERVER_SESSION_ID: + if (value == null) { + unsetServerSessionId(); + } else { + setServerSessionId((String)value); + } + break; + + case USER: + if (value == null) { + unsetUser(); + } else { + setUser((UserInfo)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SERVER_SESSION_ID: + return getServerSessionId(); + + case USER: + return getUser(); + + } + 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 SERVER_SESSION_ID: + return isSetServerSessionId(); + case USER: + return isSetUser(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof publishUser_args) + return this.equals((publishUser_args)that); + return false; + } + + public boolean equals(publishUser_args that) { + if (that == null) + return false; + + boolean this_present_serverSessionId = true && this.isSetServerSessionId(); + boolean that_present_serverSessionId = true && that.isSetServerSessionId(); + if (this_present_serverSessionId || that_present_serverSessionId) { + if (!(this_present_serverSessionId && that_present_serverSessionId)) + return false; + if (!this.serverSessionId.equals(that.serverSessionId)) + return false; + } + + boolean this_present_user = true && this.isSetUser(); + boolean that_present_user = true && that.isSetUser(); + if (this_present_user || that_present_user) { + if (!(this_present_user && that_present_user)) + return false; + if (!this.user.equals(that.user)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(publishUser_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetServerSessionId()).compareTo(other.isSetServerSessionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerSessionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverSessionId, other.serverSessionId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUser()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); + 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("publishUser_args("); + boolean first = true; + + sb.append("serverSessionId:"); + if (this.serverSessionId == null) { + sb.append("null"); + } else { + sb.append(this.serverSessionId); + } + first = false; + if (!first) sb.append(", "); + sb.append("user:"); + if (this.user == null) { + sb.append("null"); + } else { + sb.append(this.user); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (user != null) { + user.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 publishUser_argsStandardSchemeFactory implements SchemeFactory { + public publishUser_argsStandardScheme getScheme() { + return new publishUser_argsStandardScheme(); + } + } + + private static class publishUser_argsStandardScheme extends StandardScheme<publishUser_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, publishUser_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: // SERVER_SESSION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.serverSessionId = iprot.readString(); + struct.setServerSessionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USER + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.user = new UserInfo(); + struct.user.read(iprot); + struct.setUserIsSet(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, publishUser_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.serverSessionId != null) { + oprot.writeFieldBegin(SERVER_SESSION_ID_FIELD_DESC); + oprot.writeString(struct.serverSessionId); + oprot.writeFieldEnd(); + } + if (struct.user != null) { + oprot.writeFieldBegin(USER_FIELD_DESC); + struct.user.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class publishUser_argsTupleSchemeFactory implements SchemeFactory { + public publishUser_argsTupleScheme getScheme() { + return new publishUser_argsTupleScheme(); + } + } + + private static class publishUser_argsTupleScheme extends TupleScheme<publishUser_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, publishUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetServerSessionId()) { + optionals.set(0); + } + if (struct.isSetUser()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetServerSessionId()) { + oprot.writeString(struct.serverSessionId); + } + if (struct.isSetUser()) { + struct.user.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, publishUser_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.serverSessionId = iprot.readString(); + struct.setServerSessionIdIsSet(true); + } + if (incoming.get(1)) { + struct.user = new UserInfo(); + struct.user.read(iprot); + struct.setUserIsSet(true); + } + } + } + + } + + public static class publishUser_result implements org.apache.thrift.TBase<publishUser_result, publishUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<publishUser_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("publishUser_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 publishUser_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new publishUser_resultTupleSchemeFactory()); + } + + public boolean success; // required + public AuthorizationException failure; // 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 { + SUCCESS((short)0, "success"), + FAILURE((short)1, "failure"); + + 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; + case 1: // FAILURE + return FAILURE; + 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 __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.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.BOOL))); + tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(publishUser_result.class, metaDataMap); + } + + public publishUser_result() { + } + + public publishUser_result( + boolean success, + AuthorizationException failure) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.failure = failure; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public publishUser_result(publishUser_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetFailure()) { + this.failure = new AuthorizationException(other.failure); + } + } + + public publishUser_result deepCopy() { + return new publishUser_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.failure = null; + } + + public boolean isSuccess() { + return this.success; + } + + public publishUser_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public AuthorizationException getFailure() { + return this.failure; + } + + public publishUser_result setFailure(AuthorizationException failure) { + this.failure = failure; + return this; + } + + public void unsetFailure() { + this.failure = null; + } + + /** Returns true if field failure is set (has been assigned a value) and false otherwise */ + public boolean isSetFailure() { + return this.failure != null; + } + + public void setFailureIsSet(boolean value) { + if (!value) { + this.failure = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case FAILURE: + if (value == null) { + unsetFailure(); + } else { + setFailure((AuthorizationException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + case FAILURE: + return getFailure(); + + } + 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(); + case FAILURE: + return isSetFailure(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof publishUser_result) + return this.equals((publishUser_result)that); + return false; + } + + public boolean equals(publishUser_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_failure = true && this.isSetFailure(); + boolean that_present_failure = true && that.isSetFailure(); + if (this_present_failure || that_present_failure) { + if (!(this_present_failure && that_present_failure)) + return false; + if (!this.failure.equals(that.failure)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(publishUser_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; + } + } + lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFailure()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure); + 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("publishUser_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("failure:"); + if (this.failure == null) { + sb.append("null"); + } else { + sb.append(this.failure); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class publishUser_resultStandardSchemeFactory implements SchemeFactory { + public publishUser_resultStandardScheme getScheme() { + return new publishUser_resultStandardScheme(); + } + } + + private static class publishUser_resultStandardScheme extends StandardScheme<publishUser_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, publishUser_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.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // FAILURE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.failure = new AuthorizationException(); + struct.failure.read(iprot); + struct.setFailureIsSet(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, publishUser_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.failure != null) { + oprot.writeFieldBegin(FAILURE_FIELD_DESC); + struct.failure.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class publishUser_resultTupleSchemeFactory implements SchemeFactory { + public publishUser_resultTupleScheme getScheme() { + return new publishUser_resultTupleScheme(); + } + } + + private static class publishUser_resultTupleScheme extends TupleScheme<publishUser_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, publishUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetFailure()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetFailure()) { + struct.failure.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, publishUser_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.failure = new AuthorizationException(); + struct.failure.read(iprot); + struct.setFailureIsSet(true); + } + } + } + + } + } diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationException.java b/src/main/java/org/openslx/imagemaster/thrift/iface/OrganizationData.java index 69c29b7..074d582 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationException.java +++ b/src/main/java/org/openslx/imagemaster/thrift/iface/OrganizationData.java @@ -32,33 +32,25 @@ import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class ServerAuthenticationException extends TException implements org.apache.thrift.TBase<ServerAuthenticationException, ServerAuthenticationException._Fields>, java.io.Serializable, Cloneable, Comparable<ServerAuthenticationException> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ServerAuthenticationException"); +public class OrganizationData implements org.apache.thrift.TBase<OrganizationData, OrganizationData._Fields>, java.io.Serializable, Cloneable, Comparable<OrganizationData> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OrganizationData"); - private static final org.apache.thrift.protocol.TField NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("number", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2); + 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)1); + private static final org.apache.thrift.protocol.TField DISPLAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("displayName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new ServerAuthenticationExceptionStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ServerAuthenticationExceptionTupleSchemeFactory()); + schemes.put(StandardScheme.class, new OrganizationDataStandardSchemeFactory()); + schemes.put(TupleScheme.class, new OrganizationDataTupleSchemeFactory()); } - /** - * - * @see ServerAuthenticationError - */ - public ServerAuthenticationError number; // required - public String message; // required + public String organizationId; // required + public String displayName; // 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 { - /** - * - * @see ServerAuthenticationError - */ - NUMBER((short)1, "number"), - MESSAGE((short)2, "message"); + ORGANIZATION_ID((short)1, "organizationId"), + DISPLAY_NAME((short)2, "displayName"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -73,10 +65,10 @@ public class ServerAuthenticationException extends TException implements org.apa */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // NUMBER - return NUMBER; - case 2: // MESSAGE - return MESSAGE; + case 1: // ORGANIZATION_ID + return ORGANIZATION_ID; + case 2: // DISPLAY_NAME + return DISPLAY_NAME; default: return null; } @@ -120,119 +112,111 @@ public class ServerAuthenticationException extends TException implements org.apa 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.NUMBER, new org.apache.thrift.meta_data.FieldMetaData("number", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ServerAuthenticationError.class))); - tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + 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))); + tmpMap.put(_Fields.DISPLAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("displayName", 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(ServerAuthenticationException.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OrganizationData.class, metaDataMap); } - public ServerAuthenticationException() { + public OrganizationData() { } - public ServerAuthenticationException( - ServerAuthenticationError number, - String message) + public OrganizationData( + String organizationId, + String displayName) { this(); - this.number = number; - this.message = message; + this.organizationId = organizationId; + this.displayName = displayName; } /** * Performs a deep copy on <i>other</i>. */ - public ServerAuthenticationException(ServerAuthenticationException other) { - if (other.isSetNumber()) { - this.number = other.number; + public OrganizationData(OrganizationData other) { + if (other.isSetOrganizationId()) { + this.organizationId = other.organizationId; } - if (other.isSetMessage()) { - this.message = other.message; + if (other.isSetDisplayName()) { + this.displayName = other.displayName; } } - public ServerAuthenticationException deepCopy() { - return new ServerAuthenticationException(this); + public OrganizationData deepCopy() { + return new OrganizationData(this); } @Override public void clear() { - this.number = null; - this.message = null; + this.organizationId = null; + this.displayName = null; } - /** - * - * @see ServerAuthenticationError - */ - public ServerAuthenticationError getNumber() { - return this.number; + public String getOrganizationId() { + return this.organizationId; } - /** - * - * @see ServerAuthenticationError - */ - public ServerAuthenticationException setNumber(ServerAuthenticationError number) { - this.number = number; + public OrganizationData setOrganizationId(String organizationId) { + this.organizationId = organizationId; return this; } - public void unsetNumber() { - this.number = null; + public void unsetOrganizationId() { + this.organizationId = null; } - /** Returns true if field number is set (has been assigned a value) and false otherwise */ - public boolean isSetNumber() { - return this.number != 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 setNumberIsSet(boolean value) { + public void setOrganizationIdIsSet(boolean value) { if (!value) { - this.number = null; + this.organizationId = null; } } - public String getMessage() { - return this.message; + public String getDisplayName() { + return this.displayName; } - public ServerAuthenticationException setMessage(String message) { - this.message = message; + public OrganizationData setDisplayName(String displayName) { + this.displayName = displayName; return this; } - public void unsetMessage() { - this.message = null; + public void unsetDisplayName() { + this.displayName = null; } - /** Returns true if field message is set (has been assigned a value) and false otherwise */ - public boolean isSetMessage() { - return this.message != null; + /** Returns true if field displayName is set (has been assigned a value) and false otherwise */ + public boolean isSetDisplayName() { + return this.displayName != null; } - public void setMessageIsSet(boolean value) { + public void setDisplayNameIsSet(boolean value) { if (!value) { - this.message = null; + this.displayName = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case NUMBER: + case ORGANIZATION_ID: if (value == null) { - unsetNumber(); + unsetOrganizationId(); } else { - setNumber((ServerAuthenticationError)value); + setOrganizationId((String)value); } break; - case MESSAGE: + case DISPLAY_NAME: if (value == null) { - unsetMessage(); + unsetDisplayName(); } else { - setMessage((String)value); + setDisplayName((String)value); } break; @@ -241,11 +225,11 @@ public class ServerAuthenticationException extends TException implements org.apa public Object getFieldValue(_Fields field) { switch (field) { - case NUMBER: - return getNumber(); + case ORGANIZATION_ID: + return getOrganizationId(); - case MESSAGE: - return getMessage(); + case DISPLAY_NAME: + return getDisplayName(); } throw new IllegalStateException(); @@ -258,10 +242,10 @@ public class ServerAuthenticationException extends TException implements org.apa } switch (field) { - case NUMBER: - return isSetNumber(); - case MESSAGE: - return isSetMessage(); + case ORGANIZATION_ID: + return isSetOrganizationId(); + case DISPLAY_NAME: + return isSetDisplayName(); } throw new IllegalStateException(); } @@ -270,30 +254,30 @@ public class ServerAuthenticationException extends TException implements org.apa public boolean equals(Object that) { if (that == null) return false; - if (that instanceof ServerAuthenticationException) - return this.equals((ServerAuthenticationException)that); + if (that instanceof OrganizationData) + return this.equals((OrganizationData)that); return false; } - public boolean equals(ServerAuthenticationException that) { + public boolean equals(OrganizationData that) { if (that == null) return false; - boolean this_present_number = true && this.isSetNumber(); - boolean that_present_number = true && that.isSetNumber(); - if (this_present_number || that_present_number) { - if (!(this_present_number && that_present_number)) + 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.number.equals(that.number)) + if (!this.organizationId.equals(that.organizationId)) return false; } - boolean this_present_message = true && this.isSetMessage(); - boolean that_present_message = true && that.isSetMessage(); - if (this_present_message || that_present_message) { - if (!(this_present_message && that_present_message)) + boolean this_present_displayName = true && this.isSetDisplayName(); + boolean that_present_displayName = true && that.isSetDisplayName(); + if (this_present_displayName || that_present_displayName) { + if (!(this_present_displayName && that_present_displayName)) return false; - if (!this.message.equals(that.message)) + if (!this.displayName.equals(that.displayName)) return false; } @@ -306,29 +290,29 @@ public class ServerAuthenticationException extends TException implements org.apa } @Override - public int compareTo(ServerAuthenticationException other) { + public int compareTo(OrganizationData other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetNumber()).compareTo(other.isSetNumber()); + lastComparison = Boolean.valueOf(isSetOrganizationId()).compareTo(other.isSetOrganizationId()); if (lastComparison != 0) { return lastComparison; } - if (isSetNumber()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.number, other.number); + if (isSetOrganizationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organizationId, other.organizationId); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + lastComparison = Boolean.valueOf(isSetDisplayName()).compareTo(other.isSetDisplayName()); if (lastComparison != 0) { return lastComparison; } - if (isSetMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (isSetDisplayName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.displayName, other.displayName); if (lastComparison != 0) { return lastComparison; } @@ -350,22 +334,22 @@ public class ServerAuthenticationException extends TException implements org.apa @Override public String toString() { - StringBuilder sb = new StringBuilder("ServerAuthenticationException("); + StringBuilder sb = new StringBuilder("OrganizationData("); boolean first = true; - sb.append("number:"); - if (this.number == null) { + sb.append("organizationId:"); + if (this.organizationId == null) { sb.append("null"); } else { - sb.append(this.number); + sb.append(this.organizationId); } first = false; if (!first) sb.append(", "); - sb.append("message:"); - if (this.message == null) { + sb.append("displayName:"); + if (this.displayName == null) { sb.append("null"); } else { - sb.append(this.message); + sb.append(this.displayName); } first = false; sb.append(")"); @@ -393,15 +377,15 @@ public class ServerAuthenticationException extends TException implements org.apa } } - private static class ServerAuthenticationExceptionStandardSchemeFactory implements SchemeFactory { - public ServerAuthenticationExceptionStandardScheme getScheme() { - return new ServerAuthenticationExceptionStandardScheme(); + private static class OrganizationDataStandardSchemeFactory implements SchemeFactory { + public OrganizationDataStandardScheme getScheme() { + return new OrganizationDataStandardScheme(); } } - private static class ServerAuthenticationExceptionStandardScheme extends StandardScheme<ServerAuthenticationException> { + private static class OrganizationDataStandardScheme extends StandardScheme<OrganizationData> { - public void read(org.apache.thrift.protocol.TProtocol iprot, ServerAuthenticationException struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, OrganizationData struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -411,18 +395,18 @@ public class ServerAuthenticationException extends TException implements org.apa break; } switch (schemeField.id) { - case 1: // NUMBER - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.number = ServerAuthenticationError.findByValue(iprot.readI32()); - struct.setNumberIsSet(true); + case 1: // ORGANIZATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // MESSAGE + case 2: // DISPLAY_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); + struct.displayName = iprot.readString(); + struct.setDisplayNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -438,18 +422,18 @@ public class ServerAuthenticationException extends TException implements org.apa struct.validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot, ServerAuthenticationException struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, OrganizationData struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.number != null) { - oprot.writeFieldBegin(NUMBER_FIELD_DESC); - oprot.writeI32(struct.number.getValue()); + if (struct.organizationId != null) { + oprot.writeFieldBegin(ORGANIZATION_ID_FIELD_DESC); + oprot.writeString(struct.organizationId); oprot.writeFieldEnd(); } - if (struct.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(struct.message); + if (struct.displayName != null) { + oprot.writeFieldBegin(DISPLAY_NAME_FIELD_DESC); + oprot.writeString(struct.displayName); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -458,44 +442,44 @@ public class ServerAuthenticationException extends TException implements org.apa } - private static class ServerAuthenticationExceptionTupleSchemeFactory implements SchemeFactory { - public ServerAuthenticationExceptionTupleScheme getScheme() { - return new ServerAuthenticationExceptionTupleScheme(); + private static class OrganizationDataTupleSchemeFactory implements SchemeFactory { + public OrganizationDataTupleScheme getScheme() { + return new OrganizationDataTupleScheme(); } } - private static class ServerAuthenticationExceptionTupleScheme extends TupleScheme<ServerAuthenticationException> { + private static class OrganizationDataTupleScheme extends TupleScheme<OrganizationData> { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ServerAuthenticationException struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, OrganizationData struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetNumber()) { + if (struct.isSetOrganizationId()) { optionals.set(0); } - if (struct.isSetMessage()) { + if (struct.isSetDisplayName()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); - if (struct.isSetNumber()) { - oprot.writeI32(struct.number.getValue()); + if (struct.isSetOrganizationId()) { + oprot.writeString(struct.organizationId); } - if (struct.isSetMessage()) { - oprot.writeString(struct.message); + if (struct.isSetDisplayName()) { + oprot.writeString(struct.displayName); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ServerAuthenticationException struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, OrganizationData struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { - struct.number = ServerAuthenticationError.findByValue(iprot.readI32()); - struct.setNumberIsSet(true); + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); } if (incoming.get(1)) { - struct.message = iprot.readString(); - struct.setMessageIsSet(true); + struct.displayName = iprot.readString(); + struct.setDisplayNameIsSet(true); } } } diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationError.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationError.java deleted file mode 100644 index 8c3f1d3..0000000 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/ServerAuthenticationError.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.1) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.openslx.imagemaster.thrift.iface; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum ServerAuthenticationError implements org.apache.thrift.TEnum { - GENERIC_ERROR(0), - INVALID_ORGANIZATION(1), - INVALID_KEY(2), - CHALLENGE_FAILED(3), - BANNED_NETWORK(4); - - private final int value; - - private ServerAuthenticationError(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static ServerAuthenticationError findByValue(int value) { - switch (value) { - case 0: - return GENERIC_ERROR; - case 1: - return INVALID_ORGANIZATION; - case 2: - return INVALID_KEY; - case 3: - return CHALLENGE_FAILED; - case 4: - return BANNED_NETWORK; - default: - return null; - } - } -} diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/UserInfo.java b/src/main/java/org/openslx/imagemaster/thrift/iface/UserInfo.java index 67f9340..2d9581b 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/UserInfo.java +++ b/src/main/java/org/openslx/imagemaster/thrift/iface/UserInfo.java @@ -39,6 +39,7 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie private static final org.apache.thrift.protocol.TField FIRST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField LAST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastName", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField E_MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("eMail", org.apache.thrift.protocol.TType.STRING, (short)4); + 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)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -50,13 +51,15 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie public String firstName; // required public String lastName; // required public String eMail; // required + public String organizationId; // 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 { USER_ID((short)1, "userId"), FIRST_NAME((short)2, "firstName"), LAST_NAME((short)3, "lastName"), - E_MAIL((short)4, "eMail"); + E_MAIL((short)4, "eMail"), + ORGANIZATION_ID((short)5, "organizationId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -79,6 +82,8 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie return LAST_NAME; case 4: // E_MAIL return E_MAIL; + case 5: // ORGANIZATION_ID + return ORGANIZATION_ID; default: return null; } @@ -130,6 +135,8 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.E_MAIL, new org.apache.thrift.meta_data.FieldMetaData("eMail", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + 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))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserInfo.class, metaDataMap); } @@ -141,13 +148,15 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie String userId, String firstName, String lastName, - String eMail) + String eMail, + String organizationId) { this(); this.userId = userId; this.firstName = firstName; this.lastName = lastName; this.eMail = eMail; + this.organizationId = organizationId; } /** @@ -166,6 +175,9 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie if (other.isSetEMail()) { this.eMail = other.eMail; } + if (other.isSetOrganizationId()) { + this.organizationId = other.organizationId; + } } public UserInfo deepCopy() { @@ -178,6 +190,7 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie this.firstName = null; this.lastName = null; this.eMail = null; + this.organizationId = null; } public String getUserId() { @@ -276,6 +289,30 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie } } + public String getOrganizationId() { + return this.organizationId; + } + + public UserInfo 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 void setFieldValue(_Fields field, Object value) { switch (field) { case USER_ID: @@ -310,6 +347,14 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie } break; + case ORGANIZATION_ID: + if (value == null) { + unsetOrganizationId(); + } else { + setOrganizationId((String)value); + } + break; + } } @@ -327,6 +372,9 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie case E_MAIL: return getEMail(); + case ORGANIZATION_ID: + return getOrganizationId(); + } throw new IllegalStateException(); } @@ -346,6 +394,8 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie return isSetLastName(); case E_MAIL: return isSetEMail(); + case ORGANIZATION_ID: + return isSetOrganizationId(); } throw new IllegalStateException(); } @@ -399,6 +449,15 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie 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; + } + return true; } @@ -455,6 +514,16 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie return lastComparison; } } + lastComparison = Boolean.valueOf(isSetOrganizationId()).compareTo(other.isSetOrganizationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOrganizationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organizationId, other.organizationId); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -506,6 +575,14 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie sb.append(this.eMail); } first = false; + if (!first) sb.append(", "); + sb.append("organizationId:"); + if (this.organizationId == null) { + sb.append("null"); + } else { + sb.append(this.organizationId); + } + first = false; sb.append(")"); return sb.toString(); } @@ -581,6 +658,14 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 5: // ORGANIZATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -616,6 +701,11 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie oprot.writeString(struct.eMail); oprot.writeFieldEnd(); } + if (struct.organizationId != null) { + oprot.writeFieldBegin(ORGANIZATION_ID_FIELD_DESC); + oprot.writeString(struct.organizationId); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -646,7 +736,10 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie if (struct.isSetEMail()) { optionals.set(3); } - oprot.writeBitSet(optionals, 4); + if (struct.isSetOrganizationId()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetUserId()) { oprot.writeString(struct.userId); } @@ -659,12 +752,15 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie if (struct.isSetEMail()) { oprot.writeString(struct.eMail); } + if (struct.isSetOrganizationId()) { + oprot.writeString(struct.organizationId); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, UserInfo struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.userId = iprot.readString(); struct.setUserIdIsSet(true); @@ -681,6 +777,10 @@ public class UserInfo implements org.apache.thrift.TBase<UserInfo, UserInfo._Fie struct.eMail = iprot.readString(); struct.setEMailIsSet(true); } + if (incoming.get(4)) { + struct.organizationId = iprot.readString(); + struct.setOrganizationIdIsSet(true); + } } } diff --git a/src/main/thrift/imagemaster.thrift b/src/main/thrift/imagemaster.thrift index c6bd3cb..1a28c43 100644 --- a/src/main/thrift/imagemaster.thrift +++ b/src/main/thrift/imagemaster.thrift @@ -20,11 +20,6 @@ enum AuthenticationError { GENERIC_ERROR, INVALID_CREDENTIALS, ACCOUNT_SUSPENDED, - BANNED_NETWORK -} - -enum ServerAuthenticationError { - GENERIC_ERROR, INVALID_ORGANIZATION, INVALID_KEY, CHALLENGE_FAILED, @@ -57,11 +52,6 @@ exception AuthenticationException { exception InvalidTokenException { } -exception ServerAuthenticationException { - 1: ServerAuthenticationError number, - 2: string message -} - exception ImageDataException { 1: ImageDataError number, 2: string message @@ -81,7 +71,13 @@ struct UserInfo { 1: string userId, 2: string firstName, 3: string lastName, - 4: string eMail + 4: string eMail, + 5: string organizationId +} + +struct OrganizationData { + 1: string organizationId, + 2: string displayName, } struct SessionData { @@ -107,35 +103,49 @@ struct ServerSessionData { struct ImageData { 1: UUID uuid, - 2: i32 imageVersion, - 3: string imageName, - 4: UnixTimestamp imageCreateTime, - 5: UnixTimestamp imageUpdateTime, - 6: string imageOwner, - 7: string contentOperatingSystem, - 8: bool statusIsValid, - 9: bool statusIsDeleted, - 10: string imageShortDescription, - 11: string imageLongDescription, - 12: i64 fileSize + 2: i32 revision, + 3: string title, + 4: UnixTimestamp createTime, + 5: UnixTimestamp updateTime, + 6: string ownerLogin, + 7: string operatingSystem, + 8: bool isValid, + 9: bool isDeleted, + // 10: deleted, do not reuse! + 11: string description, + 12: i64 fileSize, } service ImageServer { +/* + * Client calls + */ bool ping(), - SessionData authenticate(1:string username, 2:string password) throws (1:AuthenticationException failure), + SessionData authenticate(1:string login, 2:string password) throws (1:AuthenticationException failure), + + list<OrganizationData> getOrganizations(), + + list<UserInfo> findUser(1:ID sessionId, 2:string organizationId, 3:string searchTerm) throws (1:AuthorizationException failure), + + list<ImageData> getPublicImages(1:ID sessionId, 2:i32 page) throws (1:AuthorizationException failure), +/* + * Server calls + */ UserInfo getUserFromToken(1:Token token) throws (1:InvalidTokenException failure), - binary startServerAuthentication(1:string organization) throws (1: ServerAuthenticationException failure), - bool isServerAuthenticated(1:string serverSessionId), - ServerSessionData serverAuthenticate(1:string organization, 2:binary challengeResponse) throws (1:ServerAuthenticationException failure), + binary startServerAuthentication(1:string organization) throws (1: AuthenticationException failure), + + ServerSessionData serverAuthenticate(1:string organizationId, 2:binary challengeResponse) throws (1:AuthenticationException failure), + + UploadData submitImage(1:ID serverSessionId, 2:ImageData imageDescription, 3:list<i32> crcSums) throws (1:AuthorizationException failure, 2: ImageDataException failure2, 3: UploadException failure3), - UploadData submitImage(1:string serverSessionId, 2:ImageData imageDescription, 3:list<i32> crcSums) throws (1:AuthorizationException failure, 2: ImageDataException failure2, 3: UploadException failure3), + DownloadData getImage(2:ID serverSessionId, 1:UUID uuid) throws (1:AuthorizationException failure, 2: ImageDataException failure2), - DownloadData getImage(2:string serverSessionId, 1:UUID uuid) throws (1:AuthorizationException failure, 2: ImageDataException failure2), + bool publishUser(1:ID serverSessionId, 2:UserInfo user) throws (1:AuthorizationException failure), } |
