summaryrefslogtreecommitdiffstats
path: root/src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java
blob: 5e0266d5d0a7177bf1bbd7b1bb4f9911b36e19b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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();
    }
}