Skip to content

Commit

Permalink
change catalog list to use longs
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Thompson committed Jan 18, 2016
1 parent cff22dc commit 1db2ff5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/src/main/java/org/geoserver/catalog/Catalog.java
@@ -1,4 +1,4 @@
/* (c) 2014 - 2016 Open Source Geospatial Foundation - all rights reserved
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
* (c) 2001 - 2013 OpenPlans
* This code is licensed under the GPL 2.0 license, available at the root
* application directory.
Expand Down
Expand Up @@ -791,6 +791,6 @@ public <T extends CatalogInfo> CloseableIterator<T> list(final Class<T> of,
* filter
*/
public <T extends CatalogInfo> CloseableIterator<T> list(final Class<T> of,
final Filter filter, @Nullable Integer offset, @Nullable Integer count,
final Filter filter, @Nullable Long offset, @Nullable Long count,
@Nullable SortBy... sortOrder);
}
Expand Up @@ -1790,7 +1790,7 @@ public <T extends CatalogInfo> CloseableIterator<T> list(final Class<T> of,

@Override
public <T extends CatalogInfo> CloseableIterator<T> list(final Class<T> of,
final Filter filter, Integer offset, Integer count, SortBy sortOrder) {
final Filter filter, Long offset, Long count, SortBy sortOrder) {
CatalogFacade facade = getFacade();
if (sortOrder != null && !facade.canSort(of, sortOrder.getPropertyName().getPropertyName())) {
// TODO: use GeoTools' merge-sort code to provide sorting anyways
Expand All @@ -1804,7 +1804,7 @@ public <T extends CatalogInfo> CloseableIterator<T> list(final Class<T> of,
public <T extends CatalogInfo> T get(Class<T> type, Filter filter)
throws IllegalArgumentException {

final Integer limit = Integer.valueOf(2);
final Long limit = Long.valueOf(2);
CloseableIterator<T> it = list(type, filter, null, limit, null);
T result = null;
try {
Expand Down
Expand Up @@ -95,7 +95,7 @@ protected Component getComponentForProperty(String id, IModel itemModel,
}

private Component storeNameLink(String id, final IModel itemModel) {
String wsName = (String) WORKSPACE.getModel(itemModel).getObject();
String wsName = (String) WORKSPACE.getModel(itemModel).getObject().getName();
IModel storeNameModel = NAME.getModel(itemModel);
String storeName = (String) storeNameModel.getObject();
StoreInfo store = getCatalog().getStoreByName(wsName, storeName, StoreInfo.class);
Expand Down
Expand Up @@ -131,8 +131,7 @@ protected Comparator<StoreInfo> getComparator(SortParam sort) {
return super.getComparator(sort);
}


public IModel newModel(Object object) {
public IModel newModel(StoreInfo object) {
return new StoreInfoDetachableModel((StoreInfo) object);
}

Expand Down
Expand Up @@ -56,7 +56,7 @@ public void testLoad() {
assertTrue(catchedException);

StoreInfo actual = provider.iterator(0, 1).next();
CloseableIterator<StoreInfo> list = catalog.list(StoreInfo.class, Filter.INCLUDE, 0, 1,
CloseableIterator<StoreInfo> list = catalog.list(StoreInfo.class, Filter.INCLUDE, Long.valueOf(0), Long.valueOf(1),
Predicates.sortBy("name", true));
assertTrue(list.hasNext());
StoreInfo expected = list.next();
Expand Down

0 comments on commit 1db2ff5

Please sign in to comment.