I have found a way to do the above but its a little dirty.
Get all connections and for each one get the connections endpoint html.
var outerHTML = $(this)[0].endpoints[0].canvas.outerHTML.toString();
From here check the html to see if it contains either the red or green colour set earlier.
If somebody knows a better way please let me know.