Class ConnectionDAO
- java.lang.Object
-
- org.silverpeas.core.web.external.webconnections.dao.ConnectionDAO
-
public class ConnectionDAO extends Object
-
-
Constructor Summary
Constructors Constructor Description ConnectionDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createConnection(Connection con, ConnectionDetail connection)
create a connectionvoid
deleteByComponentInstanceId(String componentInstanceId)
Deletes all connection data linked to the given component instance.void
deleteConnection(Connection con, String connectionId)
delete the connection corresponding to connectionIdConnectionDetail
getConnection(Connection con, String componentId, String userId)
Return a connection for componentId and userIdConnectionDetail
getConnectionById(Connection con, String connectionId)
Return a connection corresponding to connectionIdprotected ConnectionDetail
getConnectionFrom(ResultSet rs)
create the connection from the resultSetList<ConnectionDetail>
getConnectionsByUser(Connection con, String userId)
return all connections of the user corresponding to userIdvoid
updateConnection(Connection con, String connectionId, String login, String password)
update the connection corresponding to connectionId, with the login and the password
-
-
-
Method Detail
-
getConnection
public ConnectionDetail getConnection(Connection con, String componentId, String userId) throws SQLException
Return a connection for componentId and userId- Parameters:
con
- : ConnectioncomponentId
- : String component identifieruserId
- : 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
- : ConnectionconnectionId
- : String the connection identifier- Returns:
- connection : ConnectionDetail
- Throws:
SQLException
-
createConnection
public String createConnection(Connection con, ConnectionDetail connection) throws SQLException
create a connection- Parameters:
con
- : Connectionconnection
- : ConnectionDetail- Returns:
- the connectionId : String
- Throws:
SQLException
-
deleteConnection
public void deleteConnection(Connection con, String connectionId) throws SQLException
delete the connection corresponding to connectionId- Parameters:
con
- : ConnectionconnectionId
- : 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
- : ConnectionconnectionId
- : Stringlogin
- : Stringpassword
- : 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
- : ConnectionuserId
- : String the user identifier- Returns:
- connections : a list of ConnectionDetail
- Throws:
SQLException
-
getConnectionFrom
protected ConnectionDetail getConnectionFrom(ResultSet rs) throws SQLException
create the connection from the resultSet- Parameters:
rs
- : ResultSet- Returns:
- the connection : 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
-
-