public List < NodeDataIndexing > getNodesAndProperties ( String lastNodeId , int offset , int limit ) throws RepositoryException , IllegalStateException { List < NodeDataIndexing > result = new ArrayList < NodeDataIndexing > ( ) ; checkIfOpened ( ) ; try { startTxIfNeeded ( ) ; ResultSet resultSet = findNodesAndProperties ( lastNodeId , offset , limit ) ; int processed = 0 ; try { TempNodeData tempNodeData = null ; while ( resultSet . next ( ) ) { if ( tempNodeData == null ) { tempNodeData = new TempNodeData ( resultSet ) ; processed ++ ; } else if ( ! resultSet . getString ( COLUMN_ID ) . equals ( tempNodeData . cid ) ) { if ( ! needToSkipOffsetNodes ( ) || processed > offset ) { result . add ( createNodeDataIndexing ( tempNodeData ) ) ; } tempNodeData = new TempNodeData ( resultSet ) ; processed ++ ; } if ( ! needToSkipOffsetNodes ( ) || processed > offset ) { String key = resultSet . getString ( "P_NAME" ) ; SortedSet < TempPropertyData > values = tempNodeData . properties . get ( key ) ; if ( values == null ) { values = new TreeSet < TempPropertyData > ( ) ; tempNodeData . properties . put ( key , values ) ; } values . add ( new ExtendedTempPropertyData ( resultSet ) ) ; } } if ( tempNodeData != null && ( ! needToSkipOffsetNodes ( ) || processed > offset ) ) { result . add ( createNodeDataIndexing ( tempNodeData ) ) ; } } finally { try { resultSet . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can't close the ResultSet: " + e . getMessage ( ) ) ; } } } catch ( IOException e ) { throw new RepositoryException ( e ) ; } catch ( IllegalNameException e ) { throw new RepositoryException ( e ) ; } catch ( SQLException e ) { throw new RepositoryException ( e ) ; } if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "getNodesAndProperties(%s, %s, %s) = %s elements" , lastNodeId , offset , limit , result . size ( ) ) ; } return result ; }
Returns from storage the next page of nodes and its properties .