GUACAMOLE-1224: Extract getName() / setName() into common Nameable interface.

This commit is contained in:
Michael Jumper
2022-09-22 10:41:36 -07:00
parent 417587259f
commit 79a1bcb2a3
4 changed files with 48 additions and 45 deletions

View File

@@ -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

View File

@@ -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.

View File

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

View File

@@ -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