summaryrefslogtreecommitdiffstats
path: root/src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java
diff options
context:
space:
mode:
authorUdo Walter2020-05-07 19:30:48 +0200
committerUdo Walter2020-05-07 19:30:48 +0200
commit90f06cbe0b2ff3b1a9d85d2f73fe5864e692341b (patch)
tree17139070c9ac144f9cd214a01e4af5e86a895dbe /src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java
parentPrevent user from sticking to connection if it was reset. (diff)
downloadbwlp-guacamole-ext-90f06cbe0b2ff3b1a9d85d2f73fe5864e692341b.tar.gz
bwlp-guacamole-ext-90f06cbe0b2ff3b1a9d85d2f73fe5864e692341b.tar.xz
bwlp-guacamole-ext-90f06cbe0b2ff3b1a9d85d2f73fe5864e692341b.zip
Add location selection
Diffstat (limited to 'src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java')
-rw-r--r--src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java b/src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java
new file mode 100644
index 0000000..5e0266d
--- /dev/null
+++ b/src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java
@@ -0,0 +1,26 @@
+package de.bwlehrpool.bwlp_guac;
+
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.form.Field;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Collection;
+
+/**
+ * Field which lets the user select a location.
+ */
+public class LocationField extends Field {
+
+ public LocationField() {
+ super("location", "LOCATION");
+ }
+
+ @JsonProperty("locations")
+ public Collection<JsonLocation> getLocations() throws GuacamoleException {
+ return ConnectionManager.getLocationPool().values();
+ }
+} \ No newline at end of file