summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2016-08-31 16:42:38 +0200
committerJonathan Bauer2016-08-31 16:42:38 +0200
commitce366d169ddfb316c08953188bbd01ae50ac99c8 (patch)
treeb5a52823293fba66e007558cc3f746ac2b502878
parentFix some minor handling issues with transfers wrt global image exchange (diff)
downloadmaster-sync-shared-ce366d169ddfb316c08953188bbd01ae50ac99c8.tar.gz
master-sync-shared-ce366d169ddfb316c08953188bbd01ae50ac99c8.tar.xz
master-sync-shared-ce366d169ddfb316c08953188bbd01ae50ac99c8.zip
new API calls for VMX edit stuff
-rw-r--r--src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java2775
-rw-r--r--src/main/java/org/openslx/util/vm/VmwareConfig.java29
-rw-r--r--src/main/thrift/bwlp.thrift8
3 files changed, 2799 insertions, 13 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java
index 88cda96..98559f7 100644
--- a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java
+++ b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java
@@ -34,7 +34,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
-@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-04-18")
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-31")
public class SatelliteServer {
public interface Iface {
@@ -99,6 +99,10 @@ public class SatelliteServer {
public void setImageVersionExpiry(String userToken, String imageBaseId, long expireTime) throws TAuthorizationException, TNotFoundException, TInvocationException, TInvalidDateParam, org.apache.thrift.TException;
+ public ByteBuffer getImageVersionVirtConfig(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException;
+
+ public ByteBuffer setImageVersionVirtConfig(String userToken, String imageVersionId, ByteBuffer meta) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException;
+
public String requestImageReplication(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException;
public String publishImageVersion(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, TTransferRejectedException, org.apache.thrift.TException;
@@ -183,6 +187,10 @@ public class SatelliteServer {
public void setImageVersionExpiry(String userToken, String imageBaseId, long expireTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getImageVersionVirtConfig(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void setImageVersionVirtConfig(String userToken, String imageVersionId, ByteBuffer meta, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
public void requestImageReplication(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void publishImageVersion(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -1060,6 +1068,73 @@ public class SatelliteServer {
return;
}
+ public ByteBuffer getImageVersionVirtConfig(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException
+ {
+ send_getImageVersionVirtConfig(userToken, imageVersionId);
+ return recv_getImageVersionVirtConfig();
+ }
+
+ public void send_getImageVersionVirtConfig(String userToken, String imageVersionId) throws org.apache.thrift.TException
+ {
+ getImageVersionVirtConfig_args args = new getImageVersionVirtConfig_args();
+ args.setUserToken(userToken);
+ args.setImageVersionId(imageVersionId);
+ sendBase("getImageVersionVirtConfig", args);
+ }
+
+ public ByteBuffer recv_getImageVersionVirtConfig() throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException
+ {
+ getImageVersionVirtConfig_result result = new getImageVersionVirtConfig_result();
+ receiveBase(result, "getImageVersionVirtConfig");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.authError != null) {
+ throw result.authError;
+ }
+ if (result.notFound != null) {
+ throw result.notFound;
+ }
+ if (result.serverError != null) {
+ throw result.serverError;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageVersionVirtConfig failed: unknown result");
+ }
+
+ public ByteBuffer setImageVersionVirtConfig(String userToken, String imageVersionId, ByteBuffer meta) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException
+ {
+ send_setImageVersionVirtConfig(userToken, imageVersionId, meta);
+ return recv_setImageVersionVirtConfig();
+ }
+
+ public void send_setImageVersionVirtConfig(String userToken, String imageVersionId, ByteBuffer meta) throws org.apache.thrift.TException
+ {
+ setImageVersionVirtConfig_args args = new setImageVersionVirtConfig_args();
+ args.setUserToken(userToken);
+ args.setImageVersionId(imageVersionId);
+ args.setMeta(meta);
+ sendBase("setImageVersionVirtConfig", args);
+ }
+
+ public ByteBuffer recv_setImageVersionVirtConfig() throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException
+ {
+ setImageVersionVirtConfig_result result = new setImageVersionVirtConfig_result();
+ receiveBase(result, "setImageVersionVirtConfig");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ if (result.authError != null) {
+ throw result.authError;
+ }
+ if (result.notFound != null) {
+ throw result.notFound;
+ }
+ if (result.serverError != null) {
+ throw result.serverError;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "setImageVersionVirtConfig failed: unknown result");
+ }
+
public String requestImageReplication(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException
{
send_requestImageReplication(userToken, imageVersionId);
@@ -2422,6 +2497,79 @@ public class SatelliteServer {
}
}
+ public void getImageVersionVirtConfig(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getImageVersionVirtConfig_call method_call = new getImageVersionVirtConfig_call(userToken, imageVersionId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getImageVersionVirtConfig_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String userToken;
+ private String imageVersionId;
+ public getImageVersionVirtConfig_call(String userToken, String imageVersionId, 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.userToken = userToken;
+ this.imageVersionId = imageVersionId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getImageVersionVirtConfig", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getImageVersionVirtConfig_args args = new getImageVersionVirtConfig_args();
+ args.setUserToken(userToken);
+ args.setImageVersionId(imageVersionId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public ByteBuffer getResult() throws TAuthorizationException, TNotFoundException, TInvocationException, 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_getImageVersionVirtConfig();
+ }
+ }
+
+ public void setImageVersionVirtConfig(String userToken, String imageVersionId, ByteBuffer meta, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ setImageVersionVirtConfig_call method_call = new setImageVersionVirtConfig_call(userToken, imageVersionId, meta, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class setImageVersionVirtConfig_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String userToken;
+ private String imageVersionId;
+ private ByteBuffer meta;
+ public setImageVersionVirtConfig_call(String userToken, String imageVersionId, ByteBuffer meta, 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.userToken = userToken;
+ this.imageVersionId = imageVersionId;
+ this.meta = meta;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setImageVersionVirtConfig", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ setImageVersionVirtConfig_args args = new setImageVersionVirtConfig_args();
+ args.setUserToken(userToken);
+ args.setImageVersionId(imageVersionId);
+ args.setMeta(meta);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public ByteBuffer getResult() throws TAuthorizationException, TNotFoundException, TInvocationException, 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_setImageVersionVirtConfig();
+ }
+ }
+
public void requestImageReplication(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
requestImageReplication_call method_call = new requestImageReplication_call(userToken, imageVersionId, resultHandler, this, ___protocolFactory, ___transport);
@@ -2824,6 +2972,8 @@ public class SatelliteServer {
processMap.put("getImagePermissions", new getImagePermissions());
processMap.put("setImageOwner", new setImageOwner());
processMap.put("setImageVersionExpiry", new setImageVersionExpiry());
+ processMap.put("getImageVersionVirtConfig", new getImageVersionVirtConfig());
+ processMap.put("setImageVersionVirtConfig", new setImageVersionVirtConfig());
processMap.put("requestImageReplication", new requestImageReplication());
processMap.put("publishImageVersion", new publishImageVersion());
processMap.put("createLecture", new createLecture());
@@ -3594,6 +3744,62 @@ public class SatelliteServer {
}
}
+ public static class getImageVersionVirtConfig<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getImageVersionVirtConfig_args> {
+ public getImageVersionVirtConfig() {
+ super("getImageVersionVirtConfig");
+ }
+
+ public getImageVersionVirtConfig_args getEmptyArgsInstance() {
+ return new getImageVersionVirtConfig_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getImageVersionVirtConfig_result getResult(I iface, getImageVersionVirtConfig_args args) throws org.apache.thrift.TException {
+ getImageVersionVirtConfig_result result = new getImageVersionVirtConfig_result();
+ try {
+ result.success = iface.getImageVersionVirtConfig(args.userToken, args.imageVersionId);
+ } catch (TAuthorizationException authError) {
+ result.authError = authError;
+ } catch (TNotFoundException notFound) {
+ result.notFound = notFound;
+ } catch (TInvocationException serverError) {
+ result.serverError = serverError;
+ }
+ return result;
+ }
+ }
+
+ public static class setImageVersionVirtConfig<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setImageVersionVirtConfig_args> {
+ public setImageVersionVirtConfig() {
+ super("setImageVersionVirtConfig");
+ }
+
+ public setImageVersionVirtConfig_args getEmptyArgsInstance() {
+ return new setImageVersionVirtConfig_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public setImageVersionVirtConfig_result getResult(I iface, setImageVersionVirtConfig_args args) throws org.apache.thrift.TException {
+ setImageVersionVirtConfig_result result = new setImageVersionVirtConfig_result();
+ try {
+ result.success = iface.setImageVersionVirtConfig(args.userToken, args.imageVersionId, args.meta);
+ } catch (TAuthorizationException authError) {
+ result.authError = authError;
+ } catch (TNotFoundException notFound) {
+ result.notFound = notFound;
+ } catch (TInvocationException serverError) {
+ result.serverError = serverError;
+ }
+ return result;
+ }
+ }
+
public static class requestImageReplication<I extends Iface> extends org.apache.thrift.ProcessFunction<I, requestImageReplication_args> {
public requestImageReplication() {
super("requestImageReplication");
@@ -3921,6 +4127,8 @@ public class SatelliteServer {
processMap.put("getImagePermissions", new getImagePermissions());
processMap.put("setImageOwner", new setImageOwner());
processMap.put("setImageVersionExpiry", new setImageVersionExpiry());
+ processMap.put("getImageVersionVirtConfig", new getImageVersionVirtConfig());
+ processMap.put("setImageVersionVirtConfig", new setImageVersionVirtConfig());
processMap.put("requestImageReplication", new requestImageReplication());
processMap.put("publishImageVersion", new publishImageVersion());
processMap.put("createLecture", new createLecture());
@@ -5750,6 +5958,140 @@ public class SatelliteServer {
}
}
+ public static class getImageVersionVirtConfig<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getImageVersionVirtConfig_args, ByteBuffer> {
+ public getImageVersionVirtConfig() {
+ super("getImageVersionVirtConfig");
+ }
+
+ public getImageVersionVirtConfig_args getEmptyArgsInstance() {
+ return new getImageVersionVirtConfig_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) {
+ getImageVersionVirtConfig_result result = new getImageVersionVirtConfig_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;
+ getImageVersionVirtConfig_result result = new getImageVersionVirtConfig_result();
+ if (e instanceof TAuthorizationException) {
+ result.authError = (TAuthorizationException) e;
+ result.setAuthErrorIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof TNotFoundException) {
+ result.notFound = (TNotFoundException) e;
+ result.setNotFoundIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof TInvocationException) {
+ result.serverError = (TInvocationException) e;
+ result.setServerErrorIsSet(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, getImageVersionVirtConfig_args args, org.apache.thrift.async.AsyncMethodCallback<ByteBuffer> resultHandler) throws TException {
+ iface.getImageVersionVirtConfig(args.userToken, args.imageVersionId,resultHandler);
+ }
+ }
+
+ public static class setImageVersionVirtConfig<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setImageVersionVirtConfig_args, ByteBuffer> {
+ public setImageVersionVirtConfig() {
+ super("setImageVersionVirtConfig");
+ }
+
+ public setImageVersionVirtConfig_args getEmptyArgsInstance() {
+ return new setImageVersionVirtConfig_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) {
+ setImageVersionVirtConfig_result result = new setImageVersionVirtConfig_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;
+ setImageVersionVirtConfig_result result = new setImageVersionVirtConfig_result();
+ if (e instanceof TAuthorizationException) {
+ result.authError = (TAuthorizationException) e;
+ result.setAuthErrorIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof TNotFoundException) {
+ result.notFound = (TNotFoundException) e;
+ result.setNotFoundIsSet(true);
+ msg = result;
+ }
+ else if (e instanceof TInvocationException) {
+ result.serverError = (TInvocationException) e;
+ result.setServerErrorIsSet(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, setImageVersionVirtConfig_args args, org.apache.thrift.async.AsyncMethodCallback<ByteBuffer> resultHandler) throws TException {
+ iface.setImageVersionVirtConfig(args.userToken, args.imageVersionId, args.meta,resultHandler);
+ }
+ }
+
public static class requestImageReplication<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, requestImageReplication_args, String> {
public requestImageReplication() {
super("requestImageReplication");
@@ -35211,6 +35553,2437 @@ public class SatelliteServer {
}
+ public static class getImageVersionVirtConfig_args implements org.apache.thrift.TBase<getImageVersionVirtConfig_args, getImageVersionVirtConfig_args._Fields>, java.io.Serializable, Cloneable, Comparable<getImageVersionVirtConfig_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageVersionVirtConfig_args");
+
+ private static final org.apache.thrift.protocol.TField USER_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("userToken", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField IMAGE_VERSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageVersionId", 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 getImageVersionVirtConfig_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getImageVersionVirtConfig_argsTupleSchemeFactory());
+ }
+
+ public String userToken; // required
+ public String imageVersionId; // 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_TOKEN((short)1, "userToken"),
+ IMAGE_VERSION_ID((short)2, "imageVersionId");
+
+ 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: // USER_TOKEN
+ return USER_TOKEN;
+ case 2: // IMAGE_VERSION_ID
+ return IMAGE_VERSION_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_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("userToken", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token")));
+ tmpMap.put(_Fields.IMAGE_VERSION_ID, new org.apache.thrift.meta_data.FieldMetaData("imageVersionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID")));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getImageVersionVirtConfig_args.class, metaDataMap);
+ }
+
+ public getImageVersionVirtConfig_args() {
+ }
+
+ public getImageVersionVirtConfig_args(
+ String userToken,
+ String imageVersionId)
+ {
+ this();
+ this.userToken = userToken;
+ this.imageVersionId = imageVersionId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getImageVersionVirtConfig_args(getImageVersionVirtConfig_args other) {
+ if (other.isSetUserToken()) {
+ this.userToken = other.userToken;
+ }
+ if (other.isSetImageVersionId()) {
+ this.imageVersionId = other.imageVersionId;
+ }
+ }
+
+ public getImageVersionVirtConfig_args deepCopy() {
+ return new getImageVersionVirtConfig_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.userToken = null;
+ this.imageVersionId = null;
+ }
+
+ public String getUserToken() {
+ return this.userToken;
+ }
+
+ public getImageVersionVirtConfig_args setUserToken(String userToken) {
+ this.userToken = userToken;
+ return this;
+ }
+
+ public void unsetUserToken() {
+ this.userToken = null;
+ }
+
+ /** Returns true if field userToken is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserToken() {
+ return this.userToken != null;
+ }
+
+ public void setUserTokenIsSet(boolean value) {
+ if (!value) {
+ this.userToken = null;
+ }
+ }
+
+ public String getImageVersionId() {
+ return this.imageVersionId;
+ }
+
+ public getImageVersionVirtConfig_args setImageVersionId(String imageVersionId) {
+ this.imageVersionId = imageVersionId;
+ return this;
+ }
+
+ public void unsetImageVersionId() {
+ this.imageVersionId = null;
+ }
+
+ /** Returns true if field imageVersionId is set (has been assigned a value) and false otherwise */
+ public boolean isSetImageVersionId() {
+ return this.imageVersionId != null;
+ }
+
+ public void setImageVersionIdIsSet(boolean value) {
+ if (!value) {
+ this.imageVersionId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case USER_TOKEN:
+ if (value == null) {
+ unsetUserToken();
+ } else {
+ setUserToken((String)value);
+ }
+ break;
+
+ case IMAGE_VERSION_ID:
+ if (value == null) {
+ unsetImageVersionId();
+ } else {
+ setImageVersionId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case USER_TOKEN:
+ return getUserToken();
+
+ case IMAGE_VERSION_ID:
+ return getImageVersionId();
+
+ }
+ 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_TOKEN:
+ return isSetUserToken();
+ case IMAGE_VERSION_ID:
+ return isSetImageVersionId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getImageVersionVirtConfig_args)
+ return this.equals((getImageVersionVirtConfig_args)that);
+ return false;
+ }
+
+ public boolean equals(getImageVersionVirtConfig_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_userToken = true && this.isSetUserToken();
+ boolean that_present_userToken = true && that.isSetUserToken();
+ if (this_present_userToken || that_present_userToken) {
+ if (!(this_present_userToken && that_present_userToken))
+ return false;
+ if (!this.userToken.equals(that.userToken))
+ return false;
+ }
+
+ boolean this_present_imageVersionId = true && this.isSetImageVersionId();
+ boolean that_present_imageVersionId = true && that.isSetImageVersionId();
+ if (this_present_imageVersionId || that_present_imageVersionId) {
+ if (!(this_present_imageVersionId && that_present_imageVersionId))
+ return false;
+ if (!this.imageVersionId.equals(that.imageVersionId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_userToken = true && (isSetUserToken());
+ list.add(present_userToken);
+ if (present_userToken)
+ list.add(userToken);
+
+ boolean present_imageVersionId = true && (isSetImageVersionId());
+ list.add(present_imageVersionId);
+ if (present_imageVersionId)
+ list.add(imageVersionId);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(getImageVersionVirtConfig_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetUserToken()).compareTo(other.isSetUserToken());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUserToken()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userToken, other.userToken);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetImageVersionId()).compareTo(other.isSetImageVersionId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetImageVersionId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageVersionId, other.imageVersionId);
+ 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("getImageVersionVirtConfig_args(");
+ boolean first = true;
+
+ sb.append("userToken:");
+ if (this.userToken == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.userToken);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("imageVersionId:");
+ if (this.imageVersionId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.imageVersionId);
+ }
+ 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 getImageVersionVirtConfig_argsStandardSchemeFactory implements SchemeFactory {
+ public getImageVersionVirtConfig_argsStandardScheme getScheme() {
+ return new getImageVersionVirtConfig_argsStandardScheme();
+ }
+ }
+
+ private static class getImageVersionVirtConfig_argsStandardScheme extends StandardScheme<getImageVersionVirtConfig_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getImageVersionVirtConfig_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_TOKEN
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.userToken = iprot.readString();
+ struct.setUserTokenIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // IMAGE_VERSION_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.imageVersionId = iprot.readString();
+ struct.setImageVersionIdIsSet(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, getImageVersionVirtConfig_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.userToken != null) {
+ oprot.writeFieldBegin(USER_TOKEN_FIELD_DESC);
+ oprot.writeString(struct.userToken);
+ oprot.writeFieldEnd();
+ }
+ if (struct.imageVersionId != null) {
+ oprot.writeFieldBegin(IMAGE_VERSION_ID_FIELD_DESC);
+ oprot.writeString(struct.imageVersionId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getImageVersionVirtConfig_argsTupleSchemeFactory implements SchemeFactory {
+ public getImageVersionVirtConfig_argsTupleScheme getScheme() {
+ return new getImageVersionVirtConfig_argsTupleScheme();
+ }
+ }
+
+ private static class getImageVersionVirtConfig_argsTupleScheme extends TupleScheme<getImageVersionVirtConfig_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getImageVersionVirtConfig_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetUserToken()) {
+ optionals.set(0);
+ }
+ if (struct.isSetImageVersionId()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetUserToken()) {
+ oprot.writeString(struct.userToken);
+ }
+ if (struct.isSetImageVersionId()) {
+ oprot.writeString(struct.imageVersionId);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getImageVersionVirtConfig_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.userToken = iprot.readString();
+ struct.setUserTokenIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.imageVersionId = iprot.readString();
+ struct.setImageVersionIdIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class getImageVersionVirtConfig_result implements org.apache.thrift.TBase<getImageVersionVirtConfig_result, getImageVersionVirtConfig_result._Fields>, java.io.Serializable, Cloneable, Comparable<getImageVersionVirtConfig_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getImageVersionVirtConfig_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 AUTH_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("authError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField NOT_FOUND_FIELD_DESC = new org.apache.thrift.protocol.TField("notFound", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField SERVER_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serverError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getImageVersionVirtConfig_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getImageVersionVirtConfig_resultTupleSchemeFactory());
+ }
+
+ public ByteBuffer success; // required
+ public TAuthorizationException authError; // required
+ public TNotFoundException notFound; // required
+ public TInvocationException serverError; // 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"),
+ AUTH_ERROR((short)1, "authError"),
+ NOT_FOUND((short)2, "notFound"),
+ SERVER_ERROR((short)3, "serverError");
+
+ 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: // AUTH_ERROR
+ return AUTH_ERROR;
+ case 2: // NOT_FOUND
+ return NOT_FOUND;
+ case 3: // SERVER_ERROR
+ return SERVER_ERROR;
+ 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.AUTH_ERROR, new org.apache.thrift.meta_data.FieldMetaData("authError", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.NOT_FOUND, new org.apache.thrift.meta_data.FieldMetaData("notFound", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.SERVER_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serverError", 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(getImageVersionVirtConfig_result.class, metaDataMap);
+ }
+
+ public getImageVersionVirtConfig_result() {
+ }
+
+ public getImageVersionVirtConfig_result(
+ ByteBuffer success,
+ TAuthorizationException authError,
+ TNotFoundException notFound,
+ TInvocationException serverError)
+ {
+ this();
+ this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
+ this.authError = authError;
+ this.notFound = notFound;
+ this.serverError = serverError;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getImageVersionVirtConfig_result(getImageVersionVirtConfig_result other) {
+ if (other.isSetSuccess()) {
+ this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
+ }
+ if (other.isSetAuthError()) {
+ this.authError = new TAuthorizationException(other.authError);
+ }
+ if (other.isSetNotFound()) {
+ this.notFound = new TNotFoundException(other.notFound);
+ }
+ if (other.isSetServerError()) {
+ this.serverError = new TInvocationException(other.serverError);
+ }
+ }
+
+ public getImageVersionVirtConfig_result deepCopy() {
+ return new getImageVersionVirtConfig_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ this.authError = null;
+ this.notFound = null;
+ this.serverError = null;
+ }
+
+ public byte[] getSuccess() {
+ setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
+ return success == null ? null : success.array();
+ }
+
+ public ByteBuffer bufferForSuccess() {
+ return org.apache.thrift.TBaseHelper.copyBinary(success);
+ }
+
+ public getImageVersionVirtConfig_result setSuccess(byte[] success) {
+ this.success = success == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(success, success.length));
+ return this;
+ }
+
+ public getImageVersionVirtConfig_result setSuccess(ByteBuffer success) {
+ this.success = org.apache.thrift.TBaseHelper.copyBinary(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 TAuthorizationException getAuthError() {
+ return this.authError;
+ }
+
+ public getImageVersionVirtConfig_result setAuthError(TAuthorizationException authError) {
+ this.authError = authError;
+ return this;
+ }
+
+ public void unsetAuthError() {
+ this.authError = null;
+ }
+
+ /** Returns true if field authError is set (has been assigned a value) and false otherwise */
+ public boolean isSetAuthError() {
+ return this.authError != null;
+ }
+
+ public void setAuthErrorIsSet(boolean value) {
+ if (!value) {
+ this.authError = null;
+ }
+ }
+
+ public TNotFoundException getNotFound() {
+ return this.notFound;
+ }
+
+ public getImageVersionVirtConfig_result setNotFound(TNotFoundException notFound) {
+ this.notFound = notFound;
+ return this;
+ }
+
+ public void unsetNotFound() {
+ this.notFound = null;
+ }
+
+ /** Returns true if field notFound is set (has been assigned a value) and false otherwise */
+ public boolean isSetNotFound() {
+ return this.notFound != null;
+ }
+
+ public void setNotFoundIsSet(boolean value) {
+ if (!value) {
+ this.notFound = null;
+ }
+ }
+
+ public TInvocationException getServerError() {
+ return this.serverError;
+ }
+
+ public getImageVersionVirtConfig_result setServerError(TInvocationException serverError) {
+ this.serverError = serverError;
+ return this;
+ }
+
+ public void unsetServerError() {
+ this.serverError = null;
+ }
+
+ /** Returns true if field serverError is set (has been assigned a value) and false otherwise */
+ public boolean isSetServerError() {
+ return this.serverError != null;
+ }
+
+ public void setServerErrorIsSet(boolean value) {
+ if (!value) {
+ this.serverError = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((ByteBuffer)value);
+ }
+ break;
+
+ case AUTH_ERROR:
+ if (value == null) {
+ unsetAuthError();
+ } else {
+ setAuthError((TAuthorizationException)value);
+ }
+ break;
+
+ case NOT_FOUND:
+ if (value == null) {
+ unsetNotFound();
+ } else {
+ setNotFound((TNotFoundException)value);
+ }
+ break;
+
+ case SERVER_ERROR:
+ if (value == null) {
+ unsetServerError();
+ } else {
+ setServerError((TInvocationException)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ case AUTH_ERROR:
+ return getAuthError();
+
+ case NOT_FOUND:
+ return getNotFound();
+
+ case SERVER_ERROR:
+ return getServerError();
+
+ }
+ 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 AUTH_ERROR:
+ return isSetAuthError();
+ case NOT_FOUND:
+ return isSetNotFound();
+ case SERVER_ERROR:
+ return isSetServerError();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getImageVersionVirtConfig_result)
+ return this.equals((getImageVersionVirtConfig_result)that);
+ return false;
+ }
+
+ public boolean equals(getImageVersionVirtConfig_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_authError = true && this.isSetAuthError();
+ boolean that_present_authError = true && that.isSetAuthError();
+ if (this_present_authError || that_present_authError) {
+ if (!(this_present_authError && that_present_authError))
+ return false;
+ if (!this.authError.equals(that.authError))
+ return false;
+ }
+
+ boolean this_present_notFound = true && this.isSetNotFound();
+ boolean that_present_notFound = true && that.isSetNotFound();
+ if (this_present_notFound || that_present_notFound) {
+ if (!(this_present_notFound && that_present_notFound))
+ return false;
+ if (!this.notFound.equals(that.notFound))
+ return false;
+ }
+
+ boolean this_present_serverError = true && this.isSetServerError();
+ boolean that_present_serverError = true && that.isSetServerError();
+ if (this_present_serverError || that_present_serverError) {
+ if (!(this_present_serverError && that_present_serverError))
+ return false;
+ if (!this.serverError.equals(that.serverError))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true && (isSetSuccess());
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ boolean present_authError = true && (isSetAuthError());
+ list.add(present_authError);
+ if (present_authError)
+ list.add(authError);
+
+ boolean present_notFound = true && (isSetNotFound());
+ list.add(present_notFound);
+ if (present_notFound)
+ list.add(notFound);
+
+ boolean present_serverError = true && (isSetServerError());
+ list.add(present_serverError);
+ if (present_serverError)
+ list.add(serverError);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(getImageVersionVirtConfig_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(isSetAuthError()).compareTo(other.isSetAuthError());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAuthError()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authError, other.authError);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetNotFound()).compareTo(other.isSetNotFound());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetNotFound()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notFound, other.notFound);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetServerError()).compareTo(other.isSetServerError());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetServerError()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverError, other.serverError);
+ 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("getImageVersionVirtConfig_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("authError:");
+ if (this.authError == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.authError);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("notFound:");
+ if (this.notFound == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.notFound);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("serverError:");
+ if (this.serverError == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.serverError);
+ }
+ 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 getImageVersionVirtConfig_resultStandardSchemeFactory implements SchemeFactory {
+ public getImageVersionVirtConfig_resultStandardScheme getScheme() {
+ return new getImageVersionVirtConfig_resultStandardScheme();
+ }
+ }
+
+ private static class getImageVersionVirtConfig_resultStandardScheme extends StandardScheme<getImageVersionVirtConfig_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getImageVersionVirtConfig_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: // AUTH_ERROR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.authError = new TAuthorizationException();
+ struct.authError.read(iprot);
+ struct.setAuthErrorIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // NOT_FOUND
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.notFound = new TNotFoundException();
+ struct.notFound.read(iprot);
+ struct.setNotFoundIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // SERVER_ERROR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.serverError = new TInvocationException();
+ struct.serverError.read(iprot);
+ struct.setServerErrorIsSet(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, getImageVersionVirtConfig_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.authError != null) {
+ oprot.writeFieldBegin(AUTH_ERROR_FIELD_DESC);
+ struct.authError.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.notFound != null) {
+ oprot.writeFieldBegin(NOT_FOUND_FIELD_DESC);
+ struct.notFound.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.serverError != null) {
+ oprot.writeFieldBegin(SERVER_ERROR_FIELD_DESC);
+ struct.serverError.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getImageVersionVirtConfig_resultTupleSchemeFactory implements SchemeFactory {
+ public getImageVersionVirtConfig_resultTupleScheme getScheme() {
+ return new getImageVersionVirtConfig_resultTupleScheme();
+ }
+ }
+
+ private static class getImageVersionVirtConfig_resultTupleScheme extends TupleScheme<getImageVersionVirtConfig_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getImageVersionVirtConfig_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetAuthError()) {
+ optionals.set(1);
+ }
+ if (struct.isSetNotFound()) {
+ optionals.set(2);
+ }
+ if (struct.isSetServerError()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
+ if (struct.isSetSuccess()) {
+ oprot.writeBinary(struct.success);
+ }
+ if (struct.isSetAuthError()) {
+ struct.authError.write(oprot);
+ }
+ if (struct.isSetNotFound()) {
+ struct.notFound.write(oprot);
+ }
+ if (struct.isSetServerError()) {
+ struct.serverError.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getImageVersionVirtConfig_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(4);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBinary();
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.authError = new TAuthorizationException();
+ struct.authError.read(iprot);
+ struct.setAuthErrorIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.notFound = new TNotFoundException();
+ struct.notFound.read(iprot);
+ struct.setNotFoundIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.serverError = new TInvocationException();
+ struct.serverError.read(iprot);
+ struct.setServerErrorIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class setImageVersionVirtConfig_args implements org.apache.thrift.TBase<setImageVersionVirtConfig_args, setImageVersionVirtConfig_args._Fields>, java.io.Serializable, Cloneable, Comparable<setImageVersionVirtConfig_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setImageVersionVirtConfig_args");
+
+ private static final org.apache.thrift.protocol.TField USER_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("userToken", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField IMAGE_VERSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageVersionId", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField META_FIELD_DESC = new org.apache.thrift.protocol.TField("meta", 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 setImageVersionVirtConfig_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new setImageVersionVirtConfig_argsTupleSchemeFactory());
+ }
+
+ public String userToken; // required
+ public String imageVersionId; // required
+ public ByteBuffer meta; // 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_TOKEN((short)1, "userToken"),
+ IMAGE_VERSION_ID((short)2, "imageVersionId"),
+ META((short)3, "meta");
+
+ 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: // USER_TOKEN
+ return USER_TOKEN;
+ case 2: // IMAGE_VERSION_ID
+ return IMAGE_VERSION_ID;
+ case 3: // META
+ return META;
+ 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_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("userToken", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token")));
+ tmpMap.put(_Fields.IMAGE_VERSION_ID, new org.apache.thrift.meta_data.FieldMetaData("imageVersionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID")));
+ tmpMap.put(_Fields.META, new org.apache.thrift.meta_data.FieldMetaData("meta", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setImageVersionVirtConfig_args.class, metaDataMap);
+ }
+
+ public setImageVersionVirtConfig_args() {
+ }
+
+ public setImageVersionVirtConfig_args(
+ String userToken,
+ String imageVersionId,
+ ByteBuffer meta)
+ {
+ this();
+ this.userToken = userToken;
+ this.imageVersionId = imageVersionId;
+ this.meta = org.apache.thrift.TBaseHelper.copyBinary(meta);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public setImageVersionVirtConfig_args(setImageVersionVirtConfig_args other) {
+ if (other.isSetUserToken()) {
+ this.userToken = other.userToken;
+ }
+ if (other.isSetImageVersionId()) {
+ this.imageVersionId = other.imageVersionId;
+ }
+ if (other.isSetMeta()) {
+ this.meta = org.apache.thrift.TBaseHelper.copyBinary(other.meta);
+ }
+ }
+
+ public setImageVersionVirtConfig_args deepCopy() {
+ return new setImageVersionVirtConfig_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.userToken = null;
+ this.imageVersionId = null;
+ this.meta = null;
+ }
+
+ public String getUserToken() {
+ return this.userToken;
+ }
+
+ public setImageVersionVirtConfig_args setUserToken(String userToken) {
+ this.userToken = userToken;
+ return this;
+ }
+
+ public void unsetUserToken() {
+ this.userToken = null;
+ }
+
+ /** Returns true if field userToken is set (has been assigned a value) and false otherwise */
+ public boolean isSetUserToken() {
+ return this.userToken != null;
+ }
+
+ public void setUserTokenIsSet(boolean value) {
+ if (!value) {
+ this.userToken = null;
+ }
+ }
+
+ public String getImageVersionId() {
+ return this.imageVersionId;
+ }
+
+ public setImageVersionVirtConfig_args setImageVersionId(String imageVersionId) {
+ this.imageVersionId = imageVersionId;
+ return this;
+ }
+
+ public void unsetImageVersionId() {
+ this.imageVersionId = null;
+ }
+
+ /** Returns true if field imageVersionId is set (has been assigned a value) and false otherwise */
+ public boolean isSetImageVersionId() {
+ return this.imageVersionId != null;
+ }
+
+ public void setImageVersionIdIsSet(boolean value) {
+ if (!value) {
+ this.imageVersionId = null;
+ }
+ }
+
+ public byte[] getMeta() {
+ setMeta(org.apache.thrift.TBaseHelper.rightSize(meta));
+ return meta == null ? null : meta.array();
+ }
+
+ public ByteBuffer bufferForMeta() {
+ return org.apache.thrift.TBaseHelper.copyBinary(meta);
+ }
+
+ public setImageVersionVirtConfig_args setMeta(byte[] meta) {
+ this.meta = meta == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(meta, meta.length));
+ return this;
+ }
+
+ public setImageVersionVirtConfig_args setMeta(ByteBuffer meta) {
+ this.meta = org.apache.thrift.TBaseHelper.copyBinary(meta);
+ return this;
+ }
+
+ public void unsetMeta() {
+ this.meta = null;
+ }
+
+ /** Returns true if field meta is set (has been assigned a value) and false otherwise */
+ public boolean isSetMeta() {
+ return this.meta != null;
+ }
+
+ public void setMetaIsSet(boolean value) {
+ if (!value) {
+ this.meta = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case USER_TOKEN:
+ if (value == null) {
+ unsetUserToken();
+ } else {
+ setUserToken((String)value);
+ }
+ break;
+
+ case IMAGE_VERSION_ID:
+ if (value == null) {
+ unsetImageVersionId();
+ } else {
+ setImageVersionId((String)value);
+ }
+ break;
+
+ case META:
+ if (value == null) {
+ unsetMeta();
+ } else {
+ setMeta((ByteBuffer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case USER_TOKEN:
+ return getUserToken();
+
+ case IMAGE_VERSION_ID:
+ return getImageVersionId();
+
+ case META:
+ return getMeta();
+
+ }
+ 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_TOKEN:
+ return isSetUserToken();
+ case IMAGE_VERSION_ID:
+ return isSetImageVersionId();
+ case META:
+ return isSetMeta();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof setImageVersionVirtConfig_args)
+ return this.equals((setImageVersionVirtConfig_args)that);
+ return false;
+ }
+
+ public boolean equals(setImageVersionVirtConfig_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_userToken = true && this.isSetUserToken();
+ boolean that_present_userToken = true && that.isSetUserToken();
+ if (this_present_userToken || that_present_userToken) {
+ if (!(this_present_userToken && that_present_userToken))
+ return false;
+ if (!this.userToken.equals(that.userToken))
+ return false;
+ }
+
+ boolean this_present_imageVersionId = true && this.isSetImageVersionId();
+ boolean that_present_imageVersionId = true && that.isSetImageVersionId();
+ if (this_present_imageVersionId || that_present_imageVersionId) {
+ if (!(this_present_imageVersionId && that_present_imageVersionId))
+ return false;
+ if (!this.imageVersionId.equals(that.imageVersionId))
+ return false;
+ }
+
+ boolean this_present_meta = true && this.isSetMeta();
+ boolean that_present_meta = true && that.isSetMeta();
+ if (this_present_meta || that_present_meta) {
+ if (!(this_present_meta && that_present_meta))
+ return false;
+ if (!this.meta.equals(that.meta))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_userToken = true && (isSetUserToken());
+ list.add(present_userToken);
+ if (present_userToken)
+ list.add(userToken);
+
+ boolean present_imageVersionId = true && (isSetImageVersionId());
+ list.add(present_imageVersionId);
+ if (present_imageVersionId)
+ list.add(imageVersionId);
+
+ boolean present_meta = true && (isSetMeta());
+ list.add(present_meta);
+ if (present_meta)
+ list.add(meta);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(setImageVersionVirtConfig_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetUserToken()).compareTo(other.isSetUserToken());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetUserToken()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userToken, other.userToken);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetImageVersionId()).compareTo(other.isSetImageVersionId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetImageVersionId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageVersionId, other.imageVersionId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetMeta()).compareTo(other.isSetMeta());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetMeta()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.meta, other.meta);
+ 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("setImageVersionVirtConfig_args(");
+ boolean first = true;
+
+ sb.append("userToken:");
+ if (this.userToken == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.userToken);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("imageVersionId:");
+ if (this.imageVersionId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.imageVersionId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("meta:");
+ if (this.meta == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.meta, sb);
+ }
+ 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 setImageVersionVirtConfig_argsStandardSchemeFactory implements SchemeFactory {
+ public setImageVersionVirtConfig_argsStandardScheme getScheme() {
+ return new setImageVersionVirtConfig_argsStandardScheme();
+ }
+ }
+
+ private static class setImageVersionVirtConfig_argsStandardScheme extends StandardScheme<setImageVersionVirtConfig_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, setImageVersionVirtConfig_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_TOKEN
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.userToken = iprot.readString();
+ struct.setUserTokenIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // IMAGE_VERSION_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.imageVersionId = iprot.readString();
+ struct.setImageVersionIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // META
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.meta = iprot.readBinary();
+ struct.setMetaIsSet(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, setImageVersionVirtConfig_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.userToken != null) {
+ oprot.writeFieldBegin(USER_TOKEN_FIELD_DESC);
+ oprot.writeString(struct.userToken);
+ oprot.writeFieldEnd();
+ }
+ if (struct.imageVersionId != null) {
+ oprot.writeFieldBegin(IMAGE_VERSION_ID_FIELD_DESC);
+ oprot.writeString(struct.imageVersionId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.meta != null) {
+ oprot.writeFieldBegin(META_FIELD_DESC);
+ oprot.writeBinary(struct.meta);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class setImageVersionVirtConfig_argsTupleSchemeFactory implements SchemeFactory {
+ public setImageVersionVirtConfig_argsTupleScheme getScheme() {
+ return new setImageVersionVirtConfig_argsTupleScheme();
+ }
+ }
+
+ private static class setImageVersionVirtConfig_argsTupleScheme extends TupleScheme<setImageVersionVirtConfig_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, setImageVersionVirtConfig_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetUserToken()) {
+ optionals.set(0);
+ }
+ if (struct.isSetImageVersionId()) {
+ optionals.set(1);
+ }
+ if (struct.isSetMeta()) {
+ optionals.set(2);
+ }
+ oprot.writeBitSet(optionals, 3);
+ if (struct.isSetUserToken()) {
+ oprot.writeString(struct.userToken);
+ }
+ if (struct.isSetImageVersionId()) {
+ oprot.writeString(struct.imageVersionId);
+ }
+ if (struct.isSetMeta()) {
+ oprot.writeBinary(struct.meta);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, setImageVersionVirtConfig_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(3);
+ if (incoming.get(0)) {
+ struct.userToken = iprot.readString();
+ struct.setUserTokenIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.imageVersionId = iprot.readString();
+ struct.setImageVersionIdIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.meta = iprot.readBinary();
+ struct.setMetaIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class setImageVersionVirtConfig_result implements org.apache.thrift.TBase<setImageVersionVirtConfig_result, setImageVersionVirtConfig_result._Fields>, java.io.Serializable, Cloneable, Comparable<setImageVersionVirtConfig_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setImageVersionVirtConfig_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 AUTH_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("authError", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+ private static final org.apache.thrift.protocol.TField NOT_FOUND_FIELD_DESC = new org.apache.thrift.protocol.TField("notFound", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+ private static final org.apache.thrift.protocol.TField SERVER_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serverError", org.apache.thrift.protocol.TType.STRUCT, (short)3);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new setImageVersionVirtConfig_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new setImageVersionVirtConfig_resultTupleSchemeFactory());
+ }
+
+ public ByteBuffer success; // required
+ public TAuthorizationException authError; // required
+ public TNotFoundException notFound; // required
+ public TInvocationException serverError; // 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"),
+ AUTH_ERROR((short)1, "authError"),
+ NOT_FOUND((short)2, "notFound"),
+ SERVER_ERROR((short)3, "serverError");
+
+ 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: // AUTH_ERROR
+ return AUTH_ERROR;
+ case 2: // NOT_FOUND
+ return NOT_FOUND;
+ case 3: // SERVER_ERROR
+ return SERVER_ERROR;
+ 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.AUTH_ERROR, new org.apache.thrift.meta_data.FieldMetaData("authError", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.NOT_FOUND, new org.apache.thrift.meta_data.FieldMetaData("notFound", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
+ tmpMap.put(_Fields.SERVER_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serverError", 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(setImageVersionVirtConfig_result.class, metaDataMap);
+ }
+
+ public setImageVersionVirtConfig_result() {
+ }
+
+ public setImageVersionVirtConfig_result(
+ ByteBuffer success,
+ TAuthorizationException authError,
+ TNotFoundException notFound,
+ TInvocationException serverError)
+ {
+ this();
+ this.success = org.apache.thrift.TBaseHelper.copyBinary(success);
+ this.authError = authError;
+ this.notFound = notFound;
+ this.serverError = serverError;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public setImageVersionVirtConfig_result(setImageVersionVirtConfig_result other) {
+ if (other.isSetSuccess()) {
+ this.success = org.apache.thrift.TBaseHelper.copyBinary(other.success);
+ }
+ if (other.isSetAuthError()) {
+ this.authError = new TAuthorizationException(other.authError);
+ }
+ if (other.isSetNotFound()) {
+ this.notFound = new TNotFoundException(other.notFound);
+ }
+ if (other.isSetServerError()) {
+ this.serverError = new TInvocationException(other.serverError);
+ }
+ }
+
+ public setImageVersionVirtConfig_result deepCopy() {
+ return new setImageVersionVirtConfig_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ this.authError = null;
+ this.notFound = null;
+ this.serverError = null;
+ }
+
+ public byte[] getSuccess() {
+ setSuccess(org.apache.thrift.TBaseHelper.rightSize(success));
+ return success == null ? null : success.array();
+ }
+
+ public ByteBuffer bufferForSuccess() {
+ return org.apache.thrift.TBaseHelper.copyBinary(success);
+ }
+
+ public setImageVersionVirtConfig_result setSuccess(byte[] success) {
+ this.success = success == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(success, success.length));
+ return this;
+ }
+
+ public setImageVersionVirtConfig_result setSuccess(ByteBuffer success) {
+ this.success = org.apache.thrift.TBaseHelper.copyBinary(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 TAuthorizationException getAuthError() {
+ return this.authError;
+ }
+
+ public setImageVersionVirtConfig_result setAuthError(TAuthorizationException authError) {
+ this.authError = authError;
+ return this;
+ }
+
+ public void unsetAuthError() {
+ this.authError = null;
+ }
+
+ /** Returns true if field authError is set (has been assigned a value) and false otherwise */
+ public boolean isSetAuthError() {
+ return this.authError != null;
+ }
+
+ public void setAuthErrorIsSet(boolean value) {
+ if (!value) {
+ this.authError = null;
+ }
+ }
+
+ public TNotFoundException getNotFound() {
+ return this.notFound;
+ }
+
+ public setImageVersionVirtConfig_result setNotFound(TNotFoundException notFound) {
+ this.notFound = notFound;
+ return this;
+ }
+
+ public void unsetNotFound() {
+ this.notFound = null;
+ }
+
+ /** Returns true if field notFound is set (has been assigned a value) and false otherwise */
+ public boolean isSetNotFound() {
+ return this.notFound != null;
+ }
+
+ public void setNotFoundIsSet(boolean value) {
+ if (!value) {
+ this.notFound = null;
+ }
+ }
+
+ public TInvocationException getServerError() {
+ return this.serverError;
+ }
+
+ public setImageVersionVirtConfig_result setServerError(TInvocationException serverError) {
+ this.serverError = serverError;
+ return this;
+ }
+
+ public void unsetServerError() {
+ this.serverError = null;
+ }
+
+ /** Returns true if field serverError is set (has been assigned a value) and false otherwise */
+ public boolean isSetServerError() {
+ return this.serverError != null;
+ }
+
+ public void setServerErrorIsSet(boolean value) {
+ if (!value) {
+ this.serverError = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((ByteBuffer)value);
+ }
+ break;
+
+ case AUTH_ERROR:
+ if (value == null) {
+ unsetAuthError();
+ } else {
+ setAuthError((TAuthorizationException)value);
+ }
+ break;
+
+ case NOT_FOUND:
+ if (value == null) {
+ unsetNotFound();
+ } else {
+ setNotFound((TNotFoundException)value);
+ }
+ break;
+
+ case SERVER_ERROR:
+ if (value == null) {
+ unsetServerError();
+ } else {
+ setServerError((TInvocationException)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ case AUTH_ERROR:
+ return getAuthError();
+
+ case NOT_FOUND:
+ return getNotFound();
+
+ case SERVER_ERROR:
+ return getServerError();
+
+ }
+ 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 AUTH_ERROR:
+ return isSetAuthError();
+ case NOT_FOUND:
+ return isSetNotFound();
+ case SERVER_ERROR:
+ return isSetServerError();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof setImageVersionVirtConfig_result)
+ return this.equals((setImageVersionVirtConfig_result)that);
+ return false;
+ }
+
+ public boolean equals(setImageVersionVirtConfig_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_authError = true && this.isSetAuthError();
+ boolean that_present_authError = true && that.isSetAuthError();
+ if (this_present_authError || that_present_authError) {
+ if (!(this_present_authError && that_present_authError))
+ return false;
+ if (!this.authError.equals(that.authError))
+ return false;
+ }
+
+ boolean this_present_notFound = true && this.isSetNotFound();
+ boolean that_present_notFound = true && that.isSetNotFound();
+ if (this_present_notFound || that_present_notFound) {
+ if (!(this_present_notFound && that_present_notFound))
+ return false;
+ if (!this.notFound.equals(that.notFound))
+ return false;
+ }
+
+ boolean this_present_serverError = true && this.isSetServerError();
+ boolean that_present_serverError = true && that.isSetServerError();
+ if (this_present_serverError || that_present_serverError) {
+ if (!(this_present_serverError && that_present_serverError))
+ return false;
+ if (!this.serverError.equals(that.serverError))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_success = true && (isSetSuccess());
+ list.add(present_success);
+ if (present_success)
+ list.add(success);
+
+ boolean present_authError = true && (isSetAuthError());
+ list.add(present_authError);
+ if (present_authError)
+ list.add(authError);
+
+ boolean present_notFound = true && (isSetNotFound());
+ list.add(present_notFound);
+ if (present_notFound)
+ list.add(notFound);
+
+ boolean present_serverError = true && (isSetServerError());
+ list.add(present_serverError);
+ if (present_serverError)
+ list.add(serverError);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(setImageVersionVirtConfig_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(isSetAuthError()).compareTo(other.isSetAuthError());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetAuthError()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authError, other.authError);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetNotFound()).compareTo(other.isSetNotFound());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetNotFound()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notFound, other.notFound);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetServerError()).compareTo(other.isSetServerError());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetServerError()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverError, other.serverError);
+ 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("setImageVersionVirtConfig_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("authError:");
+ if (this.authError == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.authError);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("notFound:");
+ if (this.notFound == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.notFound);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("serverError:");
+ if (this.serverError == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.serverError);
+ }
+ 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 setImageVersionVirtConfig_resultStandardSchemeFactory implements SchemeFactory {
+ public setImageVersionVirtConfig_resultStandardScheme getScheme() {
+ return new setImageVersionVirtConfig_resultStandardScheme();
+ }
+ }
+
+ private static class setImageVersionVirtConfig_resultStandardScheme extends StandardScheme<setImageVersionVirtConfig_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, setImageVersionVirtConfig_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: // AUTH_ERROR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.authError = new TAuthorizationException();
+ struct.authError.read(iprot);
+ struct.setAuthErrorIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // NOT_FOUND
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.notFound = new TNotFoundException();
+ struct.notFound.read(iprot);
+ struct.setNotFoundIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // SERVER_ERROR
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.serverError = new TInvocationException();
+ struct.serverError.read(iprot);
+ struct.setServerErrorIsSet(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, setImageVersionVirtConfig_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.authError != null) {
+ oprot.writeFieldBegin(AUTH_ERROR_FIELD_DESC);
+ struct.authError.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.notFound != null) {
+ oprot.writeFieldBegin(NOT_FOUND_FIELD_DESC);
+ struct.notFound.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ if (struct.serverError != null) {
+ oprot.writeFieldBegin(SERVER_ERROR_FIELD_DESC);
+ struct.serverError.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class setImageVersionVirtConfig_resultTupleSchemeFactory implements SchemeFactory {
+ public setImageVersionVirtConfig_resultTupleScheme getScheme() {
+ return new setImageVersionVirtConfig_resultTupleScheme();
+ }
+ }
+
+ private static class setImageVersionVirtConfig_resultTupleScheme extends TupleScheme<setImageVersionVirtConfig_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, setImageVersionVirtConfig_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ if (struct.isSetAuthError()) {
+ optionals.set(1);
+ }
+ if (struct.isSetNotFound()) {
+ optionals.set(2);
+ }
+ if (struct.isSetServerError()) {
+ optionals.set(3);
+ }
+ oprot.writeBitSet(optionals, 4);
+ if (struct.isSetSuccess()) {
+ oprot.writeBinary(struct.success);
+ }
+ if (struct.isSetAuthError()) {
+ struct.authError.write(oprot);
+ }
+ if (struct.isSetNotFound()) {
+ struct.notFound.write(oprot);
+ }
+ if (struct.isSetServerError()) {
+ struct.serverError.write(oprot);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, setImageVersionVirtConfig_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(4);
+ if (incoming.get(0)) {
+ struct.success = iprot.readBinary();
+ struct.setSuccessIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.authError = new TAuthorizationException();
+ struct.authError.read(iprot);
+ struct.setAuthErrorIsSet(true);
+ }
+ if (incoming.get(2)) {
+ struct.notFound = new TNotFoundException();
+ struct.notFound.read(iprot);
+ struct.setNotFoundIsSet(true);
+ }
+ if (incoming.get(3)) {
+ struct.serverError = new TInvocationException();
+ struct.serverError.read(iprot);
+ struct.setServerErrorIsSet(true);
+ }
+ }
+ }
+
+ }
+
public static class requestImageReplication_args implements org.apache.thrift.TBase<requestImageReplication_args, requestImageReplication_args._Fields>, java.io.Serializable, Cloneable, Comparable<requestImageReplication_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("requestImageReplication_args");
diff --git a/src/main/java/org/openslx/util/vm/VmwareConfig.java b/src/main/java/org/openslx/util/vm/VmwareConfig.java
index 18b60df..aa82419 100644
--- a/src/main/java/org/openslx/util/vm/VmwareConfig.java
+++ b/src/main/java/org/openslx/util/vm/VmwareConfig.java
@@ -75,17 +75,8 @@ public class VmwareConfig
private void init( byte[] vmxContent, int length )
{
- String csName = detectCharset( new ByteArrayInputStream( vmxContent, 0, length ) );
- Charset cs = null;
try {
- cs = Charset.forName( csName );
- } catch ( Exception e ) {
- LOGGER.warn( "Could not instantiate charset " + csName, e );
- }
- if ( cs == null )
- cs = StandardCharsets.ISO_8859_1;
- try {
- BufferedReader reader = new BufferedReader( new InputStreamReader( new ByteArrayInputStream( vmxContent, 0, length ), cs ) );
+ BufferedReader reader = getVmxReader( vmxContent, length );
String line;
while ( ( line = reader.readLine() ) != null ) {
KeyValuePair entry = parse( line );
@@ -98,6 +89,20 @@ public class VmwareConfig
}
}
+ public static BufferedReader getVmxReader( byte[] vmxContent, int length ) throws IOException {
+ String csName = detectCharset( new ByteArrayInputStream( vmxContent, 0, length ) );
+ Charset cs = null;
+ try {
+ cs = Charset.forName( csName );
+ } catch ( Exception e ) {
+ LOGGER.warn( "Could not instantiate charset " + csName, e );
+ }
+ if ( cs == null )
+ cs = StandardCharsets.ISO_8859_1;
+ return new BufferedReader( new InputStreamReader( new ByteArrayInputStream( vmxContent, 0, length ), cs ) );
+
+ }
+
private String unescape( String value )
{
String ret = value;
@@ -110,7 +115,7 @@ public class VmwareConfig
return ret;
}
- private String detectCharset( InputStream is )
+ public static String detectCharset( InputStream is )
{
try {
BufferedReader csDetectReader = new BufferedReader( new InputStreamReader( is, StandardCharsets.ISO_8859_1 ) );
@@ -140,7 +145,7 @@ public class VmwareConfig
private static final Pattern settingMatcher2 = Pattern.compile( "^\\s*(#?[a-z0-9\\.\\:_]+)\\s*=\\s*([^\"]*)\\s*$",
Pattern.CASE_INSENSITIVE );
- private KeyValuePair parse( String line )
+ private static KeyValuePair parse( String line )
{
Matcher matcher = settingMatcher1.matcher( line );
if ( !matcher.matches() ) {
diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift
index 4985da0..e60574d 100644
--- a/src/main/thrift/bwlp.thrift
+++ b/src/main/thrift/bwlp.thrift
@@ -526,6 +526,14 @@ service SatelliteServer {
void setImageVersionExpiry(1: Token userToken, 2: UUID imageBaseId 3: UnixTimestamp expireTime)
throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInvocationException serverError, 4:TInvalidDateParam dateError),
+ // Get image's VM metadata for the given version
+ binary getImageVersionVirtConfig(1: Token userToken, 2: UUID imageVersionId)
+ throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInvocationException serverError),
+
+ // Set image's VM metadata for the given version
+ binary setImageVersionVirtConfig(1: Token userToken, 2: UUID imageVersionId, 3: binary meta)
+ throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInvocationException serverError),
+
// Client asks server to replicate an image from the master server
UUID requestImageReplication(1:Token userToken, 2: UUID imageVersionId)
throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInvocationException serverError),