Cettia Java Server 1.2 brings functional programming support and borrows useful features from Java 8
Have you ever heard of Cettia? This full-featured web app framework for Java that offers developers a whole host of features and support that other frameworks miss will definitely come in handy. Version 1.2 is already here so let’s have a look at the highlights.
We covered Cettia’s 1.0 release two months ago and now 1.2 is ready to see the light of day. As previously announced, the team has decided to drop Java 7 support and add features based on Java 8 features such as functional interfaces and lambda expressions instead.
The good news is that migration from 1.1 to 1.2 should be a breeze as you only have to update the version of the dependency. Furthermore, there are no backward incompatible changes other than the minimum Java version, as explained in the blog post announcing the new release.
This release also features a
ServerSocketPredicates class, a helper for
ServerSocketPredicate which consists of static methods that return various useful
ServerSocketPredicates, and the default methods,
or(ServerSocketPredicate that), and
ServerSocketPredicates are analogous to
RequestPredicates of Spring WebFlux.
These are the static methods to create socket predicates defined in the
- A predicate that always matches.
attr(String key, Object value)
- A predicate that tests the socket attributes against the given key-value pair.
- A predicate that tests the socket id against the given socket’s id.
- A predicate that tests the socket id against the given socket id.
- A predicate that tests the socket tags against the given tags.
But since this is a “either/or” type of situation, the existing finder methods such as
Server#byTag(String tags...) are deprecated. You’ll have to replace them with
tag(String... tags) defined in the
Server#find(ServerSocketPredicate predicate). Keep in mind that the finders will be removed in the next major version.
Sentence#find(ServerSocketPredicate predicate), which creates and returns a sentence with a given predicate like
Server#find(ServerSocketPredicate predicate) but has a composed predicate that represents a short-circuiting logical AND of the original sentence’s predicate and the given predicate. This should have a positive impact on the reusability of a sentence.
Looking to try out this full-featured web app framework for Java?
Cettia makes it possible for developers to avoid repetitive, boilerplate code while still scaling their app horizontally. This framework was designed specifically to support environments where WebSocket is not available. Plus, it can handle both text and binary data together, recover missed events, and provides a multi-device user experience.
Cettia works seamlessly with any web framework on the JVM, making it easy to adopt.