protected AppHistory history() { return ClientApp.make().getHistory(); } }
public static <E extends DominoEvent> void fire(Class<E> eventType, E dominoEvent) { ClientApp.make().fireEvent(eventType, dominoEvent); } }
public void configureModule(ModuleConfiguration moduleConfiguration){ ClientApp.make().configureModule(moduleConfiguration); }
public static boolean hasServiceRoot(String path){ final List<DynamicServiceRoot> serviceRoots = ClientApp.make().dominoOptions().getServiceRoots(); return serviceRoots.stream().anyMatch(r -> r.isMatchingPath(path)); } }
public static String matchedServiceRoot(String path) { final List<DynamicServiceRoot> serviceRoots = ClientApp.make().dominoOptions().getServiceRoots(); return serviceRoots.stream().filter(r -> r.isMatchingPath(path)).findFirst().orElse(defaultRoot).onMatchingPath(); }
@Override public void routeRequest(final PresenterCommand presenterCommand) { ClientApp.make().getAsyncRunner().runAsync(new AsyncRunner.AsyncTask() { @Override public void onSuccess() { requestEventFactory.make(presenterCommand).fire(); } @Override public void onFailed(Throwable error) { LOGGER.error("Could not RunAsync request [" + presenterCommand + "]", error); } }); } }
protected void runAsync(AsyncRunner.AsyncTask asyncTask) { ClientApp.make().getAsyncRunner().runAsync(asyncTask); }
@SuppressWarnings("rawtypes") @Override public final void send(final ServerRequest request) { ClientApp.make().getAsyncRunner().runAsync(new RequestAsyncTask(request)); }
private void inform(String token, String title, String stateJson) { listeners.stream().filter(l -> { return l.tokenFilter.filter(new DominoHistoryState(token, title, stateJson).token); }) .forEach(l -> ClientApp.make().getAsyncRunner().runAsync(() -> l.listener.onPopState(new DominoHistoryState(token, title, stateJson)))); }
private V loadView() { return (V) ClientApp.make().getViewsRepository().getView(getName()); }
protected String getName() { return ClientApp.make().getPresentersRepository().getNameFromConcreteName(getConcrete()); }
@SuppressWarnings({"unchecked", "rawtypes"}) @Override protected void sendRequest(ServerRequest request, ServerRequestEventFactory requestEventFactory) { // request.headers().put("X-XSRF-TOKEN", Cookies.getCookie("XSRF-TOKEN")); ClientApp.make().getRequestRestSendersRepository().get(request.getKey()) .send(request, new ServerRequestCallBack() { @Override public void onSuccess(ResponseBean response) { requestEventFactory.makeSuccess(request, response).fire(); } @Override public void onFailure(FailedResponseBean failedResponse) { requestEventFactory.makeFailed(request, failedResponse).fire(); } }); } }
@Override public void send(ServerRequest<R, S> request, ServerRequestCallBack callBack) { new RequestPathHandler<>(request, getPath(), getCustomRoot()).process(serverRequest -> serverRequest.setUrl(replaceRequestParameters(serverRequest.getUrl(), serverRequest.requestBean()))); ClientApp.make().dominoOptions().getRequestInterceptor() .interceptRequest(request, () -> { RestfulRequest restfulRequest = RestfulRequest.request(request.getUrl(), getMethod().toUpperCase())