I'd like to know the most simple way of doing it, preferably using just bukkit API. Edit: ... I've found Door MaterialData, but it's deprecated for some reason. Does someone know about non-deprecated way ?
http://jd.bukkit.org/apidocs/org/bukkit/material/Door.html there's that, but it is deprecated and says that it does not work correctly anymore.
It's a bit of a fudge but could you not just toggle whether or not the door is redstone powered? That would change its state in the same way as changing it directly would, in theory.
I don't like redstone thing. Anything else I could do ? I was thinking about simulating player interaction, but I doubt it's possible without NMS code.