*/
private void handleSourcesGet(Set<Source> sources, Date moment,
String[] resourceURIStrings, TypedResponse<Graph> response)
throws HandlerException {
GraphOverTime got = store.getGraphOverTime(sources);
{
Iterator<Date> previousIter = got.previousChanges(moment);
List<String> previousDateStringList = new ArrayList<String>();
int count = 0;
while (previousIter.hasNext()) {
if (count++ == 10) {
break;
}
previousDateStringList.add(MillisDateFormat.instance
.format(previousIter.next()));
}
Object[] previousArray = previousDateStringList.toArray();
if (previousArray.length > 0) {
response.setHeader(HeaderName.get("X-GVS-Previous"),
previousArray);
}
}
{
Iterator<Date> followingIter = got.followingChanges(moment);
List<String> previousDateStringList = new ArrayList<String>();
int count = 0;
while (followingIter.hasNext()) {
if (count++ == 10) {
break;
}
previousDateStringList.add(MillisDateFormat.instance
.format(followingIter.next()));
}
Object[] previousArray = previousDateStringList.toArray();
if (previousArray.length > 0) {
response.setHeader(HeaderName.get("X-GVS-Following"),
previousDateStringList.toArray());
}
}
if (resourceURIStrings != null) {
FCAGraph fcaGraph = got.getGraph(moment);
Set<GroundedNode> onlyForGroundedNodes = new HashSet<GroundedNode>(
resourceURIStrings.length);
for (String uriString : resourceURIStrings) {
onlyForGroundedNodes.add(new NamedNodeImpl(uriString));
}
response.setBody(fcaGraph.filter(onlyForGroundedNodes));
} else {
response.setBody(got.getGraph(moment));
}
}