diff options
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java')
-rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java | 188 |
1 files changed, 173 insertions, 15 deletions
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 58a01db..059abf4 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java +++ b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2014-6-30") +@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2014-7-4") public class ImageServer { public interface Iface { @@ -51,7 +51,7 @@ public class ImageServer { public UploadInfos submitImage(String serverSessionId, ImageData imageDescription) throws AuthorizationException, ImageDataException, UploadException, org.apache.thrift.TException; - public DownloadInfos getImage(String uuid, String serverSessionId) throws AuthorizationException, ImageDataException, org.apache.thrift.TException; + public DownloadInfos getImage(String uuid, String serverSessionId, List<Integer> requestedBlocks) throws AuthorizationException, ImageDataException, org.apache.thrift.TException; } @@ -69,7 +69,7 @@ public class ImageServer { public void submitImage(String serverSessionId, ImageData imageDescription, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void getImage(String uuid, String serverSessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getImage(String uuid, String serverSessionId, List<Integer> requestedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } @@ -254,17 +254,18 @@ public class ImageServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "submitImage failed: unknown result"); } - public DownloadInfos getImage(String uuid, String serverSessionId) throws AuthorizationException, ImageDataException, org.apache.thrift.TException + public DownloadInfos getImage(String uuid, String serverSessionId, List<Integer> requestedBlocks) throws AuthorizationException, ImageDataException, org.apache.thrift.TException { - send_getImage(uuid, serverSessionId); + send_getImage(uuid, serverSessionId, requestedBlocks); return recv_getImage(); } - public void send_getImage(String uuid, String serverSessionId) throws org.apache.thrift.TException + public void send_getImage(String uuid, String serverSessionId, List<Integer> requestedBlocks) throws org.apache.thrift.TException { getImage_args args = new getImage_args(); args.setUuid(uuid); args.setServerSessionId(serverSessionId); + args.setRequestedBlocks(requestedBlocks); sendBase("getImage", args); } @@ -500,9 +501,9 @@ public class ImageServer { } } - public void getImage(String uuid, String serverSessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void getImage(String uuid, String serverSessionId, List<Integer> requestedBlocks, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - getImage_call method_call = new getImage_call(uuid, serverSessionId, resultHandler, this, ___protocolFactory, ___transport); + getImage_call method_call = new getImage_call(uuid, serverSessionId, requestedBlocks, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @@ -510,10 +511,12 @@ public class ImageServer { public static class getImage_call extends org.apache.thrift.async.TAsyncMethodCall { private String uuid; private String serverSessionId; - public getImage_call(String uuid, String serverSessionId, 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 { + private List<Integer> requestedBlocks; + public getImage_call(String uuid, String serverSessionId, List<Integer> requestedBlocks, 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.uuid = uuid; this.serverSessionId = serverSessionId; + this.requestedBlocks = requestedBlocks; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { @@ -521,6 +524,7 @@ public class ImageServer { getImage_args args = new getImage_args(); args.setUuid(uuid); args.setServerSessionId(serverSessionId); + args.setRequestedBlocks(requestedBlocks); args.write(prot); prot.writeMessageEnd(); } @@ -719,7 +723,7 @@ public class ImageServer { public getImage_result getResult(I iface, getImage_args args) throws org.apache.thrift.TException { getImage_result result = new getImage_result(); try { - result.success = iface.getImage(args.uuid, args.serverSessionId); + result.success = iface.getImage(args.uuid, args.serverSessionId, args.requestedBlocks); } catch (AuthorizationException failure) { result.failure = failure; } catch (ImageDataException failure2) { @@ -1157,7 +1161,7 @@ public class ImageServer { } public void start(I iface, getImage_args args, org.apache.thrift.async.AsyncMethodCallback<DownloadInfos> resultHandler) throws TException { - iface.getImage(args.uuid, args.serverSessionId,resultHandler); + iface.getImage(args.uuid, args.serverSessionId, args.requestedBlocks,resultHandler); } } @@ -6486,6 +6490,7 @@ public class ImageServer { 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 SERVER_SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("serverSessionId", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField REQUESTED_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("requestedBlocks", org.apache.thrift.protocol.TType.LIST, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -6495,11 +6500,13 @@ public class ImageServer { public String uuid; // required public String serverSessionId; // required + public List<Integer> requestedBlocks; // 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"), - SERVER_SESSION_ID((short)2, "serverSessionId"); + SERVER_SESSION_ID((short)2, "serverSessionId"), + REQUESTED_BLOCKS((short)3, "requestedBlocks"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -6518,6 +6525,8 @@ public class ImageServer { return UUID; case 2: // SERVER_SESSION_ID return SERVER_SESSION_ID; + case 3: // REQUESTED_BLOCKS + return REQUESTED_BLOCKS; default: return null; } @@ -6565,6 +6574,9 @@ public class ImageServer { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); 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))); + tmpMap.put(_Fields.REQUESTED_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("requestedBlocks", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImage_args.class, metaDataMap); } @@ -6574,11 +6586,13 @@ public class ImageServer { public getImage_args( String uuid, - String serverSessionId) + String serverSessionId, + List<Integer> requestedBlocks) { this(); this.uuid = uuid; this.serverSessionId = serverSessionId; + this.requestedBlocks = requestedBlocks; } /** @@ -6591,6 +6605,10 @@ public class ImageServer { if (other.isSetServerSessionId()) { this.serverSessionId = other.serverSessionId; } + if (other.isSetRequestedBlocks()) { + List<Integer> __this__requestedBlocks = new ArrayList<Integer>(other.requestedBlocks); + this.requestedBlocks = __this__requestedBlocks; + } } public getImage_args deepCopy() { @@ -6601,6 +6619,7 @@ public class ImageServer { public void clear() { this.uuid = null; this.serverSessionId = null; + this.requestedBlocks = null; } public String getUuid() { @@ -6651,6 +6670,45 @@ public class ImageServer { } } + public int getRequestedBlocksSize() { + return (this.requestedBlocks == null) ? 0 : this.requestedBlocks.size(); + } + + public java.util.Iterator<Integer> getRequestedBlocksIterator() { + return (this.requestedBlocks == null) ? null : this.requestedBlocks.iterator(); + } + + public void addToRequestedBlocks(int elem) { + if (this.requestedBlocks == null) { + this.requestedBlocks = new ArrayList<Integer>(); + } + this.requestedBlocks.add(elem); + } + + public List<Integer> getRequestedBlocks() { + return this.requestedBlocks; + } + + public getImage_args setRequestedBlocks(List<Integer> requestedBlocks) { + this.requestedBlocks = requestedBlocks; + return this; + } + + public void unsetRequestedBlocks() { + this.requestedBlocks = null; + } + + /** Returns true if field requestedBlocks is set (has been assigned a value) and false otherwise */ + public boolean isSetRequestedBlocks() { + return this.requestedBlocks != null; + } + + public void setRequestedBlocksIsSet(boolean value) { + if (!value) { + this.requestedBlocks = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case UUID: @@ -6669,6 +6727,14 @@ public class ImageServer { } break; + case REQUESTED_BLOCKS: + if (value == null) { + unsetRequestedBlocks(); + } else { + setRequestedBlocks((List<Integer>)value); + } + break; + } } @@ -6680,6 +6746,9 @@ public class ImageServer { case SERVER_SESSION_ID: return getServerSessionId(); + case REQUESTED_BLOCKS: + return getRequestedBlocks(); + } throw new IllegalStateException(); } @@ -6695,6 +6764,8 @@ public class ImageServer { return isSetUuid(); case SERVER_SESSION_ID: return isSetServerSessionId(); + case REQUESTED_BLOCKS: + return isSetRequestedBlocks(); } throw new IllegalStateException(); } @@ -6730,6 +6801,15 @@ public class ImageServer { return false; } + boolean this_present_requestedBlocks = true && this.isSetRequestedBlocks(); + boolean that_present_requestedBlocks = true && that.isSetRequestedBlocks(); + if (this_present_requestedBlocks || that_present_requestedBlocks) { + if (!(this_present_requestedBlocks && that_present_requestedBlocks)) + return false; + if (!this.requestedBlocks.equals(that.requestedBlocks)) + return false; + } + return true; } @@ -6747,6 +6827,11 @@ public class ImageServer { if (present_serverSessionId) list.add(serverSessionId); + boolean present_requestedBlocks = true && (isSetRequestedBlocks()); + list.add(present_requestedBlocks); + if (present_requestedBlocks) + list.add(requestedBlocks); + return list.hashCode(); } @@ -6778,6 +6863,16 @@ public class ImageServer { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetRequestedBlocks()).compareTo(other.isSetRequestedBlocks()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRequestedBlocks()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestedBlocks, other.requestedBlocks); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -6813,6 +6908,14 @@ public class ImageServer { sb.append(this.serverSessionId); } first = false; + if (!first) sb.append(", "); + sb.append("requestedBlocks:"); + if (this.requestedBlocks == null) { + sb.append("null"); + } else { + sb.append(this.requestedBlocks); + } + first = false; sb.append(")"); return sb.toString(); } @@ -6872,6 +6975,24 @@ public class ImageServer { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // REQUESTED_BLOCKS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.requestedBlocks = new ArrayList<Integer>(_list8.size); + int _elem9; + for (int _i10 = 0; _i10 < _list8.size; ++_i10) + { + _elem9 = iprot.readI32(); + struct.requestedBlocks.add(_elem9); + } + iprot.readListEnd(); + } + struct.setRequestedBlocksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -6897,6 +7018,18 @@ public class ImageServer { oprot.writeString(struct.serverSessionId); oprot.writeFieldEnd(); } + if (struct.requestedBlocks != null) { + oprot.writeFieldBegin(REQUESTED_BLOCKS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.requestedBlocks.size())); + for (int _iter11 : struct.requestedBlocks) + { + oprot.writeI32(_iter11); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -6921,19 +7054,31 @@ public class ImageServer { if (struct.isSetServerSessionId()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetRequestedBlocks()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetUuid()) { oprot.writeString(struct.uuid); } if (struct.isSetServerSessionId()) { oprot.writeString(struct.serverSessionId); } + if (struct.isSetRequestedBlocks()) { + { + oprot.writeI32(struct.requestedBlocks.size()); + for (int _iter12 : struct.requestedBlocks) + { + oprot.writeI32(_iter12); + } + } + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getImage_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.uuid = iprot.readString(); struct.setUuidIsSet(true); @@ -6942,6 +7087,19 @@ public class ImageServer { struct.serverSessionId = iprot.readString(); struct.setServerSessionIdIsSet(true); } + 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.requestedBlocks = new ArrayList<Integer>(_list13.size); + int _elem14; + for (int _i15 = 0; _i15 < _list13.size; ++_i15) + { + _elem14 = iprot.readI32(); + struct.requestedBlocks.add(_elem14); + } + } + struct.setRequestedBlocksIsSet(true); + } } } |