@Override public ListCachePoolsResponseProto listCachePools(RpcController controller, ListCachePoolsRequestProto request) throws ServiceException { try { BatchedEntries<CachePoolEntry> entries = server.listCachePools(request.getPrevPoolName()); ListCachePoolsResponseProto.Builder responseBuilder = ListCachePoolsResponseProto.newBuilder(); responseBuilder.setHasMore(entries.hasMore()); for (int i=0, n=entries.size(); i<n; i++) { responseBuilder.addEntries(PBHelper.convert(entries.get(i))); } return responseBuilder.build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public ListCachePoolsResponseProto listCachePools(RpcController controller, ListCachePoolsRequestProto request) throws ServiceException { try { BatchedEntries<CachePoolEntry> entries = server.listCachePools(request.getPrevPoolName()); ListCachePoolsResponseProto.Builder responseBuilder = ListCachePoolsResponseProto.newBuilder(); responseBuilder.setHasMore(entries.hasMore()); for (int i=0, n=entries.size(); i<n; i++) { responseBuilder.addEntries(PBHelperClient.convert(entries.get(i))); } return responseBuilder.build(); } catch (IOException e) { throw new ServiceException(e); } }
@Override public BatchedEntries<CachePoolEntry> listCachePools(String prevKey) throws IOException { try { return new BatchedCachePoolEntries( rpcProxy.listCachePools(null, ListCachePoolsRequestProto.newBuilder(). setPrevPoolName(prevKey).build())); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }