summaryrefslogblamecommitdiffstats
path: root/src/main/java/de/bwlehrpool/bwlp_guac/LocationField.java
blob: 5e0266d5d0a7177bf1bbd7b1bb4f9911b36e19b0 (plain) (tree)

























                                                                              
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();
    }
}