+ private long getNodesNumber(String wkspName) {
+ if (IGNORED_WSKP_LIST.contains(wkspName))
+ return 0l;
+ Session sourceSession = null;
+ try {
+ sourceSession = sourceRepository.login(sourceCredentials, wkspName);
+ Query countQuery = sourceDefaultSession
+ .getWorkspace()
+ .getQueryManager()
+ .createQuery("select file from [nt:base] as file",
+ Query.JCR_SQL2);
+ QueryResult result = countQuery.execute();
+ Long expectedCount = result.getNodes().getSize();
+ return expectedCount;
+ } catch (RepositoryException e) {
+ throw new SlcException("Unexpected error while computing "
+ + "the size of the fetch for workspace " + wkspName, e);
+ } finally {
+ JcrUtils.logoutQuietly(sourceSession);
+ }
+ }
+