Class ConnectionDAO


  • public class ConnectionDAO
    extends Object
    • Constructor Detail

      • ConnectionDAO

        public ConnectionDAO()
    • Method Detail

      • getConnection

        public ConnectionDetail getConnection​(Connection con,
                                              String componentId,
                                              String userId)
                                       throws SQLException
        Return a connection for componentId and userId
        Parameters:
        con - : Connection
        componentId - : String component identifier
        userId - : String user identifier
        Returns:
        connection : ConnectionDetail
        Throws:
        SQLException
      • getConnectionById

        public ConnectionDetail getConnectionById​(Connection con,
                                                  String connectionId)
                                           throws SQLException
        Return a connection corresponding to connectionId
        Parameters:
        con - : Connection
        connectionId - : String the connection identifier
        Returns:
        connection : ConnectionDetail
        Throws:
        SQLException
      • deleteConnection

        public void deleteConnection​(Connection con,
                                     String connectionId)
                              throws SQLException
        delete the connection corresponding to connectionId
        Parameters:
        con - : Connection
        connectionId - : String the connection identifier
        Throws:
        SQLException
      • updateConnection

        public void updateConnection​(Connection con,
                                     String connectionId,
                                     String login,
                                     String password)
                              throws SQLException
        update the connection corresponding to connectionId, with the login and the password
        Parameters:
        con - : Connection
        connectionId - : String
        login - : String
        password - : String
        Throws:
        SQLException
      • getConnectionsByUser

        public List<ConnectionDetail> getConnectionsByUser​(Connection con,
                                                           String userId)
                                                    throws SQLException
        return all connections of the user corresponding to userId
        Parameters:
        con - : Connection
        userId - : String the user identifier
        Returns:
        connections : a list of ConnectionDetail
        Throws:
        SQLException
      • deleteByComponentInstanceId

        public void deleteByComponentInstanceId​(String componentInstanceId)
                                         throws SQLException
        Deletes all connection data linked to the given component instance.
        Parameters:
        componentInstanceId - the identifier of the component instance.
        Throws:
        SQLException