From 8f0b1e666e98035297b95a1a8224c77d78edff36 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Tue, 14 Oct 2014 18:54:28 +0200 Subject: Diverse Änderungen für Berechtigungen --- .../src/main/java/server/generated/Server.java | 998 +++++++++++++++++++++ 1 file changed, 998 insertions(+) (limited to 'dozentenmodulserver/src/main/java/server/generated/Server.java') diff --git a/dozentenmodulserver/src/main/java/server/generated/Server.java b/dozentenmodulserver/src/main/java/server/generated/Server.java index 424bd869..364331a5 100644 --- a/dozentenmodulserver/src/main/java/server/generated/Server.java +++ b/dozentenmodulserver/src/main/java/server/generated/Server.java @@ -90,6 +90,8 @@ public class Server { public boolean writeAdditionalImageRights(String imageName, String userID, boolean isRead, boolean isWrite, boolean isLinkAllowed, boolean isAdmin) throws org.apache.thrift.TException; + public List getPermissionForUserAndImage(String userID, String imageID) throws org.apache.thrift.TException; + } public interface AsyncIface { @@ -148,6 +150,8 @@ public class Server { public void writeAdditionalImageRights(String imageName, String userID, boolean isRead, boolean isWrite, boolean isLinkAllowed, boolean isAdmin, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getPermissionForUserAndImage(String userID, String imageID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -875,6 +879,30 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeAdditionalImageRights failed: unknown result"); } + public List getPermissionForUserAndImage(String userID, String imageID) throws org.apache.thrift.TException + { + send_getPermissionForUserAndImage(userID, imageID); + return recv_getPermissionForUserAndImage(); + } + + public void send_getPermissionForUserAndImage(String userID, String imageID) throws org.apache.thrift.TException + { + getPermissionForUserAndImage_args args = new getPermissionForUserAndImage_args(); + args.setUserID(userID); + args.setImageID(imageID); + sendBase("getPermissionForUserAndImage", args); + } + + public List recv_getPermissionForUserAndImage() throws org.apache.thrift.TException + { + getPermissionForUserAndImage_result result = new getPermissionForUserAndImage_result(); + receiveBase(result, "getPermissionForUserAndImage"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPermissionForUserAndImage 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 { @@ -2009,6 +2037,41 @@ public class Server { } } + public void getPermissionForUserAndImage(String userID, String imageID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getPermissionForUserAndImage_call method_call = new getPermissionForUserAndImage_call(userID, imageID, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getPermissionForUserAndImage_call extends org.apache.thrift.async.TAsyncMethodCall { + private String userID; + private String imageID; + public getPermissionForUserAndImage_call(String userID, String imageID, 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.userID = userID; + this.imageID = imageID; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPermissionForUserAndImage", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getPermissionForUserAndImage_args args = new getPermissionForUserAndImage_args(); + args.setUserID(userID); + args.setImageID(imageID); + args.write(prot); + prot.writeMessageEnd(); + } + + public List 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_getPermissionForUserAndImage(); + } + } + } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { @@ -2049,6 +2112,7 @@ public class Server { processMap.put("writeLectureRights", new writeLectureRights()); processMap.put("getAllOtherSatelliteUsers", new getAllOtherSatelliteUsers()); processMap.put("writeAdditionalImageRights", new writeAdditionalImageRights()); + processMap.put("getPermissionForUserAndImage", new getPermissionForUserAndImage()); return processMap; } @@ -2607,6 +2671,26 @@ public class Server { } } + public static class getPermissionForUserAndImage extends org.apache.thrift.ProcessFunction { + public getPermissionForUserAndImage() { + super("getPermissionForUserAndImage"); + } + + public getPermissionForUserAndImage_args getEmptyArgsInstance() { + return new getPermissionForUserAndImage_args(); + } + + protected boolean isOneway() { + return false; + } + + public getPermissionForUserAndImage_result getResult(I iface, getPermissionForUserAndImage_args args) throws org.apache.thrift.TException { + getPermissionForUserAndImage_result result = new getPermissionForUserAndImage_result(); + result.success = iface.getPermissionForUserAndImage(args.userID, args.imageID); + return result; + } + } + } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { @@ -2647,6 +2731,7 @@ public class Server { processMap.put("writeLectureRights", new writeLectureRights()); processMap.put("getAllOtherSatelliteUsers", new getAllOtherSatelliteUsers()); processMap.put("writeAdditionalImageRights", new writeAdditionalImageRights()); + processMap.put("getPermissionForUserAndImage", new getPermissionForUserAndImage()); return processMap; } @@ -4042,6 +4127,57 @@ public class Server { } } + public static class getPermissionForUserAndImage extends org.apache.thrift.AsyncProcessFunction> { + public getPermissionForUserAndImage() { + super("getPermissionForUserAndImage"); + } + + public getPermissionForUserAndImage_args getEmptyArgsInstance() { + return new getPermissionForUserAndImage_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + getPermissionForUserAndImage_result result = new getPermissionForUserAndImage_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; + getPermissionForUserAndImage_result result = new getPermissionForUserAndImage_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, getPermissionForUserAndImage_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.getPermissionForUserAndImage(args.userID, args.imageID,resultHandler); + } + } + } public static class getFtpUser_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -31957,4 +32093,866 @@ public class Server { } + public static class getPermissionForUserAndImage_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPermissionForUserAndImage_args"); + + private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userID", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField IMAGE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageID", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPermissionForUserAndImage_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPermissionForUserAndImage_argsTupleSchemeFactory()); + } + + public String userID; // required + public String imageID; // 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"), + IMAGE_ID((short)2, "imageID"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // USER_ID + return USER_ID; + case 2: // IMAGE_ID + return IMAGE_ID; + 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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userID", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IMAGE_ID, new org.apache.thrift.meta_data.FieldMetaData("imageID", 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(getPermissionForUserAndImage_args.class, metaDataMap); + } + + public getPermissionForUserAndImage_args() { + } + + public getPermissionForUserAndImage_args( + String userID, + String imageID) + { + this(); + this.userID = userID; + this.imageID = imageID; + } + + /** + * Performs a deep copy on other. + */ + public getPermissionForUserAndImage_args(getPermissionForUserAndImage_args other) { + if (other.isSetUserID()) { + this.userID = other.userID; + } + if (other.isSetImageID()) { + this.imageID = other.imageID; + } + } + + public getPermissionForUserAndImage_args deepCopy() { + return new getPermissionForUserAndImage_args(this); + } + + @Override + public void clear() { + this.userID = null; + this.imageID = null; + } + + public String getUserID() { + return this.userID; + } + + public getPermissionForUserAndImage_args setUserID(String userID) { + this.userID = userID; + return this; + } + + public void unsetUserID() { + this.userID = null; + } + + /** Returns true if field userID is set (has been assigned a value) and false otherwise */ + public boolean isSetUserID() { + return this.userID != null; + } + + public void setUserIDIsSet(boolean value) { + if (!value) { + this.userID = null; + } + } + + public String getImageID() { + return this.imageID; + } + + public getPermissionForUserAndImage_args setImageID(String imageID) { + this.imageID = imageID; + return this; + } + + public void unsetImageID() { + this.imageID = null; + } + + /** Returns true if field imageID is set (has been assigned a value) and false otherwise */ + public boolean isSetImageID() { + return this.imageID != null; + } + + public void setImageIDIsSet(boolean value) { + if (!value) { + this.imageID = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER_ID: + if (value == null) { + unsetUserID(); + } else { + setUserID((String)value); + } + break; + + case IMAGE_ID: + if (value == null) { + unsetImageID(); + } else { + setImageID((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER_ID: + return getUserID(); + + case IMAGE_ID: + return getImageID(); + + } + 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 USER_ID: + return isSetUserID(); + case IMAGE_ID: + return isSetImageID(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPermissionForUserAndImage_args) + return this.equals((getPermissionForUserAndImage_args)that); + return false; + } + + public boolean equals(getPermissionForUserAndImage_args that) { + if (that == null) + return false; + + boolean this_present_userID = true && this.isSetUserID(); + boolean that_present_userID = true && that.isSetUserID(); + if (this_present_userID || that_present_userID) { + if (!(this_present_userID && that_present_userID)) + return false; + if (!this.userID.equals(that.userID)) + return false; + } + + boolean this_present_imageID = true && this.isSetImageID(); + boolean that_present_imageID = true && that.isSetImageID(); + if (this_present_imageID || that_present_imageID) { + if (!(this_present_imageID && that_present_imageID)) + return false; + if (!this.imageID.equals(that.imageID)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getPermissionForUserAndImage_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUserID()).compareTo(other.isSetUserID()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserID()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userID, other.userID); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageID()).compareTo(other.isSetImageID()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageID()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageID, other.imageID); + 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("getPermissionForUserAndImage_args("); + boolean first = true; + + sb.append("userID:"); + if (this.userID == null) { + sb.append("null"); + } else { + sb.append(this.userID); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageID:"); + if (this.imageID == null) { + sb.append("null"); + } else { + sb.append(this.imageID); + } + 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 getPermissionForUserAndImage_argsStandardSchemeFactory implements SchemeFactory { + public getPermissionForUserAndImage_argsStandardScheme getScheme() { + return new getPermissionForUserAndImage_argsStandardScheme(); + } + } + + private static class getPermissionForUserAndImage_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPermissionForUserAndImage_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: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userID = iprot.readString(); + struct.setUserIDIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IMAGE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageID = iprot.readString(); + struct.setImageIDIsSet(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, getPermissionForUserAndImage_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.userID != null) { + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeString(struct.userID); + oprot.writeFieldEnd(); + } + if (struct.imageID != null) { + oprot.writeFieldBegin(IMAGE_ID_FIELD_DESC); + oprot.writeString(struct.imageID); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPermissionForUserAndImage_argsTupleSchemeFactory implements SchemeFactory { + public getPermissionForUserAndImage_argsTupleScheme getScheme() { + return new getPermissionForUserAndImage_argsTupleScheme(); + } + } + + private static class getPermissionForUserAndImage_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPermissionForUserAndImage_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserID()) { + optionals.set(0); + } + if (struct.isSetImageID()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetUserID()) { + oprot.writeString(struct.userID); + } + if (struct.isSetImageID()) { + oprot.writeString(struct.imageID); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPermissionForUserAndImage_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.userID = iprot.readString(); + struct.setUserIDIsSet(true); + } + if (incoming.get(1)) { + struct.imageID = iprot.readString(); + struct.setImageIDIsSet(true); + } + } + } + + } + + public static class getPermissionForUserAndImage_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPermissionForUserAndImage_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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getPermissionForUserAndImage_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getPermissionForUserAndImage_resultTupleSchemeFactory()); + } + + public List 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Person.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPermissionForUserAndImage_result.class, metaDataMap); + } + + public getPermissionForUserAndImage_result() { + } + + public getPermissionForUserAndImage_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getPermissionForUserAndImage_result(getPermissionForUserAndImage_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(other.success.size()); + for (Person other_element : other.success) { + __this__success.add(new Person(other_element)); + } + this.success = __this__success; + } + } + + public getPermissionForUserAndImage_result deepCopy() { + return new getPermissionForUserAndImage_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Person elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public getPermissionForUserAndImage_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getPermissionForUserAndImage_result) + return this.equals((getPermissionForUserAndImage_result)that); + return false; + } + + public boolean equals(getPermissionForUserAndImage_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getPermissionForUserAndImage_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getPermissionForUserAndImage_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getPermissionForUserAndImage_resultStandardSchemeFactory implements SchemeFactory { + public getPermissionForUserAndImage_resultStandardScheme getScheme() { + return new getPermissionForUserAndImage_resultStandardScheme(); + } + } + + private static class getPermissionForUserAndImage_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getPermissionForUserAndImage_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.LIST) { + { + org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); + struct.success = new ArrayList(_list86.size); + for (int _i87 = 0; _i87 < _list86.size; ++_i87) + { + Person _elem88; + _elem88 = new Person(); + _elem88.read(iprot); + struct.success.add(_elem88); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getPermissionForUserAndImage_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 (Person _iter89 : struct.success) + { + _iter89.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getPermissionForUserAndImage_resultTupleSchemeFactory implements SchemeFactory { + public getPermissionForUserAndImage_resultTupleScheme getScheme() { + return new getPermissionForUserAndImage_resultTupleScheme(); + } + } + + private static class getPermissionForUserAndImage_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getPermissionForUserAndImage_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Person _iter90 : struct.success) + { + _iter90.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getPermissionForUserAndImage_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list91.size); + for (int _i92 = 0; _i92 < _list91.size; ++_i92) + { + Person _elem93; + _elem93 = new Person(); + _elem93.read(iprot); + struct.success.add(_elem93); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + } -- cgit v1.2.3-55-g7522