Reference Guide

Table Of Contents
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;
import com.hp.util.persistence.ReadQuery;
import com.hp.util.persistence.WriteQuery;
...
public interface DistQueryService<C> {
ReadQuery<List<CassandraAlert>, C>
getFindAlertsQuery(CassandraAlertFilter filter,
SortSpecification<CassandraAlertSortAttribute> sortSpecification);
ReadQuery<MarkPage<CassandraAlert>, C>
getPageAlertsQuery(CassandraAlertFilter filter,
SortSpecification<CassandraAlertSortAttribute> sortSpecification,
MarkPageRequest<CassandraAlert> pageRequest);
WriteQuery<CassandraAlert, C> getAddAlertQuery(CassandraAlert alert);
91