@Test public void testList_01() throws InterruptedException { MetadataRepository repository = mockRepository(); MetadataService mds = new DefaultMetadataServiceImpl(repository); ObjectRequest request = new ObjectRequest(httpRequest(HttpMethod.GET, "/owner/index/parent/path")); mds.list(ImmediateEventExecutor.INSTANCE, request).addListener( new GenericFutureListener<Future<? super ObjectResponse>>() { @Override public void operationComplete(Future<? super ObjectResponse> future) throws Exception { if (future.isSuccess()) { log.info("fetched: {}", future.get()); } else { log.debug("failed: {}", future.cause()); } } } ).sync(); }
@Override public Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request) { return executor.submit(new Callable<ObjectResponse>() { @Override public ObjectResponse call() throws Exception { return syncList(request); } }); }
DefaultMetadataServiceImpl implements MetadataService { @Override public Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request) { return executor.submit(new Callable<ObjectResponse>() { @Override public ObjectResponse call() throws Exception { return syncList(request); } }); } }
DefaultMetadataServiceImpl implements MetadataService { @Override public Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request) { return executor.submit(new Callable<ObjectResponse>() { @Override public ObjectResponse call() throws Exception { return syncList(request); } }); } DefaultMetadataServiceImpl(MetadataRepository r); }
DefaultMetadataServiceImpl implements MetadataService { @Override public Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request) { return executor.submit(new Callable<ObjectResponse>() { @Override public ObjectResponse call() throws Exception { return syncList(request); } }); } DefaultMetadataServiceImpl(MetadataRepository r); @Override Future<ObjectResponse> delete(EventExecutor executor, final ObjectRequest request); @Override Future<ObjectResponse> head(EventExecutor executor, final ObjectRequest request); @Override Optional<FullObjectName> selectByName(ObjectName on); @Override Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request); @Override Future<ObjectResponse> put(EventExecutor executor, final FullObjectRequest request); @Override Future<List<String>> storedNodes(final EventExecutor executor, final String etag); @Override List<String> storedNodes(final ObjectName on); @Override List<String> storedNodes(String etag); @Override Future<Void> flagStored(EventExecutor executor, final String location, final Etag etag); }
DefaultMetadataServiceImpl implements MetadataService { @Override public Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request) { return executor.submit(new Callable<ObjectResponse>() { @Override public ObjectResponse call() throws Exception { return syncList(request); } }); } DefaultMetadataServiceImpl(MetadataRepository r); @Override Future<ObjectResponse> delete(EventExecutor executor, final ObjectRequest request); @Override Future<ObjectResponse> head(EventExecutor executor, final ObjectRequest request); @Override Optional<FullObjectName> selectByName(ObjectName on); @Override Future<ObjectResponse> list(EventExecutor executor, final ObjectRequest request); @Override Future<ObjectResponse> put(EventExecutor executor, final FullObjectRequest request); @Override Future<List<String>> storedNodes(final EventExecutor executor, final String etag); @Override List<String> storedNodes(final ObjectName on); @Override List<String> storedNodes(String etag); @Override Future<Void> flagStored(EventExecutor executor, final String location, final Etag etag);  }