The findAllConnections method is working, but I think by resultList's structure differs from the JDBC query list's structure. I do not really know what to do about that. My resultList is a type of LinkedList. I do not really know how to create something like a JDBCqueryList so that I do not get the following error message:
javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code 'facebook.displayName' for locale 'de_DE'.
I think my result list should be something like a associative array, but I did not find a solution in the web yet. Maybe it is just a simple type of some list, that I do not know yet...?
Code:
private Connection<?> mapEntry(ConnectionData connectionData) {
ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(connectionData.getProviderId());
return connectionFactory.createConnection(connectionData);
}
private ConnectionData mapConnectionData(Node node) {
return new ConnectionData((String) node.getProperty("providerId"),
(String) node.getProperty("providerUserId"),
(String) node.getProperty("displayName"),
(String) node.getProperty("profileUrl"),
(String) node.getProperty("imageUrl"),
decrypt((String) node.getProperty("accessToken")),
decrypt((String) node.getProperty("secret")),
decrypt((String) node.getProperty("refreshToken")),
expireTime((Long) node.getProperty("expireTime")));
}
private List<Connection<?>> createResultList(ExecutionResult er) {
List<Connection<?>> resultList = new LinkedList<Connection<?>>();
Iterator<Node> userConnections = er.columnAs("connection");
while (userConnections.hasNext()) {
Node userConnectionNode = userConnections.next();
resultList.add(mapEntry(mapConnectionData(userConnectionNode)));
}
return resultList;
}