diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connectable.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connectable.java index 407ad7ad5..2f3326fdc 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connectable.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connectable.java @@ -19,6 +19,7 @@ package org.apache.guacamole.net.auth; +import java.util.Collections; import java.util.Map; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.net.GuacamoleTunnel; @@ -38,6 +39,37 @@ public interface Connectable { * copy of the interface such that they are binary compatible. */ + /** + * Establishes a connection to guacd using the information associated with + * this object. The connection will be provided the given client + * information. + * + * @deprecated + * This function has been deprecated in favor of + * {@link #connect(org.apache.guacamole.protocol.GuacamoleClientInformation, java.util.Map)}, + * which allows for connection parameter tokens to be injected and + * applied by cooperating extensions, replacing the functionality + * previously provided through the {@link org.apache.guacamole.token.StandardTokens} + * class. It continues to be defined on this interface for + * compatibility. New implementations should instead implement + * {@link #connect(org.apache.guacamole.protocol.GuacamoleClientInformation, java.util.Map)}. + * + * @param info + * Information associated with the connecting client. + * + * @return + * A fully-established GuacamoleTunnel. + * + * @throws GuacamoleException + * If an error occurs while connecting to guacd, or if permission to + * connect is denied. + */ + @Deprecated + default GuacamoleTunnel connect(GuacamoleClientInformation info) + throws GuacamoleException { + return this.connect(info, Collections.emptyMap()); + } + /** * Establishes a connection to guacd using the information associated with * this object. The connection will be provided the given client diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java index 26cc7dc03..2934cbe9f 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleConnection.java @@ -196,31 +196,7 @@ public class SimpleConnection extends AbstractConnection { // Do nothing - there are no attributes } - /** - * Establishes a connection to guacd using the information associated with - * this object. The connection will be provided the given client - * information. - * - *

This definition is the legacy connect() definition from 1.0.0 and - * older. It is redefined here for the sake of ABI compatibility with - * 1.0.0 but is no longer defined within the - * {@link org.apache.guacamole.net.auth.Connectable} interface. - * - * @deprecated - * This definition exists solely for binary compatibility. It should - * never be used by new code. New implementations should instead use - * {@link #connect(org.apache.guacamole.protocol.GuacamoleClientInformation, java.util.Map)}. - * - * @param info - * Information associated with the connecting client. - * - * @return - * A fully-established GuacamoleTunnel. - * - * @throws GuacamoleException - * If an error occurs while connecting to guacd, or if permission to - * connect is denied. - */ + @Override @Deprecated public GuacamoleTunnel connect(GuacamoleClientInformation info) throws GuacamoleException { diff --git a/guacamole/src/main/java/org/apache/guacamole/net/auth/Connectable.java b/guacamole/src/main/java/org/apache/guacamole/net/auth/Connectable.java index 849d49a13..e09baa1d8 100644 --- a/guacamole/src/main/java/org/apache/guacamole/net/auth/Connectable.java +++ b/guacamole/src/main/java/org/apache/guacamole/net/auth/Connectable.java @@ -46,7 +46,7 @@ public interface Connectable { * *

This definition is the legacy connect() definition from 1.0.0 and * older. It is redefined here for the sake of ABI compatibility with - * 1.0.0 but is no longer defined within guacamole-ext. + * 1.0.0 but is deprecated within guacamole-ext. * * @deprecated * This definition exists solely for binary compatibility. It should