com.silverpeas.external.webConnections.dao
Class ConnectionDAO

java.lang.Object
  extended by com.silverpeas.external.webConnections.dao.ConnectionDAO

public class ConnectionDAO
extends Object


Constructor Summary
ConnectionDAO()
           
 
Method Summary
 String createConnection(Connection con, ConnectionDetail connection)
          create a connection
 void deleteConnection(Connection con, String connectionId)
          delete the connection corresponding to connectionId
 ConnectionDetail getConnection(Connection con, String componentId, String userId)
          Return a connection for componentId and userId
 ConnectionDetail getConnectionById(Connection con, String connectionId)
          Return a connection corresponding to connectionId
 List<ConnectionDetail> getConnectionsByUser(Connection con, String userId)
          return all connections of the user corresponding to userId
protected  ConnectionDetail recupConnection(ResultSet rs)
          create the connection from the resultSet
 void updateConnection(Connection con, String connectionId, String login, String password)
          update the connection corresponding to connectionId, with the login and the password
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
userId - : String
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
Returns:
connection : ConnectionDetail
Throws:
SQLException

createConnection

public String createConnection(Connection con,
                               ConnectionDetail connection)
                        throws SQLException,
                               UtilException
create a connection

Parameters:
con - : Connection
connection - : ConnectionDetail
Returns:
the connectionId : String
Throws:
SQLException
UtilException

deleteConnection

public void deleteConnection(Connection con,
                             String connectionId)
                      throws SQLException
delete the connection corresponding to connectionId

Parameters:
con - : Connection
connectionId - : String
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
Returns:
connections : a list of ConnectionDetail
Throws:
SQLException

recupConnection

protected ConnectionDetail recupConnection(ResultSet rs)
                                    throws SQLException
create the connection from the resultSet

Parameters:
rs - : ResultSet
Returns:
the connection : ConnectionDetail
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.