use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListTileCache method getCachedTile.
public static byte[] getCachedTile(String versionId, int x, int y, int zoom) {
ListTileCacheQuery query = new ListTileCacheQuery(new QueryFactory());
query.WHERE(query.getVersion().EQ(versionId));
query.AND(query.getX().EQ(x));
query.AND(query.getY().EQ(y));
query.AND(query.getZ().EQ(zoom));
OIterator<? extends ListTileCache> it = query.getIterator();
try {
if (it.hasNext()) {
ListTileCache tile = it.next();
return tile.getTile();
}
return null;
} finally {
it.close();
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListTileCache method deleteTiles.
public static void deleteTiles(ListTypeVersion version) {
ListTileCacheQuery query = new ListTileCacheQuery(new QueryFactory());
query.WHERE(query.getVersion().EQ(version));
try (OIterator<? extends ListTileCache> it = query.getIterator()) {
while (it.hasNext()) {
it.next().delete();
}
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method getVersions.
public List<ListTypeVersion> getVersions() {
ListTypeVersionQuery query = new ListTypeVersionQuery(new QueryFactory());
query.WHERE(query.getListType().EQ(this));
query.ORDER_BY_DESC(query.getForDate());
try (OIterator<? extends ListTypeVersion> it = query.getIterator()) {
return new LinkedList<ListTypeVersion>(it.getAll());
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method getEntries.
public List<ListTypeEntry> getEntries() {
ListTypeEntryQuery query = new ListTypeEntryQuery(new QueryFactory());
query.WHERE(query.getListType().EQ(this));
query.ORDER_BY_DESC(query.getForDate());
try (OIterator<? extends ListTypeEntry> it = query.getIterator()) {
return new LinkedList<ListTypeEntry>(it.getAll());
}
}
use of com.runwaysdk.query.QueryFactory in project geoprism-registry by terraframe.
the class ListType method createMdAttribute.
public static void createMdAttribute(ServerGeoObjectType type, AttributeType attributeType) {
Collection<Locale> locales = LocalizationFacade.getInstalledLocales();
ListTypeQuery query = new ListTypeQuery(new QueryFactory());
query.WHERE(query.getUniversal().EQ(type.getUniversal()));
List<? extends ListType> lists = query.getIterator().getAll();
for (ListType list : lists) {
list.createMdAttributeFromAttributeType(type, attributeType, locales);
}
}
Aggregations