Stringmsg="\nTask 05 of the AntidoteDB Java Tutorial\n"+
"--------------------------------\n"+
"You have so far familiarized with the Antidote data model by using the shell commands for updating\nCRDT counters and sets.\n"+
"In this task you will learn how to start and commit a transaction, and how to update CRDT objets,\n"+
"using the example of a last-writer-wins register.\n"+
"Implement the assignToRegister() method. The method should receive a bucket name, an object key,\n"+
"and a string value, and assign the given value to a CRDT last-writer-wins register with the given \nkey, in the given bucket.\n"+
"================================\n"
;
System.out.println(msg);
}
privatevoidprintTask06(){
Stringmsg="\nTask 06 of the AntidoteDB Java Tutorial\n"+
"--------------------------------\n"+
"For this task, let's see how we can update a more complex CRDT datatype.\n"+
"Implement the updateMapRegister() method. The method should receive a bucket name, an object key,\n"+
"a map entry key, and a string value, and add a new entry to a CRDT map with the given object key, in the given bucket. "+
"The new entry should be a last-writer-wins register with the given map entry key.\n"+
"Finally, assign the given value to the register.\n"+
"================================\n";
System.out.println(msg);
}
privatevoidprintTask07(){
Stringmsg="\nTask 07 of the AntidoteDB Java Tutorial\n"+
"--------------------------------\n"+
"Now that you seen the basics of using the AntidoteDB Java client, let's put this knowledge in use in \norder to build an application that uses AntidoteDB as a backend database.\n"+
"As you may have noticed, the shell application has a few additional commands such as userinfo,\nadduser, and ownbook. "+
"These commands implement a simple Bookstore application in which users can \ncreate accounts, register the books they own, and borrow books from other users.\n"+
"For this task, implement the addUser() method (also located in bookstore/src/main/BookCommands.java)\n"+
"The method receives the user's username and email as string. It should store these information in the \ndatabase using the proper data structure.\n"+
"Use the \"userBucket\" variable defined in BookCommands.java for the AntidoteDB bucket to store\nBookstore data in.\n"+
"Finally, use the adduser shell command to add a user with username \""+user1+"\" and email \"bob@mail.com\".\n"+
"================================\n";
System.out.println(msg);
}
privatevoidprintTask08(){
Stringmsg="\nTask 08 of the AntidoteDB Java Tutorial\n"+
"--------------------------------\n"+
"For this task, implement the addOwnedBooks() method.\n"+
"The method receives a username and a book title as strings. "+
"It should add the given book to the list \nof books owned by the given user (Hint: take a look at the \"ownBooksMapField\" variable defined in \nBookCommands.java).\n"+
"Finally, use the ownbook shell command to add a book \""+bookTitle+"\" to the user \""+user1+"\".\n"+
"================================\n";
System.out.println(msg);
}
privatevoidprintTask09(){
Stringmsg="\nTask 09 of the AntidoteDB Java Tutorial\n"+
"--------------------------------\n"+
"Another Bookstore functionality implementation task.. But this is an interesting one.\n"+
"Implement the borrowBook() method. The method receives a book title, the username of the user who \nowns the book (userFrom) and the user who borrows the book (userTo).\n"+
"It should remove the given book from the list of books owned by userFrom, and add it to the list of\n"+
"books which userTo has borrowed (Hint: the \"borrowedBooksMapField\" variable might be useful).\n"+
"Finally, use the borrowbook shell command to indicate that user \""+user2+"\" borrows \""+bookTitle+"\" from user \""+user1+"\".\n"+
"================================\n";
System.out.println(msg);
}
privatevoidprintTask10(){
Stringmsg="\nTask 10 of the AntidoteDB Java Tutorial\n"+
"--------------------------------\n"+
"For the final task, implement the getBorrowedBooks() method. The method receives the username of\n"+
"a user, and returns a list containing the books that the given user has borrowed.\n"+
"To pass this task, the list for the user \""+user2+"\" should contain the book \""+bookTitle+"\".\n"+