This commit is contained in:
Lucio Lelii 2018-06-21 13:01:01 +00:00
parent 165edfc2d1
commit 75d9f828ee
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import javax.jcr.observation.Event;
import javax.jcr.observation.EventJournal;
import javax.jcr.query.Query;
import org.gcube.common.storagehub.model.NodeConstants;
import org.gcube.common.storagehub.model.items.Item;
import org.gcube.data.access.storagehub.Constants;
import org.slf4j.Logger;
@ -59,7 +60,7 @@ public class VREQueryRetriever implements Callable<List<Item>> {
NodeIterator it = jcrQuery.execute().getNodes();
logger.trace("query for recents took {}",System.currentTimeMillis()-start);
while (it.hasNext())
cachedList.add(ItemHandler.getItem(it.nextNode(), Arrays.asList("hl:accounting")));
cachedList.add(ItemHandler.getItem(it.nextNode(), Arrays.asList(NodeConstants.ACCOUNTING_NAME)));
logger.trace("creating objects took {}",System.currentTimeMillis()-start);
if (cachedList.size()<=10) return cachedList;
else return cachedList.subList(0, 10);
@ -95,7 +96,7 @@ public class VREQueryRetriever implements Callable<List<Item>> {
logger.trace("event property changed on {} with value {} and parent {}",property.getName(), property.getValue().getString(), property.getParent().getPath());
String identifier = property.getParent().getIdentifier();
cachedList.removeIf(i -> i.getId().equals(identifier));
Item item = ItemHandler.getItem(property.getParent(), Arrays.asList("hl:accounting"));
Item item = ItemHandler.getItem(property.getParent(), Arrays.asList(NodeConstants.ACCOUNTING_NAME));
insertItemInTheRightPlace(item);
}
}