private void passThroughProcessingChain(Operation inboundOp) { // Pass the operation through the processing chain. OperationProcessingContext context = this.opProcessingChain.createContext(this); final Operation finalInboundOp = inboundOp; this.opProcessingChain.processRequest(inboundOp, context, o -> { handleRequestAfterOpProcessingChain(context.getService(), finalInboundOp); }); }
/** * Based on the auth token, populate AuthorisationContext and set it to OperationContext as well. * * The callback consumer will receive the populated auth context. * When given token is not valid, it will populate guest context. * * Infrastructure use only. * * @param authToken auth token * @param referrerPath used as a referrer when verifying the given token * @param callback a callback operation. */ public void populateAuthorizationContext(String authToken, String referrerPath, Consumer<AuthorizationContext> callback) { Operation dummyOp = new Operation(); dummyOp.addRequestHeader(Operation.REQUEST_AUTH_TOKEN_HEADER, authToken); dummyOp.setUri(UriUtils.buildUri(this, referrerPath)); OperationProcessingContext context = this.opProcessingChain.createContext(this); this.authorizationFilter.populateAuthorizationContext(dummyOp, context, (authCtx) -> { OperationContext.setAuthorizationContext(authCtx); callback.accept(authCtx); }); }
OperationProcessingChain opProcessingChain = getOperationProcessingChain(); if (opProcessingChain != null) { OperationProcessingContext context = opProcessingChain.createContext(getHost()); opProcessingChain.processRequest(op, context, o -> { handleRequest(op, OperationProcessingStage.EXECUTING_SERVICE_HANDLER);
OperationProcessingContext context = opProcessingChain.createContext(getHost()); context.setService(this); opProcessingChain.processRequest(request, context, o -> {
OperationProcessingChain opProcessingChain = getOperationProcessingChain(); if (opProcessingChain != null) { OperationProcessingContext context = opProcessingChain.createContext(getHost()); context.setService(this); opProcessingChain.processRequest(op, context, o -> {