GUAC-800: Migrate to JSON for protocol descriptions. Use full Forms instead of simply Fields for protocol parameters (allow sections).

This commit is contained in:
Michael Jumper committed 2015-05-25 19:56:53 -07:00
1 parent 96f5ab1bbd
commit 43fab89ecf
31 files changed
+1271 -877

No files matched your search

@@ -24,7 +24,7 @@ package org.glyptodon.guacamole.net.auth;
import java.util.Collection;
import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.form.Parameter;
import org.glyptodon.guacamole.form.Field;
/**
* The context of an active user. The functions of this class enforce all
@@ -121,7 +121,7 @@ public interface UserContext {
* @return
* A collection of all attributes applicable to users.
*/
Collection<Parameter> getUserAttributes();
Collection<Field> getUserAttributes();
/**
* Retrieves a collection of all attributes applicable to connections. This
@@ -132,7 +132,7 @@ public interface UserContext {
* @return
* A collection of all attributes applicable to connections.
*/
Collection<Parameter> getConnectionAttributes();
Collection<Field> getConnectionAttributes();
/**
* Retrieves a collection of all attributes applicable to connection
@@ -143,6 +143,6 @@ public interface UserContext {
* @return
* A collection of all attributes applicable to connection groups.
*/
Collection<Parameter> getConnectionGroupAttributes();
Collection<Field> getConnectionGroupAttributes();
}
@@ -25,7 +25,7 @@ package org.glyptodon.guacamole.net.auth.credentials;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import org.glyptodon.guacamole.form.Parameter;
import org.glyptodon.guacamole.form.Field;
/**
* Information which describes a set of valid credentials.
@@ -35,45 +35,45 @@ import org.glyptodon.guacamole.form.Parameter;
public class CredentialsInfo {
/**
* All parameters required for valid credentials.
* All fields required for valid credentials.
*/
private final Collection<Parameter> parameters;
private final Collection<Field> fields;
/**
* Creates a new CredentialsInfo object which requires the given parameters
* for any conforming credentials.
* Creates a new CredentialsInfo object which requires the given fields for
* any conforming credentials.
*
* @param parameters
* The parameters to require.
* @param fields
* The fields to require.
*/
public CredentialsInfo(Collection<Parameter> parameters) {
this.parameters = parameters;
public CredentialsInfo(Collection<Field> fields) {
this.fields = fields;
}
/**
* Returns all parameters required for valid credentials as described by
* this object.
* Returns all fields required for valid credentials as described by this
* object.
*
* @return
* All parameters required for valid credentials.
* All fields required for valid credentials.
*/
public Collection<Parameter> getParameters() {
return Collections.unmodifiableCollection(parameters);
public Collection<Field> getFields() {
return Collections.unmodifiableCollection(fields);
}
/**
* CredentialsInfo object which describes empty credentials. No parameters
* are required.
* CredentialsInfo object which describes empty credentials. No fields are
* required.
*/
public static final CredentialsInfo EMPTY = new CredentialsInfo(Collections.<Parameter>emptyList());
public static final CredentialsInfo EMPTY = new CredentialsInfo(Collections.<Field>emptyList());
/**
* CredentialsInfo object which describes standard username/password
* credentials.
*/
public static final CredentialsInfo USERNAME_PASSWORD = new CredentialsInfo(Arrays.asList(
new Parameter("username", "username", Parameter.Type.USERNAME),
new Parameter("password", "password", Parameter.Type.PASSWORD)
new Field("username", "username", Field.Type.USERNAME),
new Field("password", "password", Field.Type.PASSWORD)
));
}
@@ -28,7 +28,7 @@ import java.util.Collections;
import java.util.Map;
import java.util.UUID;
import org.glyptodon.guacamole.GuacamoleException;
import org.glyptodon.guacamole.form.Parameter;
import org.glyptodon.guacamole.form.Field;
import org.glyptodon.guacamole.net.auth.ActiveConnection;
import org.glyptodon.guacamole.net.auth.Connection;
import org.glyptodon.guacamole.net.auth.ConnectionGroup;
@@ -176,18 +176,18 @@ public class SimpleUserContext implements UserContext {
}
@Override
public Collection<Parameter> getUserAttributes() {
return Collections.<Parameter>emptyList();
public Collection<Field> getUserAttributes() {
return Collections.<Field>emptyList();
}
@Override
public Collection<Parameter> getConnectionAttributes() {
return Collections.<Parameter>emptyList();
public Collection<Field> getConnectionAttributes() {
return Collections.<Field>emptyList();
}
@Override
public Collection<Parameter> getConnectionGroupAttributes() {
return Collections.<Parameter>emptyList();
public Collection<Field> getConnectionGroupAttributes() {
return Collections.<Field>emptyList();
}
}