@Override public ListCacheDirectivesResponseProto listCacheDirectives( RpcController controller, ListCacheDirectivesRequestProto request) throws ServiceException { try { CacheDirectiveInfo filter = PBHelper.convert(request.getFilter()); BatchedEntries<CacheDirectiveEntry> entries = server.listCacheDirectives(request.getPrevId(), filter); ListCacheDirectivesResponseProto.Builder builder = ListCacheDirectivesResponseProto.newBuilder(); builder.setHasMore(entries.hasMore()); for (int i=0, n=entries.size(); i<n; i++) { builder.addElements(PBHelper.convert(entries.get(i))); } return builder.build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public ListCacheDirectivesResponseProto listCacheDirectives( RpcController controller, ListCacheDirectivesRequestProto request) throws ServiceException { try { CacheDirectiveInfo filter = PBHelperClient.convert(request.getFilter()); BatchedEntries<CacheDirectiveEntry> entries = server.listCacheDirectives(request.getPrevId(), filter); ListCacheDirectivesResponseProto.Builder builder = ListCacheDirectivesResponseProto.newBuilder(); builder.setHasMore(entries.hasMore()); for (int i=0, n=entries.size(); i<n; i++) { builder.addElements(PBHelperClient.convert(entries.get(i))); } return builder.build(); } catch (IOException e) { throw new ServiceException(e); } }
BatchedCacheEntries( ListCacheDirectivesResponseProto response) { this.response = response; }