@Override public void run() { timerHandler.handle(timerId); } };
/** * Called to handle a body chunk. * @param chunk */ protected void handleBody(IApimanBuffer chunk) { if (bodyHandler != null) { bodyHandler.handle(chunk); } }
/** * @see io.apiman.gateway.engine.io.IWriteStream#end() */ @Override public void end() { if (endHandler != null) { endHandler.handle((Void) null); } finished = true; }
/** * Signals the end of the stream. */ protected void handleEnd() { if (endHandler != null) { endHandler.handle((Void) null); } finished = true; } }
/** * @see io.apiman.gateway.engine.io.IWriteStream#write(io.apiman.gateway.engine.io.IApimanBuffer) */ @Override public void write(IApimanBuffer chunk) { if (bodyHandler != null) { bodyHandler.handle(chunk); } }
/** * Called to handle a body chunk. * @param chunk */ protected void handleBody(IApimanBuffer chunk) { if (bodyHandler != null) { bodyHandler.handle(chunk); } }
/** * Signals the end of the stream. */ protected void handleEnd() { if (endHandler != null) { endHandler.handle((Void) null); } finished = true; } }
/** * @see io.apiman.gateway.engine.io.IWriteStream#end() */ @Override public void end() { if (endHandler != null) { endHandler.handle((Void) null); } finished = true; }
/** * @see io.apiman.gateway.engine.io.AbstractStream#handleHead(java.lang.Object) */ @Override protected void handleHead(H api) { if (headHandler != null) headHandler.handle(api); }
@Override public <T> void executeBlocking(IAsyncHandler<IAsyncFuture<T>> blockingCode, IAsyncResultHandler<T> resultHandler) { IAsyncFuture<T> wrapped = passthrough(resultHandler); try { blockingCode.handle(wrapped); } catch (Exception e) { wrapped.fail(e); } }
@Override public <T> void executeBlocking(IAsyncHandler<IAsyncFuture<T>> blockingCode, IAsyncResultHandler<T> resultHandler) { IAsyncFuture<T> wrapped = passthrough(resultHandler); try { blockingCode.handle(wrapped); } catch (Exception e) { wrapped.fail(e); } }
@Override public <T> void executeBlocking(IAsyncHandler<IAsyncFuture<T>> blockingCode, IAsyncResultHandler<T> resultHandler) { vertx.<T>executeBlocking(future -> { blockingCode.handle(wrapFuture(future)); }, result -> { resultHandler.handle(wrapResult(result)); }); }
@Override public void handle(IAsyncResult<T> result) { if (result.isError()) { errorHandler.handle(AsyncResultImpl.<Q>create(result.getError())); } else { successHandler.handle(result.getResult()); } } };
private void getResults(String searchDn, String filter, LdapSearchScope scope, final IAsyncResultHandler<List<SearchResultEntry>> result) { try { SearchScope searchScope = (scope == LdapSearchScope.ONE) ? SearchScope.ONE : SearchScope.SUB; List<SearchResultEntry> searchResults = connection.search(searchDn, searchScope, filter).getSearchEntries(); result.handle(AsyncResultImpl.create(searchResults)); } catch (LDAPException e) { ldapErrorHandler.handle(DefaultExceptionFactory.create(e)); } catch (Exception e) { result.handle(AsyncResultImpl.<List<SearchResultEntry>>create(e)); } }
private void getResults(String searchDn, String filter, LdapSearchScope scope, final IAsyncResultHandler<List<SearchResultEntry>> result) { try { SearchScope searchScope = (scope == LdapSearchScope.ONE) ? SearchScope.ONE : SearchScope.SUB; List<SearchResultEntry> searchResults = connection.search(searchDn, searchScope, filter).getSearchEntries(); result.handle(AsyncResultImpl.create(searchResults)); } catch (LDAPException e) { ldapErrorHandler.handle(DefaultExceptionFactory.create(e)); } catch (Exception e) { result.handle(AsyncResultImpl.<List<SearchResultEntry>>create(e)); } }