Class ReadOnlyDataSourceService

    • Constructor Detail

      • ReadOnlyDataSourceService

        public ReadOnlyDataSourceService()
    • Method Detail

      • getCount

        protected abstract int getCount​(Map<String,​String> parameters)
        Returns the count of objects based on the passed parameters.
        Parameters:
        parameters - the parameters passed in from the request
        Returns:
        the total number of objects
      • getData

        protected abstract List<Map<String,​Object>> getData​(Map<String,​String> parameters,
                                                                  int startRow,
                                                                  int endRow)
        Read/create the set of data as a list of Maps with key-value pairs.
        Parameters:
        parameters - the parameters passed in from the request
        startRow - the first row to read (maybe -1 to indicate no startrow)
        endRow - the last row to read (maybe -1 to indicate no endrow
        Returns:
        the number of objects read, note that this maybe more than endRow - startRow + 1. The startRow parameter should be strictly followed though.
      • sort

        protected void sort​(String sortBy,
                            List<Map<String,​Object>> data)
        Sorts the data list by the value of the passed in sortBy key
        Parameters:
        sortBy - the
        data -