diff options
author | Simon Rettberg | 2017-03-03 12:05:53 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-03-03 12:05:53 +0100 |
commit | 914e14124ff21bb83a016757e8332a11317f7165 (patch) | |
tree | 9a435c6a7cd576f5571d9427b8ee14f39c7034f0 /dozentenmodulserver | |
parent | [server] Add headers to outgoing mails that prevent auto-responders from trig... (diff) | |
download | tutor-module-914e14124ff21bb83a016757e8332a11317f7165.tar.gz tutor-module-914e14124ff21bb83a016757e8332a11317f7165.tar.xz tutor-module-914e14124ff21bb83a016757e8332a11317f7165.zip |
[server] Implement getSupportedFeatures()
Diffstat (limited to 'dozentenmodulserver')
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java | 25 | ||||
-rw-r--r-- | dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java | 6 |
2 files changed, 31 insertions, 0 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java new file mode 100644 index 00000000..73d1a788 --- /dev/null +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/SupportedFeatures.java @@ -0,0 +1,25 @@ +package org.openslx.bwlp.sat; + +import org.openslx.sat.thrift.version.Feature; + +public class SupportedFeatures { + + private static String supportedFeatures = null; + + static { + registerFeature(Feature.EXTEND_EXPIRED_VM); + } + + public static String getFeatureString() { + return supportedFeatures; + } + + private static void registerFeature(Feature feature) { + if (supportedFeatures == null) { + supportedFeatures = feature.name(); + } else { + supportedFeatures += " " + feature.name(); + } + } + +} diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java index c405714b..f9ab5a54 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java @@ -9,6 +9,7 @@ import java.util.Map; import org.apache.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.sat.RuntimeConfig; +import org.openslx.bwlp.sat.SupportedFeatures; import org.openslx.bwlp.sat.database.mappers.DbImage; import org.openslx.bwlp.sat.database.mappers.DbImage.DeleteState; import org.openslx.bwlp.sat.database.mappers.DbImagePermissions; @@ -82,6 +83,11 @@ public class ServerHandler implements SatelliteServer.Iface { return Version.VERSION; return Math.max(clientVersion, Version.MIN_VERSION); } + + @Override + public String getSupportedFeatures() { + return SupportedFeatures.getFeatureString(); + } @Override public SatelliteConfig getConfiguration() { |