mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	Ticket #263: Switched to enum for connection group type.
This commit is contained in:
		| @@ -55,6 +55,11 @@ public abstract class AbstractConnectionGroup implements ConnectionGroup { | ||||
|      */ | ||||
|     private String identifier; | ||||
|      | ||||
|     /** | ||||
|      * The type of this connection group. | ||||
|      */ | ||||
|     private ConnectionGroup.Type type; | ||||
|      | ||||
|     @Override | ||||
|     public String getName() { | ||||
|         return name; | ||||
| @@ -74,6 +79,16 @@ public abstract class AbstractConnectionGroup implements ConnectionGroup { | ||||
|     public void setIdentifier(String identifier) { | ||||
|         this.identifier = identifier; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public ConnectionGroup.Type getType() { | ||||
|         return type; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public void setType(ConnectionGroup.Type type) { | ||||
|         this.type = type; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int hashCode() { | ||||
|   | ||||
| @@ -49,6 +49,10 @@ import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public interface ConnectionGroup { | ||||
|      | ||||
|     public enum Type { | ||||
|         ORGANIZATIONAL, BALANCING | ||||
|     }; | ||||
|  | ||||
|     /** | ||||
|      * Returns the name assigned to this ConnectionGroup. | ||||
| @@ -77,17 +81,17 @@ public interface ConnectionGroup { | ||||
|     public void setIdentifier(String identifier); | ||||
|      | ||||
|     /** | ||||
|      * Sets whether this is a balancing ConnectionGroup. | ||||
|      * Set the type of this ConnectionGroup. | ||||
|      * | ||||
|      * @param balancing whether this is a balancing ConnectionGroup. | ||||
|      * @param type The type of this ConnectionGroup. | ||||
|      */ | ||||
|     public void setBalancing(boolean balancing); | ||||
|     public void setType(Type type); | ||||
|      | ||||
|     /** | ||||
|      * Returns true if this is a balancing ConnectionGroup, false otherwise. | ||||
|      * @return true if this is a balancing ConnectionGroup, false otherwise. | ||||
|      * Returns the type of this connection. | ||||
|      * @return the type of this connection. | ||||
|      */ | ||||
|     public boolean isBalancing(); | ||||
|     public Type getType(); | ||||
|  | ||||
|     /** | ||||
|      * Retrieves a Directory which can be used to view and manipulate | ||||
|   | ||||
| @@ -64,6 +64,7 @@ public class SimpleConnectionGroup extends AbstractConnectionGroup { | ||||
|             Directory<String, ConnectionGroup> connectionGroupDirectory) { | ||||
|         this.connectionDirectory = connectionDirectory; | ||||
|         this.connectionGroupDirectory = connectionGroupDirectory; | ||||
|         this.setType(ConnectionGroup.Type.ORGANIZATIONAL); | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
| @@ -84,15 +85,4 @@ public class SimpleConnectionGroup extends AbstractConnectionGroup { | ||||
|         throw new GuacamoleSecurityException("Permission denied."); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void setBalancing(boolean balancing) { | ||||
|         // All SimpleConnectionGroups are organizational only | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean isBalancing() { | ||||
|         // All SimpleConnectionGroups are organizational only  | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user