protected Callable<CallableData> createTokenJob(final String url, BaseRequestItem request) throws ProcessingException { // TODO: Get token duration from requests final TokenRequestData tokenRequest = new TokenRequestData(url, request); return new Callable<CallableData>() { public CallableData call() throws Exception { try { return new CallableData(url, handlerService.getToken(tokenRequest)); } catch (Exception e) { return new CallableData(url, handlerService.createErrorResponse(null, e, FAILURE_TOKEN)); } } }; }
public GadgetsHandlerApi.TokenResponse call() throws Exception { try { return handlerService.getToken(tokenRequest); } catch (Exception e) { sendError(tokenRequest.getUrl(), e, FAILURE_TOKEN); return null; } } };
protected Callable<GadgetsHandlerApi.TokenResponse> createTokenJob(String url, BaseRequestItem request) { final TokenRequestData tokenRequest = new TokenRequestData(url, request); return new Callable<GadgetsHandlerApi.TokenResponse>() { public GadgetsHandlerApi.TokenResponse call() throws Exception { try { return handlerService.getToken(tokenRequest); } catch (Exception e) { sendError(tokenRequest.getUrl(), e, FAILURE_TOKEN); return null; } } }; }
protected Callable<GadgetsHandlerApi.TokenResponse> createTokenJob(String url, BaseRequestItem request) { final TokenRequestData tokenRequest = new TokenRequestData(url, request); return new Callable<GadgetsHandlerApi.TokenResponse>() { public GadgetsHandlerApi.TokenResponse call() throws Exception { try { return handlerService.getToken(tokenRequest); } catch (Exception e) { sendError(tokenRequest.getUrl(), e, FAILURE_TOKEN); return null; } } }; }
public GadgetsHandlerApi.TokenResponse call() throws Exception { try { return handlerService.getToken(tokenRequest); } catch (Exception e) { sendError(tokenRequest.getUrl(), e, FAILURE_TOKEN); return null; } } };