public String create ( GuacamoleConfiguration config ) throws GuacamoleException { // Get the next available connection identifier. String newConnectionId = Integer . toString ( getNextConnectionID ( ) ) ; // Generate a name for the configuration. String name = QCParser . getName ( config ) ; // Create a new connection and set the parent identifier. Connection connection = new SimpleConnection ( name , newConnectionId , config , true ) ; connection . setParentIdentifier ( QuickConnectUserContext . ROOT_IDENTIFIER ) ; // Place the object in this directory. add ( connection ) ; // Add connection to the tree. rootGroup . addConnectionIdentifier ( newConnectionId ) ; return newConnectionId ; }
Create a SimpleConnection object from a GuacamoleConfiguration obtain an identifier and place it on the tree returning the identifier value of the new connection .