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