mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	Ticket #263: More work on connection groups.
This commit is contained in:
		| @@ -47,6 +47,11 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; | ||||
|  */ | ||||
| public abstract class AbstractConnection implements Connection { | ||||
|  | ||||
|     /** | ||||
|      * The name associated with this connection. | ||||
|      */ | ||||
|     private String name; | ||||
|  | ||||
|     /** | ||||
|      * The unique identifier associated with this connection. | ||||
|      */ | ||||
| @@ -57,6 +62,16 @@ public abstract class AbstractConnection implements Connection { | ||||
|      */ | ||||
|     private GuacamoleConfiguration configuration; | ||||
|  | ||||
|     @Override | ||||
|     public String getName() { | ||||
|         return name; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void setName(String name) { | ||||
|         this.name = name; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getIdentifier() { | ||||
|         return identifier; | ||||
|   | ||||
| @@ -45,10 +45,25 @@ package net.sourceforge.guacamole.net.auth; | ||||
|  */ | ||||
| public abstract class AbstractConnectionGroup implements ConnectionGroup { | ||||
|  | ||||
|     /** | ||||
|      * The name associated with this connection group. | ||||
|      */ | ||||
|     private String name; | ||||
|  | ||||
|     /** | ||||
|      * The unique identifier associated with this connection group. | ||||
|      */ | ||||
|     private String identifier; | ||||
|      | ||||
|     @Override | ||||
|     public String getName() { | ||||
|         return name; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void setName(String name) { | ||||
|         this.name = name; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getIdentifier() { | ||||
|   | ||||
| @@ -54,6 +54,19 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; | ||||
|  */ | ||||
| public interface Connection { | ||||
|  | ||||
|     /** | ||||
|      * 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 identifier The name to assign. | ||||
|      */ | ||||
|     public void setName(String name); | ||||
|  | ||||
|     /** | ||||
|      * Returns the unique identifier assigned to this Connection. | ||||
|      * @return The unique identifier assigned to this Connection. | ||||
|   | ||||
| @@ -50,6 +50,19 @@ import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; | ||||
|  */ | ||||
| public interface ConnectionGroup { | ||||
|  | ||||
|     /** | ||||
|      * 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 identifier The name to assign. | ||||
|      */ | ||||
|     public void setName(String name); | ||||
|  | ||||
|     /** | ||||
|      * Returns the unique identifier assigned to this ConnectionGroup. | ||||
|      * @return The unique identifier assigned to this ConnectionGroup. | ||||
| @@ -62,6 +75,19 @@ public interface ConnectionGroup { | ||||
|      * @param identifier The identifier to assign. | ||||
|      */ | ||||
|     public void setIdentifier(String identifier); | ||||
|      | ||||
|     /** | ||||
|      * Sets whether this is a balancing ConnectionGroup. | ||||
|      * | ||||
|      * @param balancing whether this is a balancing ConnectionGroup. | ||||
|      */ | ||||
|     public void setBalancing(boolean balancing); | ||||
|      | ||||
|     /** | ||||
|      * Returns true if this is a balancing ConnectionGroup, false otherwise. | ||||
|      * @return true if this is a balancing ConnectionGroup, false otherwise. | ||||
|      */ | ||||
|     public boolean isBalancing(); | ||||
|  | ||||
|     /** | ||||
|      * Retrieves a Directory which can be used to view and manipulate | ||||
|   | ||||
| @@ -73,12 +73,16 @@ public class SimpleConnection extends AbstractConnection { | ||||
|      * Creates a new SimpleConnection having the given identifier and | ||||
|      * GuacamoleConfiguration. | ||||
|      * | ||||
|      * @param identifier The identifier to associated with this connection. | ||||
|      * @param name The name to associate with this connection. | ||||
|      * @param identifier The identifier to associate with this connection. | ||||
|      * @param config The configuration describing how to connect to this | ||||
|      *               connection. | ||||
|      */ | ||||
|     public SimpleConnection(String identifier, | ||||
|     public SimpleConnection(String name, String identifier, | ||||
|             GuacamoleConfiguration config) { | ||||
|          | ||||
|         // Set name | ||||
|         setName(name); | ||||
|  | ||||
|         // Set identifier | ||||
|         setIdentifier(identifier); | ||||
|   | ||||
| @@ -76,7 +76,8 @@ public class SimpleConnectionDirectory | ||||
|         // Create connections for each config | ||||
|         for (Entry<String, GuacamoleConfiguration> entry : configs.entrySet()) | ||||
|             connections.put(entry.getKey(), | ||||
|                     new SimpleConnection(entry.getKey(), entry.getValue())); | ||||
|                     new SimpleConnection(entry.getKey(), entry.getKey(),  | ||||
|                 entry.getValue())); | ||||
|  | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -84,4 +84,15 @@ 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