private void addConnections(Collection<Connection> connections) throws GuacamoleException {
  for (  Connection connection : connections) {
    APIConnectionGroup parent=retrievedGroups.get(connection.getParentIdentifier());
    if (parent != null) {
      Collection<APIConnection> children=parent.getChildConnections();
      if (children == null) {
        children=new ArrayList<APIConnection>();
        parent.setChildConnections(children);
      }
      APIConnection apiConnection=new APIConnection(connection);
      retrievedConnections.put(connection.getIdentifier(),apiConnection);
      children.add(apiConnection);
    }
 else     logger.debug("Connection \"{}\" cannot be added to the tree: parent \"{}\" does not actually exist.",connection.getIdentifier(),connection.getParentIdentifier());
  }
}

private void addConnections ( Collection < Connection > connections ) throws GuacamoleException { for ( Connection connection : connections ) { APIConnectionGroup parent = retrievedGroups . get ( connection . getParentIdentifier ( ) ) ; if ( parent != null ) { Collection < APIConnection > children = parent . getChildConnections ( ) ; if ( children == null ) { children = new ArrayList < APIConnection > ( ) ; parent . setChildConnections ( children ) ; } APIConnection apiConnection = new APIConnection ( connection ) ; retrievedConnections . put ( connection . getIdentifier ( ) , apiConnection ) ; children . add ( apiConnection ) ; } else logger . debug ( "Connection \"{}\" cannot be added to the tree: parent \"{}\" does not actually exist." , connection . getIdentifier ( ) , connection . getParentIdentifier ( ) ) ; } }
adds each of the provided connections to the current tree as children of their respective parents . the parent connection groups must already be added .
