This project offers an API that allows you to connect to the Infrastructure Manager REST API. For more information about the IM capabilities, check: IM Web.
The javadoc for this project can be found here: Javadoc.
See test.html as an example of how to use the lib.