private static ConnectionRecordModel createModel(RemoteAuthenticatedUser user,
            ModeledConnection connection,
            ModeledSharingProfile sharingProfile) {

        // Create model object representing an active connection that started
        // at the current time ...
        ConnectionRecordModel recordModel = new ConnectionRecordModel();
        recordModel.setStartDate(new Date());

        // ... was established by the given user ...
        recordModel.setUsername(user.getIdentifier());
        recordModel.setRemoteHost(user.getRemoteHost());

        // ... to the given connection ...
        recordModel.setConnectionIdentifier(connection.getIdentifier());
        recordModel.setConnectionName(connection.getName());

        // ... using the given sharing profile (if any)
        if (sharingProfile != null) {
            recordModel.setSharingProfileIdentifier(sharingProfile.getIdentifier());
            recordModel.setSharingProfileName(sharingProfile.getName());
        }

        return recordModel;
        
    }
Creates a new connection record model object, associating it with the
given user, connection, and sharing profile. The given sharing profile
MUST be the sharing profile that was used to share access to the given
connection. The start date of this connection record will be the time of
its creation. No end date will be assigned.

@param user
    The user that connected to the connection associated with this
    connection record.

@param connection
    The connection to associate with this connection record.

@param sharingProfile
    The sharing profile that was used to share access to the given
    connection, or null if no sharing profile was used.

@return
    A new connection record model object associated with the given user,
    connection, and sharing profile, and having the current date/time as
    its start date.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/ActiveConnectionRecord.java