public void save() throws IOException {
}
+ /**
+ * Starts inserting the given project.
+ *
+ * @param project
+ * The project to insert
+ * @throws JSiteException
+ * if the project’s node is not connected, or no node is
+ * connected at all
+ */
+ public void insertProject(Project project) throws JSiteException {
+ Request request = new Request();
+ request.setClientToken(generateClientToken(project));
+ Node wantedNode = project.getNode();
+ if (wantedNode == null) {
+ for (Node node : nodeManager.getNodes()) {
+ if (nodeManager.getFcpClient(node) != null) {
+ wantedNode = node;
+ break;
+ }
+ }
+ }
+ if (wantedNode == null) {
+ /* TODO use custom exception */
+ throw new JSiteException("No node connected.");
+ }
+ FcpClient fcpClient = nodeManager.getFcpClient(wantedNode);
+ }
+
//
// PRIVATE METHODS
//