diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connection.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connection.java index 3d8e64d64..24cf49c72 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connection.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connection.java @@ -34,20 +34,7 @@ import org.apache.guacamole.protocol.GuacamoleConfiguration; * backing GuacamoleConfiguration may be intentionally obfuscated or tokenized * to protect sensitive configuration information. */ -public interface Connection extends Identifiable, Connectable, Attributes { - - /** - * Returns the name assigned to this Connection. - * @return The name assigned to this Connection. - */ - public String getName(); - - /** - * Sets the name assigned to this Connection. - * - * @param name The name to assign. - */ - public void setName(String name); +public interface Connection extends Identifiable, Connectable, Attributes, Nameable { /** * Returns the unique identifier of the parent ConnectionGroup for diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/ConnectionGroup.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/ConnectionGroup.java index 74412de7d..a080afcc5 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/ConnectionGroup.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/ConnectionGroup.java @@ -26,7 +26,7 @@ import org.apache.guacamole.GuacamoleException; * Represents a connection group, which can contain both other connection groups * as well as connections. */ -public interface ConnectionGroup extends Identifiable, Connectable, Attributes { +public interface ConnectionGroup extends Identifiable, Connectable, Attributes, Nameable { /** * All legal types of connection group. @@ -51,19 +51,6 @@ public interface ConnectionGroup extends Identifiable, Connectable, Attributes { }; - /** - * Returns the name assigned to this ConnectionGroup. - * @return The name assigned to this ConnectionGroup. - */ - public String getName(); - - /** - * Sets the name assigned to this ConnectionGroup. - * - * @param name The name to assign. - */ - public void setName(String name); - /** * Returns the unique identifier of the parent ConnectionGroup for * this ConnectionGroup. diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Nameable.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Nameable.java new file mode 100644 index 000000000..d40206054 --- /dev/null +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Nameable.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.guacamole.net.auth; + +/** + * An object which has a human-readable, arbitrary name. No requirement is + * imposed by this interface regarding whether this name must be unique, + * however implementations are free to impose such restrictions. + */ +public interface Nameable { + + /** + * Returns the human-readable name assigned to this object. + * + * @return + * The name assigned to this object. + */ + String getName(); + + /** + * Sets the human-readable name assigned to this object. + * + * @param name + * The name to assign. + */ + void setName(String name); + +} diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/SharingProfile.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/SharingProfile.java index 2d4c4326a..1fe75d912 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/SharingProfile.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/SharingProfile.java @@ -25,23 +25,7 @@ import java.util.Map; * Represents the semantics which apply to an existing connection when shared, * along with a human-readable name and unique identifier. */ -public interface SharingProfile extends Identifiable, Attributes { - - /** - * Returns the human-readable name assigned to this SharingProfile. - * - * @return - * The name assigned to this SharingProfile. - */ - public String getName(); - - /** - * Sets the human-readable name assigned to this SharingProfile. - * - * @param name - * The name to assign. - */ - public void setName(String name); +public interface SharingProfile extends Identifiable, Attributes, Nameable { /** * Returns the identifier of the primary connection associated with this