@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 BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId, CacheDirectiveInfo filter) throws IOException { if (filter == null) { filter = new CacheDirectiveInfo.Builder().build(); } try { return new BatchedCacheEntries( rpcProxy.listCacheDirectives(null, ListCacheDirectivesRequestProto.newBuilder(). setPrevId(prevId). setFilter(PBHelper.convert(filter)). build())); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
@Override public BatchedEntries<CacheDirectiveEntry> listCacheDirectives(long prevId, CacheDirectiveInfo filter) throws IOException { if (filter == null) { filter = new CacheDirectiveInfo.Builder().build(); } try { return new BatchedCacheEntries( rpcProxy.listCacheDirectives(null, ListCacheDirectivesRequestProto.newBuilder(). setPrevId(prevId). setFilter(PBHelperClient.convert(filter)). build())); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(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); } }