use of com.netflix.exhibitor.core.entities.NameAndModifiedDate in project exhibitor by soabase.
the class IndexResource method getAvailableBackups.
@Path("get-backups")
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response getAvailableBackups() throws Exception {
Collection<BackupMetaData> backups = context.getExhibitor().getBackupManager().getAvailableBackups();
Collection<NameAndModifiedDate> transformed = Collections2.transform(backups, new Function<BackupMetaData, NameAndModifiedDate>() {
@Override
public NameAndModifiedDate apply(BackupMetaData backup) {
return new NameAndModifiedDate(backup.getName(), backup.getModifiedDate());
}
});
// move out of Google's TransformingRandomAccessList
ArrayList<NameAndModifiedDate> cleaned = Lists.newArrayList(transformed);
GenericEntity<Collection<NameAndModifiedDate>> entity = new GenericEntity<Collection<NameAndModifiedDate>>(cleaned) {
};
return Response.ok(entity).build();
}
Aggregations