Baratine on GitHub

Baratine 0.11

Baratine 0.11.2 - 2016-02-29

@Body Fixes

Bugs related to the deserialization of form bodies, particularly the parsing of the POST content type.

The @Body argument to a HTTP method parses the body into an application object or the built-in Form class.

1
2
3
4
5
6
7
8
9
import io.baratine.web.Post;
import io.baratine.web.Body;

@Get
public void update(@Body Book book, Result<String> result)
{

  result.ok("Book: " + book.title());
}

Vault

Name for multi-item services is changed to Vault.

1
2
3
4
5
6
7
8
9
import io.baratine.service.Result;
import io.baratine.service.Service;
import io.baratine.service.Vault;

@Service
public interface BookVault implements Vault<Long,Book>
{
  void findByTitle(String title, Result<Book> result);
}

Vault find results

The query result for a vault finder has been cleaned up to allow for data transfer objects, keys, and proxies. The patterns are as follows:

  • Result<Long> - key result if the type matches the Vault ID.
  • Result<BookData> - data result for classes
  • Result<BookApi> - proxy result for interfaces
  • Result<BookWithApi> - proxy result for classes annotated by @Api

Vault find method names

The find method parsing now ignores everything between “find” and “By” to give space for application names.

H3 serialization

H3 Serialization is now used for document serialization and for document queries.

WebSocket messages from JSON

WebSocket services can now send and received JSON messages without introducing parsing. An echo service might look like the following:

1
2
3
4
5
6
7
8
9
import io.baratine.web.WebSocket

public class Echo implements WebSocket<Book,Book>
{
  public void next(Book book, WebSocket<Book> ws)
  {
    ws.next(book);
  }
}