From cc2d730f0c71d4642cf122733eec2a67eea90036 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 26 Jan 2017 16:03:40 +0100 Subject: Add Feature support for dozmod; add allowLoginByDefault option --- pom.xml | 2 +- .../openslx/bwlp/thrift/iface/SatelliteConfig.java | 110 ++- .../openslx/bwlp/thrift/iface/SatelliteServer.java | 739 ++++++++++++++++++++- .../org/openslx/sat/thrift/version/Feature.java | 12 + src/main/thrift/bwlp.thrift | 6 + 5 files changed, 862 insertions(+), 7 deletions(-) create mode 100644 src/main/java/org/openslx/sat/thrift/version/Feature.java diff --git a/pom.xml b/pom.xml index 5f10585..15765a8 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,7 @@ org.apache.thrift libthrift - [0.9.1,1.0.0] + [0.9.1,0.9.9] compile diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java index f9ec5f2..08482a7 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.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-01-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-01-24") public class SatelliteConfig implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SatelliteConfig"); @@ -46,6 +46,7 @@ public class SatelliteConfig implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -61,6 +62,7 @@ public class SatelliteConfig implements org.apache.thrift.TBase byName = new HashMap(); @@ -102,6 +105,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -169,6 +175,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase blockHashes, ByteBuffer machineDescription) throws TTransferRejectedException, TAuthorizationException, TInvocationException, TNotFoundException, org.apache.thrift.TException; @@ -129,6 +131,8 @@ public class SatelliteServer { public void getVersion(long clientVersion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getSupportedFeatures(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getConfiguration(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void requestImageVersionUpload(String userToken, String imageBaseId, long fileSize, List blockHashes, ByteBuffer machineDescription, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -256,6 +260,28 @@ public class SatelliteServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getVersion failed: unknown result"); } + public String getSupportedFeatures() throws org.apache.thrift.TException + { + send_getSupportedFeatures(); + return recv_getSupportedFeatures(); + } + + public void send_getSupportedFeatures() throws org.apache.thrift.TException + { + getSupportedFeatures_args args = new getSupportedFeatures_args(); + sendBase("getSupportedFeatures", args); + } + + public String recv_getSupportedFeatures() throws org.apache.thrift.TException + { + getSupportedFeatures_result result = new getSupportedFeatures_result(); + receiveBase(result, "getSupportedFeatures"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSupportedFeatures failed: unknown result"); + } + public SatelliteConfig getConfiguration() throws org.apache.thrift.TException { send_getConfiguration(); @@ -1509,6 +1535,35 @@ public class SatelliteServer { } } + public void getSupportedFeatures(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getSupportedFeatures_call method_call = new getSupportedFeatures_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getSupportedFeatures_call extends org.apache.thrift.async.TAsyncMethodCall { + public getSupportedFeatures_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSupportedFeatures", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getSupportedFeatures_args args = new getSupportedFeatures_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getSupportedFeatures(); + } + } + public void getConfiguration(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getConfiguration_call method_call = new getConfiguration_call(resultHandler, this, ___protocolFactory, ___transport); @@ -2940,6 +2995,7 @@ public class SatelliteServer { private static Map> getProcessMap(Map> processMap) { processMap.put("getVersion", new getVersion()); + processMap.put("getSupportedFeatures", new getSupportedFeatures()); processMap.put("getConfiguration", new getConfiguration()); processMap.put("requestImageVersionUpload", new requestImageVersionUpload()); processMap.put("updateBlockHashes", new updateBlockHashes()); @@ -3005,6 +3061,26 @@ public class SatelliteServer { } } + public static class getSupportedFeatures extends org.apache.thrift.ProcessFunction { + public getSupportedFeatures() { + super("getSupportedFeatures"); + } + + public getSupportedFeatures_args getEmptyArgsInstance() { + return new getSupportedFeatures_args(); + } + + protected boolean isOneway() { + return false; + } + + public getSupportedFeatures_result getResult(I iface, getSupportedFeatures_args args) throws org.apache.thrift.TException { + getSupportedFeatures_result result = new getSupportedFeatures_result(); + result.success = iface.getSupportedFeatures(); + return result; + } + } + public static class getConfiguration extends org.apache.thrift.ProcessFunction { public getConfiguration() { super("getConfiguration"); @@ -4095,6 +4171,7 @@ public class SatelliteServer { private static Map> getProcessMap(Map> processMap) { processMap.put("getVersion", new getVersion()); + processMap.put("getSupportedFeatures", new getSupportedFeatures()); processMap.put("getConfiguration", new getConfiguration()); processMap.put("requestImageVersionUpload", new requestImageVersionUpload()); processMap.put("updateBlockHashes", new updateBlockHashes()); @@ -4191,6 +4268,57 @@ public class SatelliteServer { } } + public static class getSupportedFeatures extends org.apache.thrift.AsyncProcessFunction { + public getSupportedFeatures() { + super("getSupportedFeatures"); + } + + public getSupportedFeatures_args getEmptyArgsInstance() { + return new getSupportedFeatures_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(String o) { + getSupportedFeatures_result result = new getSupportedFeatures_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; + getSupportedFeatures_result result = new getSupportedFeatures_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getSupportedFeatures_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getSupportedFeatures(resultHandler); + } + } + public static class getConfiguration extends org.apache.thrift.AsyncProcessFunction { public getConfiguration() { super("getConfiguration"); @@ -7486,6 +7614,615 @@ public class SatelliteServer { } + public static class getSupportedFeatures_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupportedFeatures_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSupportedFeatures_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSupportedFeatures_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupportedFeatures_args.class, metaDataMap); + } + + public getSupportedFeatures_args() { + } + + /** + * Performs a deep copy on other. + */ + public getSupportedFeatures_args(getSupportedFeatures_args other) { + } + + public getSupportedFeatures_args deepCopy() { + return new getSupportedFeatures_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSupportedFeatures_args) + return this.equals((getSupportedFeatures_args)that); + return false; + } + + public boolean equals(getSupportedFeatures_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getSupportedFeatures_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSupportedFeatures_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getSupportedFeatures_argsStandardSchemeFactory implements SchemeFactory { + public getSupportedFeatures_argsStandardScheme getScheme() { + return new getSupportedFeatures_argsStandardScheme(); + } + } + + private static class getSupportedFeatures_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSupportedFeatures_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getSupportedFeatures_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSupportedFeatures_argsTupleSchemeFactory implements SchemeFactory { + public getSupportedFeatures_argsTupleScheme getScheme() { + return new getSupportedFeatures_argsTupleScheme(); + } + } + + private static class getSupportedFeatures_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSupportedFeatures_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSupportedFeatures_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getSupportedFeatures_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSupportedFeatures_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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getSupportedFeatures_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getSupportedFeatures_resultTupleSchemeFactory()); + } + + public String success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSupportedFeatures_result.class, metaDataMap); + } + + public getSupportedFeatures_result() { + } + + public getSupportedFeatures_result( + String success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getSupportedFeatures_result(getSupportedFeatures_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public getSupportedFeatures_result deepCopy() { + return new getSupportedFeatures_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public String getSuccess() { + return this.success; + } + + public getSupportedFeatures_result setSuccess(String success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getSupportedFeatures_result) + return this.equals((getSupportedFeatures_result)that); + return false; + } + + public boolean equals(getSupportedFeatures_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(getSupportedFeatures_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getSupportedFeatures_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getSupportedFeatures_resultStandardSchemeFactory implements SchemeFactory { + public getSupportedFeatures_resultStandardScheme getScheme() { + return new getSupportedFeatures_resultStandardScheme(); + } + } + + private static class getSupportedFeatures_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getSupportedFeatures_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.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getSupportedFeatures_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getSupportedFeatures_resultTupleSchemeFactory implements SchemeFactory { + public getSupportedFeatures_resultTupleScheme getScheme() { + return new getSupportedFeatures_resultTupleScheme(); + } + } + + private static class getSupportedFeatures_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getSupportedFeatures_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getSupportedFeatures_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + + } + public static class getConfiguration_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getConfiguration_args"); diff --git a/src/main/java/org/openslx/sat/thrift/version/Feature.java b/src/main/java/org/openslx/sat/thrift/version/Feature.java new file mode 100644 index 0000000..d3d45b8 --- /dev/null +++ b/src/main/java/org/openslx/sat/thrift/version/Feature.java @@ -0,0 +1,12 @@ +package org.openslx.sat.thrift.version; + +public enum Feature { + + /** + * Server can properly extend the expiration time of an image version that + * is already expired, but has not been deleted yet. (Early versions of dmsd + * did not handle this case properly.) + */ + EXTEND_EXPIRED_VM, + +} diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index 47f0964..12fa302 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -353,6 +353,8 @@ struct SatelliteConfig { 7: optional i32 maxConnectionsPerTransfer, // Maximum number of locations per lecture 8: optional i32 maxLocationsPerLecture, + // Whether users connecting to the sat for the first time are allowed to login + 9: optional bool allowLoginByDefault, } struct SatelliteStatus { @@ -406,6 +408,10 @@ service SatelliteServer { // Get server (thrift interface) version int getVersion(1: int clientVersion), + // Get server features. Kinda superseding getVersion, as it's reasier to handle minor updates + // This returns a space separated list of keywords which represent certain features + string getSupportedFeatures(), + // Get configuration parameters of this satellite server SatelliteConfig getConfiguration(), -- cgit v1.2.3-55-g7522