Java Code Examples for org.wso2.carbon.utils.DataPaginator#doPaging()

The following examples show how to use org.wso2.carbon.utils.DataPaginator#doPaging() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogViewerClient.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
private PaginatedLogEvent getPaginatedLogEvent(int pageNumber, List<LogEvent> logMsgList) {

        if (logMsgList != null && !logMsgList.isEmpty()) {
            PaginatedLogEvent paginatedLogEvent = new PaginatedLogEvent();
            DataPaginator.doPaging(pageNumber, logMsgList, paginatedLogEvent);
            return paginatedLogEvent;
        } else {
            return null;
        }
    }
 
Example 2
Source File: LogViewerClient.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
private PaginatedLogFileInfo getPaginatedLogFileInfo(int pageNumber,
                                                     List<LogFileInfo> logFileInfoList) {

    if (logFileInfoList != null && !logFileInfoList.isEmpty()) {
        PaginatedLogFileInfo paginatedLogFileInfo = new PaginatedLogFileInfo();
        DataPaginator.doPaging(pageNumber, logFileInfoList, paginatedLogFileInfo);
        return paginatedLogFileInfo;
    } else {
        return null;
    }
}
 
Example 3
Source File: UrlMapperAdminService.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
public static PaginatedMappingData getPaginatedMappings(int pageNumber, String tenantDomain)
		throws UrlMapperException {
	MappingData[] mappings = HostUtil.getTenantSpecificMappingsFromRegistry(tenantDomain);
	if (mappings != null) {
		List<MappingData> mappingsList = Arrays.asList(mappings);
		// Pagination
		PaginatedMappingData paginatedMappings = new PaginatedMappingData();
		DataPaginator.doPaging(pageNumber, mappingsList, paginatedMappings);
		return paginatedMappings;
	} else {
		return null;
	}

}
 
Example 4
Source File: Util.java    From carbon-identity-framework with Apache License 2.0 4 votes vote down vote up
public static PaginatedNamesBean retrievePaginatedFlaggedName(int pageNumber, List<FlaggedName> names) {

        PaginatedNamesBean bean = new PaginatedNamesBean();
        DataPaginator.doPaging(pageNumber, names, bean);
        return bean;
    }
 
Example 5
Source File: Util.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
public static PaginatedNamesBean retrievePaginatedFlaggedName(int pageNumber, List<FlaggedName> names) {

        PaginatedNamesBean bean = new PaginatedNamesBean();
        DataPaginator.doPaging(pageNumber, names, bean);
        return bean;
    }