SDN Controller Programming Guide

84
public CassandraAlert(String uid) {
super(uid, null);
}
@Override
public Id<CassandraAlert, String> getId() {
return Id.<CassandraAlert, String>valueOf(this.uid());
}
// Implement getters for immutable fields.
// Implement setters and getters for mutable fields.
// Good practice to override the following methods on transport objects:
// equals(Object), hashCode() and toString()
...
}
The function of a DTO is to list out all the columns and provide setters/getters for each of the
attributes. The application fills out all the values as necessary and passes the object down to the
persistence layer using various queries.
Distributed Database Queries
The distributed persistence layer of the HP VAN SDN Controller exposes the following queries to the
application:
AddQuery
CountQuery
DeleteQuery
DeleteQueryWithFilter
FindQuery
GetQuery
PagedFindQuery
UpdateQuery
These are generic queries and need to be qualified appropriately by the application. The
following shows a Distributed Query Service interface that provides application specific queries.
Here is the interface code from the demo application.
DistQueryService.java:
package com.hp.demo.cassandra.dao;
import com.hp.demo.cassandra.model.alert.CassandraAlert;
import com.hp.demo.cassandra.model.alert.CassandraAlertFilter;
import com.hp.demo.cassandra.model.alert.CassandraAlertSortAttribute;
import com.hp.util.MarkPage;
import com.hp.util.MarkPageRequest;
import com.hp.util.SortSpecification;